@contiva/sap-integration-suite-client
Version:
SAP Cloud Platform Integration API Client
571 lines (570 loc) • 28.7 kB
JavaScript
;
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
/*
* ---------------------------------------------------------------
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
* ## ##
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Api = exports.HttpClient = exports.ContentType = void 0;
var ContentType;
(function (ContentType) {
ContentType["Json"] = "application/json";
ContentType["FormData"] = "multipart/form-data";
ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
ContentType["Text"] = "text/plain";
})(ContentType || (exports.ContentType = ContentType = {}));
class HttpClient {
constructor(apiConfig = {}) {
this.baseUrl = "https://{Account Short Name}-tmn.{SSL Host}.{landscapehost}/api/v1";
this.securityData = null;
this.abortControllers = new Map();
this.customFetch = (...fetchParams) => fetch(...fetchParams);
this.baseApiParams = {
credentials: "same-origin",
headers: {},
redirect: "follow",
referrerPolicy: "no-referrer",
};
this.setSecurityData = (data) => {
this.securityData = data;
};
this.contentFormatters = {
[ContentType.Json]: (input) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
[ContentType.Text]: (input) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
[ContentType.FormData]: (input) => Object.keys(input || {}).reduce((formData, key) => {
const property = input[key];
formData.append(key, property instanceof Blob
? property
: typeof property === "object" && property !== null
? JSON.stringify(property)
: `${property}`);
return formData;
}, new FormData()),
[ContentType.UrlEncoded]: (input) => this.toQueryString(input),
};
this.createAbortSignal = (cancelToken) => {
if (this.abortControllers.has(cancelToken)) {
const abortController = this.abortControllers.get(cancelToken);
if (abortController) {
return abortController.signal;
}
return void 0;
}
const abortController = new AbortController();
this.abortControllers.set(cancelToken, abortController);
return abortController.signal;
};
this.abortRequest = (cancelToken) => {
const abortController = this.abortControllers.get(cancelToken);
if (abortController) {
abortController.abort();
this.abortControllers.delete(cancelToken);
}
};
this.request = async ({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }) => {
const secureParams = ((typeof secure === "boolean" ? secure : this.baseApiParams.secure) &&
this.securityWorker &&
(await this.securityWorker(this.securityData))) ||
{};
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format || requestParams.format;
return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(requestParams.headers || {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
},
signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
}).then(async (response) => {
const r = response.clone();
r.data = null;
r.error = null;
const data = !responseFormat
? r
: await response[responseFormat]()
.then((data) => {
if (r.ok) {
r.data = data;
}
else {
r.error = data;
}
return r;
})
.catch((e) => {
r.error = e;
return r;
});
if (cancelToken) {
this.abortControllers.delete(cancelToken);
}
if (!response.ok)
throw data;
return data;
});
};
Object.assign(this, apiConfig);
}
encodeQueryParam(key, value) {
const encodedKey = encodeURIComponent(key);
return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`;
}
addQueryParam(query, key) {
return this.encodeQueryParam(key, query[key]);
}
addArrayQueryParam(query, key) {
const value = query[key];
return value.map((v) => this.encodeQueryParam(key, v)).join("&");
}
toQueryString(rawQuery) {
const query = rawQuery || {};
const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]);
return keys
.map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key)))
.join("&");
}
addQueryParams(rawQuery) {
const queryString = this.toQueryString(rawQuery);
return queryString ? `?${queryString}` : "";
}
mergeRequestParams(params1, params2) {
return {
...this.baseApiParams,
...params1,
...(params2 || {}),
headers: {
...(this.baseApiParams.headers || {}),
...(params1.headers || {}),
...((params2 && params2.headers) || {}),
},
};
}
}
exports.HttpClient = HttpClient;
/**
* @title Message Processing Logs
* @version 1.0.0
* @baseUrl https://{Account Short Name}-tmn.{SSL Host}.{landscapehost}/api/v1
* @externalDocs https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/827a2d7e9c6f4866a1d6c0e647bcacd2.html
*
* Message processing logs enable you to store data about the messages processed on a tenant and - for each processed message - information about the individual processing steps.
* This API is implemented based on OData version 2 specification.
*/
class Api extends HttpClient {
constructor() {
super(...arguments);
/**
* @description You can use the following request to get the CSRF token for this session, which is required for write access via POST, PUT and DELETE operations. Copy the received X-CSRF-Token from the response header.<br> **In API sandbox this request is not relevant!**
*
* @tags CSRF Token Handling
* @name GetRoot
* @summary Get CSRF token.
* @request GET:/
* @secure
*/
this.getRoot = (params = {}) => this.request({
path: `/`,
method: "GET",
secure: true,
...params,
});
this.messageProcessingLogs = {
/**
* @description Get all message processing logs.<br> In API sandbox the available integration flows provide the following log information: * '__Integration Flow with Message Store entries - COMPLETED PROCESSING__': Attachments and message store entries * '__Integration Flow with Adapter Data - FAILED PROCESSING__': Message processing log error information, attachments, custom header properties and adapter data
*
* @tags Logs
* @name MessageProcessingLogsList
* @summary Get all message processing logs.
* @request GET:/MessageProcessingLogs
* @secure
*/
messageProcessingLogsList: (query, params = {}) => this.request({
path: `/MessageProcessingLogs`,
method: "GET",
query: query,
secure: true,
format: "json",
...params,
}),
/**
* @description You can use the following request to get number of all message processing logs.
*
* @tags Logs
* @name CountList
* @summary Get number of all message processing logs.
* @request GET:/MessageProcessingLogs/$count
* @secure
*/
countList: (query, params = {}) => this.request({
path: `/MessageProcessingLogs/$count`,
method: "GET",
query: query,
secure: true,
...params,
}),
};
this.messageProcessingLogsMessageGuid = {
/**
* @description You can use the following request to get message processing log by message Guid.<br> In API sandbox the integration flows provide the following log information: * '__Integration Flow with message store entries COMPLETED PROCESSING__': Attachments and message store entries * '__Integration Flow with Adapter Data - FAILED PROCESSING__': Message processing log error information, attachments, custom header properties and adapter data
*
* @tags Logs
* @name MessageProcessingLogsList
* @summary Get message processing log by message Guid.
* @request GET:/MessageProcessingLogs('{MessageGuid}')
* @secure
*/
messageProcessingLogsList: (messageGuid, query, params = {}) => this.request({
path: `/MessageProcessingLogs('${messageGuid}')`,
method: "GET",
query: query,
secure: true,
format: "json",
...params,
}),
/**
* @description You can use the following request to get the adapter attributes of the message processing log with the specified message Guid.<br> In API sandbox only the deployed integration flow '__Integration Flow with Adapter Data - FAILED PROCESSING__' provides the required adapter data
*
* @tags Adapter Attributes
* @name AdapterAttributesList
* @summary Get adapter attributes of message processing log by message Guid.
* @request GET:/MessageProcessingLogs('{MessageGuid}')/AdapterAttributes
* @secure
*/
adapterAttributesList: (messageGuid, query, params = {}) => this.request({
path: `/MessageProcessingLogs('${messageGuid}')/AdapterAttributes`,
method: "GET",
query: query,
secure: true,
format: "json",
...params,
}),
/**
* @description You can use the following request to get the attachments of the message processing log with the specified message Guid.<br> In API sandbox the following integration flows provide the required message processing log attachments: * '__Integration Flow with message store entries COMPLETED PROCESSING__' * '__Integration Flow with Adapter Data FAILED PROCESSING__'
*
* @tags Attachments
* @name AttachmentsList
* @summary Get attachments of message processing log by message Guid.
* @request GET:/MessageProcessingLogs('{MessageGuid}')/Attachments
* @secure
*/
attachmentsList: (messageGuid, params = {}) => this.request({
path: `/MessageProcessingLogs('${messageGuid}')/Attachments`,
method: "GET",
secure: true,
format: "json",
...params,
}),
/**
* @description You can use the following request to get custom header properties of message processing log with the specified message Guid.<br> In API sandbox only the deployed integration flow '__Integration Flow with Adapter Data - FAILED PROCESSING__' provides the required custom header properties
*
* @tags Custom Header Properties
* @name CustomHeaderPropertiesList
* @summary Get custom header properties of message processing log by message Guid.
* @request GET:/MessageProcessingLogs('{MessageGuid}')/CustomHeaderProperties
* @secure
*/
customHeaderPropertiesList: (messageGuid, query, params = {}) => this.request({
path: `/MessageProcessingLogs('${messageGuid}')/CustomHeaderProperties`,
method: "GET",
query: query,
secure: true,
format: "json",
...params,
}),
/**
* @description You can use the following request to get error information for the message with the specified message Guid.<br> In API sandbox only the deployed integration flow '__Integration Flow with Adapter Data - FAILED PROCESSING__' provides the required error information
*
* @tags Error Information
* @name ErrorInformationList
* @summary Get error information of message processing log by message Guid.
* @request GET:/MessageProcessingLogs('{MessageGuid}')/ErrorInformation
* @secure
*/
errorInformationList: (messageGuid, params = {}) => this.request({
path: `/MessageProcessingLogs('${messageGuid}')/ErrorInformation`,
method: "GET",
secure: true,
format: "json",
...params,
}),
/**
* @description You can use the following request to get error information text for the message with the specified message Guid.<br> In API sandbox only the deployed integration flow '__Integration Flow with Adapter Data - FAILED PROCESSING__' provides the required error information
*
* @tags Error Information
* @name ErrorInformationValueList
* @summary Get error information text of message processing log by message Guid.
* @request GET:/MessageProcessingLogs('{MessageGuid}')/ErrorInformation/$value
* @secure
*/
errorInformationValueList: (messageGuid, params = {}) => this.request({
path: `/MessageProcessingLogs('${messageGuid}')/ErrorInformation/$value`,
method: "GET",
secure: true,
...params,
}),
};
this.idMapFromIdsSourceId = {
/**
* @description You can use the following request to get all target Ids for the given source Id, which are stored in the Id mapper.
*
* @tags ID Mapper
* @name ToIdsList
* @summary Get all target Ids for the given source Id.
* @request GET:/IdMapFromIds('{Source ID}')/ToIds
* @secure
*/
toIdsList: (sourceId, params = {}) => this.request({
path: `/IdMapFromIds('{Source ID}')/ToIds`,
method: "GET",
secure: true,
format: "json",
...params,
}),
};
this.idMapToIdsTargetId = {
/**
* @description You can use the following request to get all source Ids for the given target Id, which are stored in the Id mapper.
*
* @tags ID Mapper
* @name FromId2SList
* @summary Get source Ids for a given target Id
* @request GET:/IdMapToIds('{Target ID}')/FromId2s
* @secure
*/
fromId2SList: (targetId, params = {}) => this.request({
path: `/IdMapToIds('{Target ID}')/FromId2s`,
method: "GET",
secure: true,
format: "json",
...params,
}),
};
this.idempotentRepositoryEntries = {
/**
* @description This path is deprecated. Please use the __/GenericIdempotentRepositoryEntries__ path.<br> You can use the following request to get entries from Idempotent Repository with the same id.
*
* @tags Idempotent Repository
* @name IdempotentRepositoryEntriesList
* @summary Get Idempotent Repository entries by id.
* @request GET:/IdempotentRepositoryEntries
* @deprecated
* @secure
*/
idempotentRepositoryEntriesList: (query, params = {}) => this.request({
path: `/IdempotentRepositoryEntries`,
method: "GET",
query: query,
secure: true,
format: "json",
...params,
}),
};
this.idempotentRepositoryEntriesHexSourceHexSourceHexEntryHexEntry = {
/**
* @description This path is deprecated. Please use the __/GenericIdempotentRepositoryEntries__ path.<br> You can use the following request to get entry from Idempotent Repository by hex encoded source and entry values.
*
* @tags Idempotent Repository
* @name IdempotentRepositoryEntriesHexSourceHexEntryList
* @summary Get Idempotent Repository entry.
* @request GET:/IdempotentRepositoryEntries(HexSource='{HexSource}',HexEntry='{HexEntry}')
* @deprecated
* @secure
*/
idempotentRepositoryEntriesHexSourceHexEntryList: (hexSource, hexEntry, params = {}) => this.request({
path: `/IdempotentRepositoryEntries(HexSource='${hexSource}',HexEntry='${hexEntry}')`,
method: "GET",
secure: true,
format: "json",
...params,
}),
/**
* @description This path is deprecated. Please use the __/GenericIdempotentRepositoryEntries__ path.<br> You can use the following request to delete entry from Idempotent Repository.<br> In API sandbox only read APIs could be tested. You need to configure an API endpoint for your account, where you have the required write permissions to delete entries from the Idempotent Repository.
*
* @tags Idempotent Repository
* @name IdempotentRepositoryEntriesHexSourceHexEntryDelete
* @summary Delete Idempotent Repository entry.
* @request DELETE:/IdempotentRepositoryEntries(HexSource='{HexSource}',HexEntry='{HexEntry}')
* @deprecated
* @secure
*/
idempotentRepositoryEntriesHexSourceHexEntryDelete: (hexSource, hexEntry, params = {}) => this.request({
path: `/IdempotentRepositoryEntries(HexSource='${hexSource}',HexEntry='${hexEntry}')`,
method: "DELETE",
secure: true,
...params,
}),
};
this.genericIdempotentRepositoryEntries = {
/**
* @description You can use the following request to get entries from Idempotent Repository with the same id.
*
* @tags Idempotent Repository
* @name GenericIdempotentRepositoryEntriesList
* @summary Get Idempotent Repository entries by id.
* @request GET:/GenericIdempotentRepositoryEntries
* @secure
*/
genericIdempotentRepositoryEntriesList: (query, params = {}) => this.request({
path: `/GenericIdempotentRepositoryEntries`,
method: "GET",
query: query,
secure: true,
format: "json",
...params,
}),
};
this.genericIdempotentRepositoryEntriesHexVendorHexVendorHexSourceHexSourceHexEntryHexEntryHexComponentHexComponent = {
/**
* @description You can use the following request to get entry from Idempotent Repository by hex encoded vendor, source, entry and component values.
*
* @tags Idempotent Repository
* @name GenericIdempotentRepositoryEntriesHexVendorHexSourceHexEntryHexComponentList
* @summary Get Idempotent Repository entry.
* @request GET:/GenericIdempotentRepositoryEntries(HexVendor='{HexVendor}',HexSource='{HexSource}',HexEntry='{HexEntry}',HexComponent='{HexComponent}')
* @secure
*/
genericIdempotentRepositoryEntriesHexVendorHexSourceHexEntryHexComponentList: (hexVendor, hexSource, hexEntry, hexComponent, params = {}) => this.request({
path: `/GenericIdempotentRepositoryEntries(HexVendor='${hexVendor}',HexSource='${hexSource}',HexEntry='${hexEntry}',HexComponent='${hexComponent}')`,
method: "GET",
secure: true,
format: "json",
...params,
}),
/**
* @description You can use the following request to delete entry from Idempotent Repository.<br> In API sandbox only read APIs could be tested. You need to configure an API endpoint for your account, where you have the required write permissions to delete entries from the Idempotent Repository.
*
* @tags Idempotent Repository
* @name GenericIdempotentRepositoryEntriesHexVendorHexSourceHexEntryHexComponentDelete
* @summary Delete Idempotent Repository entry.
* @request DELETE:/GenericIdempotentRepositoryEntries(HexVendor='{HexVendor}',HexSource='{HexSource}',HexEntry='{HexEntry}',HexComponent='{HexComponent}')
* @secure
*/
genericIdempotentRepositoryEntriesHexVendorHexSourceHexEntryHexComponentDelete: (hexVendor, hexSource, hexEntry, hexComponent, params = {}) => this.request({
path: `/GenericIdempotentRepositoryEntries(HexVendor='${hexVendor}',HexSource='${hexSource}',HexEntry='${hexEntry}',HexComponent='${hexComponent}')`,
method: "DELETE",
secure: true,
...params,
}),
};
this.activateExternalLogging = {
/**
* @description This API is only present in the <b>Cloud Foundry environment.</b> You can use the following request to acitvate external logging on your tenant.<br>If no response body is returned, there's an authentication issue. Make sure the request is authorized and that your user has the ActivateExternalLogging role.<br>For more information, see SAP Help Portal documentation at [External Logging](https://help.sap.com/docs/integration-suite/sap-integration-suite/external-logging-cloud-foundry-environment).
*
* @tags External Logging
* @name ActivateExternalLoggingCreate
* @summary Activate external logging
* @request POST:/activateExternalLogging
* @secure
*/
activateExternalLoggingCreate: (query, params = {}) => this.request({
path: `/activateExternalLogging`,
method: "POST",
query: query,
secure: true,
format: "json",
...params,
}),
};
this.deactivateExternalLogging = {
/**
* @description This API is only present in the <b>Cloud Foundry environment.</b> You can use the following request to deacitvate external logging on your tenant.<br>If no response body is returned, there's an authentication issue. Make sure the request is authorized and that your user has the ActivateExternalLogging role.<br>For more information, see SAP Help Portal documentation at [External Logging](https://help.sap.com/docs/integration-suite/sap-integration-suite/external-logging-cloud-foundry-environment).
*
* @tags External Logging
* @name DeactivateExternalLoggingCreate
* @summary Deactivate external logging
* @request POST:/deactivateExternalLogging
* @secure
*/
deactivateExternalLoggingCreate: (params = {}) => this.request({
path: `/deactivateExternalLogging`,
method: "POST",
secure: true,
format: "json",
...params,
}),
};
this.externalLoggingActivationStatusTenantName = {
/**
* @description This API is only present in the <b>Cloud Foundry environment.</b>
*
* @tags External Logging
* @name ExternalLoggingActivationStatusList
* @summary Get external logging status for a tenant
* @request GET:/ExternalLoggingActivationStatus('{TenantName}')
* @secure
*/
externalLoggingActivationStatusList: (tenantName, params = {}) => this.request({
path: `/ExternalLoggingActivationStatus('${tenantName}')`,
method: "GET",
secure: true,
format: "json",
...params,
}),
};
this.activateArchivingConfiguration = {
/**
* @description This API is only present in the <b>Cloud Foundry environment.</b> You can use the following request to acitvate the archiving functionality in your tenant.
*
* @tags Data Archiving
* @name ActivateArchivingConfigurationCreate
* @summary Enable archiving
* @request POST:/activateArchivingConfiguration
* @secure
*/
activateArchivingConfigurationCreate: (params = {}) => this.request({
path: `/activateArchivingConfiguration`,
method: "POST",
secure: true,
format: "json",
...params,
}),
};
this.archivingConfigurationsTenantName = {
/**
* @description This API is only present in the <b>Cloud Foundry environment.</b> You can use the following request to acitvate the archiving functionality in your tenant.
*
* @tags Data Archiving
* @name ArchivingConfigurationsList
* @summary Get archiving configuration for a tenant
* @request GET:/ArchivingConfigurations('{TenantName}')
* @secure
*/
archivingConfigurationsList: (tenantName, params = {}) => this.request({
path: `/ArchivingConfigurations('${tenantName}')`,
method: "GET",
secure: true,
format: "json",
...params,
}),
};
this.archivingKeyPerformanceIndicators = {
/**
* @description This API is only present in the <b>Cloud Foundry environment.</b> You can use the following request to get the Key Performance Indicators (KPIs) of the archiving runs.
*
* @tags Data Archiving
* @name ArchivingKeyPerformanceIndicatorsList
* @summary Get Key Performance Indicators of the archiving run
* @request GET:/ArchivingKeyPerformanceIndicators
* @secure
*/
archivingKeyPerformanceIndicatorsList: (query, params = {}) => this.request({
path: `/ArchivingKeyPerformanceIndicators`,
method: "GET",
query: query,
secure: true,
format: "json",
...params,
}),
};
}
}
exports.Api = Api;