@gibme/ipinfo 1.0.0 → 1.0.2

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.
@@ -0,0 +1,15 @@
1
+ import { PrefixInfo } from './types';
2
+ import { CheckIP } from './web';
3
+ export { CheckIP };
4
+ /**
5
+ * Looks up information regarding the IP address supplied
6
+ *
7
+ * @param address
8
+ * @param max_retries
9
+ */
10
+ export declare const IPInfo: (address: string, max_retries?: number) => Promise<PrefixInfo | undefined>;
11
+ declare const _default: {
12
+ IPInfo: (address: string, max_retries?: number) => Promise<PrefixInfo | undefined>;
13
+ CheckIP: (address?: string) => Promise<import("./types").CheckIPResponse | undefined>;
14
+ };
15
+ export default _default;
package/dist/index.js ADDED
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ // Copyright (c) 2016-2024, Brandon Lehmann <brandonlehmann@gmail.com>
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
+ return new (P || (P = Promise))(function (resolve, reject) {
24
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ var __importDefault = (this && this.__importDefault) || function (mod) {
31
+ return (mod && mod.__esModule) ? mod : { "default": mod };
32
+ };
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.IPInfo = exports.CheckIP = void 0;
35
+ const helpers_1 = __importDefault(require("./helpers"));
36
+ const web_1 = require("./web");
37
+ Object.defineProperty(exports, "CheckIP", { enumerable: true, get: function () { return web_1.CheckIP; } });
38
+ /**
39
+ * Looks up information regarding the IP address supplied
40
+ *
41
+ * @param address
42
+ * @param max_retries
43
+ */
44
+ const IPInfo = (address_1, ...args_1) => __awaiter(void 0, [address_1, ...args_1], void 0, function* (address, max_retries = 3) {
45
+ return helpers_1.default.getPrefix(address, max_retries);
46
+ });
47
+ exports.IPInfo = IPInfo;
48
+ exports.default = {
49
+ IPInfo: exports.IPInfo,
50
+ CheckIP: web_1.CheckIP
51
+ };
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,EAAE;AACF,iFAAiF;AACjF,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY;;;;;;;;;;;;;;;AAGZ,wDAAgC;AAChC,+BAAgC;AACvB,wFADA,aAAO,OACA;AAEhB;;;;;GAKG;AACI,MAAM,MAAM,GAAG,uBAGa,EAAE,8DAFjC,OAAe,EACf,WAAW,GAAG,CAAC;IAEf,OAAO,iBAAO,CAAC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC,CAAA,CAAC;AALW,QAAA,MAAM,UAKjB;AAEF,kBAAe;IACX,MAAM,EAAN,cAAM;IACN,OAAO,EAAP,aAAO;CACV,CAAC"}
package/dist/web.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { CheckIPResponse } from './types';
2
+ /**
3
+ * Looks up information regarding the IP address supplied; OR,
4
+ * if no address is supplied, looks up information regarding
5
+ * our client's IP address
6
+ *
7
+ * @param address
8
+ * @constructor
9
+ */
10
+ export declare const CheckIP: (address?: string) => Promise<CheckIPResponse | undefined>;
@@ -31,19 +31,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
31
31
  return (mod && mod.__esModule) ? mod : { "default": mod };
32
32
  };
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
- exports.CheckIP = exports.IPInfo = void 0;
35
- const helpers_1 = __importDefault(require("./helpers"));
34
+ exports.CheckIP = void 0;
36
35
  const fetch_1 = __importDefault(require("@gibme/fetch"));
37
- /**
38
- * Looks up information regarding the IP address supplied
39
- *
40
- * @param address
41
- * @param max_retries
42
- */
43
- const IPInfo = (address_1, ...args_1) => __awaiter(void 0, [address_1, ...args_1], void 0, function* (address, max_retries = 3) {
44
- return helpers_1.default.getPrefix(address, max_retries);
45
- });
46
- exports.IPInfo = IPInfo;
47
36
  /**
48
37
  * Looks up information regarding the IP address supplied; OR,
49
38
  * if no address is supplied, looks up information regarding
@@ -85,8 +74,4 @@ const CheckIP = (address) => __awaiter(void 0, void 0, void 0, function* () {
85
74
  };
86
75
  });
87
76
  exports.CheckIP = CheckIP;
88
- exports.default = {
89
- IPInfo: exports.IPInfo,
90
- CheckIP: exports.CheckIP
91
- };
92
- //# sourceMappingURL=ipinfo.js.map
77
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,EAAE;AACF,iFAAiF;AACjF,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY;;;;;;;;;;;;;;;AAGZ,yDAAiC;AAEjC;;;;;;;GAOG;AACI,MAAM,OAAO,GAAG,CACnB,OAAgB,EACoB,EAAE;IACtC,MAAM,GAAG,GAAG,0CAA0C,OAAO,CAAC,CAAC,CAAC,OAAO,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAExF,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEtC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,IAAI,GAAqB,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAErD,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QACzB,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;SACnC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAE9B,MAAM,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAEhD,OAAO;QACH,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;QACjD,EAAE,EAAE;YACA,GAAG;YACH,IAAI;SACP;KACJ,CAAC;AACN,CAAC,CAAA,CAAC;AAxCW,QAAA,OAAO,WAwClB"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@gibme/ipinfo",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A simple IP information lookup helper using Team CYMRU services",
5
- "main": "dist/ipinfo.js",
6
- "types": "dist/ipinfo.d.ts",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
7
  "files": [
8
8
  "dist/*"
9
9
  ],
@@ -12,6 +12,7 @@
12
12
  "build": "yarn build:typescript",
13
13
  "build:docs": "./node_modules/.bin/typedoc",
14
14
  "build:typescript": "./node_modules/.bin/tsc",
15
+ "build:webpack": "./node_modules/.bin/auto-pack",
15
16
  "test": "yarn test:style && yarn test:typecheck && yarn test:mocha",
16
17
  "test:typecheck": "./node_modules/.bin/tsc --noEmit",
17
18
  "test:style": "yarn style",
@@ -19,7 +20,7 @@
19
20
  "style": "./node_modules/.bin/eslint src/**/*.ts test/**/*.ts",
20
21
  "fix-style": "./node_modules/.bin/eslint --fix src/**/*.ts test/**/*.ts",
21
22
  "fix:style": "yarn fix-style",
22
- "prepublishOnly": "yarn build"
23
+ "prepublishOnly": "yarn build && yarn build:webpack"
23
24
  },
