diff --git a/src/address-book/create.ts b/src/address-book/create.ts index 493541f..c496ad5 100644 --- a/src/address-book/create.ts +++ b/src/address-book/create.ts @@ -1,9 +1,9 @@ import axios from "axios"; import Apis from "../utils/api-config"; -import {addressbookSchemaType} from "../types/address-book/index"; +import {AddressBook} from "../types/address-book/index"; import { Headers } from "../types"; -export const _create = async (data: addressbookSchemaType, headers:Headers): Promise => { +export const _create = async (data: AddressBook, headers:Headers): Promise => { const req = await axios({ url: `${Apis.wAddressBookEndpoint}`, method: "POST", diff --git a/src/address-book/generate-message.ts b/src/address-book/generate-message.ts index e21ac27..537a950 100644 --- a/src/address-book/generate-message.ts +++ b/src/address-book/generate-message.ts @@ -1,9 +1,9 @@ import axios from "axios"; import Apis from "../utils/api-config"; -import {addressbookMessageSchema} from "../types/address-book/index"; +import {AddressbookMessage} from "../types/address-book/index"; import { Headers } from "../types"; -export const _generateMessage = async (data: addressbookMessageSchema, headers: Headers): Promise => { +export const _generateMessage = async (data: AddressbookMessage, headers: Headers): Promise => { const req = await axios({ url: `${Apis.wAddressBookGenerateMessageEndpoint}`, method: "POST", diff --git a/src/address-book/index.ts b/src/address-book/index.ts index 8139aad..d8c5acd 100644 --- a/src/address-book/index.ts +++ b/src/address-book/index.ts @@ -1,8 +1,8 @@ import {_get} from './get'; -import {_generateMessage} from './addressbook-generate-message'; -import {_create} from './create-addressbook'; -import {_update} from './update-addressbook'; -import {addressbookMessageSchema, updateAddressbookSchemaType,addressbookSchemaType} from "../types/address-book/index"; +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 @@ -15,11 +15,15 @@ export default class Addressbook{ return _get(owner, this.headers) } - generateMessage(data: addressbookMessageSchema) { + generateMessage(data: AddressbookMessage) { return _generateMessage(data, this.headers) } - create(data: addressbookSchemaType) { + create(data: AddressBook) { return _create(data,this.headers) } + + update(data: UpdateAddressbook) { + return _update(data, this.headers) + } } diff --git a/src/address-book/update.ts b/src/address-book/update.ts index 0b930c8..211446d 100644 --- a/src/address-book/update.ts +++ b/src/address-book/update.ts @@ -1,9 +1,9 @@ import Apis from "../utils/api-config"; import axios from "axios"; -import {updateAddressbookSchemaType} from "../types/address-book/index"; +import {UpdateAddressbook} from "../types/address-book/index"; import { Headers } from "../types"; -export const _update = async (data: updateAddressbookSchemaType, headers:Headers): Promise => { +export const _update = async (data: UpdateAddressbook, headers:Headers): Promise => { const req = await axios({ url: Apis.wAddressBookEndpoint, method: "PATCH", diff --git a/src/auth/index.ts b/src/auth/index.ts index 3a3263d..c4a3695 100644 --- a/src/auth/index.ts +++ b/src/auth/index.ts @@ -1,6 +1,6 @@ import { _login } from "./login"; import { _generateMessage } from "./login-message"; -import { AuthSchema, Headers } from "../types"; +import { Authentication, Headers } from "../types"; export default class Auth { private headers: Headers @@ -9,7 +9,7 @@ export default class Auth { this.headers = headers } - login(actions: AuthSchema) { + login(actions: Authentication) { return _login(actions,this.headers) } diff --git a/src/auth/login.ts b/src/auth/login.ts index 6d38a5b..6415b00 100644 --- a/src/auth/login.ts +++ b/src/auth/login.ts @@ -1,9 +1,9 @@ import Apis from "../utils/api-config"; import axios from "axios"; -import { AuthSchema, } from "../types/auth"; +import { Authentication } from "../types/auth"; import { Headers } from "../types"; -export const _login = async (auth: AuthSchema,headers:Headers): Promise => { +export const _login = async (auth: Authentication,headers:Headers): Promise => { const req = await axios({ url: Apis.wAuthenticationEndpoint, method: 'POST', diff --git a/src/identity/generate-message.ts b/src/identity/generate-message.ts index 4fc9a22..b742451 100644 --- a/src/identity/generate-message.ts +++ b/src/identity/generate-message.ts @@ -1,9 +1,9 @@ import axios from "axios"; import Apis from "../utils/api-config"; -import { generateIdentityMessageSchema } from "../types/identity"; +import { GenerateIdentityMessage } from "../types/identity"; import { Headers } from "../types"; -export const _generateMessage = async (data: generateIdentityMessageSchema, headers: Headers): Promise => { +export const _generateMessage = async (data: GenerateIdentityMessage, headers: Headers): Promise => { const req = await axios({ url: Apis.wIdentityGenerateMessageEndpoint, diff --git a/src/identity/index.ts b/src/identity/index.ts index 357734e..6065124 100644 --- a/src/identity/index.ts +++ b/src/identity/index.ts @@ -1,8 +1,8 @@ import {_get} from "./get"; -import {_generateMessage} from "./generate-identity-message"; -import {_create} from "./create-identity"; +import {_generateMessage} from "./generate-message"; +import {_create} from "./create"; import { Headers } from '../types'; -import {generateIdentityMessageSchema, identitySchema} from "../types/identity"; +import {GenerateIdentityMessage, Identity} from "../types/identity"; export default class identity { private headers: Headers @@ -15,11 +15,11 @@ export default class identity { return _get(id, this.headers) } - generateMessage(data: generateIdentityMessageSchema) { + generateMessage(data: GenerateIdentityMessage) { return _generateMessage(data, this.headers) } - create(data: identitySchema) { + create(data: Identity) { return _create(data,this.headers) } } diff --git a/src/request/create.ts b/src/request/create.ts index 4e63dd0..faf279a 100644 --- a/src/request/create.ts +++ b/src/request/create.ts @@ -1,9 +1,9 @@ -import { RequestSchema } from "../types/request" +import { PaymentRequest } from "../types/request" import Apis from "../utils/api-config" import axios from "axios" import { Headers } from "../types" -export const _create = async (data: RequestSchema, headers: Headers): Promise => { +export const _create = async (data: PaymentRequest, headers: Headers): Promise => { const req = await axios({ url: Apis.wPaymentRequestEndpoint, method: "POST", diff --git a/src/request/generate-message.ts b/src/request/generate-message.ts index dd2e1bc..2a6b169 100644 --- a/src/request/generate-message.ts +++ b/src/request/generate-message.ts @@ -1,9 +1,9 @@ -import { MessageSchema } from '../types/request/index'; +import { GenerateMessage } from '../types/request/index'; import axios from "axios"; import Apis from "../utils/api-config"; import { Headers } from '../types'; -export const _generateMessage = async (data: MessageSchema, headers:Headers): Promise => { +export const _generateMessage = async (data: GenerateMessage, headers:Headers): Promise => { const req = await axios({ url: Apis.wPaymentRequestGenerateMessageEndpoint, method: "POST", diff --git a/src/request/index.ts b/src/request/index.ts index e273358..40f5cf7 100644 --- a/src/request/index.ts +++ b/src/request/index.ts @@ -1,9 +1,9 @@ import { _get } from './get' -import { _create } from './create-request' +import { _create } from './create' import { _generateMessage } from './generate-message' -import { _update } from './update-request' +import { _update } from './update' import {Headers} from '../types' -import {RequestSchema, MessageSchema, UpdateRequestSchema} from '../types/request/index' +import {PaymentRequest, UpdateRequest, GenerateMessage} from '../types/request/index' export default class Request { private headers: Headers @@ -15,15 +15,15 @@ export default class Request { return _get(requestId, this.headers) } - create(data: RequestSchema) { + create(data: PaymentRequest) { return _create(data, this.headers) } - generateMessage(data: MessageSchema) { + generateMessage(data: GenerateMessage) { return _generateMessage(data, this.headers) } - update(data: UpdateRequestSchema) { + update(data: UpdateRequest) { return _update(data, this.headers) } } diff --git a/src/request/update.ts b/src/request/update.ts index 11aab3c..d00c77d 100644 --- a/src/request/update.ts +++ b/src/request/update.ts @@ -1,9 +1,9 @@ import axios from "axios"; import Apis from "../utils/api-config"; -import { UpdateRequestSchema } from "../types/request"; +import { UpdateRequest } from "../types/request"; import { Headers } from "../types"; -export const _update = async (body: UpdateRequestSchema, headers: Headers): Promise => { +export const _update = async (body: UpdateRequest, headers: Headers): Promise => { const req = await axios({ url: Apis.wPaymentRequestEndpoint, method: "PATCH", diff --git a/src/types/address-book/index.ts b/src/types/address-book/index.ts index dae9604..fcdd753 100644 --- a/src/types/address-book/index.ts +++ b/src/types/address-book/index.ts @@ -37,6 +37,6 @@ export const updateAddressbookSchema = z.object({ signature: z.string(), }); -export type addressbookMessageSchema = z.infer; -export type addressbookSchemaType = z.infer; -export type updateAddressbookSchemaType = z.infer; \ No newline at end of file +export type AddressbookMessage = z.infer; +export type AddressBook = z.infer; +export type UpdateAddressbook = z.infer; \ No newline at end of file diff --git a/src/types/auth/index.ts b/src/types/auth/index.ts index 628ddc8..b68c479 100644 --- a/src/types/auth/index.ts +++ b/src/types/auth/index.ts @@ -10,4 +10,4 @@ export const authSchema = z.object({ timestamp: z.number(), }); -export type AuthSchema = z.infer \ No newline at end of file +export type Authentication = z.infer \ No newline at end of file diff --git a/src/types/identity/index.ts b/src/types/identity/index.ts index fc2ac8d..0c16e87 100644 --- a/src/types/identity/index.ts +++ b/src/types/identity/index.ts @@ -27,5 +27,5 @@ export const generateMessage = z.object({ secondary: z.array(addressConfig).optional(), }); -export type generateIdentityMessageSchema = z.infer; -export type identitySchema = z.infer; \ No newline at end of file +export type GenerateIdentityMessage = z.infer; +export type Identity = z.infer; \ No newline at end of file diff --git a/src/types/request/index.ts b/src/types/request/index.ts index 92499d1..3cda330 100644 --- a/src/types/request/index.ts +++ b/src/types/request/index.ts @@ -56,9 +56,9 @@ export const MessageSchema = z.object({ label: z.string(), }) -export type RequestSchema = z.input +export type PaymentRequest = z.input export type Actions = z.input -export type UpdateRequestSchema = z.input -export type MessageSchema = z.input +export type UpdateRequest = z.input +export type GenerateMessage = z.input export * from "./request-intent-types" \ No newline at end of file