-
Notifications
You must be signed in to change notification settings - Fork 0
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 #2 from FetcchX/development
Fix: Structure changes
- Loading branch information
Showing
28 changed files
with
214 additions
and
202 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import axios from "axios"; | ||
import Apis from "../utils/api-config"; | ||
import {AddressBook} from "../types/address-book/index"; | ||
import { Headers } from "../types"; | ||
|
||
export const _create = async (data: AddressBook, headers:Headers): Promise<any> => { | ||
const req = await axios({ | ||
url: `${Apis.wAddressBookEndpoint}`, | ||
method: "POST", | ||
headers: headers, | ||
data | ||
}) | ||
|
||
const res = await req.data | ||
|
||
return res.data | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import axios from "axios"; | ||
import Apis from "../utils/api-config"; | ||
import {AddressbookMessage} from "../types/address-book/index"; | ||
import { Headers } from "../types"; | ||
|
||
export const _generateMessage = async (data: AddressbookMessage, headers: Headers): Promise<any> => { | ||
const req = await axios({ | ||
url: `${Apis.wAddressBookGenerateMessageEndpoint}`, | ||
method: "POST", | ||
headers: headers, | ||
data | ||
}) | ||
|
||
const res = await req.data | ||
|
||
return res.data | ||
}; |
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
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,11 +1,29 @@ | ||
import {get} from './get_circle'; | ||
import {generateMessage} from './addressbook_generate_message'; | ||
import {create} from './create_addressbook'; | ||
import {update} from './update_addressbook'; | ||
|
||
export default { | ||
get, | ||
generateMessage, | ||
create, | ||
update | ||
import {_get} from './get'; | ||
import {_generateMessage} from './generate-message'; | ||
import {_create} from './create'; | ||
import {_update} from './update'; | ||
import {UpdateAddressbook, AddressBook, AddressbookMessage, } from "../types/address-book/index"; | ||
import { Headers } from '../types'; | ||
export default class Addressbook{ | ||
private headers: Headers | ||
|
||
constructor(headers: Headers) { | ||
this.headers = headers | ||
} | ||
|
||
get(owner: string) { | ||
return _get(owner, this.headers) | ||
} | ||
|
||
generateMessage(data: AddressbookMessage) { | ||
return _generateMessage(data, this.headers) | ||
} | ||
|
||
create(data: AddressBook) { | ||
return _create(data,this.headers) | ||
} | ||
|
||
update(data: UpdateAddressbook) { | ||
return _update(data, this.headers) | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Apis from "../utils/api-config"; | ||
import axios from "axios"; | ||
import {UpdateAddressbook} from "../types/address-book/index"; | ||
import { Headers } from "../types"; | ||
|
||
export const _update = async (data: UpdateAddressbook, headers:Headers): Promise<any> => { | ||
const req = await axios({ | ||
url: Apis.wAddressBookEndpoint, | ||
method: "PATCH", | ||
headers: headers, | ||
data | ||
}) | ||
|
||
const res = await req.data | ||
|
||
return res.data | ||
}; |
This file was deleted.
Oops, something went wrong.
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,7 +1,19 @@ | ||
import { login } from "./login"; | ||
import { generateMessage } from "./login_message"; | ||
import { _login } from "./login"; | ||
import { _generateMessage } from "./login-message"; | ||
import { Authentication, Headers } from "../types"; | ||
|
||
export default{ | ||
login, | ||
generateMessage | ||
export default class Auth { | ||
private headers: Headers | ||
|
||
constructor(headers: Headers) { | ||
this.headers = headers | ||
} | ||
|
||
login(actions: Authentication) { | ||
return _login(actions,this.headers) | ||
} | ||
|
||
generateMessage(owner: string) { | ||
return _generateMessage(owner, this.headers) | ||
} | ||
} |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import axios from "axios"; | ||
import Apis from "../utils/api-config"; | ||
import { GenerateIdentityMessage } from "../types/identity"; | ||
import { Headers } from "../types"; | ||
|
||
export const _generateMessage = async (data: GenerateIdentityMessage, headers: Headers): Promise<any[]> => { | ||
|
||
const req = await axios({ | ||
url: Apis.wIdentityGenerateMessageEndpoint, | ||
method: "POST", | ||
headers: headers, | ||
data | ||
}) | ||
|
||
const res = await req.data; | ||
return res.data; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
import {get} from "./get"; | ||
import {create} from "./create_identity"; | ||
import {generateMessage} from "./generate_identity_message"; | ||
import {_get} from "./get"; | ||
import {_generateMessage} from "./generate-message"; | ||
import {_create} from "./create"; | ||
import { Headers } from '../types'; | ||
import {GenerateIdentityMessage, IdentityIntent} from "../types/identity"; | ||
export default class Identity { | ||
|
||
private headers: Headers | ||
|
||
constructor(headers: Headers) { | ||
this.headers = headers | ||
} | ||
|
||
export default { | ||
get, | ||
create, | ||
generateMessage | ||
get(id: string) { | ||
return _get(id, this.headers) | ||
} | ||
|
||
generateMessage(data: GenerateIdentityMessage) { | ||
return _generateMessage(data, this.headers) | ||
} | ||
|
||
create(data: IdentityIntent) { | ||
return _create(data,this.headers) | ||
} | ||
} |
Oops, something went wrong.