24
25
  "repository": {
25
26
  "type": "git",
@@ -38,9 +39,16 @@
38
39
  "email": "brandonlehmann@gmail.com"
39
40
  },
40
41
  "dependencies": {
41
- "@gibme/fetch": "^1.0.7"
42
+ "@gibme/fetch": "^1.1.1"
43
+ },
44
+ "webpack": {
45
+ "entry": {
46
+ "ipinfo": "./src/web.ts"
47
+ },
48
+ "filename": "[name].min.js"
42
49
  },
43
50
  "devDependencies": {
51
+ "@gibme/auto-pack": "^0.4.6",
44
52
  "@types/mocha": "^10.0.6",
45
53
  "@types/node": "^20.11.7",
46
54
  "@typescript-eslint/eslint-plugin": "^6.19.1",
package/dist/ipinfo.d.ts DELETED
@@ -1,22 +0,0 @@
1
- import { CheckIPResponse, PrefixInfo } from './types';
2
- /**
3
- * Looks up information regarding the IP address supplied
4
- *
5
- * @param address
6
- * @param max_retries
7
- */
8
- export declare const IPInfo: (address: string, max_retries?: number) => Promise<PrefixInfo | undefined>;
9
- /**
10
- * Looks up information regarding the IP address supplied; OR,
11
- * if no address is supplied, looks up information regarding
12
- * our client's IP address
13
- *
14
- * @param address
15
- * @constructor
16
- */
17
- export declare const CheckIP: (address?: string) => Promise<CheckIPResponse | undefined>;
18
- declare const _default: {
19
- IPInfo: (address: string, max_retries?: number) => Promise<PrefixInfo | undefined>;
20
- CheckIP: (address?: string) => Promise<CheckIPResponse | undefined>;
21
- };
22
- export default _default;
@@ -1 +0,0 @@
1
- {"version":3,"file":"ipinfo.js","sourceRoot":"","sources":["../src/ipinfo.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;A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