@affinidi-tdk/credential-issuance-client
Version:
Affinidi TDK typescript client for Affinidi CREDENTIAL ISSUANCE
845 lines • 102 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* CredentialIssuanceService
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
* Contact: info@affinidi.com
*
* 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());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotFoundErrorHttpStatusCodeEnum = exports.NotFoundErrorMessageEnum = exports.NotFoundErrorNameEnum = exports.MissingHolderDidErrorHttpStatusCodeEnum = exports.MissingHolderDidErrorMessageEnum = exports.MissingHolderDidErrorNameEnum = exports.IssuanceStateResponseStatusEnum = exports.IssuanceConfigMiniDtoFormatEnum = exports.IssuanceConfigDtoFormatEnum = exports.InvalidProofErrorHttpStatusCodeEnum = exports.InvalidProofErrorMessageEnum = exports.InvalidProofErrorNameEnum = exports.InvalidParameterErrorHttpStatusCodeEnum = exports.InvalidParameterErrorMessageEnum = exports.InvalidParameterErrorNameEnum = exports.InvalidJwtTokenErrorHttpStatusCodeEnum = exports.InvalidJwtTokenErrorMessageEnum = exports.InvalidJwtTokenErrorNameEnum = exports.InvalidIssuerWalletErrorHttpStatusCodeEnum = exports.InvalidIssuerWalletErrorMessageEnum = exports.InvalidIssuerWalletErrorNameEnum = exports.InvalidCredentialTypeErrorHttpStatusCodeEnum = exports.InvalidCredentialTypeErrorMessageEnum = exports.InvalidCredentialTypeErrorNameEnum = exports.InvalidCredentialRequestErrorHttpStatusCodeEnum = exports.InvalidCredentialRequestErrorMessageEnum = exports.InvalidCredentialRequestErrorNameEnum = exports.FlowDataStatusListsDetailsInnerStandardEnum = exports.FlowDataStatusListsDetailsInnerStatusListPurposeEnum = exports.CredentialSubjectNotValidErrorHttpStatusCodeEnum = exports.CredentialSubjectNotValidErrorMessageEnum = exports.CredentialSubjectNotValidErrorNameEnum = exports.CredentialProofProofTypeEnum = exports.CredentialOfferExpiredErrorHttpStatusCodeEnum = exports.CredentialOfferExpiredErrorMessageEnum = exports.CredentialOfferExpiredErrorNameEnum = exports.CredentialOfferClaimedErrorHttpStatusCodeEnum = exports.CredentialOfferClaimedErrorMessageEnum = exports.CredentialOfferClaimedErrorNameEnum = exports.CredentialIssuanceIdExistErrorHttpStatusCodeEnum = exports.CredentialIssuanceIdExistErrorMessageEnum = exports.CredentialIssuanceIdExistErrorNameEnum = exports.CreateIssuanceConfigInputFormatEnum = exports.ChangeStatusForbiddenErrorHttpStatusCodeEnum = exports.ChangeStatusForbiddenErrorMessageEnum = exports.ChangeStatusForbiddenErrorNameEnum = exports.ChangeCredentialStatusInputChangeReasonEnum = exports.ActionForbiddenErrorHttpStatusCodeEnum = exports.ActionForbiddenErrorMessageEnum = exports.ActionForbiddenErrorNameEnum = void 0;
exports.WellKnownApi = exports.WellKnownApiFactory = exports.WellKnownApiFp = exports.WellKnownApiAxiosParamCreator = exports.OfferApi = exports.OfferApiFactory = exports.OfferApiFp = exports.OfferApiAxiosParamCreator = exports.IssuanceApi = exports.IssuanceApiFactory = exports.IssuanceApiFp = exports.IssuanceApiAxiosParamCreator = exports.DefaultApi = exports.DefaultApiFactory = exports.DefaultApiFp = exports.DefaultApiAxiosParamCreator = exports.CredentialsApi = exports.CredentialsApiFactory = exports.CredentialsApiFp = exports.CredentialsApiAxiosParamCreator = exports.ConfigurationApi = exports.ConfigurationApiFactory = exports.ConfigurationApiFp = exports.ConfigurationApiAxiosParamCreator = exports.WellKnownOpenIdCredentialIssuerResponseTokenEndpointAuthMethodsSupportedEnum = exports.WellKnownOpenIdCredentialIssuerResponseScopesSupportedEnum = exports.WellKnownOpenIdCredentialIssuerResponseGrantTypesSupportedEnum = exports.VcClaimedErrorHttpStatusCodeEnum = exports.VcClaimedErrorMessageEnum = exports.VcClaimedErrorNameEnum = exports.UpdateIssuanceConfigInputFormatEnum = exports.StartIssuanceInputDataInnerStatusListDetailsInnerStandardEnum = exports.StartIssuanceInputDataInnerStatusListDetailsInnerPurposeEnum = exports.StartIssuanceInputClaimModeEnum = exports.RevocationForbiddenErrorHttpStatusCodeEnum = exports.RevocationForbiddenErrorMessageEnum = exports.RevocationForbiddenErrorNameEnum = exports.ProjectCredentialConfigNotExistErrorHttpStatusCodeEnum = exports.ProjectCredentialConfigNotExistErrorMessageEnum = exports.ProjectCredentialConfigNotExistErrorNameEnum = exports.ProjectCredentialConfigExistErrorHttpStatusCodeEnum = exports.ProjectCredentialConfigExistErrorMessageEnum = exports.ProjectCredentialConfigExistErrorNameEnum = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("./common");
// @ts-ignore
const base_1 = require("./base");
exports.ActionForbiddenErrorNameEnum = {
ActionForbiddenError: 'ActionForbiddenError',
};
exports.ActionForbiddenErrorMessageEnum = {
PrincipalCanNotExecuteActionOnGivenResource: 'Principal can not execute action on given resource',
};
exports.ActionForbiddenErrorHttpStatusCodeEnum = {
NUMBER_403: 403,
};
exports.ChangeCredentialStatusInputChangeReasonEnum = {
InvalidCredential: 'INVALID_CREDENTIAL',
CompromisedIssuer: 'COMPROMISED_ISSUER',
};
exports.ChangeStatusForbiddenErrorNameEnum = {
ChangeStatusForbiddenError: 'ChangeStatusForbiddenError',
};
exports.ChangeStatusForbiddenErrorMessageEnum = {
RelatedVcStatusCannotBeChanged: 'Related VC status cannot be changed',
};
exports.ChangeStatusForbiddenErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.CreateIssuanceConfigInputFormatEnum = {
LdpVc: 'ldp_vc',
JwtVcJsonLd: 'jwt_vc_json-ld',
SdJwtVcJsonLd: 'sd_jwt_vc_json-ld',
};
exports.CredentialIssuanceIdExistErrorNameEnum = {
CredentialIssuanceIdExistError: 'CredentialIssuanceIdExistError',
};
exports.CredentialIssuanceIdExistErrorMessageEnum = {
IssuanceIdExistForTheProjectPleaseUseDifferentIssuanceId: 'issuanceId exist for the project, please use different issuanceId',
};
exports.CredentialIssuanceIdExistErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.CredentialOfferClaimedErrorNameEnum = {
CredentialOfferClaimedError: 'CredentialOfferClaimedError',
};
exports.CredentialOfferClaimedErrorMessageEnum = {
CredentialOfferIsAlreadyClaimed: 'Credential offer is already claimed',
};
exports.CredentialOfferClaimedErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.CredentialOfferExpiredErrorNameEnum = {
CredentialOfferExpiredError: 'CredentialOfferExpiredError',
};
exports.CredentialOfferExpiredErrorMessageEnum = {
CredentialOfferIsExpired: 'Credential offer is expired',
};
exports.CredentialOfferExpiredErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.CredentialProofProofTypeEnum = {
Jwt: 'jwt',
};
exports.CredentialSubjectNotValidErrorNameEnum = {
CredentialSubjectNotValidError: 'CredentialSubjectNotValidError',
};
exports.CredentialSubjectNotValidErrorMessageEnum = {
CredentialSubjectIsNotAccordingToTheVcSchema: 'Credential subject is not according to the vc schema',
};
exports.CredentialSubjectNotValidErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.FlowDataStatusListsDetailsInnerStatusListPurposeEnum = {
Revoked: 'REVOKED',
};
exports.FlowDataStatusListsDetailsInnerStandardEnum = {
RevocationList2020: 'RevocationList2020',
};
exports.InvalidCredentialRequestErrorNameEnum = {
InvalidCredentialRequestError: 'InvalidCredentialRequestError',
};
exports.InvalidCredentialRequestErrorMessageEnum = {
CredentialRequestIsInvalid: 'Credential Request is invalid',
};
exports.InvalidCredentialRequestErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.InvalidCredentialTypeErrorNameEnum = {
InvalidCredentialTypeError: 'InvalidCredentialTypeError',
};
exports.InvalidCredentialTypeErrorMessageEnum = {
TheRequestedCredentialTypeIsNotSupported: 'The requested credential type is not supported',
};
exports.InvalidCredentialTypeErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.InvalidIssuerWalletErrorNameEnum = {
InvalidIssuerWalletError: 'InvalidIssuerWalletError',
};
exports.InvalidIssuerWalletErrorMessageEnum = {
IssuerWalletIdIsInvalid: 'issuer wallet id is invalid',
};
exports.InvalidIssuerWalletErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.InvalidJwtTokenErrorNameEnum = {
InvalidJwtTokenError: 'InvalidJwtTokenError',
};
exports.InvalidJwtTokenErrorMessageEnum = {
JwtTokenIsInvalid: 'JWT token is invalid',
};
exports.InvalidJwtTokenErrorHttpStatusCodeEnum = {
NUMBER_401: 401,
};
exports.InvalidParameterErrorNameEnum = {
InvalidParameterError: 'InvalidParameterError',
};
exports.InvalidParameterErrorMessageEnum = {
InvalidParameterParam: 'Invalid parameter: ${param}.',
};
exports.InvalidParameterErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.InvalidProofErrorNameEnum = {
InvalidProofError: 'InvalidProofError',
};
exports.InvalidProofErrorMessageEnum = {
TheProofInTheCredentialRequestIsInvalid: 'The proof in the Credential Request is invalid',
};
exports.InvalidProofErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.IssuanceConfigDtoFormatEnum = {
LdpVc: 'ldp_vc',
JwtVcJsonLd: 'jwt_vc_json-ld',
SdJwtVcJsonLd: 'sd_jwt_vc_json-ld',
};
exports.IssuanceConfigMiniDtoFormatEnum = {
LdpVc: 'ldp_vc',
JwtVcJsonLd: 'jwt_vc_json-ld',
SdJwtVcJsonLd: 'sd_jwt_vc_json-ld',
};
exports.IssuanceStateResponseStatusEnum = {
Init: 'INIT',
OfferDelivered: 'OFFER_DELIVERED',
VcClaimed: 'VC_CLAIMED',
Timeout: 'TIMEOUT',
};
exports.MissingHolderDidErrorNameEnum = {
MissingHolderDidError: 'MissingHolderDidError',
};
exports.MissingHolderDidErrorMessageEnum = {
HolderDidIsRequiredInThisClaimMode: 'holderDID is required in this claimMode',
};
exports.MissingHolderDidErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.NotFoundErrorNameEnum = {
NotFoundError: 'NotFoundError',
};
exports.NotFoundErrorMessageEnum = {
NotFoundParam: 'Not found: ${param}.',
};
exports.NotFoundErrorHttpStatusCodeEnum = {
NUMBER_404: 404,
};
exports.ProjectCredentialConfigExistErrorNameEnum = {
ProjectCredentialConfigExistError: 'ProjectCredentialConfigExistError',
};
exports.ProjectCredentialConfigExistErrorMessageEnum = {
CredentialConfigurationAlreadyExistsForThisProjectAndOnlyOneConfigurationIsAllowedPerProject: 'Credential configuration already exists for this project and only one configuration is allowed per project',
};
exports.ProjectCredentialConfigExistErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.ProjectCredentialConfigNotExistErrorNameEnum = {
ProjectCredentialConfigNotExistError: 'ProjectCredentialConfigNotExistError',
};
exports.ProjectCredentialConfigNotExistErrorMessageEnum = {
CredentialConfigIsNotAvailableForTheProject: 'Credential config is not available for the project',
};
exports.ProjectCredentialConfigNotExistErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.RevocationForbiddenErrorNameEnum = {
RevocationForbiddenError: 'RevocationForbiddenError',
};
exports.RevocationForbiddenErrorMessageEnum = {
RelatedVcHasNotBeenClaimedYet: 'Related VC has not been claimed yet',
};
exports.RevocationForbiddenErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.StartIssuanceInputClaimModeEnum = {
Normal: 'NORMAL',
TxCode: 'TX_CODE',
FixedHolder: 'FIXED_HOLDER',
};
exports.StartIssuanceInputDataInnerStatusListDetailsInnerPurposeEnum = {
Revocable: 'REVOCABLE',
};
exports.StartIssuanceInputDataInnerStatusListDetailsInnerStandardEnum = {
RevocationList2020: 'RevocationList2020',
};
exports.UpdateIssuanceConfigInputFormatEnum = {
LdpVc: 'ldp_vc',
JwtVcJsonLd: 'jwt_vc_json-ld',
SdJwtVcJsonLd: 'sd_jwt_vc_json-ld',
};
exports.VcClaimedErrorNameEnum = {
VcClaimedError: 'VcClaimedError',
};
exports.VcClaimedErrorMessageEnum = {
TheRequestedVcHasAlreadyBeenClaimedByTheUser: 'The requested VC has already been claimed by the user',
};
exports.VcClaimedErrorHttpStatusCodeEnum = {
NUMBER_400: 400,
};
exports.WellKnownOpenIdCredentialIssuerResponseGrantTypesSupportedEnum = {
AuthorizationCode: 'authorization_code',
UrnIetfParamsOauthGrantTypePreAuthorizedCode: 'urn:ietf:params:oauth:grant-type:pre-authorized_code',
};
exports.WellKnownOpenIdCredentialIssuerResponseScopesSupportedEnum = {
Openid: 'openid',
};
exports.WellKnownOpenIdCredentialIssuerResponseTokenEndpointAuthMethodsSupportedEnum = {
ClientSecretPost: 'client_secret_post',
ClientSecretBasic: 'client_secret_basic',
None: 'none',
};
/**
* ConfigurationApi - axios parameter creator
* @export
*/
const ConfigurationApiAxiosParamCreator = function (configuration) {
return {
/**
* Create issuance configuration, project have only one configuration
* @param {CreateIssuanceConfigInput} createIssuanceConfigInput Request body of create configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createIssuanceConfig: (createIssuanceConfigInput, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'createIssuanceConfigInput' is not null or undefined
(0, common_1.assertParamExists)('createIssuanceConfig', 'createIssuanceConfigInput', createIssuanceConfigInput);
const localVarPath = `/v1/configurations`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ProjectTokenAuth required
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'authorization', configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createIssuanceConfigInput, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Delete project issuance configuration
* @param {string} configurationId The id of the issuance configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteIssuanceConfigById: (configurationId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'configurationId' is not null or undefined
(0, common_1.assertParamExists)('deleteIssuanceConfigById', 'configurationId', configurationId);
const localVarPath = `/v1/configurations/{configurationId}`.replace(`{${'configurationId'}}`, encodeURIComponent(String(configurationId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ProjectTokenAuth required
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'authorization', configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Get issuance configuration by id
* @param {string} configurationId The id of the issuance configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIssuanceConfigById: (configurationId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'configurationId' is not null or undefined
(0, common_1.assertParamExists)('getIssuanceConfigById', 'configurationId', configurationId);
const localVarPath = `/v1/configurations/{configurationId}`.replace(`{${'configurationId'}}`, encodeURIComponent(String(configurationId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ProjectTokenAuth required
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'authorization', configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Get issuance configuration for my selected project
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIssuanceConfigList: (options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/v1/configurations`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ProjectTokenAuth required
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'authorization', configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Update issuance configuration
* @param {string} configurationId The id of the issuance configuration
* @param {UpdateIssuanceConfigInput} updateIssuanceConfigInput Request body of update configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateIssuanceConfigById: (configurationId, updateIssuanceConfigInput, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'configurationId' is not null or undefined
(0, common_1.assertParamExists)('updateIssuanceConfigById', 'configurationId', configurationId);
// verify required parameter 'updateIssuanceConfigInput' is not null or undefined
(0, common_1.assertParamExists)('updateIssuanceConfigById', 'updateIssuanceConfigInput', updateIssuanceConfigInput);
const localVarPath = `/v1/configurations/{configurationId}`.replace(`{${'configurationId'}}`, encodeURIComponent(String(configurationId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ProjectTokenAuth required
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'authorization', configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateIssuanceConfigInput, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
exports.ConfigurationApiAxiosParamCreator = ConfigurationApiAxiosParamCreator;
/**
* ConfigurationApi - functional programming interface
* @export
*/
const ConfigurationApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.ConfigurationApiAxiosParamCreator)(configuration);
return {
/**
* Create issuance configuration, project have only one configuration
* @param {CreateIssuanceConfigInput} createIssuanceConfigInput Request body of create configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createIssuanceConfig(createIssuanceConfigInput, options) {
var _a, _b, _c;
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.createIssuanceConfig(createIssuanceConfigInput, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ConfigurationApi.createIssuanceConfig']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
/**
* Delete project issuance configuration
* @param {string} configurationId The id of the issuance configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteIssuanceConfigById(configurationId, options) {
var _a, _b, _c;
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteIssuanceConfigById(configurationId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ConfigurationApi.deleteIssuanceConfigById']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
/**
* Get issuance configuration by id
* @param {string} configurationId The id of the issuance configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIssuanceConfigById(configurationId, options) {
var _a, _b, _c;
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getIssuanceConfigById(configurationId, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ConfigurationApi.getIssuanceConfigById']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
/**
* Get issuance configuration for my selected project
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIssuanceConfigList(options) {
var _a, _b, _c;
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.getIssuanceConfigList(options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ConfigurationApi.getIssuanceConfigList']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
/**
* Update issuance configuration
* @param {string} configurationId The id of the issuance configuration
* @param {UpdateIssuanceConfigInput} updateIssuanceConfigInput Request body of update configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateIssuanceConfigById(configurationId, updateIssuanceConfigInput, options) {
var _a, _b, _c;
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.updateIssuanceConfigById(configurationId, updateIssuanceConfigInput, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ConfigurationApi.updateIssuanceConfigById']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
};
};
exports.ConfigurationApiFp = ConfigurationApiFp;
/**
* ConfigurationApi - factory interface
* @export
*/
const ConfigurationApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.ConfigurationApiFp)(configuration);
return {
/**
* Create issuance configuration, project have only one configuration
* @param {CreateIssuanceConfigInput} createIssuanceConfigInput Request body of create configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createIssuanceConfig(createIssuanceConfigInput, options) {
return localVarFp
.createIssuanceConfig(createIssuanceConfigInput, options)
.then((request) => request(axios, basePath));
},
/**
* Delete project issuance configuration
* @param {string} configurationId The id of the issuance configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteIssuanceConfigById(configurationId, options) {
return localVarFp
.deleteIssuanceConfigById(configurationId, options)
.then((request) => request(axios, basePath));
},
/**
* Get issuance configuration by id
* @param {string} configurationId The id of the issuance configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIssuanceConfigById(configurationId, options) {
return localVarFp
.getIssuanceConfigById(configurationId, options)
.then((request) => request(axios, basePath));
},
/**
* Get issuance configuration for my selected project
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIssuanceConfigList(options) {
return localVarFp
.getIssuanceConfigList(options)
.then((request) => request(axios, basePath));
},
/**
* Update issuance configuration
* @param {string} configurationId The id of the issuance configuration
* @param {UpdateIssuanceConfigInput} updateIssuanceConfigInput Request body of update configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateIssuanceConfigById(configurationId, updateIssuanceConfigInput, options) {
return localVarFp
.updateIssuanceConfigById(configurationId, updateIssuanceConfigInput, options)
.then((request) => request(axios, basePath));
},
};
};
exports.ConfigurationApiFactory = ConfigurationApiFactory;
/**
* ConfigurationApi - object-oriented interface
* @export
* @class ConfigurationApi
* @extends {BaseAPI}
*/
class ConfigurationApi extends base_1.BaseAPI {
/**
* Create issuance configuration, project have only one configuration
* @param {CreateIssuanceConfigInput} createIssuanceConfigInput Request body of create configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfigurationApi
*/
createIssuanceConfig(createIssuanceConfigInput, options) {
return (0, exports.ConfigurationApiFp)(this.configuration)
.createIssuanceConfig(createIssuanceConfigInput, options)
.then((request) => request(this.axios, this.basePath));
}
/**
* Delete project issuance configuration
* @param {string} configurationId The id of the issuance configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfigurationApi
*/
deleteIssuanceConfigById(configurationId, options) {
return (0, exports.ConfigurationApiFp)(this.configuration)
.deleteIssuanceConfigById(configurationId, options)
.then((request) => request(this.axios, this.basePath));
}
/**
* Get issuance configuration by id
* @param {string} configurationId The id of the issuance configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfigurationApi
*/
getIssuanceConfigById(configurationId, options) {
return (0, exports.ConfigurationApiFp)(this.configuration)
.getIssuanceConfigById(configurationId, options)
.then((request) => request(this.axios, this.basePath));
}
/**
* Get issuance configuration for my selected project
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfigurationApi
*/
getIssuanceConfigList(options) {
return (0, exports.ConfigurationApiFp)(this.configuration)
.getIssuanceConfigList(options)
.then((request) => request(this.axios, this.basePath));
}
/**
* Update issuance configuration
* @param {string} configurationId The id of the issuance configuration
* @param {UpdateIssuanceConfigInput} updateIssuanceConfigInput Request body of update configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfigurationApi
*/
updateIssuanceConfigById(configurationId, updateIssuanceConfigInput, options) {
return (0, exports.ConfigurationApiFp)(this.configuration)
.updateIssuanceConfigById(configurationId, updateIssuanceConfigInput, options)
.then((request) => request(this.axios, this.basePath));
}
}
exports.ConfigurationApi = ConfigurationApi;
/**
* CredentialsApi - axios parameter creator
* @export
*/
const CredentialsApiAxiosParamCreator = function (configuration) {
return {
/**
* Allows wallets to claim multiple credentials at once. For authentication, it uses a token from the authorization server
* @summary Allows wallets to claim multiple credentials at once.
* @param {string} projectId Affinidi project id
* @param {BatchCredentialInput} batchCredentialInput Request body for batch credential
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
batchCredential: (projectId, batchCredentialInput, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'projectId' is not null or undefined
(0, common_1.assertParamExists)('batchCredential', 'projectId', projectId);
// verify required parameter 'batchCredentialInput' is not null or undefined
(0, common_1.assertParamExists)('batchCredential', 'batchCredentialInput', batchCredentialInput);
const localVarPath = `/v1/{projectId}/batch_credential`.replace(`{${'projectId'}}`, encodeURIComponent(String(projectId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(batchCredentialInput, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Issue credential for end user upon presentation a valid access token. Since we don\'t immediate issue credential It\'s expected to return `transaction_id` and use this `transaction_id` to get the deferred credentials
* @param {string} projectId Affinidi project id
* @param {CreateCredentialInput} createCredentialInput Request body to issue credentials
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
generateCredentials: (projectId, createCredentialInput, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'projectId' is not null or undefined
(0, common_1.assertParamExists)('generateCredentials', 'projectId', projectId);
// verify required parameter 'createCredentialInput' is not null or undefined
(0, common_1.assertParamExists)('generateCredentials', 'createCredentialInput', createCredentialInput);
const localVarPath = `/v1/{projectId}/credential`.replace(`{${'projectId'}}`, encodeURIComponent(String(projectId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication bearerAuth required
// http bearer authentication required
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createCredentialInput, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Get claimed credential in the specified range
* @summary Get claimed credential in the specified range
* @param {string} projectId project id
* @param {string} configurationId configuration id
* @param {string} rangeStartTime
* @param {string} [rangeEndTime]
* @param {string} [exclusiveStartKey] exclusiveStartKey for retrieving the next batch of data.
* @param {number} [limit]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getClaimedCredentials: (projectId, configurationId, rangeStartTime, rangeEndTime, exclusiveStartKey, limit, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'projectId' is not null or undefined
(0, common_1.assertParamExists)('getClaimedCredentials', 'projectId', projectId);
// verify required parameter 'configurationId' is not null or undefined
(0, common_1.assertParamExists)('getClaimedCredentials', 'configurationId', configurationId);
// verify required parameter 'rangeStartTime' is not null or undefined
(0, common_1.assertParamExists)('getClaimedCredentials', 'rangeStartTime', rangeStartTime);
const localVarPath = `/v1/{projectId}/configurations/{configurationId}/credentials`
.replace(`{${'projectId'}}`, encodeURIComponent(String(projectId)))
.replace(`{${'configurationId'}}`, encodeURIComponent(String(configurationId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ProjectTokenAuth required
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'authorization', configuration);
if (rangeStartTime !== undefined) {
localVarQueryParameter['rangeStartTime'] = rangeStartTime;
}
if (rangeEndTime !== undefined) {
localVarQueryParameter['rangeEndTime'] = rangeEndTime;
}
if (exclusiveStartKey !== undefined) {
localVarQueryParameter['exclusiveStartKey'] = exclusiveStartKey;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
/**
* Get claimed VC linked to the issuanceId
* @summary Get claimed VC linked to the issuanceId
* @param {string} projectId project id
* @param {string} configurationId configuration id
* @param {string} issuanceId issuance id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getIssuanceIdClaimedCredential: (projectId, configurationId, issuanceId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'projectId' is not null or undefined
(0, common_1.assertParamExists)('getIssuanceIdClaimedCredential', 'projectId', projectId);
// verify required parameter 'configurationId' is not null or undefined
(0, common_1.assertParamExists)('getIssuanceIdClaimedCredential', 'configurationId', configurationId);
// verify required parameter 'issuanceId' is not null or undefined
(0, common_1.assertParamExists)('getIssuanceIdClaimedCredential', 'issuanceId', issuanceId);
const localVarPath = `/v1/{projectId}/configurations/{configurationId}/issuances/{issuanceId}/credentials`
.replace(`{${'projectId'}}`, encodeURIComponent(String(projectId)))
.replace(`{${'configurationId'}}`, encodeURIComponent(String(configurationId)))
.replace(`{${'issuanceId'}}`, encodeURIComponent(String(issuanceId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ProjectTokenAuth required
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'authorization', configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
exports.CredentialsApiAxiosParamCreator = CredentialsApiAxiosParamCreator;
/**
* CredentialsApi - functional programming interface
* @export
*/
const CredentialsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.CredentialsApiAxiosParamCreator)(configuration);
return {
/**
* Allows wallets to claim multiple credentials at once. For authentication, it uses a token from the authorization server
* @summary Allows wallets to claim multiple credentials at once.
* @param {string} projectId Affinidi project id
* @param {BatchCredentialInput} batchCredentialInput Request body for batch credential
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
batchCredential(projectId, batchCredentialInput, options) {
var _a, _b, _c;
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.batchCredential(projectId, batchCredentialInput, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['CredentialsApi.batchCredential']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
/**
* Issue credential for end user upon presentation a valid access token. Since we don\'t immediate issue credential It\'s expected to return `transaction_id` and use this `transaction_id` to get the deferred credentials
* @param {string} projectId Affinidi project id
* @param {CreateCredentialInput} createCredentialInput Request body to issue credentials
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
generateCredentials(projectId, createCredentialInput, options) {
var _a, _b, _c;
return __awaiter(this, void 0, void 0, function* () {
const localVarAxiosArgs = yield localVarAxiosParamCreator.generateCredentials(projectId, createCredentialInput, options);
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['CredentialsApi.generateCredentials']) === null || _b === v