-
Notifications
You must be signed in to change notification settings - Fork 115
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 #337 from tonkeeper/feature/2fa
Two FA
- Loading branch information
Showing
130 changed files
with
6,192 additions
and
580 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
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,3 @@ | ||
FROM openapitools/openapi-generator-cli | ||
|
||
CMD ["generate", "-i", "https://raw.githubusercontent.com/tonkeeper/tonkeeper_2fa_backend/refs/heads/main/swagger.yaml?token=GHSAT0AAAAAACJYQUOCG3M3IRKQM3KPJSAUZ3MA5IA", "-g", "typescript-fetch", "-o", "/local/src/2faApi", "-p", "supportsES6=true,withInterfaces=true", "--openapi-normalizer", "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true"] |
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,3 +1,3 @@ | ||
FROM openapitools/openapi-generator-cli | ||
|
||
CMD ["generate", "-i", "https://raw.githubusercontent.com/tonkeeper/opentonapi/master/api/openapi.yml", "-g", "typescript-fetch", "-o", "/local/src/tonApiV2", "-p", "supportsES6=true,withInterfaces=true", "--openapi-normalizer", "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true"] | ||
CMD ["generate", "-i", "https://raw.githubusercontent.com/tonkeeper/opentonapi/master/api/openapi.yml", "-g", "typescript-fetch", "-o", "/local/src/tonApiV2", "-p", "supportsES6=true,withInterfaces=true", "--openapi-normalizer", "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true", "--skip-validate-spec"] |
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,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
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,21 @@ | ||
.openapi-generator-ignore | ||
apis/AuthApi.ts | ||
apis/MessageApi.ts | ||
apis/SystemApi.ts | ||
apis/index.ts | ||
index.ts | ||
models/ConnectRequest.ts | ||
models/ErrorCode.ts | ||
models/ExistsExtensionRequest.ts | ||
models/Message.ts | ||
models/MessageID.ts | ||
models/MessageState.ts | ||
models/ModelError.ts | ||
models/Ok.ts | ||
models/Payload.ts | ||
models/PingReadyGet500Response.ts | ||
models/Proof.ts | ||
models/RemoveExtensionRequest.ts | ||
models/Url.ts | ||
models/index.ts | ||
runtime.ts |
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 @@ | ||
7.10.0-SNAPSHOT |
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,292 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* REST API | ||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
* | ||
* The version of the OpenAPI document: 0.0.1 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
import * as runtime from '../runtime'; | ||
import type { | ||
ConnectRequest, | ||
ExistsExtensionRequest, | ||
MessageID, | ||
Ok, | ||
Payload, | ||
PingReadyGet500Response, | ||
RemoveExtensionRequest, | ||
Url, | ||
} from '../models/index'; | ||
import { | ||
ConnectRequestFromJSON, | ||
ConnectRequestToJSON, | ||
ExistsExtensionRequestFromJSON, | ||
ExistsExtensionRequestToJSON, | ||
MessageIDFromJSON, | ||
MessageIDToJSON, | ||
OkFromJSON, | ||
OkToJSON, | ||
PayloadFromJSON, | ||
PayloadToJSON, | ||
PingReadyGet500ResponseFromJSON, | ||
PingReadyGet500ResponseToJSON, | ||
RemoveExtensionRequestFromJSON, | ||
RemoveExtensionRequestToJSON, | ||
UrlFromJSON, | ||
UrlToJSON, | ||
} from '../models/index'; | ||
|
||
export interface ConnectOperationRequest { | ||
connectRequest?: ConnectRequest; | ||
} | ||
|
||
export interface ExistsExtensionOperationRequest { | ||
existsExtensionRequest?: ExistsExtensionRequest; | ||
} | ||
|
||
export interface ReConnectRequest { | ||
connectRequest?: ConnectRequest; | ||
} | ||
|
||
export interface RemoveExtensionOperationRequest { | ||
removeExtensionRequest?: RemoveExtensionRequest; | ||
} | ||
|
||
/** | ||
* AuthApi - interface | ||
* | ||
* @export | ||
* @interface AuthApiInterface | ||
*/ | ||
export interface AuthApiInterface { | ||
/** | ||
* | ||
* @summary Receive a deep link for the Telegram bot | ||
* @param {ConnectRequest} [connectRequest] Data that is expected | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof AuthApiInterface | ||
*/ | ||
connectRaw(requestParameters: ConnectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Url>>; | ||
|
||
/** | ||
* Receive a deep link for the Telegram bot | ||
*/ | ||
connect(requestParameters: ConnectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Url>; | ||
|
||
/** | ||
* | ||
* @summary Verify if a wallet is linked to a Telegram bot | ||
* @param {ExistsExtensionRequest} [existsExtensionRequest] Data that is expected | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof AuthApiInterface | ||
*/ | ||
existsExtensionRaw(requestParameters: ExistsExtensionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Ok>>; | ||
|
||
/** | ||
* Verify if a wallet is linked to a Telegram bot | ||
*/ | ||
existsExtension(requestParameters: ExistsExtensionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Ok>; | ||
|
||
/** | ||
* | ||
* @summary Retrieve the payload | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof AuthApiInterface | ||
*/ | ||
getPayloadRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Payload>>; | ||
|
||
/** | ||
* Retrieve the payload | ||
*/ | ||
getPayload(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Payload>; | ||
|
||
/** | ||
* | ||
* @summary Relink your account with the Telegram bot | ||
* @param {ConnectRequest} [connectRequest] Data that is expected | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof AuthApiInterface | ||
*/ | ||
reConnectRaw(requestParameters: ReConnectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Url>>; | ||
|
||
/** | ||
* Relink your account with the Telegram bot | ||
*/ | ||
reConnect(requestParameters: ReConnectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Url>; | ||
|
||
/** | ||
* | ||
* @summary Disable 2FA for the wallet | ||
* @param {RemoveExtensionRequest} [removeExtensionRequest] Data that is expected | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof AuthApiInterface | ||
*/ | ||
removeExtensionRaw(requestParameters: RemoveExtensionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MessageID>>; | ||
|
||
/** | ||
* Disable 2FA for the wallet | ||
*/ | ||
removeExtension(requestParameters: RemoveExtensionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageID>; | ||
|
||
} | ||
|
||
/** | ||
* | ||
*/ | ||
export class AuthApi extends runtime.BaseAPI implements AuthApiInterface { | ||
|
||
/** | ||
* Receive a deep link for the Telegram bot | ||
*/ | ||
async connectRaw(requestParameters: ConnectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Url>> { | ||
const queryParameters: any = {}; | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
headerParameters['Content-Type'] = 'application/json'; | ||
|
||
const response = await this.request({ | ||
path: `/api/v1/connect`, | ||
method: 'POST', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
body: ConnectRequestToJSON(requestParameters['connectRequest']), | ||
}, initOverrides); | ||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => UrlFromJSON(jsonValue)); | ||
} | ||
|
||
/** | ||
* Receive a deep link for the Telegram bot | ||
*/ | ||
async connect(requestParameters: ConnectOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Url> { | ||
const response = await this.connectRaw(requestParameters, initOverrides); | ||
return await response.value(); | ||
} | ||
|
||
/** | ||
* Verify if a wallet is linked to a Telegram bot | ||
*/ | ||
async existsExtensionRaw(requestParameters: ExistsExtensionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Ok>> { | ||
const queryParameters: any = {}; | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
headerParameters['Content-Type'] = 'application/json'; | ||
|
||
const response = await this.request({ | ||
path: `/api/v1/exists`, | ||
method: 'POST', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
body: ExistsExtensionRequestToJSON(requestParameters['existsExtensionRequest']), | ||
}, initOverrides); | ||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => OkFromJSON(jsonValue)); | ||
} | ||
|
||
/** | ||
* Verify if a wallet is linked to a Telegram bot | ||
*/ | ||
async existsExtension(requestParameters: ExistsExtensionOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Ok> { | ||
const response = await this.existsExtensionRaw(requestParameters, initOverrides); | ||
return await response.value(); | ||
} | ||
|
||
/** | ||
* Retrieve the payload | ||
*/ | ||
async getPayloadRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Payload>> { | ||
const queryParameters: any = {}; | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
const response = await this.request({ | ||
path: `/api/v1/payload`, | ||
method: 'GET', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
}, initOverrides); | ||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => PayloadFromJSON(jsonValue)); | ||
} | ||
|
||
/** | ||
* Retrieve the payload | ||
*/ | ||
async getPayload(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Payload> { | ||
const response = await this.getPayloadRaw(initOverrides); | ||
return await response.value(); | ||
} | ||
|
||
/** | ||
* Relink your account with the Telegram bot | ||
*/ | ||
async reConnectRaw(requestParameters: ReConnectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Url>> { | ||
const queryParameters: any = {}; | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
headerParameters['Content-Type'] = 'application/json'; | ||
|
||
const response = await this.request({ | ||
path: `/api/v1/reconnect`, | ||
method: 'POST', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
body: ConnectRequestToJSON(requestParameters['connectRequest']), | ||
}, initOverrides); | ||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => UrlFromJSON(jsonValue)); | ||
} | ||
|
||
/** | ||
* Relink your account with the Telegram bot | ||
*/ | ||
async reConnect(requestParameters: ReConnectRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Url> { | ||
const response = await this.reConnectRaw(requestParameters, initOverrides); | ||
return await response.value(); | ||
} | ||
|
||
/** | ||
* Disable 2FA for the wallet | ||
*/ | ||
async removeExtensionRaw(requestParameters: RemoveExtensionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MessageID>> { | ||
const queryParameters: any = {}; | ||
|
||
const headerParameters: runtime.HTTPHeaders = {}; | ||
|
||
headerParameters['Content-Type'] = 'application/json'; | ||
|
||
const response = await this.request({ | ||
path: `/api/v1/remove`, | ||
method: 'POST', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
body: RemoveExtensionRequestToJSON(requestParameters['removeExtensionRequest']), | ||
}, initOverrides); | ||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => MessageIDFromJSON(jsonValue)); | ||
} | ||
|
||
/** | ||
* Disable 2FA for the wallet | ||
*/ | ||
async removeExtension(requestParameters: RemoveExtensionOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageID> { | ||
const response = await this.removeExtensionRaw(requestParameters, initOverrides); | ||
return await response.value(); | ||
} | ||
|
||
} |
Oops, something went wrong.