@spritz-finance/api-client
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -158,2 +158,3 @@ import { DocumentNode } from 'graphql'; | ||
deliveryMethod: PaymentDeliveryMethod | null; | ||
paymentRequestId: string | null; | ||
} | ||
@@ -425,2 +426,3 @@ interface AccountPayments { | ||
deliveryMethod: PaymentDeliveryMethod | null; | ||
paymentRequestId: string | null; | ||
} | ||
@@ -452,2 +454,3 @@ | ||
deliveryMethod: PaymentDeliveryMethod | null; | ||
paymentRequestId: string | null; | ||
} | ||
@@ -1178,5 +1181,17 @@ interface PaymentRequestPayment { | ||
} | ||
interface RequestApiKeyResponse { | ||
success: boolean; | ||
} | ||
interface CreateUserParams { | ||
email: string; | ||
} | ||
interface AuthorizeApiKeyResponse { | ||
apiKey: string; | ||
userId: any; | ||
email: string; | ||
} | ||
interface AuthorizeApiKeyParams { | ||
otp: any; | ||
email: string; | ||
} | ||
declare class UserService { | ||
@@ -1187,2 +1202,4 @@ private client; | ||
create(args: CreateUserParams): Promise<CreateUserResponse>; | ||
requestApiKey(email: string): Promise<RequestApiKeyResponse>; | ||
authorizeApiKeyWithOTP(args: AuthorizeApiKeyParams): Promise<AuthorizeApiKeyResponse>; | ||
getCurrentUser(): Promise<CurrentUser_me>; | ||
@@ -1189,0 +1206,0 @@ getUserVerification(): Promise<UserVerification_verification | null>; |
{ | ||
"name": "@spritz-finance/api-client", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "Typescript library for interacting with the Spritz Finance API", | ||
@@ -5,0 +5,0 @@ "main": "dist/spritz-api-client.js", |
@@ -29,2 +29,3 @@ # @spritz-finance/api-client | ||
- [Setting the User API Key](#setting-the-user-api-key) | ||
- [Reauthorizing a user](#reauthorizing-a-user) | ||
- [Basic User Data](#basic-user-data) | ||
@@ -141,2 +142,15 @@ - [User Verification](#user-verification) | ||
## Reauthorizing a user | ||
There is a scenrio where you may need to get access to a users API key again. This can happen if you are trying to sign in a user that already has a Spritz account, or if you have lost access to their API key. In this case, you can reauthorize the user by providing their email. The process is that we will send the user an OTP code to their email, and then the user must pass that code on to you to confirm that they are allowing you to interact with their account on their behalf. | ||
```typescript | ||
const { success } = await client.user.requestApiKey('bilbo@shiremail.net') | ||
const { apiKey, userId, email } = await client.user.authorizeApiKeyWithOTP({ | ||
email: 'bilbo@shiremail.net', | ||
otp: '123456', | ||
}) | ||
``` | ||
## Basic User Data | ||
@@ -143,0 +157,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
396586
3148
736