@kloutit/kloutit-sdk
Version:
Kloutit SDK API for client integrations
859 lines (858 loc) • 48.5 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* API Reference
* The Kloutit API is organized around [REST](https://en.wikipedia.org/wiki/REST), it accepts and returns [JSON-encoded](https://www.json.org) bodies, returning standard [HTTP response codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes). You can interact with the API directly using your preferred HTTP/REST library.
*
* The version of the OpenAPI document: 2.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 __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
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 __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UploadFileTypeEnum = exports.KloutitCaseApi = exports.KloutitCaseApiFactory = exports.KloutitCaseApiFp = exports.KloutitCaseApiAxiosParamCreator = exports.HealthApi = exports.HealthApiFactory = exports.HealthApiFp = exports.HealthApiAxiosParamCreator = exports.Currencies = exports.ChargebackReason = exports.CaseStatus = exports.CaseSector = exports.CaseSectorEnum = exports.CasePaymentProcessorEnum = void 0;
var axios_1 = require("axios");
// Some imports not used depending on template conditions
// @ts-ignore
var common_1 = require("./common");
// @ts-ignore
var base_1 = require("./base");
exports.CasePaymentProcessorEnum = {
STRIPE: 'STRIPE',
CHECKOUT_COM: 'CHECKOUT_COM',
WORLDLINE: 'WORLDLINE',
REDSYS: 'REDSYS',
PAYPAL: 'PAYPAL',
MANGOPAY: 'MANGOPAY',
ADYEN: 'ADYEN'
};
exports.CaseSectorEnum = {
DIGITAL_PRODUCT: 'DIGITAL_PRODUCT',
EDUCATION: 'EDUCATION',
FASHION: 'FASHION',
FOOD: 'FOOD',
GAMING: 'GAMING',
HEALTH_BEAUTY: 'HEALTH_BEAUTY',
HOME: 'HOME',
LEISURE: 'LEISURE',
MARKETPLACE: 'MARKETPLACE',
PHONE: 'PHONE',
SOFTWARE: 'SOFTWARE',
SPORT: 'SPORT',
SUBSCRIPTION: 'SUBSCRIPTION',
SUPPLY: 'SUPPLY',
TECHNOLOGY: 'TECHNOLOGY',
TRANSPORT: 'TRANSPORT',
TRAVEL_AIRLINE: 'TRAVEL_AIRLINE',
TRAVEL_HOTEL: 'TRAVEL_HOTEL'
};
/**
* Sector of the case. It must be one of the sectors of the organization, for instance: EDUCATION, SOFTWARE, TRAVEL_HOTEL,...
* @export
* @enum {string}
*/
exports.CaseSector = {
DIGITAL_PRODUCT: 'DIGITAL_PRODUCT',
EDUCATION: 'EDUCATION',
FASHION: 'FASHION',
FOOD: 'FOOD',
GAMING: 'GAMING',
HEALTH_BEAUTY: 'HEALTH_BEAUTY',
HOME: 'HOME',
LEISURE: 'LEISURE',
MARKETPLACE: 'MARKETPLACE',
PHONE: 'PHONE',
SOFTWARE: 'SOFTWARE',
SPORT: 'SPORT',
SUBSCRIPTION: 'SUBSCRIPTION',
SUPPLY: 'SUPPLY',
TECHNOLOGY: 'TECHNOLOGY',
TRANSPORT: 'TRANSPORT',
TRAVEL_AIRLINE: 'TRAVEL_AIRLINE',
TRAVEL_HOTEL: 'TRAVEL_HOTEL'
};
/**
* Current status of the case.
* @export
* @enum {string}
*/
exports.CaseStatus = {
PENDING: 'PENDING',
GENERATING: 'GENERATING',
GENERATED: 'GENERATED',
ALLEGING: 'ALLEGING',
ALLEGED: 'ALLEGED',
WON: 'WON',
LOST: 'LOST',
ACCEPTED: 'ACCEPTED',
EXPIRED: 'EXPIRED'
};
/**
* Reason why the customer is requesting the chargeback.
* @export
* @enum {string}
*/
exports.ChargebackReason = {
FRAUD: 'FRAUD',
PRODUCT_SERVICE_NOT_RECEIVED: 'PRODUCT_SERVICE_NOT_RECEIVED',
DEFECTIVE_PRODUCT_SERVICE: 'DEFECTIVE_PRODUCT_SERVICE',
PRODUCT_SERVICE_NOT_AS_DESCRIBED: 'PRODUCT_SERVICE_NOT_AS_DESCRIBED',
INCORRECT_DUPLICATED_CHARGES: 'INCORRECT_DUPLICATED_CHARGES',
PRODUCT_SERVICE_CANCELLED: 'PRODUCT_SERVICE_CANCELLED',
REFUND_NOT_RECEIVED: 'REFUND_NOT_RECEIVED',
RECURRENT_OPERATION_CANCELLED: 'RECURRENT_OPERATION_CANCELLED'
};
/**
*
* @export
* @enum {string}
*/
exports.Currencies = {
EUR: 'EUR',
GBP: 'GBP',
CHF: 'CHF',
NOK: 'NOK',
DKK: 'DKK',
SEK: 'SEK',
BGN: 'BGN',
HRK: 'HRK',
CZK: 'CZK',
HUF: 'HUF',
PLN: 'PLN',
RON: 'RON',
ISK: 'ISK',
RUB: 'RUB',
MKD: 'MKD',
RSD: 'RSD',
ARS: 'ARS',
BOB: 'BOB',
BRL: 'BRL',
CLP: 'CLP',
COP: 'COP',
CRC: 'CRC',
CUP: 'CUP',
DOP: 'DOP',
GTQ: 'GTQ',
HNL: 'HNL',
MXN: 'MXN',
NIO: 'NIO',
PAB: 'PAB',
PYG: 'PYG',
PEN: 'PEN',
SRD: 'SRD',
UYU: 'UYU',
VES: 'VES',
USD: 'USD',
CAD: 'CAD',
CNY: 'CNY',
JPY: 'JPY',
INR: 'INR',
KRW: 'KRW',
IDR: 'IDR',
MYR: 'MYR',
PHP: 'PHP',
SGD: 'SGD',
THB: 'THB',
VND: 'VND',
HKD: 'HKD',
TWD: 'TWD',
TRY: 'TRY',
AUD: 'AUD',
NZD: 'NZD',
FJD: 'FJD',
PGK: 'PGK',
WST: 'WST',
VUV: 'VUV'
};
/**
* HealthApi - axios parameter creator
* @export
*/
var HealthApiAxiosParamCreator = function (configuration) {
var _this = this;
return {
/**
*
* @summary Health check
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
healthControllerHealth: function (options) {
if (options === void 0) { options = {}; }
return __awaiter(_this, void 0, void 0, function () {
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
return __generator(this, function (_a) {
localVarPath = "/health";
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
if (configuration) {
baseOptions = configuration.baseOptions;
}
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
localVarHeaderParameter = {};
localVarQueryParameter = {};
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return [2 /*return*/, {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
}];
});
});
},
};
};
exports.HealthApiAxiosParamCreator = HealthApiAxiosParamCreator;
/**
* HealthApi - functional programming interface
* @export
*/
var HealthApiFp = function (configuration) {
var localVarAxiosParamCreator = (0, exports.HealthApiAxiosParamCreator)(configuration);
return {
/**
*
* @summary Health check
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
healthControllerHealth: function (options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function () {
var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4 /*yield*/, localVarAxiosParamCreator.healthControllerHealth(options)];
case 1:
localVarAxiosArgs = _c.sent();
localVarOperationServerIndex = 0;
localVarOperationServerBasePath = (_b = (_a = base_1.operationServerMap['HealthApi.healthControllerHealth']) === null || _a === void 0 ? void 0 : _a[localVarOperationServerIndex]) === null || _b === void 0 ? void 0 : _b.url;
return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
}
});
});
},
};
};
exports.HealthApiFp = HealthApiFp;
/**
* HealthApi - factory interface
* @export
*/
var HealthApiFactory = function (configuration, basePath, axios) {
var localVarFp = (0, exports.HealthApiFp)(configuration);
return {
/**
*
* @summary Health check
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
healthControllerHealth: function (options) {
return localVarFp.healthControllerHealth(options).then(function (request) { return request(axios, basePath); });
},
};
};
exports.HealthApiFactory = HealthApiFactory;
/**
* HealthApi - object-oriented interface
* @export
* @class HealthApi
* @extends {BaseAPI}
*/
var HealthApi = /** @class */ (function (_super) {
__extends(HealthApi, _super);
function HealthApi() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
*
* @summary Health check
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof HealthApi
*/
HealthApi.prototype.healthControllerHealth = function (options) {
var _this = this;
return (0, exports.HealthApiFp)(this.configuration).healthControllerHealth(options).then(function (request) { return request(_this.axios, _this.basePath); });
};
return HealthApi;
}(base_1.BaseAPI));
exports.HealthApi = HealthApi;
/**
* KloutitCaseApi - axios parameter creator
* @export
*/
var KloutitCaseApiAxiosParamCreator = function (configuration) {
var _this = this;
return {
/**
* Validates that the case has been updated with all the needed information. It indicates in the response if there are still some fields that could be informed to Kloutit before generating the dispute. It also informs the type and the required nature of each field.
* @summary Check case information
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
checkCase: function (expedientNumber, options) {
if (options === void 0) { options = {}; }
return __awaiter(_this, void 0, void 0, function () {
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
// verify required parameter 'expedientNumber' is not null or undefined
(0, common_1.assertParamExists)('checkCase', 'expedientNumber', expedientNumber);
localVarPath = "/case/{expedientNumber}/check-case"
.replace("{".concat("expedientNumber", "}"), encodeURIComponent(String(expedientNumber)));
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
if (configuration) {
baseOptions = configuration.baseOptions;
}
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
localVarHeaderParameter = {};
localVarQueryParameter = {};
// authentication x-api-key required
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration)];
case 1:
// authentication x-api-key required
_a.sent();
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return [2 /*return*/, {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
}];
}
});
});
},
/**
* Submits that the case has been updated with all the needed information. If you have configured automated dispute generation in Kloutit, this endpoint will indicate that the case is ready and will trigger the defense generation automatically.
* @summary Submit completed case
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
submitCompletedCase: function (expedientNumber, options) {
if (options === void 0) { options = {}; }
return __awaiter(_this, void 0, void 0, function () {
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
// verify required parameter 'expedientNumber' is not null or undefined
(0, common_1.assertParamExists)('submitCompletedCase', 'expedientNumber', expedientNumber);
localVarPath = "/case/{expedientNumber}/submit-completed-case"
.replace("{".concat("expedientNumber", "}"), encodeURIComponent(String(expedientNumber)));
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
if (configuration) {
baseOptions = configuration.baseOptions;
}
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
localVarHeaderParameter = {};
localVarQueryParameter = {};
// authentication x-api-key required
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration)];
case 1:
// authentication x-api-key required
_a.sent();
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return [2 /*return*/, {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
}];
}
});
});
},
/**
* Updates data to enrich an existing case in order to generate a more complete defense and increase the chances of winning.
* @summary Update case
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {UpdateCaseParams} updateCaseParams
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCase: function (expedientNumber, updateCaseParams, options) {
if (options === void 0) { options = {}; }
return __awaiter(_this, void 0, void 0, function () {
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
// verify required parameter 'expedientNumber' is not null or undefined
(0, common_1.assertParamExists)('updateCase', 'expedientNumber', expedientNumber);
// verify required parameter 'updateCaseParams' is not null or undefined
(0, common_1.assertParamExists)('updateCase', 'updateCaseParams', updateCaseParams);
localVarPath = "/case/{expedientNumber}/update-case"
.replace("{".concat("expedientNumber", "}"), encodeURIComponent(String(expedientNumber)));
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
if (configuration) {
baseOptions = configuration.baseOptions;
}
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
localVarHeaderParameter = {};
localVarQueryParameter = {};
// authentication x-api-key required
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration)];
case 1:
// authentication x-api-key required
_a.sent();
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateCaseParams, localVarRequestOptions, configuration);
return [2 /*return*/, {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
}];
}
});
});
},
/**
* Uploads a file into an existing case. You need to send a request of type ``multipart/form-data``. This file can be attached as a customer evidence, company evidence or product related file (for marketplace). Allowed formats are ``PDF``, ``JPG``, ``JPEG``, ``PNG``. Max. file size is ``10Mb``
* @summary Upload file
* @param {string} expedientNumber
* @param {File} file A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the multipart/form-data protocol. Allowed formats are ``PDF``, ``JPG``, ``JPEG``, ``PNG``. Max. file size is ``10Mb``. Ensure that the file upload adheres to [RFC 2388](https://www.ietf.org/rfc/rfc2388.txt), which defines file transfers for the multipart/form-data protocol.
* @param {UploadFileTypeEnum} type Type of file: ``customer``, ``company`` or ``product`` (product only for marketplace)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
uploadFile: function (expedientNumber, file, type, options) {
if (options === void 0) { options = {}; }
return __awaiter(_this, void 0, void 0, function () {
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, localVarFormParams, headersFromBaseOptions;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
// verify required parameter 'expedientNumber' is not null or undefined
(0, common_1.assertParamExists)('uploadFile', 'expedientNumber', expedientNumber);
// verify required parameter 'file' is not null or undefined
(0, common_1.assertParamExists)('uploadFile', 'file', file);
// verify required parameter 'type' is not null or undefined
(0, common_1.assertParamExists)('uploadFile', 'type', type);
localVarPath = "/case/{expedientNumber}/upload-file"
.replace("{".concat("expedientNumber", "}"), encodeURIComponent(String(expedientNumber)));
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
if (configuration) {
baseOptions = configuration.baseOptions;
}
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
localVarHeaderParameter = {};
localVarQueryParameter = {};
localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
// authentication x-api-key required
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration)];
case 1:
// authentication x-api-key required
_a.sent();
if (file !== undefined) {
localVarFormParams.append('file', file);
}
if (type !== undefined) {
localVarFormParams.append('type', type);
}
localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = localVarFormParams;
return [2 /*return*/, {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
}];
}
});
});
},
/**
* Verifies if the webhook event received has been sent by Kloutit
* @summary Verify webhook event
* @param {ClientWebhookEventDto} clientWebhookEventDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
verifyEvent: function (clientWebhookEventDto, options) {
if (options === void 0) { options = {}; }
return __awaiter(_this, void 0, void 0, function () {
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
// verify required parameter 'clientWebhookEventDto' is not null or undefined
(0, common_1.assertParamExists)('verifyEvent', 'clientWebhookEventDto', clientWebhookEventDto);
localVarPath = "/case/verify-event";
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
if (configuration) {
baseOptions = configuration.baseOptions;
}
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
localVarHeaderParameter = {};
localVarQueryParameter = {};
// authentication x-api-key required
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration)];
case 1:
// authentication x-api-key required
_a.sent();
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(clientWebhookEventDto, localVarRequestOptions, configuration);
return [2 /*return*/, {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
}];
}
});
});
},
};
};
exports.KloutitCaseApiAxiosParamCreator = KloutitCaseApiAxiosParamCreator;
/**
* KloutitCaseApi - functional programming interface
* @export
*/
var KloutitCaseApiFp = function (configuration) {
var localVarAxiosParamCreator = (0, exports.KloutitCaseApiAxiosParamCreator)(configuration);
return {
/**
* Validates that the case has been updated with all the needed information. It indicates in the response if there are still some fields that could be informed to Kloutit before generating the dispute. It also informs the type and the required nature of each field.
* @summary Check case information
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
checkCase: function (expedientNumber, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function () {
var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4 /*yield*/, localVarAxiosParamCreator.checkCase(expedientNumber, options)];
case 1:
localVarAxiosArgs = _c.sent();
localVarOperationServerIndex = 0;
localVarOperationServerBasePath = (_b = (_a = base_1.operationServerMap['KloutitCaseApi.checkCase']) === null || _a === void 0 ? void 0 : _a[localVarOperationServerIndex]) === null || _b === void 0 ? void 0 : _b.url;
return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
}
});
});
},
/**
* Submits that the case has been updated with all the needed information. If you have configured automated dispute generation in Kloutit, this endpoint will indicate that the case is ready and will trigger the defense generation automatically.
* @summary Submit completed case
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
submitCompletedCase: function (expedientNumber, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function () {
var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4 /*yield*/, localVarAxiosParamCreator.submitCompletedCase(expedientNumber, options)];
case 1:
localVarAxiosArgs = _c.sent();
localVarOperationServerIndex = 0;
localVarOperationServerBasePath = (_b = (_a = base_1.operationServerMap['KloutitCaseApi.submitCompletedCase']) === null || _a === void 0 ? void 0 : _a[localVarOperationServerIndex]) === null || _b === void 0 ? void 0 : _b.url;
return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
}
});
});
},
/**
* Updates data to enrich an existing case in order to generate a more complete defense and increase the chances of winning.
* @summary Update case
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {UpdateCaseParams} updateCaseParams
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCase: function (expedientNumber, updateCaseParams, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function () {
var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4 /*yield*/, localVarAxiosParamCreator.updateCase(expedientNumber, updateCaseParams, options)];
case 1:
localVarAxiosArgs = _c.sent();
localVarOperationServerIndex = 0;
localVarOperationServerBasePath = (_b = (_a = base_1.operationServerMap['KloutitCaseApi.updateCase']) === null || _a === void 0 ? void 0 : _a[localVarOperationServerIndex]) === null || _b === void 0 ? void 0 : _b.url;
return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
}
});
});
},
/**
* Uploads a file into an existing case. You need to send a request of type ``multipart/form-data``. This file can be attached as a customer evidence, company evidence or product related file (for marketplace). Allowed formats are ``PDF``, ``JPG``, ``JPEG``, ``PNG``. Max. file size is ``10Mb``
* @summary Upload file
* @param {string} expedientNumber
* @param {File} file A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the multipart/form-data protocol. Allowed formats are ``PDF``, ``JPG``, ``JPEG``, ``PNG``. Max. file size is ``10Mb``. Ensure that the file upload adheres to [RFC 2388](https://www.ietf.org/rfc/rfc2388.txt), which defines file transfers for the multipart/form-data protocol.
* @param {UploadFileTypeEnum} type Type of file: ``customer``, ``company`` or ``product`` (product only for marketplace)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
uploadFile: function (expedientNumber, file, type, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function () {
var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4 /*yield*/, localVarAxiosParamCreator.uploadFile(expedientNumber, file, type, options)];
case 1:
localVarAxiosArgs = _c.sent();
localVarOperationServerIndex = 0;
localVarOperationServerBasePath = (_b = (_a = base_1.operationServerMap['KloutitCaseApi.uploadFile']) === null || _a === void 0 ? void 0 : _a[localVarOperationServerIndex]) === null || _b === void 0 ? void 0 : _b.url;
return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
}
});
});
},
/**
* Verifies if the webhook event received has been sent by Kloutit
* @summary Verify webhook event
* @param {ClientWebhookEventDto} clientWebhookEventDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
verifyEvent: function (clientWebhookEventDto, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function () {
var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4 /*yield*/, localVarAxiosParamCreator.verifyEvent(clientWebhookEventDto, options)];
case 1:
localVarAxiosArgs = _c.sent();
localVarOperationServerIndex = 0;
localVarOperationServerBasePath = (_b = (_a = base_1.operationServerMap['KloutitCaseApi.verifyEvent']) === null || _a === void 0 ? void 0 : _a[localVarOperationServerIndex]) === null || _b === void 0 ? void 0 : _b.url;
return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
}
});
});
},
};
};
exports.KloutitCaseApiFp = KloutitCaseApiFp;
/**
* KloutitCaseApi - factory interface
* @export
*/
var KloutitCaseApiFactory = function (configuration, basePath, axios) {
var localVarFp = (0, exports.KloutitCaseApiFp)(configuration);
return {
/**
* Validates that the case has been updated with all the needed information. It indicates in the response if there are still some fields that could be informed to Kloutit before generating the dispute. It also informs the type and the required nature of each field.
* @summary Check case information
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
checkCase: function (expedientNumber, options) {
return localVarFp.checkCase(expedientNumber, options).then(function (request) { return request(axios, basePath); });
},
/**
* Submits that the case has been updated with all the needed information. If you have configured automated dispute generation in Kloutit, this endpoint will indicate that the case is ready and will trigger the defense generation automatically.
* @summary Submit completed case
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
submitCompletedCase: function (expedientNumber, options) {
return localVarFp.submitCompletedCase(expedientNumber, options).then(function (request) { return request(axios, basePath); });
},
/**
* Updates data to enrich an existing case in order to generate a more complete defense and increase the chances of winning.
* @summary Update case
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {UpdateCaseParams} updateCaseParams
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCase: function (expedientNumber, updateCaseParams, options) {
return localVarFp.updateCase(expedientNumber, updateCaseParams, options).then(function (request) { return request(axios, basePath); });
},
/**
* Uploads a file into an existing case. You need to send a request of type ``multipart/form-data``. This file can be attached as a customer evidence, company evidence or product related file (for marketplace). Allowed formats are ``PDF``, ``JPG``, ``JPEG``, ``PNG``. Max. file size is ``10Mb``
* @summary Upload file
* @param {string} expedientNumber
* @param {File} file A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the multipart/form-data protocol. Allowed formats are ``PDF``, ``JPG``, ``JPEG``, ``PNG``. Max. file size is ``10Mb``. Ensure that the file upload adheres to [RFC 2388](https://www.ietf.org/rfc/rfc2388.txt), which defines file transfers for the multipart/form-data protocol.
* @param {UploadFileTypeEnum} type Type of file: ``customer``, ``company`` or ``product`` (product only for marketplace)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
uploadFile: function (expedientNumber, file, type, options) {
return localVarFp.uploadFile(expedientNumber, file, type, options).then(function (request) { return request(axios, basePath); });
},
/**
* Verifies if the webhook event received has been sent by Kloutit
* @summary Verify webhook event
* @param {ClientWebhookEventDto} clientWebhookEventDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
verifyEvent: function (clientWebhookEventDto, options) {
return localVarFp.verifyEvent(clientWebhookEventDto, options).then(function (request) { return request(axios, basePath); });
},
};
};
exports.KloutitCaseApiFactory = KloutitCaseApiFactory;
/**
* KloutitCaseApi - object-oriented interface
* @export
* @class KloutitCaseApi
* @extends {BaseAPI}
*/
var KloutitCaseApi = /** @class */ (function (_super) {
__extends(KloutitCaseApi, _super);
function KloutitCaseApi() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Validates that the case has been updated with all the needed information. It indicates in the response if there are still some fields that could be informed to Kloutit before generating the dispute. It also informs the type and the required nature of each field.
* @summary Check case information
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof KloutitCaseApi
*/
KloutitCaseApi.prototype.checkCase = function (expedientNumber, options) {
var _this = this;
return (0, exports.KloutitCaseApiFp)(this.configuration).checkCase(expedientNumber, options).then(function (request) { return request(_this.axios, _this.basePath); });
};
/**
* Submits that the case has been updated with all the needed information. If you have configured automated dispute generation in Kloutit, this endpoint will indicate that the case is ready and will trigger the defense generation automatically.
* @summary Submit completed case
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof KloutitCaseApi
*/
KloutitCaseApi.prototype.submitCompletedCase = function (expedientNumber, options) {
var _this = this;
return (0, exports.KloutitCaseApiFp)(this.configuration).submitCompletedCase(expedientNumber, options).then(function (request) { return request(_this.axios, _this.basePath); });
};
/**
* Updates data to enrich an existing case in order to generate a more complete defense and increase the chances of winning.
* @summary Update case
* @param {string} expedientNumber Case expedient number. This value must exist in Kloutit.
* @param {UpdateCaseParams} updateCaseParams
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof KloutitCaseApi
*/
KloutitCaseApi.prototype.updateCase = function (expedientNumber, updateCaseParams, options) {
var _this = this;
return (0, exports.KloutitCaseApiFp)(this.configuration).updateCase(expedientNumber, updateCaseParams, options).then(function (request) { return request(_this.axios, _this.basePath); });
};
/**
* Uploads a file into an existing case. You need to send a request of type ``multipart/form-data``. This file can be attached as a customer evidence, company evidence or product related file (for marketplace). Allowed formats are ``PDF``, ``JPG``, ``JPEG``, ``PNG``. Max. file size is ``10Mb``
* @summary Upload file
* @param {string} expedientNumber
* @param {File} file A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the multipart/form-data protocol. Allowed formats are ``PDF``, ``JPG``, ``JPEG``, ``PNG``. Max. file size is ``10Mb``. Ensure that the file upload adheres to [RFC 2388](https://www.ietf.org/rfc/rfc2388.txt), which defines file transfers for the multipart/form-data protocol.
* @param {UploadFileTypeEnum} type Type of file: ``customer``, ``company`` or ``product`` (product only for marketplace)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof KloutitCaseApi
*/
KloutitCaseApi.prototype.uploadFile = function (expedientNumber, file, type, options) {
var _this = this;
return (0, exports.KloutitCaseApiFp)(this.configuration).uploadFile(expedientNumber, file, type, options).then(function (request) { return request(_this.axios, _this.basePath); });
};
/**
* Verifies if the webhook event received has been sent by Kloutit
* @summary Verify webhook event
* @param {ClientWebhookEventDto} clientWebhookEventDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof KloutitCaseApi
*/
KloutitCaseApi.prototype.verifyEvent = function (clientWebhookEventDto, options) {
var _this = this;
return (0, exports.KloutitCaseApiFp)(this.configuration).verifyEvent(clientWebhookEventDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
};
return KloutitCaseApi;
}(base_1.BaseAPI));
exports.KloutitCaseApi = KloutitCaseApi;
/**
* @export
*/
exports.UploadFileTypeEnum = {
COMPANY: 'COMPANY',
CUSTOMER: 'CUSTOMER',
PRODUCT: 'PRODUCT'
};