@openweb3-io/wallet 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -0
- package/dist/index.d.ts +158 -0
- package/dist/index.js +339 -0
- package/dist/index.js.map +1 -0
- package/dist/openapi/apis/AddressesApi.d.ts +15 -0
- package/dist/openapi/apis/AddressesApi.js +224 -0
- package/dist/openapi/apis/AddressesApi.js.map +1 -0
- package/dist/openapi/apis/CurrenciesApi.d.ts +13 -0
- package/dist/openapi/apis/CurrenciesApi.js +138 -0
- package/dist/openapi/apis/CurrenciesApi.js.map +1 -0
- package/dist/openapi/apis/ExchangesApi.d.ts +25 -0
- package/dist/openapi/apis/ExchangesApi.js +338 -0
- package/dist/openapi/apis/ExchangesApi.js.map +1 -0
- package/dist/openapi/apis/NetworksApi.d.ts +10 -0
- package/dist/openapi/apis/NetworksApi.js +82 -0
- package/dist/openapi/apis/NetworksApi.js.map +1 -0
- package/dist/openapi/apis/RatesApi.d.ts +14 -0
- package/dist/openapi/apis/RatesApi.js +149 -0
- package/dist/openapi/apis/RatesApi.js.map +1 -0
- package/dist/openapi/apis/SweepFundsApi.d.ts +11 -0
- package/dist/openapi/apis/SweepFundsApi.js +86 -0
- package/dist/openapi/apis/SweepFundsApi.js.map +1 -0
- package/dist/openapi/apis/TransactionsApi.d.ts +25 -0
- package/dist/openapi/apis/TransactionsApi.js +322 -0
- package/dist/openapi/apis/TransactionsApi.js.map +1 -0
- package/dist/openapi/apis/WalletsApi.d.ts +22 -0
- package/dist/openapi/apis/WalletsApi.js +317 -0
- package/dist/openapi/apis/WalletsApi.js.map +1 -0
- package/dist/openapi/apis/WebhookEndpointsApi.d.ts +22 -0
- package/dist/openapi/apis/WebhookEndpointsApi.js +264 -0
- package/dist/openapi/apis/WebhookEndpointsApi.js.map +1 -0
- package/dist/openapi/apis/WebhookEventTypesApi.d.ts +10 -0
- package/dist/openapi/apis/WebhookEventTypesApi.js +65 -0
- package/dist/openapi/apis/WebhookEventTypesApi.js.map +1 -0
- package/dist/openapi/apis/WebhookEventsApi.d.ts +14 -0
- package/dist/openapi/apis/WebhookEventsApi.js +127 -0
- package/dist/openapi/apis/WebhookEventsApi.js.map +1 -0
- package/dist/openapi/apis/baseapi.d.ts +16 -0
- package/dist/openapi/apis/baseapi.js +25 -0
- package/dist/openapi/apis/baseapi.js.map +1 -0
- package/dist/openapi/apis/exception.d.ts +5 -0
- package/dist/openapi/apis/exception.js +12 -0
- package/dist/openapi/apis/exception.js.map +1 -0
- package/dist/openapi/auth/auth.d.ts +40 -0
- package/dist/openapi/auth/auth.js +42 -0
- package/dist/openapi/auth/auth.js.map +1 -0
- package/dist/openapi/configuration.d.ts +18 -0
- package/dist/openapi/configuration.js +21 -0
- package/dist/openapi/configuration.js.map +1 -0
- package/dist/openapi/http/http.d.ts +69 -0
- package/dist/openapi/http/http.js +162 -0
- package/dist/openapi/http/http.js.map +1 -0
- package/dist/openapi/http/isomorphic-fetch.d.ts +6 -0
- package/dist/openapi/http/isomorphic-fetch.js +31 -0
- package/dist/openapi/http/isomorphic-fetch.js.map +1 -0
- package/dist/openapi/index.d.ts +9 -0
- package/dist/openapi/index.js +32 -0
- package/dist/openapi/index.js.map +1 -0
- package/dist/openapi/middleware.d.ts +16 -0
- package/dist/openapi/middleware.js +17 -0
- package/dist/openapi/middleware.js.map +1 -0
- package/dist/openapi/models/Account.d.ts +22 -0
- package/dist/openapi/models/Account.js +51 -0
- package/dist/openapi/models/Account.js.map +1 -0
- package/dist/openapi/models/Address.d.ts +19 -0
- package/dist/openapi/models/Address.js +33 -0
- package/dist/openapi/models/Address.js.map +1 -0
- package/dist/openapi/models/ChainNetwork.d.ts +24 -0
- package/dist/openapi/models/ChainNetwork.js +63 -0
- package/dist/openapi/models/ChainNetwork.js.map +1 -0
- package/dist/openapi/models/CreateEndpoint.d.ts +27 -0
- package/dist/openapi/models/CreateEndpoint.js +57 -0
- package/dist/openapi/models/CreateEndpoint.js.map +1 -0
- package/dist/openapi/models/CreateExchange.d.ts +21 -0
- package/dist/openapi/models/CreateExchange.js +45 -0
- package/dist/openapi/models/CreateExchange.js.map +1 -0
- package/dist/openapi/models/CreateTransferRequest.d.ts +20 -0
- package/dist/openapi/models/CreateTransferRequest.js +39 -0
- package/dist/openapi/models/CreateTransferRequest.js.map +1 -0
- package/dist/openapi/models/CreateTransferResponse.d.ts +17 -0
- package/dist/openapi/models/CreateTransferResponse.js +21 -0
- package/dist/openapi/models/CreateTransferResponse.js.map +1 -0
- package/dist/openapi/models/CreateWalletRequest.d.ts +18 -0
- package/dist/openapi/models/CreateWalletRequest.js +27 -0
- package/dist/openapi/models/CreateWalletRequest.js.map +1 -0
- package/dist/openapi/models/CreateWithdrawReply.d.ts +17 -0
- package/dist/openapi/models/CreateWithdrawReply.js +21 -0
- package/dist/openapi/models/CreateWithdrawReply.js.map +1 -0
- package/dist/openapi/models/CreateWithdrawRequest.d.ts +23 -0
- package/dist/openapi/models/CreateWithdrawRequest.js +57 -0
- package/dist/openapi/models/CreateWithdrawRequest.js.map +1 -0
- package/dist/openapi/models/Currency.d.ts +37 -0
- package/dist/openapi/models/Currency.js +135 -0
- package/dist/openapi/models/Currency.js.map +1 -0
- package/dist/openapi/models/CurrencyNetwork.d.ts +36 -0
- package/dist/openapi/models/CurrencyNetwork.js +135 -0
- package/dist/openapi/models/CurrencyNetwork.js.map +1 -0
- package/dist/openapi/models/CurrencyPair.d.ts +18 -0
- package/dist/openapi/models/CurrencyPair.js +27 -0
- package/dist/openapi/models/CurrencyPair.js.map +1 -0
- package/dist/openapi/models/CursorPageAccount.d.ts +21 -0
- package/dist/openapi/models/CursorPageAccount.js +39 -0
- package/dist/openapi/models/CursorPageAccount.js.map +1 -0
- package/dist/openapi/models/CursorPageAddress.d.ts +21 -0
- package/dist/openapi/models/CursorPageAddress.js +39 -0
- package/dist/openapi/models/CursorPageAddress.js.map +1 -0
- package/dist/openapi/models/CursorPageChainNetwork.d.ts +21 -0
- package/dist/openapi/models/CursorPageChainNetwork.js +39 -0
- package/dist/openapi/models/CursorPageChainNetwork.js.map +1 -0
- package/dist/openapi/models/CursorPageCurrency.d.ts +21 -0
- package/dist/openapi/models/CursorPageCurrency.js +39 -0
- package/dist/openapi/models/CursorPageCurrency.js.map +1 -0
- package/dist/openapi/models/CursorPageEndpoint.d.ts +21 -0
- package/dist/openapi/models/CursorPageEndpoint.js +39 -0
- package/dist/openapi/models/CursorPageEndpoint.js.map +1 -0
- package/dist/openapi/models/CursorPageExchange.d.ts +21 -0
- package/dist/openapi/models/CursorPageExchange.js +39 -0
- package/dist/openapi/models/CursorPageExchange.js.map +1 -0
- package/dist/openapi/models/CursorPageTransaction.d.ts +21 -0
- package/dist/openapi/models/CursorPageTransaction.js +39 -0
- package/dist/openapi/models/CursorPageTransaction.js.map +1 -0
- package/dist/openapi/models/CursorPageWallet.d.ts +21 -0
- package/dist/openapi/models/CursorPageWallet.js +39 -0
- package/dist/openapi/models/CursorPageWallet.js.map +1 -0
- package/dist/openapi/models/CursorPageWebhookEvent.d.ts +21 -0
- package/dist/openapi/models/CursorPageWebhookEvent.js +39 -0
- package/dist/openapi/models/CursorPageWebhookEvent.js.map +1 -0
- package/dist/openapi/models/DeleteWebhookEndpointResponse.d.ts +17 -0
- package/dist/openapi/models/DeleteWebhookEndpointResponse.js +21 -0
- package/dist/openapi/models/DeleteWebhookEndpointResponse.js.map +1 -0
- package/dist/openapi/models/Endpoint.d.ts +29 -0
- package/dist/openapi/models/Endpoint.js +69 -0
- package/dist/openapi/models/Endpoint.js.map +1 -0
- package/dist/openapi/models/EstimateFeeRequest.d.ts +21 -0
- package/dist/openapi/models/EstimateFeeRequest.js +45 -0
- package/dist/openapi/models/EstimateFeeRequest.js.map +1 -0
- package/dist/openapi/models/EstimateFeeResponse.d.ts +18 -0
- package/dist/openapi/models/EstimateFeeResponse.js +27 -0
- package/dist/openapi/models/EstimateFeeResponse.js.map +1 -0
- package/dist/openapi/models/EstimateResponse.d.ts +21 -0
- package/dist/openapi/models/EstimateResponse.js +45 -0
- package/dist/openapi/models/EstimateResponse.js.map +1 -0
- package/dist/openapi/models/EventType.d.ts +18 -0
- package/dist/openapi/models/EventType.js +27 -0
- package/dist/openapi/models/EventType.js.map +1 -0
- package/dist/openapi/models/Exchange.d.ts +30 -0
- package/dist/openapi/models/Exchange.js +99 -0
- package/dist/openapi/models/Exchange.js.map +1 -0
- package/dist/openapi/models/ExchangeCurrencyPairs.d.ts +18 -0
- package/dist/openapi/models/ExchangeCurrencyPairs.js +27 -0
- package/dist/openapi/models/ExchangeCurrencyPairs.js.map +1 -0
- package/dist/openapi/models/ExchangeSubmitResponse.d.ts +17 -0
- package/dist/openapi/models/ExchangeSubmitResponse.js +21 -0
- package/dist/openapi/models/ExchangeSubmitResponse.js.map +1 -0
- package/dist/openapi/models/GetCurrencyPairQuotaResponse.d.ts +22 -0
- package/dist/openapi/models/GetCurrencyPairQuotaResponse.js +51 -0
- package/dist/openapi/models/GetCurrencyPairQuotaResponse.js.map +1 -0
- package/dist/openapi/models/GetRatesRequest.d.ts +18 -0
- package/dist/openapi/models/GetRatesRequest.js +21 -0
- package/dist/openapi/models/GetRatesRequest.js.map +1 -0
- package/dist/openapi/models/GetRatesResponse.d.ts +18 -0
- package/dist/openapi/models/GetRatesResponse.js +21 -0
- package/dist/openapi/models/GetRatesResponse.js.map +1 -0
- package/dist/openapi/models/ListExchangeCurrencyPairsResponse.d.ts +18 -0
- package/dist/openapi/models/ListExchangeCurrencyPairsResponse.js +21 -0
- package/dist/openapi/models/ListExchangeCurrencyPairsResponse.js.map +1 -0
- package/dist/openapi/models/ModelError.d.ts +18 -0
- package/dist/openapi/models/ModelError.js +27 -0
- package/dist/openapi/models/ModelError.js.map +1 -0
- package/dist/openapi/models/ObjectSerializer.d.ts +57 -0
- package/dist/openapi/models/ObjectSerializer.js +336 -0
- package/dist/openapi/models/ObjectSerializer.js.map +1 -0
- package/dist/openapi/models/Rate.d.ts +19 -0
- package/dist/openapi/models/Rate.js +27 -0
- package/dist/openapi/models/Rate.js.map +1 -0
- package/dist/openapi/models/ResendWebhookEventRequest.d.ts +18 -0
- package/dist/openapi/models/ResendWebhookEventRequest.js +27 -0
- package/dist/openapi/models/ResendWebhookEventRequest.js.map +1 -0
- package/dist/openapi/models/ResendWebhookEventResponse.d.ts +17 -0
- package/dist/openapi/models/ResendWebhookEventResponse.js +21 -0
- package/dist/openapi/models/ResendWebhookEventResponse.js.map +1 -0
- package/dist/openapi/models/SweepAddressRequest.d.ts +17 -0
- package/dist/openapi/models/SweepAddressRequest.js +21 -0
- package/dist/openapi/models/SweepAddressRequest.js.map +1 -0
- package/dist/openapi/models/SweepAddressResponse.d.ts +17 -0
- package/dist/openapi/models/SweepAddressResponse.js +21 -0
- package/dist/openapi/models/SweepAddressResponse.js.map +1 -0
- package/dist/openapi/models/Transaction.d.ts +32 -0
- package/dist/openapi/models/Transaction.js +99 -0
- package/dist/openapi/models/Transaction.js.map +1 -0
- package/dist/openapi/models/TransactionDirection.d.ts +1 -0
- package/dist/openapi/models/TransactionDirection.js +3 -0
- package/dist/openapi/models/TransactionDirection.js.map +1 -0
- package/dist/openapi/models/TransactionStatus.d.ts +1 -0
- package/dist/openapi/models/TransactionStatus.js +3 -0
- package/dist/openapi/models/TransactionStatus.js.map +1 -0
- package/dist/openapi/models/UpdateEndpoint.d.ts +27 -0
- package/dist/openapi/models/UpdateEndpoint.js +57 -0
- package/dist/openapi/models/UpdateEndpoint.js.map +1 -0
- package/dist/openapi/models/UpdateWalletRequest.d.ts +18 -0
- package/dist/openapi/models/UpdateWalletRequest.js +27 -0
- package/dist/openapi/models/UpdateWalletRequest.js.map +1 -0
- package/dist/openapi/models/Wallet.d.ts +20 -0
- package/dist/openapi/models/Wallet.js +39 -0
- package/dist/openapi/models/Wallet.js.map +1 -0
- package/dist/openapi/models/WebhookEvent.d.ts +22 -0
- package/dist/openapi/models/WebhookEvent.js +39 -0
- package/dist/openapi/models/WebhookEvent.js.map +1 -0
- package/dist/openapi/models/all.d.ts +48 -0
- package/dist/openapi/models/all.js +61 -0
- package/dist/openapi/models/all.js.map +1 -0
- package/dist/openapi/rxjsStub.d.ts +10 -0
- package/dist/openapi/rxjsStub.js +32 -0
- package/dist/openapi/rxjsStub.js.map +1 -0
- package/dist/openapi/servers.d.ts +17 -0
- package/dist/openapi/servers.js +31 -0
- package/dist/openapi/servers.js.map +1 -0
- package/dist/openapi/types/ObjectParamAPI.d.ts +259 -0
- package/dist/openapi/types/ObjectParamAPI.js +180 -0
- package/dist/openapi/types/ObjectParamAPI.js.map +1 -0
- package/dist/openapi/types/ObservableAPI.d.ts +150 -0
- package/dist/openapi/types/ObservableAPI.js +600 -0
- package/dist/openapi/types/ObservableAPI.js.map +1 -0
- package/dist/openapi/types/PromiseAPI.d.ts +127 -0
- package/dist/openapi/types/PromiseAPI.js +213 -0
- package/dist/openapi/types/PromiseAPI.js.map +1 -0
- package/dist/openapi/util.d.ts +1 -0
- package/dist/openapi/util.js +25 -0
- package/dist/openapi/util.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RequestContext } from "../http/http";
|
|
2
|
+
export interface SecurityAuthentication {
|
|
3
|
+
getName(): string;
|
|
4
|
+
applySecurityAuthentication(context: RequestContext): void | Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export interface TokenProvider {
|
|
7
|
+
getToken(): Promise<string> | string;
|
|
8
|
+
}
|
|
9
|
+
export declare class ApiKeyAuthAuthentication implements SecurityAuthentication {
|
|
10
|
+
private apiKey;
|
|
11
|
+
constructor(apiKey: string);
|
|
12
|
+
getName(): string;
|
|
13
|
+
applySecurityAuthentication(context: RequestContext): void;
|
|
14
|
+
}
|
|
15
|
+
export declare class SignatureAuthAuthentication implements SecurityAuthentication {
|
|
16
|
+
private apiKey;
|
|
17
|
+
constructor(apiKey: string);
|
|
18
|
+
getName(): string;
|
|
19
|
+
applySecurityAuthentication(context: RequestContext): void;
|
|
20
|
+
}
|
|
21
|
+
export declare type AuthMethods = {
|
|
22
|
+
"ApiKeyAuth"?: SecurityAuthentication;
|
|
23
|
+
"SignatureAuth"?: SecurityAuthentication;
|
|
24
|
+
};
|
|
25
|
+
export declare type ApiKeyConfiguration = string;
|
|
26
|
+
export declare type HttpBasicConfiguration = {
|
|
27
|
+
"username": string;
|
|
28
|
+
"password": string;
|
|
29
|
+
};
|
|
30
|
+
export declare type HttpBearerConfiguration = {
|
|
31
|
+
tokenProvider: TokenProvider;
|
|
32
|
+
};
|
|
33
|
+
export declare type OAuth2Configuration = {
|
|
34
|
+
accessToken: string;
|
|
35
|
+
};
|
|
36
|
+
export declare type AuthMethodsConfiguration = {
|
|
37
|
+
"ApiKeyAuth"?: ApiKeyConfiguration;
|
|
38
|
+
"SignatureAuth"?: ApiKeyConfiguration;
|
|
39
|
+
};
|
|
40
|
+
export declare function configureAuthMethods(config: AuthMethodsConfiguration | undefined): AuthMethods;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configureAuthMethods = exports.SignatureAuthAuthentication = exports.ApiKeyAuthAuthentication = void 0;
|
|
4
|
+
class ApiKeyAuthAuthentication {
|
|
5
|
+
constructor(apiKey) {
|
|
6
|
+
this.apiKey = apiKey;
|
|
7
|
+
}
|
|
8
|
+
getName() {
|
|
9
|
+
return "ApiKeyAuth";
|
|
10
|
+
}
|
|
11
|
+
applySecurityAuthentication(context) {
|
|
12
|
+
context.setHeaderParam("X-Api-Key", this.apiKey);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ApiKeyAuthAuthentication = ApiKeyAuthAuthentication;
|
|
16
|
+
class SignatureAuthAuthentication {
|
|
17
|
+
constructor(apiKey) {
|
|
18
|
+
this.apiKey = apiKey;
|
|
19
|
+
}
|
|
20
|
+
getName() {
|
|
21
|
+
return "SignatureAuth";
|
|
22
|
+
}
|
|
23
|
+
applySecurityAuthentication(context) {
|
|
24
|
+
context.setHeaderParam("X-Signature", this.apiKey);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.SignatureAuthAuthentication = SignatureAuthAuthentication;
|
|
28
|
+
function configureAuthMethods(config) {
|
|
29
|
+
let authMethods = {};
|
|
30
|
+
if (!config) {
|
|
31
|
+
return authMethods;
|
|
32
|
+
}
|
|
33
|
+
if (config["ApiKeyAuth"]) {
|
|
34
|
+
authMethods["ApiKeyAuth"] = new ApiKeyAuthAuthentication(config["ApiKeyAuth"]);
|
|
35
|
+
}
|
|
36
|
+
if (config["SignatureAuth"]) {
|
|
37
|
+
authMethods["SignatureAuth"] = new SignatureAuthAuthentication(config["SignatureAuth"]);
|
|
38
|
+
}
|
|
39
|
+
return authMethods;
|
|
40
|
+
}
|
|
41
|
+
exports.configureAuthMethods = configureAuthMethods;
|
|
42
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/openapi/auth/auth.ts"],"names":[],"mappings":";;;AA2BA,MAAa,wBAAwB;IAMjC,YAA2B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAEtC,OAAO;QACV,OAAO,YAAY,CAAC;IACxB,CAAC;IAEM,2BAA2B,CAAC,OAAuB;QACtD,OAAO,CAAC,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;CACJ;AAfD,4DAeC;AAKD,MAAa,2BAA2B;IAMpC,YAA2B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAEtC,OAAO;QACV,OAAO,eAAe,CAAC;IAC3B,CAAC;IAEM,2BAA2B,CAAC,OAAuB;QACtD,OAAO,CAAC,cAAc,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;CACJ;AAfD,kEAeC;AAsBD,SAAgB,oBAAoB,CAAC,MAA4C;IAC7E,IAAI,WAAW,GAAgB,EAAE,CAAA;IAEjC,IAAI,CAAC,MAAM,EAAE;QACT,OAAO,WAAW,CAAC;KACtB;IAED,IAAI,MAAM,CAAC,YAAY,CAAC,EAAE;QACtB,WAAW,CAAC,YAAY,CAAC,GAAG,IAAI,wBAAwB,CACpD,MAAM,CAAC,YAAY,CAAC,CACvB,CAAC;KACL;IAED,IAAI,MAAM,CAAC,eAAe,CAAC,EAAE;QACzB,WAAW,CAAC,eAAe,CAAC,GAAG,IAAI,2BAA2B,CAC1D,MAAM,CAAC,eAAe,CAAC,CAC1B,CAAC;KACL;IAED,OAAO,WAAW,CAAC;AACvB,CAAC;AApBD,oDAoBC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpLibrary } from "./http/http";
|
|
2
|
+
import { Middleware, PromiseMiddleware } from "./middleware";
|
|
3
|
+
import { BaseServerConfiguration } from "./servers";
|
|
4
|
+
import { AuthMethods, AuthMethodsConfiguration } from "./auth/auth";
|
|
5
|
+
export interface Configuration {
|
|
6
|
+
readonly baseServer: BaseServerConfiguration;
|
|
7
|
+
readonly httpApi: HttpLibrary;
|
|
8
|
+
readonly middleware: Middleware[];
|
|
9
|
+
readonly authMethods: AuthMethods;
|
|
10
|
+
}
|
|
11
|
+
export interface ConfigurationParameters {
|
|
12
|
+
baseServer?: BaseServerConfiguration;
|
|
13
|
+
httpApi?: HttpLibrary;
|
|
14
|
+
middleware?: Middleware[];
|
|
15
|
+
promiseMiddleware?: PromiseMiddleware[];
|
|
16
|
+
authMethods?: AuthMethodsConfiguration;
|
|
17
|
+
}
|
|
18
|
+
export declare function createConfiguration(conf?: ConfigurationParameters): Configuration;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createConfiguration = void 0;
|
|
4
|
+
const middleware_1 = require("./middleware");
|
|
5
|
+
const isomorphic_fetch_1 = require("./http/isomorphic-fetch");
|
|
6
|
+
const servers_1 = require("./servers");
|
|
7
|
+
const auth_1 = require("./auth/auth");
|
|
8
|
+
function createConfiguration(conf = {}) {
|
|
9
|
+
const configuration = {
|
|
10
|
+
baseServer: conf.baseServer !== undefined ? conf.baseServer : servers_1.server1,
|
|
11
|
+
httpApi: conf.httpApi || new isomorphic_fetch_1.IsomorphicFetchHttpLibrary(),
|
|
12
|
+
middleware: conf.middleware || [],
|
|
13
|
+
authMethods: auth_1.configureAuthMethods(conf.authMethods)
|
|
14
|
+
};
|
|
15
|
+
if (conf.promiseMiddleware) {
|
|
16
|
+
conf.promiseMiddleware.forEach(m => configuration.middleware.push(new middleware_1.PromiseMiddlewareWrapper(m)));
|
|
17
|
+
}
|
|
18
|
+
return configuration;
|
|
19
|
+
}
|
|
20
|
+
exports.createConfiguration = createConfiguration;
|
|
21
|
+
//# sourceMappingURL=configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../src/openapi/configuration.ts"],"names":[],"mappings":";;;AACA,6CAAuF;AACvF,8DAA2F;AAC3F,uCAA6D;AAC7D,sCAA0F;AAgD1F,SAAgB,mBAAmB,CAAC,OAAgC,EAAE;IAClE,MAAM,aAAa,GAAkB;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAO;QACrE,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,6CAAkB,EAAE;QACjD,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,EAAE;QACjC,WAAW,EAAE,2BAAoB,CAAC,IAAI,CAAC,WAAW,CAAC;KACtD,CAAC;IACF,IAAI,IAAI,CAAC,iBAAiB,EAAE;QACxB,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAC1B,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,qCAAwB,CAAC,CAAC,CAAC,CAAC,CACtE,CAAC;KACL;IACD,OAAO,aAAa,CAAC;AACzB,CAAC;AAbD,kDAaC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Observable } from '../rxjsStub';
|
|
2
|
+
export * from './isomorphic-fetch';
|
|
3
|
+
export declare enum HttpMethod {
|
|
4
|
+
GET = "GET",
|
|
5
|
+
HEAD = "HEAD",
|
|
6
|
+
POST = "POST",
|
|
7
|
+
PUT = "PUT",
|
|
8
|
+
DELETE = "DELETE",
|
|
9
|
+
CONNECT = "CONNECT",
|
|
10
|
+
OPTIONS = "OPTIONS",
|
|
11
|
+
TRACE = "TRACE",
|
|
12
|
+
PATCH = "PATCH"
|
|
13
|
+
}
|
|
14
|
+
export declare type HttpFile = Blob & {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
};
|
|
17
|
+
export declare class HttpException extends Error {
|
|
18
|
+
constructor(msg: string);
|
|
19
|
+
}
|
|
20
|
+
export declare type RequestBody = undefined | string | FormData;
|
|
21
|
+
export declare class RequestContext {
|
|
22
|
+
private httpMethod;
|
|
23
|
+
private headers;
|
|
24
|
+
private body;
|
|
25
|
+
private url;
|
|
26
|
+
constructor(url: string, httpMethod: HttpMethod);
|
|
27
|
+
getUrl(): string;
|
|
28
|
+
setUrl(url: string): void;
|
|
29
|
+
setBody(body: RequestBody): void;
|
|
30
|
+
getHttpMethod(): HttpMethod;
|
|
31
|
+
getHeaders(): {
|
|
32
|
+
[key: string]: string;
|
|
33
|
+
};
|
|
34
|
+
getBody(): RequestBody;
|
|
35
|
+
setQueryParam(name: string, value: string): void;
|
|
36
|
+
addCookie(name: string, value: string): void;
|
|
37
|
+
setHeaderParam(key: string, value: string): void;
|
|
38
|
+
}
|
|
39
|
+
export interface ResponseBody {
|
|
40
|
+
text(): Promise<string>;
|
|
41
|
+
binary(): Promise<Blob>;
|
|
42
|
+
}
|
|
43
|
+
export declare class SelfDecodingBody implements ResponseBody {
|
|
44
|
+
private dataSource;
|
|
45
|
+
constructor(dataSource: Promise<Blob>);
|
|
46
|
+
binary(): Promise<Blob>;
|
|
47
|
+
text(): Promise<string>;
|
|
48
|
+
}
|
|
49
|
+
export declare class ResponseContext {
|
|
50
|
+
httpStatusCode: number;
|
|
51
|
+
headers: {
|
|
52
|
+
[key: string]: string;
|
|
53
|
+
};
|
|
54
|
+
body: ResponseBody;
|
|
55
|
+
constructor(httpStatusCode: number, headers: {
|
|
56
|
+
[key: string]: string;
|
|
57
|
+
}, body: ResponseBody);
|
|
58
|
+
getParsedHeader(headerName: string): {
|
|
59
|
+
[parameter: string]: string;
|
|
60
|
+
};
|
|
61
|
+
getBodyAsFile(): Promise<HttpFile>;
|
|
62
|
+
}
|
|
63
|
+
export interface HttpLibrary {
|
|
64
|
+
send(request: RequestContext): Observable<ResponseContext>;
|
|
65
|
+
}
|
|
66
|
+
export interface PromiseHttpLibrary {
|
|
67
|
+
send(request: RequestContext): Promise<ResponseContext>;
|
|
68
|
+
}
|
|
69
|
+
export declare function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLibrary;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.wrapHttpLibrary = exports.ResponseContext = exports.SelfDecodingBody = exports.RequestContext = exports.HttpException = exports.HttpMethod = void 0;
|
|
23
|
+
const URLParse = require("url-parse");
|
|
24
|
+
const rxjsStub_1 = require("../rxjsStub");
|
|
25
|
+
__exportStar(require("./isomorphic-fetch"), exports);
|
|
26
|
+
var HttpMethod;
|
|
27
|
+
(function (HttpMethod) {
|
|
28
|
+
HttpMethod["GET"] = "GET";
|
|
29
|
+
HttpMethod["HEAD"] = "HEAD";
|
|
30
|
+
HttpMethod["POST"] = "POST";
|
|
31
|
+
HttpMethod["PUT"] = "PUT";
|
|
32
|
+
HttpMethod["DELETE"] = "DELETE";
|
|
33
|
+
HttpMethod["CONNECT"] = "CONNECT";
|
|
34
|
+
HttpMethod["OPTIONS"] = "OPTIONS";
|
|
35
|
+
HttpMethod["TRACE"] = "TRACE";
|
|
36
|
+
HttpMethod["PATCH"] = "PATCH";
|
|
37
|
+
})(HttpMethod = exports.HttpMethod || (exports.HttpMethod = {}));
|
|
38
|
+
class HttpException extends Error {
|
|
39
|
+
constructor(msg) {
|
|
40
|
+
super(msg);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.HttpException = HttpException;
|
|
44
|
+
class RequestContext {
|
|
45
|
+
constructor(url, httpMethod) {
|
|
46
|
+
this.httpMethod = httpMethod;
|
|
47
|
+
this.headers = {};
|
|
48
|
+
this.body = undefined;
|
|
49
|
+
this.url = new URLParse(url, true);
|
|
50
|
+
}
|
|
51
|
+
getUrl() {
|
|
52
|
+
return this.url.toString();
|
|
53
|
+
}
|
|
54
|
+
setUrl(url) {
|
|
55
|
+
this.url = new URLParse(url, true);
|
|
56
|
+
}
|
|
57
|
+
setBody(body) {
|
|
58
|
+
this.body = body;
|
|
59
|
+
}
|
|
60
|
+
getHttpMethod() {
|
|
61
|
+
return this.httpMethod;
|
|
62
|
+
}
|
|
63
|
+
getHeaders() {
|
|
64
|
+
return this.headers;
|
|
65
|
+
}
|
|
66
|
+
getBody() {
|
|
67
|
+
return this.body;
|
|
68
|
+
}
|
|
69
|
+
setQueryParam(name, value) {
|
|
70
|
+
let queryObj = this.url.query;
|
|
71
|
+
queryObj[name] = value;
|
|
72
|
+
this.url.set("query", queryObj);
|
|
73
|
+
}
|
|
74
|
+
addCookie(name, value) {
|
|
75
|
+
if (!this.headers["Cookie"]) {
|
|
76
|
+
this.headers["Cookie"] = "";
|
|
77
|
+
}
|
|
78
|
+
this.headers["Cookie"] += name + "=" + value + "; ";
|
|
79
|
+
}
|
|
80
|
+
setHeaderParam(key, value) {
|
|
81
|
+
this.headers[key] = value;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.RequestContext = RequestContext;
|
|
85
|
+
class SelfDecodingBody {
|
|
86
|
+
constructor(dataSource) {
|
|
87
|
+
this.dataSource = dataSource;
|
|
88
|
+
}
|
|
89
|
+
binary() {
|
|
90
|
+
return this.dataSource;
|
|
91
|
+
}
|
|
92
|
+
text() {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
const data = yield this.dataSource;
|
|
95
|
+
if (data.text) {
|
|
96
|
+
return data.text();
|
|
97
|
+
}
|
|
98
|
+
return new Promise((resolve, reject) => {
|
|
99
|
+
const reader = new FileReader();
|
|
100
|
+
reader.addEventListener("load", () => resolve(reader.result));
|
|
101
|
+
reader.addEventListener("error", () => reject(reader.error));
|
|
102
|
+
reader.readAsText(data);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.SelfDecodingBody = SelfDecodingBody;
|
|
108
|
+
class ResponseContext {
|
|
109
|
+
constructor(httpStatusCode, headers, body) {
|
|
110
|
+
this.httpStatusCode = httpStatusCode;
|
|
111
|
+
this.headers = headers;
|
|
112
|
+
this.body = body;
|
|
113
|
+
}
|
|
114
|
+
getParsedHeader(headerName) {
|
|
115
|
+
const result = {};
|
|
116
|
+
if (!this.headers[headerName]) {
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
const parameters = this.headers[headerName].split(";");
|
|
120
|
+
for (const parameter of parameters) {
|
|
121
|
+
let [key, value] = parameter.split("=", 2);
|
|
122
|
+
key = key.toLowerCase().trim();
|
|
123
|
+
if (value === undefined) {
|
|
124
|
+
result[""] = key;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
value = value.trim();
|
|
128
|
+
if (value.startsWith('"') && value.endsWith('"')) {
|
|
129
|
+
value = value.substring(1, value.length - 1);
|
|
130
|
+
}
|
|
131
|
+
result[key] = value;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
getBodyAsFile() {
|
|
137
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
const data = yield this.body.binary();
|
|
139
|
+
const fileName = this.getParsedHeader("content-disposition")["filename"] || "";
|
|
140
|
+
const contentType = this.headers["content-type"] || "";
|
|
141
|
+
try {
|
|
142
|
+
return new File([data], fileName, { type: contentType });
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
return Object.assign(data, {
|
|
146
|
+
name: fileName,
|
|
147
|
+
type: contentType
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exports.ResponseContext = ResponseContext;
|
|
154
|
+
function wrapHttpLibrary(promiseHttpLibrary) {
|
|
155
|
+
return {
|
|
156
|
+
send(request) {
|
|
157
|
+
return rxjsStub_1.from(promiseHttpLibrary.send(request));
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
exports.wrapHttpLibrary = wrapHttpLibrary;
|
|
162
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/openapi/http/http.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,sCAAsC;AACtC,0CAA+C;AAE/C,qDAAmC;AAKnC,IAAY,UAUX;AAVD,WAAY,UAAU;IAClB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;IACf,6BAAe,CAAA;AACnB,CAAC,EAVW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAUrB;AAQD,MAAa,aAAc,SAAQ,KAAK;IACpC,YAAmB,GAAW;QAC1B,KAAK,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACJ;AAJD,sCAIC;AAUD,MAAa,cAAc;IAWvB,YAAmB,GAAW,EAAU,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAVtD,YAAO,GAA8B,EAAE,CAAC;QACxC,SAAI,GAAgB,SAAS,CAAC;QAUlC,IAAI,CAAC,GAAG,GAAG,IAAI,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC;IAMM,MAAM;QACT,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;IAMM,MAAM,CAAC,GAAW;QACrB,IAAI,CAAC,GAAG,GAAG,IAAI,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC;IAWM,OAAO,CAAC,IAAiB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAEM,aAAa;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAEM,UAAU;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAEM,OAAO;QACV,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAEM,aAAa,CAAC,IAAY,EAAE,KAAa;QAC5C,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;QAC9B,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;IAMM,SAAS,CAAC,IAAY,EAAE,KAAa;QACxC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;SAC/B;QACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,GAAG,GAAG,GAAG,KAAK,GAAG,IAAI,CAAC;IACxD,CAAC;IAEM,cAAc,CAAC,GAAW,EAAE,KAAa;QAC5C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC9B,CAAC;CACJ;AA5ED,wCA4EC;AAUD,MAAa,gBAAgB;IACzB,YAAoB,UAAyB;QAAzB,eAAU,GAAV,UAAU,CAAe;IAAG,CAAC;IAEjD,MAAM;QACF,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAEK,IAAI;;YACN,MAAM,IAAI,GAAS,MAAM,IAAI,CAAC,UAAU,CAAC;YAEzC,IAAI,IAAI,CAAC,IAAI,EAAE;gBAEX,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;aACtB;YAED,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC3C,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;gBAChC,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAgB,CAAC,CAAC,CAAC;gBACxE,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;gBAC7D,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC,CAAC,CAAC;QACP,CAAC;KAAA;CACJ;AAtBD,4CAsBC;AAED,MAAa,eAAe;IACxB,YACW,cAAsB,EACtB,OAAkC,EAClC,IAAkB;QAFlB,mBAAc,GAAd,cAAc,CAAQ;QACtB,YAAO,GAAP,OAAO,CAA2B;QAClC,SAAI,GAAJ,IAAI,CAAc;IAC1B,CAAC;IASG,eAAe,CAAC,UAAkB;QACrC,MAAM,MAAM,GAAoC,EAAE,CAAC;QACnD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YAC3B,OAAO,MAAM,CAAC;SACjB;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YAChC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAC3C,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;YAC/B,IAAI,KAAK,KAAK,SAAS,EAAE;gBACrB,MAAM,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;aACpB;iBAAM;gBACH,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;gBACrB,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBAC9C,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;iBAChD;gBACD,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aACvB;SACJ;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAEY,aAAa;;YACtB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YAC/E,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;YACvD,IAAI;gBACA,OAAO,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;aAC5D;YAAC,OAAO,KAAK,EAAE;gBAEZ,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;oBACvB,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,WAAW;iBACpB,CAAC,CAAC;aACN;QACL,CAAC;KAAA;CACJ;AAnDD,0CAmDC;AAUD,SAAgB,eAAe,CAAC,kBAAsC;IACpE,OAAO;QACL,IAAI,CAAC,OAAuB;YAC1B,OAAO,eAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAChD,CAAC;KACF,CAAA;AACH,CAAC;AAND,0CAMC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HttpLibrary, RequestContext, ResponseContext } from './http';
|
|
2
|
+
import { Observable } from '../rxjsStub';
|
|
3
|
+
import "whatwg-fetch";
|
|
4
|
+
export declare class IsomorphicFetchHttpLibrary implements HttpLibrary {
|
|
5
|
+
send(request: RequestContext): Observable<ResponseContext>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IsomorphicFetchHttpLibrary = void 0;
|
|
4
|
+
const http_1 = require("./http");
|
|
5
|
+
const rxjsStub_1 = require("../rxjsStub");
|
|
6
|
+
require("whatwg-fetch");
|
|
7
|
+
class IsomorphicFetchHttpLibrary {
|
|
8
|
+
send(request) {
|
|
9
|
+
let method = request.getHttpMethod().toString();
|
|
10
|
+
let body = request.getBody();
|
|
11
|
+
const resultPromise = fetch(request.getUrl(), {
|
|
12
|
+
method: method,
|
|
13
|
+
body: body,
|
|
14
|
+
headers: request.getHeaders(),
|
|
15
|
+
credentials: "same-origin"
|
|
16
|
+
}).then((resp) => {
|
|
17
|
+
const headers = {};
|
|
18
|
+
resp.headers.forEach((value, name) => {
|
|
19
|
+
headers[name] = value;
|
|
20
|
+
});
|
|
21
|
+
const body = {
|
|
22
|
+
text: () => resp.text(),
|
|
23
|
+
binary: () => resp.blob()
|
|
24
|
+
};
|
|
25
|
+
return new http_1.ResponseContext(resp.status, headers, body);
|
|
26
|
+
});
|
|
27
|
+
return rxjsStub_1.from(resultPromise);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.IsomorphicFetchHttpLibrary = IsomorphicFetchHttpLibrary;
|
|
31
|
+
//# sourceMappingURL=isomorphic-fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isomorphic-fetch.js","sourceRoot":"","sources":["../../../src/openapi/http/isomorphic-fetch.ts"],"names":[],"mappings":";;;AAAA,iCAAoE;AACpE,0CAA+C;AAC/C,wBAAsB;AAEtB,MAAa,0BAA0B;IAE5B,IAAI,CAAC,OAAuB;QAC/B,IAAI,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC;QAChD,IAAI,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;QAE7B,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE;YAC1C,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAW;YACjB,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE;YAC7B,WAAW,EAAE,aAAa;SAC7B,CAAC,CAAC,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE;YAClB,MAAM,OAAO,GAA+B,EAAE,CAAC;YAC/C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;gBACnD,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;YACxB,CAAC,CAAC,CAAC;YAEH,MAAM,IAAI,GAAG;gBACX,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE;gBACvB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE;aAC1B,CAAC;YACF,OAAO,IAAI,sBAAe,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;QAEH,OAAO,eAAI,CAA2B,aAAa,CAAC,CAAC;IAEzD,CAAC;CACJ;AA3BD,gEA2BC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./http/http";
|
|
2
|
+
export * from "./auth/auth";
|
|
3
|
+
export * from "./models/all";
|
|
4
|
+
export { createConfiguration } from "./configuration";
|
|
5
|
+
export { Configuration } from "./configuration";
|
|
6
|
+
export * from "./apis/exception";
|
|
7
|
+
export * from "./servers";
|
|
8
|
+
export { PromiseMiddleware as Middleware } from './middleware';
|
|
9
|
+
export { AddressesApiV1AddressesListRequest, AddressesApiV1WalletsGetDepositAddressRequest, AddressesApiV1WalletsListDepositAddressesRequest, ObjectAddressesApi as AddressesApi, CurrenciesApiV1CurrenciesListRequest, CurrenciesApiV1CurrenciesRetrieveRequest, ObjectCurrenciesApi as CurrenciesApi, ExchangesApiV1ExchangesCreateRequest, ExchangesApiV1ExchangesCurrencyPairsRequest, ExchangesApiV1ExchangesCurrencyQuotaRequest, ExchangesApiV1ExchangesListRequest, ExchangesApiV1ExchangesRetrieveRequest, ExchangesApiV1ExchangesSubmitRequest, ObjectExchangesApi as ExchangesApi, NetworksApiV1NetworksListRequest, ObjectNetworksApi as NetworksApi, RatesApiV1RatesEstimateRequest, RatesApiV1RatesListRequest, ObjectRatesApi as RatesApi, SweepFundsApiV1SweepAddressRequest, ObjectSweepFundsApi as SweepFundsApi, TransactionsApiV1TransactionsEstimateFeeRequest, TransactionsApiV1TransactionsListRequest, TransactionsApiV1TransactionsRetrieveRequest, TransactionsApiV1TransactionsTransferRequest, TransactionsApiV1TransactionsWithdrawRequest, ObjectTransactionsApi as TransactionsApi, WalletsApiV1WalletsCreateRequest, WalletsApiV1WalletsListRequest, WalletsApiV1WalletsListAccountsRequest, WalletsApiV1WalletsRetrieveRequest, WalletsApiV1WalletsUpdateRequest, ObjectWalletsApi as WalletsApi, WebhookEndpointsApiV1WebhooksCreateRequest, WebhookEndpointsApiV1WebhooksDeleteRequest, WebhookEndpointsApiV1WebhooksListRequest, WebhookEndpointsApiV1WebhooksRetrieveRequest, WebhookEndpointsApiV1WebhooksUpdateRequest, ObjectWebhookEndpointsApi as WebhookEndpointsApi, WebhookEventTypesApiV1WebhooksEventtypesListRequest, ObjectWebhookEventTypesApi as WebhookEventTypesApi, WebhookEventsApiV1WebhooksEventsListRequest, WebhookEventsApiV1WebhooksEventsResendRequest, ObjectWebhookEventsApi as WebhookEventsApi } from './types/ObjectParamAPI';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./http/http"), exports);
|
|
14
|
+
__exportStar(require("./auth/auth"), exports);
|
|
15
|
+
__exportStar(require("./models/all"), exports);
|
|
16
|
+
var configuration_1 = require("./configuration");
|
|
17
|
+
Object.defineProperty(exports, "createConfiguration", { enumerable: true, get: function () { return configuration_1.createConfiguration; } });
|
|
18
|
+
__exportStar(require("./apis/exception"), exports);
|
|
19
|
+
__exportStar(require("./servers"), exports);
|
|
20
|
+
var ObjectParamAPI_1 = require("./types/ObjectParamAPI");
|
|
21
|
+
Object.defineProperty(exports, "AddressesApi", { enumerable: true, get: function () { return ObjectParamAPI_1.ObjectAddressesApi; } });
|
|
22
|
+
Object.defineProperty(exports, "CurrenciesApi", { enumerable: true, get: function () { return ObjectParamAPI_1.ObjectCurrenciesApi; } });
|
|
23
|
+
Object.defineProperty(exports, "ExchangesApi", { enumerable: true, get: function () { return ObjectParamAPI_1.ObjectExchangesApi; } });
|
|
24
|
+
Object.defineProperty(exports, "NetworksApi", { enumerable: true, get: function () { return ObjectParamAPI_1.ObjectNetworksApi; } });
|
|
25
|
+
Object.defineProperty(exports, "RatesApi", { enumerable: true, get: function () { return ObjectParamAPI_1.ObjectRatesApi; } });
|
|
26
|
+
Object.defineProperty(exports, "SweepFundsApi", { enumerable: true, get: function () { return ObjectParamAPI_1.ObjectSweepFundsApi; } });
|
|
27
|
+
Object.defineProperty(exports, "TransactionsApi", { enumerable: true, get: function () { return ObjectParamAPI_1.ObjectTransactionsApi; } });
|
|
28
|
+
Object.defineProperty(exports, "WalletsApi", { enumerable: true, get: function () { return ObjectParamAPI_1.ObjectWalletsApi; } });
|
|
29
|
+
Object.defineProperty(exports, "WebhookEndpointsApi", { enumerable: true, get: function () { return ObjectParamAPI_1.ObjectWebhookEndpointsApi; } });
|
|
30
|
+
Object.defineProperty(exports, "WebhookEventTypesApi", { enumerable: true, get: function () { return ObjectParamAPI_1.ObjectWebhookEventTypesApi; } });
|
|
31
|
+
Object.defineProperty(exports, "WebhookEventsApi", { enumerable: true, get: function () { return ObjectParamAPI_1.ObjectWebhookEventsApi; } });
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/openapi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B;AAC5B,8CAA4B;AAC5B,+CAA6B;AAC7B,iDAAqD;AAA5C,oHAAA,mBAAmB,OAAA;AAE5B,mDAAiC;AACjC,4CAA0B;AAG1B,yDAA2yD;AAA7pD,8GAAA,kBAAkB,OAAgB;AAAmF,+GAAA,mBAAmB,OAAiB;AAAqP,8GAAA,kBAAkB,OAAgB;AAAqC,6GAAA,iBAAiB,OAAe;AAA+D,0GAAA,cAAc,OAAY;AAAuC,+GAAA,mBAAmB,OAAiB;AAAwO,iHAAA,qBAAqB,OAAmB;AAAmL,4GAAA,gBAAgB,OAAc;AAA+N,qHAAA,yBAAyB,OAAuB;AAAwD,sHAAA,0BAA0B,OAAwB;AAA+F,kHAAA,sBAAsB,OAAoB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RequestContext, ResponseContext } from './http/http';
|
|
2
|
+
import { Observable } from './rxjsStub';
|
|
3
|
+
export interface Middleware {
|
|
4
|
+
pre(context: RequestContext): Observable<RequestContext>;
|
|
5
|
+
post(context: ResponseContext): Observable<ResponseContext>;
|
|
6
|
+
}
|
|
7
|
+
export declare class PromiseMiddlewareWrapper implements Middleware {
|
|
8
|
+
private middleware;
|
|
9
|
+
constructor(middleware: PromiseMiddleware);
|
|
10
|
+
pre(context: RequestContext): Observable<RequestContext>;
|
|
11
|
+
post(context: ResponseContext): Observable<ResponseContext>;
|
|
12
|
+
}
|
|
13
|
+
export interface PromiseMiddleware {
|
|
14
|
+
pre(context: RequestContext): Promise<RequestContext>;
|
|
15
|
+
post(context: ResponseContext): Promise<ResponseContext>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PromiseMiddlewareWrapper = void 0;
|
|
4
|
+
const rxjsStub_1 = require("./rxjsStub");
|
|
5
|
+
class PromiseMiddlewareWrapper {
|
|
6
|
+
constructor(middleware) {
|
|
7
|
+
this.middleware = middleware;
|
|
8
|
+
}
|
|
9
|
+
pre(context) {
|
|
10
|
+
return rxjsStub_1.from(this.middleware.pre(context));
|
|
11
|
+
}
|
|
12
|
+
post(context) {
|
|
13
|
+
return rxjsStub_1.from(this.middleware.post(context));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.PromiseMiddlewareWrapper = PromiseMiddlewareWrapper;
|
|
17
|
+
//# sourceMappingURL=middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/openapi/middleware.ts"],"names":[],"mappings":";;;AACA,yCAA8C;AA0B9C,MAAa,wBAAwB;IAEjC,YAA2B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAExD,CAAC;IAED,GAAG,CAAC,OAAuB;QACvB,OAAO,eAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,CAAC,OAAwB;QACzB,OAAO,eAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,CAAC;CAEJ;AAdD,4DAcC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare class Account {
|
|
2
|
+
'balance': string;
|
|
3
|
+
'currency': string;
|
|
4
|
+
'id': string;
|
|
5
|
+
'inTransitBalance': string;
|
|
6
|
+
'lockedBalance': string;
|
|
7
|
+
'walletId': string;
|
|
8
|
+
static readonly discriminator: string | undefined;
|
|
9
|
+
static readonly attributeTypeMap: Array<{
|
|
10
|
+
name: string;
|
|
11
|
+
baseName: string;
|
|
12
|
+
type: string;
|
|
13
|
+
format: string;
|
|
14
|
+
}>;
|
|
15
|
+
static getAttributeTypeMap(): {
|
|
16
|
+
name: string;
|
|
17
|
+
baseName: string;
|
|
18
|
+
type: string;
|
|
19
|
+
format: string;
|
|
20
|
+
}[];
|
|
21
|
+
constructor();
|
|
22
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Account = void 0;
|
|
4
|
+
class Account {
|
|
5
|
+
constructor() {
|
|
6
|
+
}
|
|
7
|
+
static getAttributeTypeMap() {
|
|
8
|
+
return Account.attributeTypeMap;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.Account = Account;
|
|
12
|
+
Account.discriminator = undefined;
|
|
13
|
+
Account.attributeTypeMap = [
|
|
14
|
+
{
|
|
15
|
+
"name": "balance",
|
|
16
|
+
"baseName": "balance",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"format": ""
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "currency",
|
|
22
|
+
"baseName": "currency",
|
|
23
|
+
"type": "string",
|
|
24
|
+
"format": ""
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "id",
|
|
28
|
+
"baseName": "id",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"format": ""
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "inTransitBalance",
|
|
34
|
+
"baseName": "in_transit_balance",
|
|
35
|
+
"type": "string",
|
|
36
|
+
"format": ""
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "lockedBalance",
|
|
40
|
+
"baseName": "locked_balance",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"format": ""
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "walletId",
|
|
46
|
+
"baseName": "wallet_id",
|
|
47
|
+
"type": "string",
|
|
48
|
+
"format": ""
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
//# sourceMappingURL=Account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Account.js","sourceRoot":"","sources":["../../../src/openapi/models/Account.ts"],"names":[],"mappings":";;;AAcA,MAAa,OAAO;IAsEhB;IACA,CAAC;IALD,MAAM,CAAC,mBAAmB;QACtB,OAAO,OAAO,CAAC,gBAAgB,CAAC;IACpC,CAAC;;AApEL,0BAwEC;AA9CmB,qBAAa,GAAuB,SAAS,CAAC;AAE9C,wBAAgB,GAA0E;IACtG;QACI,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,EAAE;KACf;IACD;QACI,MAAM,EAAE,UAAU;QAClB,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,EAAE;KACf;IACD;QACI,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,EAAE;KACf;IACD;QACI,MAAM,EAAE,kBAAkB;QAC1B,UAAU,EAAE,oBAAoB;QAChC,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,EAAE;KACf;IACD;QACI,MAAM,EAAE,eAAe;QACvB,UAAU,EAAE,gBAAgB;QAC5B,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,EAAE;KACf;IACD;QACI,MAAM,EAAE,UAAU;QAClB,UAAU,EAAE,WAAW;QACvB,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,EAAE;KACf;CAAK,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class Address {
|
|
2
|
+
'address': string;
|
|
3
|
+
'network': string;
|
|
4
|
+
'type': string;
|
|
5
|
+
static readonly discriminator: string | undefined;
|
|
6
|
+
static readonly attributeTypeMap: Array<{
|
|
7
|
+
name: string;
|
|
8
|
+
baseName: string;
|
|
9
|
+
type: string;
|
|
10
|
+
format: string;
|
|
11
|
+
}>;
|
|
12
|
+
static getAttributeTypeMap(): {
|
|
13
|
+
name: string;
|
|
14
|
+
baseName: string;
|
|
15
|
+
type: string;
|
|
16
|
+
format: string;
|
|
17
|
+
}[];
|
|
18
|
+
constructor();
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Address = void 0;
|
|
4
|
+
class Address {
|
|
5
|
+
constructor() {
|
|
6
|
+
}
|
|
7
|
+
static getAttributeTypeMap() {
|
|
8
|
+
return Address.attributeTypeMap;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.Address = Address;
|
|
12
|
+
Address.discriminator = undefined;
|
|
13
|
+
Address.attributeTypeMap = [
|
|
14
|
+
{
|
|
15
|
+
"name": "address",
|
|
16
|
+
"baseName": "address",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"format": ""
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "network",
|
|
22
|
+
"baseName": "network",
|
|
23
|
+
"type": "string",
|
|
24
|
+
"format": ""
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "type",
|
|
28
|
+
"baseName": "type",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"format": ""
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
//# sourceMappingURL=Address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Address.js","sourceRoot":"","sources":["../../../src/openapi/models/Address.ts"],"names":[],"mappings":";;;AAcA,MAAa,OAAO;IAwChB;IACA,CAAC;IALD,MAAM,CAAC,mBAAmB;QACtB,OAAO,OAAO,CAAC,gBAAgB,CAAC;IACpC,CAAC;;AAtCL,0BA0CC;AA5BmB,qBAAa,GAAuB,SAAS,CAAC;AAE9C,wBAAgB,GAA0E;IACtG;QACI,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,EAAE;KACf;IACD;QACI,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,EAAE;KACf;IACD;QACI,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,EAAE;KACf;CAAK,CAAC"}
|