@cotofe/service-of-usercenter
Version:
OpenAPI client for @cotofe/service-of-usercenter
91 lines (90 loc) • 4 kB
JavaScript
/**
* Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import * as runtime from '../runtime';
/**
*
*/
export class UserCenterReferralToEarnDiscordApi extends runtime.BaseAPI {
/**
* 无需任何参数,返回dc授权链接
* discord login
*/
apiV1DiscordLoginV2GetRaw(initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters.authorization =
yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication
}
const response = yield this.request({
path: `/api/v1/discord/login-v2`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response);
});
}
/**
* 无需任何参数,返回dc授权链接
* discord login
*/
apiV1DiscordLoginV2Get(initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.apiV1DiscordLoginV2GetRaw(initOverrides);
return yield response.value();
});
}
/**
* code是授权登录成功之后,跳转链接中带code参数,前端获取之后传递。 例如:https://chat-test.chainopera.ai?code=dsafsaf413211312
* save dc user infomation
*/
apiV1DiscordSaveDcUserInfoPostRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters.authorization =
yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication
}
const response = yield this.request({
path: `/api/v1/discord/saveDcUserInfo`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters.apiV1DiscordSaveDcUserInfoPostRequest,
}, initOverrides);
return new runtime.JSONApiResponse(response);
});
}
/**
* code是授权登录成功之后,跳转链接中带code参数,前端获取之后传递。 例如:https://chat-test.chainopera.ai?code=dsafsaf413211312
* save dc user infomation
*/
apiV1DiscordSaveDcUserInfoPost() {
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
const response = yield this.apiV1DiscordSaveDcUserInfoPostRaw(requestParameters, initOverrides);
return yield response.value();
});
}
}