@affinidi/internal-api-clients
Version:
SDK core monorepo for affinity DID solution
75 lines • 3.52 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const tools_common_1 = require("@affinidi/tools-common");
const tools_openapi_1 = require("@affinidi/tools-openapi");
const _keyStorage_1 = __importDefault(require("../spec/_keyStorage"));
const clientMethods = (0, tools_openapi_1.createClientMethods)(_keyStorage_1.default);
let KeyStorageApiService = class KeyStorageApiService {
constructor(options) {
this.client = (0, tools_openapi_1.createClient)(clientMethods, options.keyStorageUrl, options);
}
async storeTemplate(params) {
return this.client.StoreTemplate({ params });
}
async readMyKey({ accessToken }) {
const tenantToken = this.client.tenantToken;
const params = { authorization: accessToken };
if (tenantToken) {
params.queryParams = { tenantToken };
}
return this.client.ReadMyKey(params);
}
async storeMyKey(accessToken, params) {
return this.client.StoreMyKey({ authorization: accessToken, params });
}
async adminCreateConfirmedUser(params) {
return this.client.AdminCreateConfirmedUser({ params });
}
async storeInTruecallerUserList(params) {
return this.client.StoreInTruecallerUserList({ params });
}
async adminConfirmUser(params) {
return this.client.AdminConfirmUser({ params });
}
async adminDeleteUnconfirmedUser(params) {
return this.client.AdminDeleteUnconfirmedUser({ params });
}
async adminDeleteIncompleteUser({ accessToken }) {
return this.client.AdminDeleteIncompleteUser({ authorization: accessToken });
}
async adminLogOutUser({ accessToken }) {
return this.client.AdminLogOutUser({ authorization: accessToken });
}
async adminGetUserInfo({ accessToken }) {
const result = await this.client.AdminGetUserInfo({ authorization: accessToken });
return result.body;
}
async confirmPasswordlessSignUp({ accessToken }) {
const result = await this.client.ConfirmPasswordlessSignUp({ authorization: accessToken });
return result.body;
}
async doesUserExist({ field, value }) {
const result = await this.client.DoesUserExist({ queryParams: { field, value } });
return result.body;
}
async getCredentialOffer({ accessToken, env }) {
return this.client.GetCredentialOffer({ authorization: accessToken, queryParams: { env } });
}
async getSignedCredential(accessToken, params) {
return this.client.GetSignedCredential({ authorization: accessToken, params });
}
};
KeyStorageApiService = __decorate([
(0, tools_common_1.profile)()
], KeyStorageApiService);
exports.default = KeyStorageApiService;
//# sourceMappingURL=KeyStorageApiService.js.map