Skip to content

Commit c3e317f

Browse files
authored
Merge pull request #3 from passbase/28773-ip-address-fix
fix: deserialize IP address if returned by API
2 parents ce543b3 + 4819721 commit c3e317f

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "git",
55
"url": "https://github.com/passbase/passbase-node.git"
66
},
7-
"version": "1.3.0",
7+
"version": "1.3.1",
88
"description": "Passbase API client for NodeJS",
99
"main": "lib/index.js",
1010
"types": "lib/index.d.ts",

src/models/Identity.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import {IdentityOwner} from "./IdentityOwner";
2-
import {IdentityResource} from "./IdentityResource";
3-
import {Watchlist} from "./Watchlist";
1+
import { IdentityOwner } from "./IdentityOwner";
2+
import { IdentityResource } from "./IdentityResource";
3+
import { Watchlist } from "./Watchlist";
4+
import { Network } from "./Network";
5+
46

57
enum IdentityStatus {
68
Created = "created",
@@ -21,8 +23,9 @@ export class Identity {
2123
owner: IdentityOwner | null;
2224
score: number;
2325
resources: IdentityResource[];
24-
metadata: {[x: string]: any} | null;
26+
metadata: { [x: string]: any } | null;
2527
watchlist: Watchlist | null;
28+
network: Network | null;
2629

2730
constructor(obj: any) {
2831
this.id = obj.id;
@@ -36,5 +39,6 @@ export class Identity {
3639
);
3740
this.metadata = obj.metadata;
3841
this.watchlist = obj.watchlist ? new Watchlist(obj.watchlist) : null;
42+
this.network = obj.network ? new Network(obj.network) : null;
3943
}
4044
}

src/models/Network.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export class Network {
2+
ipAddress: string;
3+
4+
constructor(obj: any) {
5+
this.ipAddress = obj.ip_address
6+
}
7+
}

0 commit comments

Comments
 (0)