This repository has been archived by the owner on Oct 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from antoine-pous/owners-get-by-id
Implement owners.betById
- Loading branch information
Showing
4 changed files
with
95 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ npm-debug.log | |
yarn.lock | ||
coverage | ||
.nyc_output | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
class Owner { | ||
constructor(client) { | ||
this.client = client | ||
} | ||
|
||
get(options) { | ||
return this.client._request({ | ||
method: 'GET', | ||
path: '/owners/v2/owners', | ||
qs: options, | ||
}) | ||
} | ||
|
||
getById(id) { | ||
return this.client._request({ | ||
method: 'GET', | ||
path: '/owners/v2/owners/' + id | ||
}) | ||
} | ||
} | ||
|
||
module.exports = Owner | ||
class Owner { | ||
constructor(client) { | ||
this.client = client | ||
} | ||
|
||
get(options) { | ||
return this.client._request({ | ||
method: 'GET', | ||
path: '/owners/v2/owners', | ||
qs: options, | ||
}) | ||
} | ||
|
||
getById(id, options) { | ||
return this.client._request({ | ||
method: 'GET', | ||
path: '/owners/v2/owners/' + id, | ||
qs: options, | ||
}) | ||
} | ||
} | ||
|
||
module.exports = Owner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,38 @@ | ||
import { RequestPromise } from 'request-promise' | ||
|
||
declare class Owner { | ||
get(opts?: {}): RequestPromise | ||
|
||
getById(number: string): RequestPromise | ||
} | ||
|
||
export { Owner } | ||
import { RequestPromise } from 'request-promise' | ||
|
||
export declare class Owner { | ||
get(opts?: {}): RequestPromise | ||
getById(ownerId: number | string, opts?: {}): RequestPromise | ||
} | ||
|
||
export enum OwnerType { | ||
person = 'PERSON', | ||
} | ||
|
||
export enum RemoteType { | ||
hubspot = 'HUBSPOT', | ||
} | ||
|
||
export interface OwnerRemote { | ||
portalId: number | ||
ownerId: number | ||
remoteId: string | ||
remoteType: RemoteType | ||
active: boolean | ||
} | ||
|
||
export interface OwnerInterface { | ||
portalId: number | ||
ownerId: number | ||
type: OwnerType | ||
firstName: string | ||
lastName: string | ||
email: string | ||
createdAt: number | ||
updatedAt: number | ||
remoteList: OwnerRemote[] | ||
hasContactsAccess: boolean | ||
activeUserId: number | ||
userIdIncludingInactive: number | ||
isActive: boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters