@xyo-network/url-safety-plugin 2.99.3 → 2.99.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/browser/Plugin.d.cts +2 -2
- package/dist/browser/Plugin.d.mts +2 -2
- package/dist/browser/Plugin.d.ts +2 -2
- package/dist/browser/Witness/Params.d.cts +1 -1
- package/dist/browser/Witness/Params.d.mts +1 -1
- package/dist/browser/Witness/Params.d.ts +1 -1
- package/dist/browser/Witness/Witness.d.cts +1 -1
- package/dist/browser/Witness/Witness.d.mts +1 -1
- package/dist/browser/Witness/Witness.d.ts +1 -1
- package/dist/browser/Witness/index.d.cts +3 -3
- package/dist/browser/Witness/index.d.mts +3 -3
- package/dist/browser/Witness/index.d.ts +3 -3
- package/dist/browser/index.cjs +61 -30
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +2 -2
- package/dist/browser/index.d.mts +2 -2
- package/dist/browser/index.d.ts +2 -2
- package/dist/browser/{index.js → index.mjs} +64 -31
- package/dist/browser/index.mjs.map +1 -0
- package/dist/neutral/Plugin.d.cts +2 -2
- package/dist/neutral/Plugin.d.mts +2 -2
- package/dist/neutral/Plugin.d.ts +2 -2
- package/dist/neutral/Witness/Params.d.cts +1 -1
- package/dist/neutral/Witness/Params.d.mts +1 -1
- package/dist/neutral/Witness/Params.d.ts +1 -1
- package/dist/neutral/Witness/Witness.d.cts +1 -1
- package/dist/neutral/Witness/Witness.d.mts +1 -1
- package/dist/neutral/Witness/Witness.d.ts +1 -1
- package/dist/neutral/Witness/index.d.cts +3 -3
- package/dist/neutral/Witness/index.d.mts +3 -3
- package/dist/neutral/Witness/index.d.ts +3 -3
- package/dist/neutral/index.cjs +61 -30
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts +2 -2
- package/dist/neutral/index.d.mts +2 -2
- package/dist/neutral/index.d.ts +2 -2
- package/dist/neutral/{index.js → index.mjs} +64 -31
- package/dist/neutral/index.mjs.map +1 -0
- package/dist/node/Plugin.d.cts +2 -2
- package/dist/node/Plugin.d.mts +2 -2
- package/dist/node/Plugin.d.ts +2 -2
- package/dist/node/Witness/Params.d.cts +1 -1
- package/dist/node/Witness/Params.d.mts +1 -1
- package/dist/node/Witness/Params.d.ts +1 -1
- package/dist/node/Witness/Witness.d.cts +1 -1
- package/dist/node/Witness/Witness.d.mts +1 -1
- package/dist/node/Witness/Witness.d.ts +1 -1
- package/dist/node/Witness/index.d.cts +3 -3
- package/dist/node/Witness/index.d.mts +3 -3
- package/dist/node/Witness/index.d.ts +3 -3
- package/dist/node/index.cjs +67 -32
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +2 -2
- package/dist/node/index.d.mts +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.mjs +130 -0
- package/dist/node/index.mjs.map +1 -0
- package/package.json +16 -17
- package/src/Plugin.ts +1 -1
- package/src/Witness/Params.ts +1 -1
- package/src/Witness/Witness.ts +8 -8
- package/src/Witness/index.ts +3 -3
- package/src/index.ts +2 -2
- package/dist/browser/index.js.map +0 -1
- package/dist/neutral/index.js.map +0 -1
- package/dist/node/index.js +0 -93
- package/dist/node/index.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Params.
|
|
3
|
-
export * from './Witness.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Params.ts';
|
|
3
|
+
export * from './Witness.ts';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/neutral/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -43,7 +44,7 @@ var import_abstract_witness = require("@xyo-network/abstract-witness");
|
|
|
43
44
|
var import_url_payload_plugin = require("@xyo-network/url-payload-plugin");
|
|
44
45
|
var import_url_safety_payload_plugin2 = require("@xyo-network/url-safety-payload-plugin");
|
|
45
46
|
var GoogleSafeBrowsingMatchSchema = "com.google.safebrowsing.match";
|
|
46
|
-
var checkUrlSafety = async (urls, config) => {
|
|
47
|
+
var checkUrlSafety = /* @__PURE__ */ __name(async (urls, config) => {
|
|
47
48
|
const axios = new import_axios.AxiosJson();
|
|
48
49
|
const endPoint = config?.endPoint ?? "https://safebrowsing.googleapis.com/v4/threatMatches:find";
|
|
49
50
|
const key = config?.key;
|
|
@@ -57,17 +58,43 @@ var checkUrlSafety = async (urls, config) => {
|
|
|
57
58
|
clientVersion: "1.0"
|
|
58
59
|
},
|
|
59
60
|
threatInfo: {
|
|
60
|
-
platformTypes: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
platformTypes: [
|
|
62
|
+
"WINDOWS",
|
|
63
|
+
"LINUX",
|
|
64
|
+
"OSX"
|
|
65
|
+
],
|
|
66
|
+
threatEntries: mutatedUrls.map((url) => ({
|
|
67
|
+
url
|
|
68
|
+
})),
|
|
69
|
+
threatEntryTypes: [
|
|
70
|
+
"URL"
|
|
71
|
+
],
|
|
72
|
+
threatTypes: [
|
|
73
|
+
"SOCIAL_ENGINEERING",
|
|
74
|
+
"POTENTIALLY_HARMFUL_APPLICATION",
|
|
75
|
+
"UNWANTED_SOFTWARE",
|
|
76
|
+
"THREAT_TYPE_UNSPECIFIED"
|
|
77
|
+
]
|
|
64
78
|
}
|
|
65
79
|
};
|
|
66
|
-
const result = (await axios.post(`${endPoint}?key=${key}`, postData, {
|
|
67
|
-
|
|
68
|
-
|
|
80
|
+
const result = (await axios.post(`${endPoint}?key=${key}`, postData, {
|
|
81
|
+
headers: {
|
|
82
|
+
referer: "http://localhost:3000"
|
|
83
|
+
}
|
|
84
|
+
})).data;
|
|
85
|
+
return result.matches?.map((match) => ({
|
|
86
|
+
...match,
|
|
87
|
+
schema: GoogleSafeBrowsingMatchSchema
|
|
88
|
+
})) ?? [];
|
|
89
|
+
}, "checkUrlSafety");
|
|
69
90
|
var UrlSafetyWitness = class extends import_abstract_witness.AbstractWitness {
|
|
70
|
-
static
|
|
91
|
+
static {
|
|
92
|
+
__name(this, "UrlSafetyWitness");
|
|
93
|
+
}
|
|
94
|
+
static configSchemas = [
|
|
95
|
+
...super.configSchemas,
|
|
96
|
+
UrlSafetyWitnessConfigSchema
|
|
97
|
+
];
|
|
71
98
|
static defaultConfigSchema = UrlSafetyWitnessConfigSchema;
|
|
72
99
|
get key() {
|
|
73
100
|
return this.params.google?.safeBrowsing?.key;
|
|
@@ -79,20 +106,22 @@ var UrlSafetyWitness = class extends import_abstract_witness.AbstractWitness {
|
|
|
79
106
|
const urls = this.urls ?? payloads.filter((p) => p.schema === import_url_payload_plugin.UrlSchema).map((p) => {
|
|
80
107
|
return p.url;
|
|
81
108
|
});
|
|
82
|
-
const matches = await checkUrlSafety(urls, {
|
|
109
|
+
const matches = await checkUrlSafety(urls, {
|
|
110
|
+
key: this.key
|
|
111
|
+
});
|
|
83
112
|
return urls.map((url) => {
|
|
84
|
-
const payload = matches.reduce(
|
|
85
|
-
(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
prev.threatTypes.push(match.threatEntryType);
|
|
90
|
-
}
|
|
113
|
+
const payload = matches.reduce((prev, match) => {
|
|
114
|
+
if (match.threat.url === url) {
|
|
115
|
+
prev.threatTypes = prev.threatTypes ?? [];
|
|
116
|
+
if (!prev.threatTypes.includes(match.threatEntryType)) {
|
|
117
|
+
prev.threatTypes.push(match.threatEntryType);
|
|
91
118
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
119
|
+
}
|
|
120
|
+
return prev;
|
|
121
|
+
}, {
|
|
122
|
+
schema: import_url_safety_payload_plugin2.UrlSafetySchema,
|
|
123
|
+
url
|
|
124
|
+
});
|
|
96
125
|
payload.threatTypes = payload.threatTypes?.sort();
|
|
97
126
|
return payload;
|
|
98
127
|
});
|
|
@@ -100,13 +129,15 @@ var UrlSafetyWitness = class extends import_abstract_witness.AbstractWitness {
|
|
|
100
129
|
};
|
|
101
130
|
|
|
102
131
|
// src/Plugin.ts
|
|
103
|
-
var UrlSafetyPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
132
|
+
var UrlSafetyPlugin = /* @__PURE__ */ __name(() => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)({
|
|
133
|
+
required: {
|
|
134
|
+
[import_url_safety_payload_plugin3.UrlSafetySchema]: 1
|
|
135
|
+
},
|
|
136
|
+
schema: import_payload_model.PayloadSetSchema
|
|
137
|
+
}, {
|
|
138
|
+
witness: /* @__PURE__ */ __name(async (params) => {
|
|
139
|
+
const result = await UrlSafetyWitness.create(params);
|
|
140
|
+
return result;
|
|
141
|
+
}, "witness")
|
|
142
|
+
}), "UrlSafetyPlugin");
|
|
112
143
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness/Config.ts","../../src/Witness/Witness.ts"],"sourcesContent":["// eslint-disable-next-line import/no-default-export\nexport { UrlSafetyPlugin as default, UrlSafetyPlugin } from './Plugin.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness/Config.ts","../../src/Witness/Witness.ts"],"sourcesContent":["// eslint-disable-next-line import/no-default-export\nexport { UrlSafetyPlugin as default, UrlSafetyPlugin } from './Plugin.ts'\nexport * from './Witness/index.ts'\n","import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\nimport { UrlSafetySchema } from '@xyo-network/url-safety-payload-plugin'\n\nimport { UrlSafetyWitness } from './Witness/index.ts'\n\nexport const UrlSafetyPlugin = () =>\n createPayloadSetWitnessPlugin<UrlSafetyWitness>(\n { required: { [UrlSafetySchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await UrlSafetyWitness.create(params)\n return result\n },\n },\n )\n","import { UrlSafetySchema } from '@xyo-network/url-safety-payload-plugin'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport const UrlSafetyWitnessConfigSchema = `${UrlSafetySchema}.witness.config` as const\nexport type UrlSafetyWitnessConfigSchema = typeof UrlSafetyWitnessConfigSchema\n\nexport type UrlSafetyWitnessConfig = WitnessConfig<{\n google?: {\n safeBrowsing?: {\n endPoint?: string\n }\n }\n schema: UrlSafetyWitnessConfigSchema\n urls?: string[]\n}>\n","import { AxiosJson } from '@xylabs/axios'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { UrlPayload, UrlSchema } from '@xyo-network/url-payload-plugin'\nimport { UrlSafetyPayload, UrlSafetySchema, UrlSafetyThreatType } from '@xyo-network/url-safety-payload-plugin'\n\nimport { UrlSafetyWitnessConfigSchema } from './Config.ts'\nimport { UrlSafetyWitnessParams } from './Params.ts'\n\nexport type GoogleSafeBrowsingMatchSchema = 'com.google.safebrowsing.match'\nexport const GoogleSafeBrowsingMatchSchema: GoogleSafeBrowsingMatchSchema = 'com.google.safebrowsing.match'\n\nexport interface GoogleSafeBrowsingMatch {\n cacheDuration: string\n platformType: string\n threat: {\n url: string\n }\n threatEntryType: string\n threatType: string\n}\n\nexport type GoogleSafeBrowsingMatchPayload = Payload<GoogleSafeBrowsingMatch, GoogleSafeBrowsingMatchSchema>\n\ninterface GoogleSafeBrowsingResult {\n matches?: GoogleSafeBrowsingMatch[]\n}\n\nconst checkUrlSafety = async (\n urls: string[],\n config?: {\n endPoint?: string\n key?: string\n },\n): Promise<GoogleSafeBrowsingMatchPayload[]> => {\n const axios = new AxiosJson()\n const endPoint = config?.endPoint ?? 'https://safebrowsing.googleapis.com/v4/threatMatches:find'\n const key = config?.key\n const mutatedUrls = urls.map(url => url.replace('ipfs://', 'https://cloudflare-ipfs.com/'))\n if (mutatedUrls.length === 0) {\n return []\n }\n const postData = {\n client: {\n clientId: 'foreventory',\n clientVersion: '1.0',\n },\n threatInfo: {\n platformTypes: ['WINDOWS', 'LINUX', 'OSX'],\n threatEntries: mutatedUrls.map(url => ({ url })),\n threatEntryTypes: ['URL'],\n threatTypes: ['SOCIAL_ENGINEERING', 'POTENTIALLY_HARMFUL_APPLICATION', 'UNWANTED_SOFTWARE', 'THREAT_TYPE_UNSPECIFIED'],\n },\n }\n const result = (await axios.post<GoogleSafeBrowsingResult>(`${endPoint}?key=${key}`, postData, { headers: { referer: 'http://localhost:3000' } }))\n .data\n return result.matches?.map<GoogleSafeBrowsingMatchPayload>(match => ({ ...match, schema: GoogleSafeBrowsingMatchSchema })) ?? []\n}\n\nexport class UrlSafetyWitness<TParams extends UrlSafetyWitnessParams = UrlSafetyWitnessParams> extends AbstractWitness<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, UrlSafetyWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = UrlSafetyWitnessConfigSchema\n\n get key() {\n return this.params.google?.safeBrowsing?.key\n }\n\n get urls() {\n return this.config?.urls\n }\n\n protected override async observeHandler(payloads: UrlPayload[] = []): Promise<UrlSafetyPayload[]> {\n const urls: string[]\n = this.urls\n ?? payloads\n .filter((p): p is UrlPayload => p.schema === UrlSchema)\n .map((p) => {\n return p.url\n })\n\n const matches = await checkUrlSafety(urls, { key: this.key })\n\n return urls.map((url) => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const payload = matches.reduce<UrlSafetyPayload>(\n (prev, match) => {\n if (match.threat.url === url) {\n prev.threatTypes = prev.threatTypes ?? []\n if (!prev.threatTypes.includes(match.threatEntryType as UrlSafetyThreatType)) {\n prev.threatTypes.push(match.threatEntryType as UrlSafetyThreatType)\n }\n }\n return prev\n },\n { schema: UrlSafetySchema, url },\n )\n payload.threatTypes = payload.threatTypes?.sort()\n return payload\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;ACAA,2BAAiC;AACjC,+BAA8C;AAC9C,IAAAA,oCAAgC;;;ACFhC,uCAAgC;AAGzB,IAAMC,+BAA+B,GAAGC,gDAAAA;;;ACH/C,mBAA0B;AAC1B,8BAAgC;AAEhC,gCAAsC;AACtC,IAAAC,oCAAuE;AAMhE,IAAMC,gCAA+D;AAkB5E,IAAMC,iBAAiB,8BACrBC,MACAC,WAAAA;AAKA,QAAMC,QAAQ,IAAIC,uBAAAA;AAClB,QAAMC,WAAWH,QAAQG,YAAY;AACrC,QAAMC,MAAMJ,QAAQI;AACpB,QAAMC,cAAcN,KAAKO,IAAIC,CAAAA,QAAOA,IAAIC,QAAQ,WAAW,8BAAA,CAAA;AAC3D,MAAIH,YAAYI,WAAW,GAAG;AAC5B,WAAO,CAAA;EACT;AACA,QAAMC,WAAW;IACfC,QAAQ;MACNC,UAAU;MACVC,eAAe;IACjB;IACAC,YAAY;MACVC,eAAe;QAAC;QAAW;QAAS;;MACpCC,eAAeX,YAAYC,IAAIC,CAAAA,SAAQ;QAAEA;MAAI,EAAA;MAC7CU,kBAAkB;QAAC;;MACnBC,aAAa;QAAC;QAAsB;QAAmC;QAAqB;;IAC9F;EACF;AACA,QAAMC,UAAU,MAAMlB,MAAMmB,KAA+B,GAAGjB,QAAAA,QAAgBC,GAAAA,IAAOM,UAAU;IAAEW,SAAS;MAAEC,SAAS;IAAwB;EAAE,CAAA,GAC5IC;AACH,SAAOJ,OAAOK,SAASlB,IAAoCmB,CAAAA,WAAU;IAAE,GAAGA;IAAOC,QAAQ7B;EAA8B,EAAA,KAAO,CAAA;AAChI,GA7BuB;AA+BhB,IAAM8B,mBAAN,cAAgGC,wCAAAA;EA3DvG,OA2DuGA;;;EACrG,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,IAAI1B,MAAM;AACR,WAAO,KAAK4B,OAAOC,QAAQC,cAAc9B;EAC3C;EAEA,IAAIL,OAAO;AACT,WAAO,KAAKC,QAAQD;EACtB;EAEA,MAAyBoC,eAAeC,WAAyB,CAAA,GAAiC;AAChG,UAAMrC,OACF,KAAKA,QACJqC,SACAC,OAAO,CAACC,MAAuBA,EAAEZ,WAAWa,mCAAAA,EAC5CjC,IAAI,CAACgC,MAAAA;AACJ,aAAOA,EAAE/B;IACX,CAAA;AAEJ,UAAMiB,UAAU,MAAM1B,eAAeC,MAAM;MAAEK,KAAK,KAAKA;IAAI,CAAA;AAE3D,WAAOL,KAAKO,IAAI,CAACC,QAAAA;AAEf,YAAMiC,UAAUhB,QAAQiB,OACtB,CAACC,MAAMjB,UAAAA;AACL,YAAIA,MAAMkB,OAAOpC,QAAQA,KAAK;AAC5BmC,eAAKxB,cAAcwB,KAAKxB,eAAe,CAAA;AACvC,cAAI,CAACwB,KAAKxB,YAAY0B,SAASnB,MAAMoB,eAAe,GAA0B;AAC5EH,iBAAKxB,YAAY4B,KAAKrB,MAAMoB,eAAe;UAC7C;QACF;AACA,eAAOH;MACT,GACA;QAAEhB,QAAQqB;QAAiBxC;MAAI,CAAA;AAEjCiC,cAAQtB,cAAcsB,QAAQtB,aAAa8B,KAAAA;AAC3C,aAAOR;IACT,CAAA;EACF;AACF;;;AF9FO,IAAMS,kBAAkB,iCAC7BC,wDACE;EAAEC,UAAU;IAAE,CAACC,iDAAAA,GAAkB;EAAE;EAAGC,QAAQC;AAAiB,GAC/D;EACEC,SAAS,8BAAOC,WAAAA;AACd,UAAMC,SAAS,MAAMC,iBAAiBC,OAAOH,MAAAA;AAC7C,WAAOC;EACT,GAHS;AAIX,CAAA,GAR2B;","names":["import_url_safety_payload_plugin","UrlSafetyWitnessConfigSchema","UrlSafetySchema","import_url_safety_payload_plugin","GoogleSafeBrowsingMatchSchema","checkUrlSafety","urls","config","axios","AxiosJson","endPoint","key","mutatedUrls","map","url","replace","length","postData","client","clientId","clientVersion","threatInfo","platformTypes","threatEntries","threatEntryTypes","threatTypes","result","post","headers","referer","data","matches","match","schema","UrlSafetyWitness","AbstractWitness","configSchemas","UrlSafetyWitnessConfigSchema","defaultConfigSchema","params","google","safeBrowsing","observeHandler","payloads","filter","p","UrlSchema","payload","reduce","prev","threat","includes","threatEntryType","push","UrlSafetySchema","sort","UrlSafetyPlugin","createPayloadSetWitnessPlugin","required","UrlSafetySchema","schema","PayloadSetSchema","witness","params","result","UrlSafetyWitness","create"]}
|
package/dist/neutral/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { UrlSafetyPlugin as default, UrlSafetyPlugin } from './Plugin.
|
|
2
|
-
export * from './Witness/index.
|
|
1
|
+
export { UrlSafetyPlugin as default, UrlSafetyPlugin } from './Plugin.ts';
|
|
2
|
+
export * from './Witness/index.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/neutral/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { UrlSafetyPlugin as default, UrlSafetyPlugin } from './Plugin.
|
|
2
|
-
export * from './Witness/index.
|
|
1
|
+
export { UrlSafetyPlugin as default, UrlSafetyPlugin } from './Plugin.ts';
|
|
2
|
+
export * from './Witness/index.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { UrlSafetyPlugin as default, UrlSafetyPlugin } from './Plugin.
|
|
2
|
-
export * from './Witness/index.
|
|
1
|
+
export { UrlSafetyPlugin as default, UrlSafetyPlugin } from './Plugin.ts';
|
|
2
|
+
export * from './Witness/index.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/Plugin.ts
|
|
2
5
|
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
3
6
|
import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
@@ -13,7 +16,7 @@ import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
|
13
16
|
import { UrlSchema } from "@xyo-network/url-payload-plugin";
|
|
14
17
|
import { UrlSafetySchema as UrlSafetySchema2 } from "@xyo-network/url-safety-payload-plugin";
|
|
15
18
|
var GoogleSafeBrowsingMatchSchema = "com.google.safebrowsing.match";
|
|
16
|
-
var checkUrlSafety = async (urls, config) => {
|
|
19
|
+
var checkUrlSafety = /* @__PURE__ */ __name(async (urls, config) => {
|
|
17
20
|
const axios = new AxiosJson();
|
|
18
21
|
const endPoint = config?.endPoint ?? "https://safebrowsing.googleapis.com/v4/threatMatches:find";
|
|
19
22
|
const key = config?.key;
|
|
@@ -27,17 +30,43 @@ var checkUrlSafety = async (urls, config) => {
|
|
|
27
30
|
clientVersion: "1.0"
|
|
28
31
|
},
|
|
29
32
|
threatInfo: {
|
|
30
|
-
platformTypes: [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
platformTypes: [
|
|
34
|
+
"WINDOWS",
|
|
35
|
+
"LINUX",
|
|
36
|
+
"OSX"
|
|
37
|
+
],
|
|
38
|
+
threatEntries: mutatedUrls.map((url) => ({
|
|
39
|
+
url
|
|
40
|
+
})),
|
|
41
|
+
threatEntryTypes: [
|
|
42
|
+
"URL"
|
|
43
|
+
],
|
|
44
|
+
threatTypes: [
|
|
45
|
+
"SOCIAL_ENGINEERING",
|
|
46
|
+
"POTENTIALLY_HARMFUL_APPLICATION",
|
|
47
|
+
"UNWANTED_SOFTWARE",
|
|
48
|
+
"THREAT_TYPE_UNSPECIFIED"
|
|
49
|
+
]
|
|
34
50
|
}
|
|
35
51
|
};
|
|
36
|
-
const result = (await axios.post(`${endPoint}?key=${key}`, postData, {
|
|
37
|
-
|
|
38
|
-
|
|
52
|
+
const result = (await axios.post(`${endPoint}?key=${key}`, postData, {
|
|
53
|
+
headers: {
|
|
54
|
+
referer: "http://localhost:3000"
|
|
55
|
+
}
|
|
56
|
+
})).data;
|
|
57
|
+
return result.matches?.map((match) => ({
|
|
58
|
+
...match,
|
|
59
|
+
schema: GoogleSafeBrowsingMatchSchema
|
|
60
|
+
})) ?? [];
|
|
61
|
+
}, "checkUrlSafety");
|
|
39
62
|
var UrlSafetyWitness = class extends AbstractWitness {
|
|
40
|
-
static
|
|
63
|
+
static {
|
|
64
|
+
__name(this, "UrlSafetyWitness");
|
|
65
|
+
}
|
|
66
|
+
static configSchemas = [
|
|
67
|
+
...super.configSchemas,
|
|
68
|
+
UrlSafetyWitnessConfigSchema
|
|
69
|
+
];
|
|
41
70
|
static defaultConfigSchema = UrlSafetyWitnessConfigSchema;
|
|
42
71
|
get key() {
|
|
43
72
|
return this.params.google?.safeBrowsing?.key;
|
|
@@ -49,20 +78,22 @@ var UrlSafetyWitness = class extends AbstractWitness {
|
|
|
49
78
|
const urls = this.urls ?? payloads.filter((p) => p.schema === UrlSchema).map((p) => {
|
|
50
79
|
return p.url;
|
|
51
80
|
});
|
|
52
|
-
const matches = await checkUrlSafety(urls, {
|
|
81
|
+
const matches = await checkUrlSafety(urls, {
|
|
82
|
+
key: this.key
|
|
83
|
+
});
|
|
53
84
|
return urls.map((url) => {
|
|
54
|
-
const payload = matches.reduce(
|
|
55
|
-
(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
prev.threatTypes.push(match.threatEntryType);
|
|
60
|
-
}
|
|
85
|
+
const payload = matches.reduce((prev, match) => {
|
|
86
|
+
if (match.threat.url === url) {
|
|
87
|
+
prev.threatTypes = prev.threatTypes ?? [];
|
|
88
|
+
if (!prev.threatTypes.includes(match.threatEntryType)) {
|
|
89
|
+
prev.threatTypes.push(match.threatEntryType);
|
|
61
90
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
91
|
+
}
|
|
92
|
+
return prev;
|
|
93
|
+
}, {
|
|
94
|
+
schema: UrlSafetySchema2,
|
|
95
|
+
url
|
|
96
|
+
});
|
|
66
97
|
payload.threatTypes = payload.threatTypes?.sort();
|
|
67
98
|
return payload;
|
|
68
99
|
});
|
|
@@ -70,15 +101,17 @@ var UrlSafetyWitness = class extends AbstractWitness {
|
|
|
70
101
|
};
|
|
71
102
|
|
|
72
103
|
// src/Plugin.ts
|
|
73
|
-
var UrlSafetyPlugin = () => createPayloadSetWitnessPlugin(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
104
|
+
var UrlSafetyPlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
|
|
105
|
+
required: {
|
|
106
|
+
[UrlSafetySchema3]: 1
|
|
107
|
+
},
|
|
108
|
+
schema: PayloadSetSchema
|
|
109
|
+
}, {
|
|
110
|
+
witness: /* @__PURE__ */ __name(async (params) => {
|
|
111
|
+
const result = await UrlSafetyWitness.create(params);
|
|
112
|
+
return result;
|
|
113
|
+
}, "witness")
|
|
114
|
+
}), "UrlSafetyPlugin");
|
|
82
115
|
export {
|
|
83
116
|
GoogleSafeBrowsingMatchSchema,
|
|
84
117
|
UrlSafetyPlugin,
|
|
@@ -86,4 +119,4 @@ export {
|
|
|
86
119
|
UrlSafetyWitnessConfigSchema,
|
|
87
120
|
UrlSafetyPlugin as default
|
|
88
121
|
};
|
|
89
|
-
//# sourceMappingURL=index.
|
|
122
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Plugin.ts","../../src/Witness/Config.ts","../../src/Witness/Witness.ts"],"sourcesContent":["import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\nimport { UrlSafetySchema } from '@xyo-network/url-safety-payload-plugin'\n\nimport { UrlSafetyWitness } from './Witness/index.ts'\n\nexport const UrlSafetyPlugin = () =>\n createPayloadSetWitnessPlugin<UrlSafetyWitness>(\n { required: { [UrlSafetySchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await UrlSafetyWitness.create(params)\n return result\n },\n },\n )\n","import { UrlSafetySchema } from '@xyo-network/url-safety-payload-plugin'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport const UrlSafetyWitnessConfigSchema = `${UrlSafetySchema}.witness.config` as const\nexport type UrlSafetyWitnessConfigSchema = typeof UrlSafetyWitnessConfigSchema\n\nexport type UrlSafetyWitnessConfig = WitnessConfig<{\n google?: {\n safeBrowsing?: {\n endPoint?: string\n }\n }\n schema: UrlSafetyWitnessConfigSchema\n urls?: string[]\n}>\n","import { AxiosJson } from '@xylabs/axios'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { UrlPayload, UrlSchema } from '@xyo-network/url-payload-plugin'\nimport { UrlSafetyPayload, UrlSafetySchema, UrlSafetyThreatType } from '@xyo-network/url-safety-payload-plugin'\n\nimport { UrlSafetyWitnessConfigSchema } from './Config.ts'\nimport { UrlSafetyWitnessParams } from './Params.ts'\n\nexport type GoogleSafeBrowsingMatchSchema = 'com.google.safebrowsing.match'\nexport const GoogleSafeBrowsingMatchSchema: GoogleSafeBrowsingMatchSchema = 'com.google.safebrowsing.match'\n\nexport interface GoogleSafeBrowsingMatch {\n cacheDuration: string\n platformType: string\n threat: {\n url: string\n }\n threatEntryType: string\n threatType: string\n}\n\nexport type GoogleSafeBrowsingMatchPayload = Payload<GoogleSafeBrowsingMatch, GoogleSafeBrowsingMatchSchema>\n\ninterface GoogleSafeBrowsingResult {\n matches?: GoogleSafeBrowsingMatch[]\n}\n\nconst checkUrlSafety = async (\n urls: string[],\n config?: {\n endPoint?: string\n key?: string\n },\n): Promise<GoogleSafeBrowsingMatchPayload[]> => {\n const axios = new AxiosJson()\n const endPoint = config?.endPoint ?? 'https://safebrowsing.googleapis.com/v4/threatMatches:find'\n const key = config?.key\n const mutatedUrls = urls.map(url => url.replace('ipfs://', 'https://cloudflare-ipfs.com/'))\n if (mutatedUrls.length === 0) {\n return []\n }\n const postData = {\n client: {\n clientId: 'foreventory',\n clientVersion: '1.0',\n },\n threatInfo: {\n platformTypes: ['WINDOWS', 'LINUX', 'OSX'],\n threatEntries: mutatedUrls.map(url => ({ url })),\n threatEntryTypes: ['URL'],\n threatTypes: ['SOCIAL_ENGINEERING', 'POTENTIALLY_HARMFUL_APPLICATION', 'UNWANTED_SOFTWARE', 'THREAT_TYPE_UNSPECIFIED'],\n },\n }\n const result = (await axios.post<GoogleSafeBrowsingResult>(`${endPoint}?key=${key}`, postData, { headers: { referer: 'http://localhost:3000' } }))\n .data\n return result.matches?.map<GoogleSafeBrowsingMatchPayload>(match => ({ ...match, schema: GoogleSafeBrowsingMatchSchema })) ?? []\n}\n\nexport class UrlSafetyWitness<TParams extends UrlSafetyWitnessParams = UrlSafetyWitnessParams> extends AbstractWitness<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, UrlSafetyWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = UrlSafetyWitnessConfigSchema\n\n get key() {\n return this.params.google?.safeBrowsing?.key\n }\n\n get urls() {\n return this.config?.urls\n }\n\n protected override async observeHandler(payloads: UrlPayload[] = []): Promise<UrlSafetyPayload[]> {\n const urls: string[]\n = this.urls\n ?? payloads\n .filter((p): p is UrlPayload => p.schema === UrlSchema)\n .map((p) => {\n return p.url\n })\n\n const matches = await checkUrlSafety(urls, { key: this.key })\n\n return urls.map((url) => {\n // eslint-disable-next-line unicorn/no-array-reduce\n const payload = matches.reduce<UrlSafetyPayload>(\n (prev, match) => {\n if (match.threat.url === url) {\n prev.threatTypes = prev.threatTypes ?? []\n if (!prev.threatTypes.includes(match.threatEntryType as UrlSafetyThreatType)) {\n prev.threatTypes.push(match.threatEntryType as UrlSafetyThreatType)\n }\n }\n return prev\n },\n { schema: UrlSafetySchema, url },\n )\n payload.threatTypes = payload.threatTypes?.sort()\n return payload\n })\n }\n}\n"],"mappings":";;;;AAAA,SAASA,wBAAwB;AACjC,SAASC,qCAAqC;AAC9C,SAASC,mBAAAA,wBAAuB;;;ACFhC,SAASC,uBAAuB;AAGzB,IAAMC,+BAA+B,GAAGD,eAAAA;;;ACH/C,SAASE,iBAAiB;AAC1B,SAASC,uBAAuB;AAEhC,SAAqBC,iBAAiB;AACtC,SAA2BC,mBAAAA,wBAA4C;AAMhE,IAAMC,gCAA+D;AAkB5E,IAAMC,iBAAiB,8BACrBC,MACAC,WAAAA;AAKA,QAAMC,QAAQ,IAAIC,UAAAA;AAClB,QAAMC,WAAWH,QAAQG,YAAY;AACrC,QAAMC,MAAMJ,QAAQI;AACpB,QAAMC,cAAcN,KAAKO,IAAIC,CAAAA,QAAOA,IAAIC,QAAQ,WAAW,8BAAA,CAAA;AAC3D,MAAIH,YAAYI,WAAW,GAAG;AAC5B,WAAO,CAAA;EACT;AACA,QAAMC,WAAW;IACfC,QAAQ;MACNC,UAAU;MACVC,eAAe;IACjB;IACAC,YAAY;MACVC,eAAe;QAAC;QAAW;QAAS;;MACpCC,eAAeX,YAAYC,IAAIC,CAAAA,SAAQ;QAAEA;MAAI,EAAA;MAC7CU,kBAAkB;QAAC;;MACnBC,aAAa;QAAC;QAAsB;QAAmC;QAAqB;;IAC9F;EACF;AACA,QAAMC,UAAU,MAAMlB,MAAMmB,KAA+B,GAAGjB,QAAAA,QAAgBC,GAAAA,IAAOM,UAAU;IAAEW,SAAS;MAAEC,SAAS;IAAwB;EAAE,CAAA,GAC5IC;AACH,SAAOJ,OAAOK,SAASlB,IAAoCmB,CAAAA,WAAU;IAAE,GAAGA;IAAOC,QAAQ7B;EAA8B,EAAA,KAAO,CAAA;AAChI,GA7BuB;AA+BhB,IAAM8B,mBAAN,cAAgGC,gBAAAA;EA3DvG,OA2DuGA;;;EACrG,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,IAAI1B,MAAM;AACR,WAAO,KAAK4B,OAAOC,QAAQC,cAAc9B;EAC3C;EAEA,IAAIL,OAAO;AACT,WAAO,KAAKC,QAAQD;EACtB;EAEA,MAAyBoC,eAAeC,WAAyB,CAAA,GAAiC;AAChG,UAAMrC,OACF,KAAKA,QACJqC,SACAC,OAAO,CAACC,MAAuBA,EAAEZ,WAAWa,SAAAA,EAC5CjC,IAAI,CAACgC,MAAAA;AACJ,aAAOA,EAAE/B;IACX,CAAA;AAEJ,UAAMiB,UAAU,MAAM1B,eAAeC,MAAM;MAAEK,KAAK,KAAKA;IAAI,CAAA;AAE3D,WAAOL,KAAKO,IAAI,CAACC,QAAAA;AAEf,YAAMiC,UAAUhB,QAAQiB,OACtB,CAACC,MAAMjB,UAAAA;AACL,YAAIA,MAAMkB,OAAOpC,QAAQA,KAAK;AAC5BmC,eAAKxB,cAAcwB,KAAKxB,eAAe,CAAA;AACvC,cAAI,CAACwB,KAAKxB,YAAY0B,SAASnB,MAAMoB,eAAe,GAA0B;AAC5EH,iBAAKxB,YAAY4B,KAAKrB,MAAMoB,eAAe;UAC7C;QACF;AACA,eAAOH;MACT,GACA;QAAEhB,QAAQqB;QAAiBxC;MAAI,CAAA;AAEjCiC,cAAQtB,cAAcsB,QAAQtB,aAAa8B,KAAAA;AAC3C,aAAOR;IACT,CAAA;EACF;AACF;;;AF9FO,IAAMS,kBAAkB,6BAC7BC,8BACE;EAAEC,UAAU;IAAE,CAACC,gBAAAA,GAAkB;EAAE;EAAGC,QAAQC;AAAiB,GAC/D;EACEC,SAAS,8BAAOC,WAAAA;AACd,UAAMC,SAAS,MAAMC,iBAAiBC,OAAOH,MAAAA;AAC7C,WAAOC;EACT,GAHS;AAIX,CAAA,GAR2B;","names":["PayloadSetSchema","createPayloadSetWitnessPlugin","UrlSafetySchema","UrlSafetySchema","UrlSafetyWitnessConfigSchema","AxiosJson","AbstractWitness","UrlSchema","UrlSafetySchema","GoogleSafeBrowsingMatchSchema","checkUrlSafety","urls","config","axios","AxiosJson","endPoint","key","mutatedUrls","map","url","replace","length","postData","client","clientId","clientVersion","threatInfo","platformTypes","threatEntries","threatEntryTypes","threatTypes","result","post","headers","referer","data","matches","match","schema","UrlSafetyWitness","AbstractWitness","configSchemas","UrlSafetyWitnessConfigSchema","defaultConfigSchema","params","google","safeBrowsing","observeHandler","payloads","filter","p","UrlSchema","payload","reduce","prev","threat","includes","threatEntryType","push","UrlSafetySchema","sort","UrlSafetyPlugin","createPayloadSetWitnessPlugin","required","UrlSafetySchema","schema","PayloadSetSchema","witness","params","result","UrlSafetyWitness","create"]}
|
package/dist/node/Plugin.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UrlSafetyWitness } from './Witness/index.
|
|
1
|
+
import { UrlSafetyWitness } from './Witness/index.ts';
|
|
2
2
|
export declare const UrlSafetyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<UrlSafetyWitness<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -12,7 +12,7 @@ export declare const UrlSafetyPlugin: () => import("@xyo-network/payloadset-plug
|
|
|
12
12
|
endPoint?: string;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
schema: import("./Witness/Config.
|
|
15
|
+
schema: import("./Witness/Config.ts").UrlSafetyWitnessConfigSchema;
|
|
16
16
|
urls?: string[];
|
|
17
17
|
}, "schema"> & {
|
|
18
18
|
schema: "network.xyo.url.safety.witness.config";
|
package/dist/node/Plugin.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UrlSafetyWitness } from './Witness/index.
|
|
1
|
+
import { UrlSafetyWitness } from './Witness/index.ts';
|
|
2
2
|
export declare const UrlSafetyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<UrlSafetyWitness<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -12,7 +12,7 @@ export declare const UrlSafetyPlugin: () => import("@xyo-network/payloadset-plug
|
|
|
12
12
|
endPoint?: string;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
schema: import("./Witness/Config.
|
|
15
|
+
schema: import("./Witness/Config.ts").UrlSafetyWitnessConfigSchema;
|
|
16
16
|
urls?: string[];
|
|
17
17
|
}, "schema"> & {
|
|
18
18
|
schema: "network.xyo.url.safety.witness.config";
|
package/dist/node/Plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UrlSafetyWitness } from './Witness/index.
|
|
1
|
+
import { UrlSafetyWitness } from './Witness/index.ts';
|
|
2
2
|
export declare const UrlSafetyPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<UrlSafetyWitness<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -12,7 +12,7 @@ export declare const UrlSafetyPlugin: () => import("@xyo-network/payloadset-plug
|
|
|
12
12
|
endPoint?: string;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
schema: import("./Witness/Config.
|
|
15
|
+
schema: import("./Witness/Config.ts").UrlSafetyWitnessConfigSchema;
|
|
16
16
|
urls?: string[];
|
|
17
17
|
}, "schema"> & {
|
|
18
18
|
schema: "network.xyo.url.safety.witness.config";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
2
2
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
3
|
-
import { UrlSafetyWitnessConfig } from './Config.
|
|
3
|
+
import { UrlSafetyWitnessConfig } from './Config.ts';
|
|
4
4
|
export type UrlSafetyWitnessParams = WitnessParams<AnyConfigSchema<UrlSafetyWitnessConfig>, {
|
|
5
5
|
google?: {
|
|
6
6
|
safeBrowsing?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
2
2
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
3
|
-
import { UrlSafetyWitnessConfig } from './Config.
|
|
3
|
+
import { UrlSafetyWitnessConfig } from './Config.ts';
|
|
4
4
|
export type UrlSafetyWitnessParams = WitnessParams<AnyConfigSchema<UrlSafetyWitnessConfig>, {
|
|
5
5
|
google?: {
|
|
6
6
|
safeBrowsing?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
2
2
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
3
|
-
import { UrlSafetyWitnessConfig } from './Config.
|
|
3
|
+
import { UrlSafetyWitnessConfig } from './Config.ts';
|
|
4
4
|
export type UrlSafetyWitnessParams = WitnessParams<AnyConfigSchema<UrlSafetyWitnessConfig>, {
|
|
5
5
|
google?: {
|
|
6
6
|
safeBrowsing?: {
|
|
@@ -2,7 +2,7 @@ import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
|
2
2
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
3
3
|
import { UrlPayload } from '@xyo-network/url-payload-plugin';
|
|
4
4
|
import { UrlSafetyPayload } from '@xyo-network/url-safety-payload-plugin';
|
|
5
|
-
import { UrlSafetyWitnessParams } from './Params.
|
|
5
|
+
import { UrlSafetyWitnessParams } from './Params.ts';
|
|
6
6
|
export type GoogleSafeBrowsingMatchSchema = 'com.google.safebrowsing.match';
|
|
7
7
|
export declare const GoogleSafeBrowsingMatchSchema: GoogleSafeBrowsingMatchSchema;
|
|
8
8
|
export interface GoogleSafeBrowsingMatch {
|
|
@@ -2,7 +2,7 @@ import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
|
2
2
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
3
3
|
import { UrlPayload } from '@xyo-network/url-payload-plugin';
|
|
4
4
|
import { UrlSafetyPayload } from '@xyo-network/url-safety-payload-plugin';
|
|
5
|
-
import { UrlSafetyWitnessParams } from './Params.
|
|
5
|
+
import { UrlSafetyWitnessParams } from './Params.ts';
|
|
6
6
|
export type GoogleSafeBrowsingMatchSchema = 'com.google.safebrowsing.match';
|
|
7
7
|
export declare const GoogleSafeBrowsingMatchSchema: GoogleSafeBrowsingMatchSchema;
|
|
8
8
|
export interface GoogleSafeBrowsingMatch {
|
|
@@ -2,7 +2,7 @@ import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
|
2
2
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
3
3
|
import { UrlPayload } from '@xyo-network/url-payload-plugin';
|
|
4
4
|
import { UrlSafetyPayload } from '@xyo-network/url-safety-payload-plugin';
|
|
5
|
-
import { UrlSafetyWitnessParams } from './Params.
|
|
5
|
+
import { UrlSafetyWitnessParams } from './Params.ts';
|
|
6
6
|
export type GoogleSafeBrowsingMatchSchema = 'com.google.safebrowsing.match';
|
|
7
7
|
export declare const GoogleSafeBrowsingMatchSchema: GoogleSafeBrowsingMatchSchema;
|
|
8
8
|
export interface GoogleSafeBrowsingMatch {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Params.
|
|
3
|
-
export * from './Witness.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Params.ts';
|
|
3
|
+
export * from './Witness.ts';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Params.
|
|
3
|
-
export * from './Witness.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Params.ts';
|
|
3
|
+
export * from './Witness.ts';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Params.
|
|
3
|
-
export * from './Witness.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Params.ts';
|
|
3
|
+
export * from './Witness.ts';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|