@novo-learning/novo-sdk
Version:
SDK for the Novolanguage Speech Analysis API
143 lines • 7.82 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthApi = exports.AuthApiFactory = exports.AuthApiFp = exports.AuthApiAxiosParamCreator = exports.RetentionType = exports.PermissionType = void 0;
const axios_1 = require("axios");
const common_1 = require("./common");
const base_1 = require("./base");
exports.PermissionType = {
attempt_read_result: 'attempt_read_result',
attempt_read_audio: 'attempt_read_audio',
attempt_read_group_result: 'attempt_read_group_result',
attempt_read_group_audio: 'attempt_read_group_audio',
attempt_edit: 'attempt_edit',
attempt_delete: 'attempt_delete',
attempt_maintenance: 'attempt_maintenance',
exercise_edit: 'exercise_edit',
exercise_delete: 'exercise_delete',
exercise_maintenance: 'exercise_maintenance',
publisher_edit: 'publisher_edit',
publisher_read: 'publisher_read',
publisher_maintenance: 'publisher_maintenance',
publisher_configuration_read: 'publisher_configuration_read',
publisher_configuration_edit: 'publisher_configuration_edit',
pronunciation_edit: 'pronunciation_edit'
};
exports.RetentionType = {
all: 'all',
attempt: 'attempt',
none: 'none'
};
const AuthApiAxiosParamCreator = function (configuration) {
return {
refresh: async (refreshRequestDtoV1, options = {}) => {
(0, common_1.assertParamExists)('refresh', 'refreshRequestDtoV1', refreshRequestDtoV1);
const localVarPath = `/v1/auth/refresh`;
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(refreshRequestDtoV1, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
sso: async (authenticateSsoRequestDtoV1, options = {}) => {
(0, common_1.assertParamExists)('sso', 'authenticateSsoRequestDtoV1', authenticateSsoRequestDtoV1);
const localVarPath = `/v1/auth/sso`;
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(authenticateSsoRequestDtoV1, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
ssoAnonymous: async (ssoRequestDtoV1, options = {}) => {
(0, common_1.assertParamExists)('ssoAnonymous', 'ssoRequestDtoV1', ssoRequestDtoV1);
const localVarPath = `/v1/auth/sso/anonymous`;
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(ssoRequestDtoV1, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.AuthApiAxiosParamCreator = AuthApiAxiosParamCreator;
const AuthApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.AuthApiAxiosParamCreator)(configuration);
return {
async refresh(refreshRequestDtoV1, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.refresh(refreshRequestDtoV1, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
async sso(authenticateSsoRequestDtoV1, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.sso(authenticateSsoRequestDtoV1, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
async ssoAnonymous(ssoRequestDtoV1, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.ssoAnonymous(ssoRequestDtoV1, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.AuthApiFp = AuthApiFp;
const AuthApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.AuthApiFp)(configuration);
return {
refresh(refreshRequestDtoV1, options) {
return localVarFp.refresh(refreshRequestDtoV1, options).then((request) => request(axios, basePath));
},
sso(authenticateSsoRequestDtoV1, options) {
return localVarFp.sso(authenticateSsoRequestDtoV1, options).then((request) => request(axios, basePath));
},
ssoAnonymous(ssoRequestDtoV1, options) {
return localVarFp.ssoAnonymous(ssoRequestDtoV1, options).then((request) => request(axios, basePath));
},
};
};
exports.AuthApiFactory = AuthApiFactory;
class AuthApi extends base_1.BaseAPI {
refresh(refreshRequestDtoV1, options) {
return (0, exports.AuthApiFp)(this.configuration).refresh(refreshRequestDtoV1, options).then((request) => request(this.axios, this.basePath));
}
sso(authenticateSsoRequestDtoV1, options) {
return (0, exports.AuthApiFp)(this.configuration).sso(authenticateSsoRequestDtoV1, options).then((request) => request(this.axios, this.basePath));
}
ssoAnonymous(ssoRequestDtoV1, options) {
return (0, exports.AuthApiFp)(this.configuration).ssoAnonymous(ssoRequestDtoV1, options).then((request) => request(this.axios, this.basePath));
}
}
exports.AuthApi = AuthApi;
//# sourceMappingURL=api.js.map