@sapphire/phisherman 1.4.1 → 1.4.2-next.a6a12b1.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,46 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [1.4.1](https://github.com/sapphiredev/utilities/compare/@sapphire/phisherman@1.4.0...@sapphire/phisherman@1.4.1) (2022-04-01)
6
+
7
+ **Note:** Version bump only for package @sapphire/phisherman
8
+
9
+ # [1.4.0](https://github.com/sapphiredev/utilities/compare/@sapphire/phisherman@1.3.1...@sapphire/phisherman@1.4.0) (2022-03-06)
10
+
11
+ ### Features
12
+
13
+ - allow module: NodeNext ([#306](https://github.com/sapphiredev/utilities/issues/306)) ([9dc6dd6](https://github.com/sapphiredev/utilities/commit/9dc6dd619efab879bb2b0b3c9e64304e10a67ed6))
14
+
15
+ ## [1.3.1](https://github.com/sapphiredev/utilities/compare/@sapphire/phisherman@1.3.0...@sapphire/phisherman@1.3.1) (2022-03-01)
16
+
17
+ **Note:** Version bump only for package @sapphire/phisherman
18
+
19
+ # [1.3.0](https://github.com/sapphiredev/utilities/compare/@sapphire/phisherman@1.2.0...@sapphire/phisherman@1.3.0) (2022-02-15)
20
+
21
+ ### Features
22
+
23
+ - **phisherman:** add url validation ([#294](https://github.com/sapphiredev/utilities/issues/294)) ([b039d4a](https://github.com/sapphiredev/utilities/commit/b039d4a621b4b0be7b87af578868a37145087846))
24
+ - **ts-config:** add multi-config structure ([#281](https://github.com/sapphiredev/utilities/issues/281)) ([b5191d7](https://github.com/sapphiredev/utilities/commit/b5191d7f2416dc5838590c4ff221454925553e37))
25
+
26
+ # [1.2.0](https://github.com/sapphiredev/utilities/compare/@sapphire/phisherman@1.1.0...@sapphire/phisherman@1.2.0) (2022-01-28)
27
+
28
+ ### Features
29
+
30
+ - change build system to tsup ([#270](https://github.com/sapphiredev/utilities/issues/270)) ([365a53a](https://github.com/sapphiredev/utilities/commit/365a53a5517a01a0926cf28a83c96b63f32ed9f8))
31
+
32
+ # [1.1.0](https://github.com/sapphiredev/utilities/compare/@sapphire/phisherman@1.0.1...@sapphire/phisherman@1.1.0) (2022-01-22)
33
+
34
+ ### Features
35
+
36
+ - **phisherman:** add more methods ([#265](https://github.com/sapphiredev/utilities/issues/265)) ([524f311](https://github.com/sapphiredev/utilities/commit/524f3116fe5e1fd2f8186ef1e635dcf750503555))
37
+
38
+ ## [1.0.1](https://github.com/sapphiredev/utilities/compare/@sapphire/phisherman@1.0.0...@sapphire/phisherman@1.0.1) (2022-01-16)
39
+
40
+ **Note:** Version bump only for package @sapphire/phisherman
41
+
42
+ # 1.0.0 (2022-01-12)
43
+
44
+ ### Features
45
+
46
+ - add phisherman ([#255](https://github.com/sapphiredev/utilities/issues/255)) ([68fba03](https://github.com/sapphiredev/utilities/commit/68fba03bcbd3af14e66b25357d1eafd0cc315f0f))
package/dist/index.js CHANGED
@@ -51,6 +51,7 @@ async function checkDomain(domain, apiKey = storedApiKey) {
51
51
  isScam: result.classification === "safe" || result.classification === "unknown" ? false : true
52
52
  };
53
53
  }
54
+ __name(checkDomain, "checkDomain");
54
55
  function reportDomain(domain, apiKey = storedApiKey) {
55
56
  validateUrl(domain);
56
57
  return (0, import_fetch.fetch)(`https://api.phisherman.gg/v2/phish/report`, {
@@ -65,6 +66,7 @@ function reportDomain(domain, apiKey = storedApiKey) {
65
66
  })
66
67
  }, import_fetch.FetchResultTypes.JSON);
67
68
  }
69
+ __name(reportDomain, "reportDomain");
68
70
  async function getDomainInfo(domain, apiKey = storedApiKey) {
69
71
  validateUrl(domain);
70
72
  const result = await (0, import_fetch.fetch)(`https://api.phisherman.gg/v2/domains/info/${domain}`, {
@@ -76,6 +78,7 @@ async function getDomainInfo(domain, apiKey = storedApiKey) {
76
78
  }, import_fetch.FetchResultTypes.JSON);
77
79
  return result[domain];
78
80
  }
81
+ __name(getDomainInfo, "getDomainInfo");
79
82
  function reportCaughtPhish(domain, apiKey = storedApiKey, guildId = "") {
80
83
  return (0, import_fetch.fetch)(`https://api.phisherman.gg/v2/phish/caught/${domain}`, {
81
84
  method: import_fetch.FetchMethods.Post,
@@ -89,10 +92,12 @@ function reportCaughtPhish(domain, apiKey = storedApiKey, guildId = "") {
89
92
  })
90
93
  }, import_fetch.FetchResultTypes.JSON);
91
94
  }
95
+ __name(reportCaughtPhish, "reportCaughtPhish");
92
96
  async function setApiKey(key) {
93
97
  await checkApiKey(key);
94
98
  storedApiKey = key;
95
99
  }
100
+ __name(setApiKey, "setApiKey");
96
101
  async function checkApiKey(apiKey) {
97
102
  try {
98
103
  await (0, import_fetch.fetch)(`https://api.phisherman.gg/v2/domains/check/verified.test.phisherman.gg`, {
@@ -110,11 +115,13 @@ async function checkApiKey(apiKey) {
110
115
  throw error;
111
116
  }
112
117
  }
118
+ __name(checkApiKey, "checkApiKey");
113
119
  function validateUrl(domain) {
114
120
  const regexp = /[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi;
115
121
  if (!domain.match(regexp))
116
122
  throw new Error("[SapphirePhisherman]: Invalid domain provided");
117
123
  }
124
+ __name(validateUrl, "validateUrl");
118
125
  // Annotate the CommonJS export names for ESM import in node:
119
126
  0 && (module.exports = {
120
127
  checkDomain,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/lib/Phisherman.ts"],"sourcesContent":["export * from './lib/Phisherman';\nexport type { CheckReturnType, PhishermanOptions, PhishermanReportType, PhishermanReturnType } from './lib/PhishermanTypes';\n","import { fetch, FetchMethods, FetchResultTypes, QueryError } from '@sapphire/fetch';\nimport type { PhishermanInfoType, PhishermanReportType, PhishermanReturnType } from './PhishermanTypes';\nimport os from 'node:os';\n\nconst agent = `Sapphire Phisherman/1.0.0 (node-fetch) ${os.platform()}/${os.release()} (https://github.com/sapphiredev/utilities/tree/main/packages/phisherman)`;\n/**\n * The cached apiKey which was created using {@link setApiKey}\n */\nlet storedApiKey: string;\n\n/**\n * Checks if a link is detected as a scam or phishing link by phisherman.\n * @param domain The domain to check.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.0.0\n */\nexport async function checkDomain(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\tconst result = await fetch<PhishermanReturnType>(\n\t\t`https://api.phisherman.gg/v2/domains/check/${domain}`,\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t}\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n\n\treturn {\n\t\t...result,\n\t\tisScam: result.classification === 'safe' || result.classification === 'unknown' ? false : true\n\t};\n}\n\n/**\n * Report a domain that is confirmed to be a scam or phishing domain to phisherman, to enhance their API.\n * @param domain The domain to report.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.0.0\n */\nexport function reportDomain(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\treturn fetch<PhishermanReportType>(\n\t\t`https://api.phisherman.gg/v2/phish/report`,\n\t\t{\n\t\t\tmethod: FetchMethods.Put,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\turl: domain\n\t\t\t})\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n}\n\n/**\n * Returns information for a domain.\n * @param domain The domain to get info about.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.1.0\n */\nexport async function getDomainInfo(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\tconst result = await fetch<PhishermanInfoType>(\n\t\t`https://api.phisherman.gg/v2/domains/info/${domain}`,\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t}\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n\treturn result[domain];\n}\n\n/**\n * Report a caught phish back to phisherman to improve their analytics.\n * @param domain The domain which was caught.\n * @param apiKey @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @param guildId The id of the guild in which the domain was caught.\n * @since 1.1.0\n */\nexport function reportCaughtPhish(domain: string, apiKey: string = storedApiKey, guildId: string | number = '') {\n\treturn fetch<PhishermanReportType>(\n\t\t`https://api.phisherman.gg/v2/phish/caught/${domain}`,\n\t\t{\n\t\t\tmethod: FetchMethods.Post,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tguild: Number(guildId)\n\t\t\t})\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n}\n\n/**\n * Set the phisherman's API key.\n * @param key The API key to access the phisherman API and cache within the code of the wrapper.\n * @since 1.0.0\n */\nexport async function setApiKey(key: string) {\n\tawait checkApiKey(key);\n\tstoredApiKey = key;\n}\n\nasync function checkApiKey(apiKey: string) {\n\ttry {\n\t\tawait fetch<{ message: string; success: false }>(\n\t\t\t`https://api.phisherman.gg/v2/domains/check/verified.test.phisherman.gg`,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t'User-Agent': agent,\n\t\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t\t}\n\t\t\t},\n\t\t\tFetchResultTypes.JSON\n\t\t);\n\t} catch (error) {\n\t\tconst typedError = error as QueryError;\n\n\t\tif (typedError.code === 401 && typedError.toJSON().message === 'missing permissions or invalid API key') {\n\t\t\tthrow new Error('[SapphirePhisherman]: Invalid API key provided');\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n\nfunction validateUrl(domain: string) {\n\tconst regexp = /[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)/gi;\n\tif (!domain.match(regexp)) throw new Error('[SapphirePhisherman]: Invalid domain provided');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkE;AAElE,qBAAe;AAEf,IAAM,QAAQ,0CAA0C,uBAAG,SAAS,KAAK,uBAAG,QAAQ;AAIpF,IAAI;AAQJ,2BAAkC,QAAgB,SAAiB,cAAc;AAChF,cAAY,MAAM;AAClB,QAAM,SAAS,MAAM,wBACpB,8CAA8C,UAC9C;AAAA,IACC,SAAS;AAAA,MACR,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,eAAe,UAAU;AAAA,IAC1B;AAAA,EACD,GACA,8BAAiB,IAClB;AAEA,SAAO;AAAA,OACH;AAAA,IACH,QAAQ,OAAO,mBAAmB,UAAU,OAAO,mBAAmB,YAAY,QAAQ;AAAA,EAC3F;AACD;AAlBsB,AA0Bf,sBAAsB,QAAgB,SAAiB,cAAc;AAC3E,cAAY,MAAM;AAClB,SAAO,wBACN,6CACA;AAAA,IACC,QAAQ,0BAAa;AAAA,IACrB,SAAS;AAAA,MACR,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,eAAe,UAAU;AAAA,IAC1B;AAAA,IACA,MAAM,KAAK,UAAU;AAAA,MACpB,KAAK;AAAA,IACN,CAAC;AAAA,EACF,GACA,8BAAiB,IAClB;AACD;AAjBgB,AAyBhB,6BAAoC,QAAgB,SAAiB,cAAc;AAClF,cAAY,MAAM;AAClB,QAAM,SAAS,MAAM,wBACpB,6CAA6C,UAC7C;AAAA,IACC,SAAS;AAAA,MACR,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,eAAe,UAAU;AAAA,IAC1B;AAAA,EACD,GACA,8BAAiB,IAClB;AACA,SAAO,OAAO;AACf;AAdsB,AAuBf,2BAA2B,QAAgB,SAAiB,cAAc,UAA2B,IAAI;AAC/G,SAAO,wBACN,6CAA6C,UAC7C;AAAA,IACC,QAAQ,0BAAa;AAAA,IACrB,SAAS;AAAA,MACR,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,eAAe,UAAU;AAAA,IAC1B;AAAA,IACA,MAAM,KAAK,UAAU;AAAA,MACpB,OAAO,OAAO,OAAO;AAAA,IACtB,CAAC;AAAA,EACF,GACA,8BAAiB,IAClB;AACD;AAhBgB,AAuBhB,yBAAgC,KAAa;AAC5C,QAAM,YAAY,GAAG;AACrB,iBAAe;AAChB;AAHsB,AAKtB,2BAA2B,QAAgB;AAC1C,MAAI;AACH,UAAM,wBACL,0EACA;AAAA,MACC,SAAS;AAAA,QACR,gBAAgB;AAAA,QAChB,cAAc;AAAA,QACd,eAAe,UAAU;AAAA,MAC1B;AAAA,IACD,GACA,8BAAiB,IAClB;AAAA,EACD,SAAS,OAAP;AACD,UAAM,aAAa;AAEnB,QAAI,WAAW,SAAS,OAAO,WAAW,OAAO,EAAE,YAAY,0CAA0C;AACxG,YAAM,IAAI,MAAM,gDAAgD;AAAA,IACjE;AAEA,UAAM;AAAA,EACP;AACD;AAtBe,AAwBf,qBAAqB,QAAgB;AACpC,QAAM,SAAS;AACf,MAAI,CAAC,OAAO,MAAM,MAAM;AAAG,UAAM,IAAI,MAAM,+CAA+C;AAC3F;AAHS","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/lib/Phisherman.ts"],"sourcesContent":["export * from './lib/Phisherman';\nexport type { CheckReturnType, PhishermanOptions, PhishermanReportType, PhishermanReturnType } from './lib/PhishermanTypes';\n","import { fetch, FetchMethods, FetchResultTypes, QueryError } from '@sapphire/fetch';\nimport type { PhishermanInfoType, PhishermanReportType, PhishermanReturnType } from './PhishermanTypes';\nimport os from 'node:os';\n\nconst agent = `Sapphire Phisherman/1.0.0 (node-fetch) ${os.platform()}/${os.release()} (https://github.com/sapphiredev/utilities/tree/main/packages/phisherman)`;\n/**\n * The cached apiKey which was created using {@link setApiKey}\n */\nlet storedApiKey: string;\n\n/**\n * Checks if a link is detected as a scam or phishing link by phisherman.\n * @param domain The domain to check.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.0.0\n */\nexport async function checkDomain(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\tconst result = await fetch<PhishermanReturnType>(\n\t\t`https://api.phisherman.gg/v2/domains/check/${domain}`,\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t}\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n\n\treturn {\n\t\t...result,\n\t\tisScam: result.classification === 'safe' || result.classification === 'unknown' ? false : true\n\t};\n}\n\n/**\n * Report a domain that is confirmed to be a scam or phishing domain to phisherman, to enhance their API.\n * @param domain The domain to report.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.0.0\n */\nexport function reportDomain(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\treturn fetch<PhishermanReportType>(\n\t\t`https://api.phisherman.gg/v2/phish/report`,\n\t\t{\n\t\t\tmethod: FetchMethods.Put,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\turl: domain\n\t\t\t})\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n}\n\n/**\n * Returns information for a domain.\n * @param domain The domain to get info about.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.1.0\n */\nexport async function getDomainInfo(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\tconst result = await fetch<PhishermanInfoType>(\n\t\t`https://api.phisherman.gg/v2/domains/info/${domain}`,\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t}\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n\treturn result[domain];\n}\n\n/**\n * Report a caught phish back to phisherman to improve their analytics.\n * @param domain The domain which was caught.\n * @param apiKey @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @param guildId The id of the guild in which the domain was caught.\n * @since 1.1.0\n */\nexport function reportCaughtPhish(domain: string, apiKey: string = storedApiKey, guildId: string | number = '') {\n\treturn fetch<PhishermanReportType>(\n\t\t`https://api.phisherman.gg/v2/phish/caught/${domain}`,\n\t\t{\n\t\t\tmethod: FetchMethods.Post,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tguild: Number(guildId)\n\t\t\t})\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n}\n\n/**\n * Set the phisherman's API key.\n * @param key The API key to access the phisherman API and cache within the code of the wrapper.\n * @since 1.0.0\n */\nexport async function setApiKey(key: string) {\n\tawait checkApiKey(key);\n\tstoredApiKey = key;\n}\n\nasync function checkApiKey(apiKey: string) {\n\ttry {\n\t\tawait fetch<{ message: string; success: false }>(\n\t\t\t`https://api.phisherman.gg/v2/domains/check/verified.test.phisherman.gg`,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t'User-Agent': agent,\n\t\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t\t}\n\t\t\t},\n\t\t\tFetchResultTypes.JSON\n\t\t);\n\t} catch (error) {\n\t\tconst typedError = error as QueryError;\n\n\t\tif (typedError.code === 401 && typedError.toJSON().message === 'missing permissions or invalid API key') {\n\t\t\tthrow new Error('[SapphirePhisherman]: Invalid API key provided');\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n\nfunction validateUrl(domain: string) {\n\tconst regexp = /[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)/gi;\n\tif (!domain.match(regexp)) throw new Error('[SapphirePhisherman]: Invalid domain provided');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkE;AAElE,qBAAe;AAEf,IAAM,QAAQ,0CAA0C,uBAAG,SAAS,KAAK,uBAAG,QAAQ;AAIpF,IAAI;AAQJ,2BAAkC,QAAgB,SAAiB,cAAc;AAChF,cAAY,MAAM;AAClB,QAAM,SAAS,MAAM,wBACpB,8CAA8C,UAC9C;AAAA,IACC,SAAS;AAAA,MACR,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,eAAe,UAAU;AAAA,IAC1B;AAAA,EACD,GACA,8BAAiB,IAClB;AAEA,SAAO;AAAA,OACH;AAAA,IACH,QAAQ,OAAO,mBAAmB,UAAU,OAAO,mBAAmB,YAAY,QAAQ;AAAA,EAC3F;AACD;AAlBsB;AA0Bf,sBAAsB,QAAgB,SAAiB,cAAc;AAC3E,cAAY,MAAM;AAClB,SAAO,wBACN,6CACA;AAAA,IACC,QA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qB,QAAgB;AACpC,QAAM,SAAS;AACf,MAAI,CAAC,OAAO,MAAM,MAAM;AAAG,UAAM,IAAI,MAAM,+CAA+C;AAC3F;AAHS;","names":[]}
package/dist/index.mjs CHANGED
@@ -20,6 +20,7 @@ async function checkDomain(domain, apiKey = storedApiKey) {
20
20
  isScam: result.classification === "safe" || result.classification === "unknown" ? false : true
21
21
  };
22
22
  }
23
+ __name(checkDomain, "checkDomain");
23
24
  function reportDomain(domain, apiKey = storedApiKey) {
24
25
  validateUrl(domain);
25
26
  return fetch(`https://api.phisherman.gg/v2/phish/report`, {
@@ -34,6 +35,7 @@ function reportDomain(domain, apiKey = storedApiKey) {
34
35
  })
35
36
  }, FetchResultTypes.JSON);
36
37
  }
38
+ __name(reportDomain, "reportDomain");
37
39
  async function getDomainInfo(domain, apiKey = storedApiKey) {
38
40
  validateUrl(domain);
39
41
  const result = await fetch(`https://api.phisherman.gg/v2/domains/info/${domain}`, {
@@ -45,6 +47,7 @@ async function getDomainInfo(domain, apiKey = storedApiKey) {
45
47
  }, FetchResultTypes.JSON);
46
48
  return result[domain];
47
49
  }
50
+ __name(getDomainInfo, "getDomainInfo");
48
51
  function reportCaughtPhish(domain, apiKey = storedApiKey, guildId = "") {
49
52
  return fetch(`https://api.phisherman.gg/v2/phish/caught/${domain}`, {
50
53
  method: FetchMethods.Post,
@@ -58,10 +61,12 @@ function reportCaughtPhish(domain, apiKey = storedApiKey, guildId = "") {
58
61
  })
59
62
  }, FetchResultTypes.JSON);
60
63
  }
64
+ __name(reportCaughtPhish, "reportCaughtPhish");
61
65
  async function setApiKey(key) {
62
66
  await checkApiKey(key);
63
67
  storedApiKey = key;
64
68
  }
69
+ __name(setApiKey, "setApiKey");
65
70
  async function checkApiKey(apiKey) {
66
71
  try {
67
72
  await fetch(`https://api.phisherman.gg/v2/domains/check/verified.test.phisherman.gg`, {
@@ -79,11 +84,13 @@ async function checkApiKey(apiKey) {
79
84
  throw error;
80
85
  }
81
86
  }
87
+ __name(checkApiKey, "checkApiKey");
82
88
  function validateUrl(domain) {
83
89
  const regexp = /[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi;
84
90
  if (!domain.match(regexp))
85
91
  throw new Error("[SapphirePhisherman]: Invalid domain provided");
86
92
  }
93
+ __name(validateUrl, "validateUrl");
87
94
  export {
88
95
  checkDomain,
89
96
  getDomainInfo,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/Phisherman.ts"],"sourcesContent":["import { fetch, FetchMethods, FetchResultTypes, QueryError } from '@sapphire/fetch';\nimport type { PhishermanInfoType, PhishermanReportType, PhishermanReturnType } from './PhishermanTypes';\nimport os from 'node:os';\n\nconst agent = `Sapphire Phisherman/1.0.0 (node-fetch) ${os.platform()}/${os.release()} (https://github.com/sapphiredev/utilities/tree/main/packages/phisherman)`;\n/**\n * The cached apiKey which was created using {@link setApiKey}\n */\nlet storedApiKey: string;\n\n/**\n * Checks if a link is detected as a scam or phishing link by phisherman.\n * @param domain The domain to check.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.0.0\n */\nexport async function checkDomain(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\tconst result = await fetch<PhishermanReturnType>(\n\t\t`https://api.phisherman.gg/v2/domains/check/${domain}`,\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t}\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n\n\treturn {\n\t\t...result,\n\t\tisScam: result.classification === 'safe' || result.classification === 'unknown' ? false : true\n\t};\n}\n\n/**\n * Report a domain that is confirmed to be a scam or phishing domain to phisherman, to enhance their API.\n * @param domain The domain to report.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.0.0\n */\nexport function reportDomain(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\treturn fetch<PhishermanReportType>(\n\t\t`https://api.phisherman.gg/v2/phish/report`,\n\t\t{\n\t\t\tmethod: FetchMethods.Put,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\turl: domain\n\t\t\t})\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n}\n\n/**\n * Returns information for a domain.\n * @param domain The domain to get info about.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.1.0\n */\nexport async function getDomainInfo(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\tconst result = await fetch<PhishermanInfoType>(\n\t\t`https://api.phisherman.gg/v2/domains/info/${domain}`,\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t}\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n\treturn result[domain];\n}\n\n/**\n * Report a caught phish back to phisherman to improve their analytics.\n * @param domain The domain which was caught.\n * @param apiKey @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @param guildId The id of the guild in which the domain was caught.\n * @since 1.1.0\n */\nexport function reportCaughtPhish(domain: string, apiKey: string = storedApiKey, guildId: string | number = '') {\n\treturn fetch<PhishermanReportType>(\n\t\t`https://api.phisherman.gg/v2/phish/caught/${domain}`,\n\t\t{\n\t\t\tmethod: FetchMethods.Post,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tguild: Number(guildId)\n\t\t\t})\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n}\n\n/**\n * Set the phisherman's API key.\n * @param key The API key to access the phisherman API and cache within the code of the wrapper.\n * @since 1.0.0\n */\nexport async function setApiKey(key: string) {\n\tawait checkApiKey(key);\n\tstoredApiKey = key;\n}\n\nasync function checkApiKey(apiKey: string) {\n\ttry {\n\t\tawait fetch<{ message: string; success: false }>(\n\t\t\t`https://api.phisherman.gg/v2/domains/check/verified.test.phisherman.gg`,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t'User-Agent': agent,\n\t\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t\t}\n\t\t\t},\n\t\t\tFetchResultTypes.JSON\n\t\t);\n\t} catch (error) {\n\t\tconst typedError = error as QueryError;\n\n\t\tif (typedError.code === 401 && typedError.toJSON().message === 'missing permissions or invalid API key') {\n\t\t\tthrow new Error('[SapphirePhisherman]: Invalid API key provided');\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n\nfunction validateUrl(domain: string) {\n\tconst regexp = /[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)/gi;\n\tif (!domain.match(regexp)) throw new Error('[SapphirePhisherman]: Invalid domain provided');\n}\n"],"mappings":";;;;AAAA;AAEA;AAEA,IAAM,QAAQ,0CAA0C,GAAG,SAAS,KAAK,GAAG,QAAQ;AAIpF,IAAI;AAQJ,2BAAkC,QAAgB,SAAiB,cAAc;AAChF,cAAY,MAAM;AAClB,QAAM,SAAS,MAAM,MACpB,8CAA8C,UAC9C;AAAA,IACC,SAAS;AAAA,MACR,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,eAAe,UAAU;AAAA,IAC1B;AAAA,EACD,GACA,iBAAiB,IA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AiB,IAClB;AAAA,EACD,SAAS,OAAP;AACD,UAAM,aAAa;AAEnB,QAAI,WAAW,SAAS,OAAO,WAAW,OAAO,EAAE,YAAY,0CAA0C;AACxG,YAAM,IAAI,MAAM,gDAAgD;AAAA,IACjE;AAEA,UAAM;AAAA,EACP;AACD;AAtBe,AAwBf,qBAAqB,QAAgB;AACpC,QAAM,SAAS;AACf,MAAI,CAAC,OAAO,MAAM,MAAM;AAAG,UAAM,IAAI,MAAM,+CAA+C;AAC3F;AAHS","names":[]}
1
+ {"version":3,"sources":["../src/lib/Phisherman.ts"],"sourcesContent":["import { fetch, FetchMethods, FetchResultTypes, QueryError } from '@sapphire/fetch';\nimport type { PhishermanInfoType, PhishermanReportType, PhishermanReturnType } from './PhishermanTypes';\nimport os from 'node:os';\n\nconst agent = `Sapphire Phisherman/1.0.0 (node-fetch) ${os.platform()}/${os.release()} (https://github.com/sapphiredev/utilities/tree/main/packages/phisherman)`;\n/**\n * The cached apiKey which was created using {@link setApiKey}\n */\nlet storedApiKey: string;\n\n/**\n * Checks if a link is detected as a scam or phishing link by phisherman.\n * @param domain The domain to check.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.0.0\n */\nexport async function checkDomain(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\tconst result = await fetch<PhishermanReturnType>(\n\t\t`https://api.phisherman.gg/v2/domains/check/${domain}`,\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t}\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n\n\treturn {\n\t\t...result,\n\t\tisScam: result.classification === 'safe' || result.classification === 'unknown' ? false : true\n\t};\n}\n\n/**\n * Report a domain that is confirmed to be a scam or phishing domain to phisherman, to enhance their API.\n * @param domain The domain to report.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.0.0\n */\nexport function reportDomain(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\treturn fetch<PhishermanReportType>(\n\t\t`https://api.phisherman.gg/v2/phish/report`,\n\t\t{\n\t\t\tmethod: FetchMethods.Put,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\turl: domain\n\t\t\t})\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n}\n\n/**\n * Returns information for a domain.\n * @param domain The domain to get info about.\n * @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @since 1.1.0\n */\nexport async function getDomainInfo(domain: string, apiKey: string = storedApiKey) {\n\tvalidateUrl(domain);\n\tconst result = await fetch<PhishermanInfoType>(\n\t\t`https://api.phisherman.gg/v2/domains/info/${domain}`,\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t}\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n\treturn result[domain];\n}\n\n/**\n * Report a caught phish back to phisherman to improve their analytics.\n * @param domain The domain which was caught.\n * @param apiKey @param apiKey optionally pass a Phiserman API key for making this request. This will default to {@link storedApiKey}, which can be configured through {@link setApiKey}.\n * @param guildId The id of the guild in which the domain was caught.\n * @since 1.1.0\n */\nexport function reportCaughtPhish(domain: string, apiKey: string = storedApiKey, guildId: string | number = '') {\n\treturn fetch<PhishermanReportType>(\n\t\t`https://api.phisherman.gg/v2/phish/caught/${domain}`,\n\t\t{\n\t\t\tmethod: FetchMethods.Post,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'User-Agent': agent,\n\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tguild: Number(guildId)\n\t\t\t})\n\t\t},\n\t\tFetchResultTypes.JSON\n\t);\n}\n\n/**\n * Set the phisherman's API key.\n * @param key The API key to access the phisherman API and cache within the code of the wrapper.\n * @since 1.0.0\n */\nexport async function setApiKey(key: string) {\n\tawait checkApiKey(key);\n\tstoredApiKey = key;\n}\n\nasync function checkApiKey(apiKey: string) {\n\ttry {\n\t\tawait fetch<{ message: string; success: false }>(\n\t\t\t`https://api.phisherman.gg/v2/domains/check/verified.test.phisherman.gg`,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t'User-Agent': agent,\n\t\t\t\t\tAuthorization: `Bearer ${apiKey}`\n\t\t\t\t}\n\t\t\t},\n\t\t\tFetchResultTypes.JSON\n\t\t);\n\t} catch (error) {\n\t\tconst typedError = error as QueryError;\n\n\t\tif (typedError.code === 401 && typedError.toJSON().message === 'missing permissions or invalid API key') {\n\t\t\tthrow new Error('[SapphirePhisherman]: Invalid API key provided');\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n\nfunction validateUrl(domain: string) {\n\tconst regexp = /[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)/gi;\n\tif (!domain.match(regexp)) throw new Error('[SapphirePhisherman]: Invalid domain provided');\n}\n"],"mappings":";;;;AAAA;AAEA;AAEA,IAAM,QAAQ,0CAA0C,GAAG,SAAS,KAAK,GAAG,QAAQ;AAIpF,IAAI;AAQJ,2BAAkC,QAAgB,SAAiB,cAAc;AAChF,cAAY,MAAM;AAClB,QAAM,SAAS,MAAM,MACpB,8CAA8C,UAC9C;AAAA,IACC,SAAS;AAAA,MACR,gBAAgB;AAAA,MAChB,cAAc;AAAA,MACd,eAAe,UAAU;AAAA,IAC1B;AAA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1B;AAAA,IACD,GACA,iBAAiB,IAClB;AAAA,EACD,SAAS,OAAP;AACD,UAAM,aAAa;AAEnB,QAAI,WAAW,SAAS,OAAO,WAAW,OAAO,EAAE,YAAY,0CAA0C;AACxG,YAAM,IAAI,MAAM,gDAAgD;AAAA,IACjE;AAEA,UAAM;AAAA,EACP;AACD;AAtBe;AAwBf,qBAAqB,QAAgB;AACpC,QAAM,SAAS;AACf,MAAI,CAAC,OAAO,MAAM,MAAM;AAAG,UAAM,IAAI,MAAM,+CAA+C;AAC3F;AAHS;","names":[]}
package/package.json CHANGED
@@ -1,57 +1,62 @@
1
1
  {
2
- "name": "@sapphire/phisherman",
3
- "version": "1.4.1",
4
- "description": "Wrapper around phisherman to easily check and report domains",
5
- "author": "@sapphire",
6
- "license": "MIT",
7
- "main": "dist/index.js",
8
- "module": "dist/index.mjs",
9
- "types": "dist/index.d.ts",
10
- "typedocMain": "src/index.ts",
11
- "exports": {
12
- "import": "./dist/index.mjs",
13
- "require": "./dist/index.js",
14
- "types": "./dist/index.d.ts"
15
- },
16
- "homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/phisherman",
17
- "scripts": {
18
- "lint": "eslint src --ext ts --fix",
19
- "build": "tsup && tsc -b src",
20
- "prepublishOnly": "yarn build"
21
- },
22
- "dependencies": {
23
- "@sapphire/fetch": "^2.3.1"
24
- },
25
- "repository": {
26
- "type": "git",
27
- "url": "git+https://github.com/sapphiredev/utilities.git",
28
- "directory": "packages/phisherman"
29
- },
30
- "files": [
31
- "dist",
32
- "!dist/*.tsbuildinfo"
33
- ],
34
- "engines": {
35
- "node": ">=16.6.0",
36
- "npm": ">=7.0.0"
37
- },
38
- "keywords": [
39
- "sapphiredev",
40
- "bot",
41
- "typescript",
42
- "ts",
43
- "yarn",
44
- "discord",
45
- "sapphire",
46
- "phisherman",
47
- "scam",
48
- "detection"
49
- ],
50
- "bugs": {
51
- "url": "https://github.com/sapphiredev/utilities/issues"
52
- },
53
- "publishConfig": {
54
- "access": "public"
55
- },
56
- "gitHead": "bf5ac56e547bfdbfac38e020882004e0f136546e"
57
- }
2
+ "name": "@sapphire/phisherman",
3
+ "version": "1.4.2-next.a6a12b1.0",
4
+ "description": "Wrapper around phisherman to easily check and report domains",
5
+ "author": "@sapphire",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "module": "dist/index.mjs",
9
+ "types": "dist/index.d.ts",
10
+ "exports": {
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/phisherman",
16
+ "scripts": {
17
+ "lint": "eslint src --ext ts --fix",
18
+ "build": "tsup && tsc -b src",
19
+ "prepublish": "yarn build",
20
+ "bump": "cliff-jumper",
21
+ "check-update": "cliff-jumper --dry-run"
22
+ },
23
+ "dependencies": {
24
+ "@sapphire/fetch": "^2.3.2-next.a6a12b1.0"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/sapphiredev/utilities.git",
29
+ "directory": "packages/phisherman"
30
+ },
31
+ "files": [
32
+ "dist/**/*.js*",
33
+ "dist/**/*.mjs*",
34
+ "dist/**/*.d*"
35
+ ],
36
+ "engines": {
37
+ "node": ">=16.6.0",
38
+ "npm": ">=7.0.0"
39
+ },
40
+ "keywords": [
41
+ "sapphiredev",
42
+ "bot",
43
+ "typescript",
44
+ "ts",
45
+ "yarn",
46
+ "discord",
47
+ "sapphire",
48
+ "phisherman",
49
+ "scam",
50
+ "detection"
51
+ ],
52
+ "bugs": {
53
+ "url": "https://github.com/sapphiredev/utilities/issues"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
58
+ "devDependencies": {
59
+ "tsup": "^5.12.5",
60
+ "typescript": "^4.6.3"
61
+ }
62
+ }
package/LICENSE.md DELETED
@@ -1,24 +0,0 @@
1
- # The MIT License (MIT)
2
-
3
- Copyright © `2020` `The Sapphire Community and its contributors`
4
-
5
- Permission is hereby granted, free of charge, to any person
6
- obtaining a copy of this software and associated documentation
7
- files (the “Software”), to deal in the Software without
8
- restriction, including without limitation the rights to use,
9
- copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the
11
- Software is furnished to do so, subject to the following
12
- conditions:
13
-
14
- The above copyright notice and this permission notice shall be
15
- included in all copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
18
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
- OTHER DEALINGS IN THE SOFTWARE.