UNPKG

@contiva/sap-integration-suite-client

Version:
658 lines (657 loc) 33.7 kB
"use strict"; /* 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 Stores * @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/1aab5e9482f545539a7caae3e9887e4e.html * * Message store enables you get data for processed messages. You can access the stored message and analyze it at a later point in time. An integration flow stores messages in a message store through the Persist step for 90 days. * Additionally, you can get information on the JMS resources available on the tenant as well as on those actually used by your integration flows. * 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.messageProcessingLogsMessageGuid = { /** * @description You can use the following request to get message store entries for the specified message Guid.<br> In API sandbox the integration flow '__Integration Flow with MessageStore - COMPLETED PROCESSING__' creates the corresponding message processing logs with message store entries. * * @tags Entries * @name MessageStoreEntriesList * @summary Get message store entries by message Guid. * @request GET:/MessageProcessingLogs('{MessageGuid}')/MessageStoreEntries * @secure */ messageStoreEntriesList: (messageGuid, params = {}) => this.request({ path: `/MessageProcessingLogs('${messageGuid}')/MessageStoreEntries`, method: "GET", secure: true, format: "json", ...params, }), }; this.messageStoreEntriesMessageStoreEntryId = { /** * @description You can use the following request to get entry from message store for a specific entry Id.<br> In API sandbox the integration flow '__Integration Flow with MessageStore COMPLETED PROCESSING__' creates the corresponding message processing logs with message store entries. * * @tags Entries * @name MessageStoreEntriesList * @summary Get message store entry by Id. * @request GET:/MessageStoreEntries('{MessageStoreEntryId}') * @secure */ messageStoreEntriesList: (messageStoreEntryId, params = {}) => this.request({ path: `/MessageStoreEntries('${messageStoreEntryId}')`, method: "GET", secure: true, format: "json", ...params, }), /** * @description You can use the following request to get message payload from message store for a specific entry Id.<br> In API sandbox the integration flow '__Integration Flow with MessageStore - COMPLETED PROCESSING__' creates the corresponding message processing logs with message store entries. * * @tags Entries * @name ValueList * @summary Get message payload from message store by entry Id. * @request GET:/MessageStoreEntries('{MessageStoreEntryId}')/$value * @secure */ valueList: (messageStoreEntryId, params = {}) => this.request({ path: `/MessageStoreEntries('${messageStoreEntryId}')/$value`, method: "GET", secure: true, ...params, }), /** * @description You can use the following request to get all attachments from the message store entry with specified entry Id.<br> In API sandbox the integration flow '__Integration Flow with MessageStore COMPLETED PROCESSING__' creates the corresponding message processing logs with message store entries and attachments. * * @tags Entry Attachments * @name AttachmentsList * @summary Get attachments from message store by entry Id. * @request GET:/MessageStoreEntries('{MessageStoreEntryId}')/Attachments * @secure */ attachmentsList: (messageStoreEntryId, params = {}) => this.request({ path: `/MessageStoreEntries('${messageStoreEntryId}')/Attachments`, method: "GET", secure: true, format: "json", ...params, }), /** * @description You can use the following request to get all properties of message store entry for the specified entry Id.<br> In API sandbox the integration flow '__Integration Flow with MessageStore - COMPLETED PROCESSING__' creates the corresponding message processing logs with message store entries and properties. * * @tags Entry Properties * @name PropertiesList * @summary Get all properties of message store by entry Id * @request GET:/MessageStoreEntries('{MessageStoreEntryId}')/Properties * @secure */ propertiesList: (messageStoreEntryId, params = {}) => this.request({ path: `/MessageStoreEntries('${messageStoreEntryId}')/Properties`, method: "GET", secure: true, format: "json", ...params, }), }; this.messageStoreEntryAttachmentsMessageStoreEntryAttachmentId = { /** * @description You can use the following request to get the attachment of a message store entry with specified attachment Id.<br> In API sandbox the integration flow '__Integration Flow with MessageStore - COMPLETED PROCESSING__' creates the corresponding message processing logs with message store entries and attachments. * * @tags Entry Attachments * @name MessageStoreEntryAttachmentsList * @summary Get attachment from message store by attachment Id. * @request GET:/MessageStoreEntryAttachments('{MessageStoreEntryAttachmentId}') * @secure */ messageStoreEntryAttachmentsList: (messageStoreEntryAttachmentId, params = {}) => this.request({ path: `/MessageStoreEntryAttachments('${messageStoreEntryAttachmentId}')`, method: "GET", secure: true, format: "json", ...params, }), /** * @description You can use the following request to get the attachment content of a message store entry with specified Id.<br> In API sandbox the integration flow '__Integration Flow with MessageStore - COMPLETED PROCESSING__' creates the corresponding message processing logs with message store entries and attachments. * * @tags Entry Attachments * @name ValueList * @summary Get attachment content from message store by attachment Id. * @request GET:/MessageStoreEntryAttachments('{MessageStoreEntryAttachmentId}')/$value * @secure */ valueList: (messageStoreEntryAttachmentId, params = {}) => this.request({ path: `/MessageStoreEntryAttachments('${messageStoreEntryAttachmentId}')/$value`, method: "GET", secure: true, ...params, }), /** * @description You can use the following request to get attachment properties of a message store entry for specified attachment Id.<br> In API sandbox the integration flow '__Integration Flow with MessageStore - COMPLETED PROCESSING__' creates the corresponding message processing logs with message store entries and attachments. * * @tags Entry Attachment Properties * @name PropertiesList * @summary Get attachment properties from message store by attachment Id. * @request GET:/MessageStoreEntryAttachments('{MessageStoreEntryAttachmentId}')/Properties * @secure */ propertiesList: (messageStoreEntryAttachmentId, params = {}) => this.request({ path: `/MessageStoreEntryAttachments('${messageStoreEntryAttachmentId}')/Properties`, method: "GET", secure: true, format: "json", ...params, }), }; this.messageStoreEntryAttachmentPropertiesAttachmentIdMessageStoreEntryAttachmentIdNameName = { /** * @description You can use the following request to get attachment properties of a message store entry for specified attachment Id and property name.<br> In API sandbox the integration flow '__Integration Flow with MessageStore - COMPLETED PROCESSING__' creates the corresponding message processing logs with message store entries and attachments. * * @tags Entry Attachment Properties * @name MessageStoreEntryAttachmentPropertiesAttachmentIdNameList * @summary Get attachment properties from message store by attachment Id and property name. * @request GET:/MessageStoreEntryAttachmentProperties(AttachmentId='{MessageStoreEntryAttachmentId}',Name='{Name}') * @secure */ messageStoreEntryAttachmentPropertiesAttachmentIdNameList: (messageStoreEntryAttachmentId, name, params = {}) => this.request({ path: `/MessageStoreEntryAttachmentProperties(AttachmentId='${messageStoreEntryAttachmentId}',Name='${name}')`, method: "GET", secure: true, format: "json", ...params, }), }; this.messageStoreEntryPropertiesMessageIdMessageStoreEntryIdNamePropertyName = { /** * @description You can use the following request to get property of message store entry for the specified entry Id and property name.<br> In API sandbox the integration flow '__Integration Flow with MessageStore - COMPLETED PROCESSING__' creates the corresponding message processing logs with message store entries and properties. * * @tags Entry Properties * @name MessageStoreEntryPropertiesMessageIdNameList * @summary Get property from message store by entry Id and property name. * @request GET:/MessageStoreEntryProperties(MessageId='{MessageStoreEntryID}',Name='{PropertyName}') * @secure */ messageStoreEntryPropertiesMessageIdNameList: (messageStoreEntryId, propertyName, params = {}) => this.request({ path: `/MessageStoreEntryProperties(MessageId='${messageStoreEntryId}',Name='${propertyName}')`, method: "GET", secure: true, format: "json", ...params, }), }; this.jmsBrokersBroker1 = { /** * @description You can use the following request to get information on the JMS resources available on the tenant as well as on those actually used by your integration flows.<br> Additional information about response values for some attributes: * __IsTransactedSessionsHigh__: __0__ - enough transactions available __1__ - number of transactions exceeding the allowed limit * __IsConsumerHigh__: __0__ - enough consumer available __1__ - number of consumers exceeding the allowed limits * __IsProducersHigh__: __0__ - enough producers available __1__ - number of producers exceeding the allowed limit * * @tags JMS Resources * @name JmsBrokersBroker1List * @summary Get available resources of JMS queues. * @request GET:/JmsBrokers('Broker1') * @secure */ jmsBrokersBroker1List: (query, params = {}) => this.request({ path: `/JmsBrokers('Broker1')`, method: "GET", query: query, secure: true, format: "json", ...params, }), }; this.numberRanges = { /** * @description You can use the following request to get the Number Range Objects available on the tenant.<br> There are two Number Ranges defined in API sandbox: '__NumberRange1__' and '__NumberRange2__' * * @tags Number Ranges * @name NumberRangesList * @summary Get available Number Ranges. * @request GET:/NumberRanges * @secure */ numberRangesList: (params = {}) => this.request({ path: `/NumberRanges`, method: "GET", secure: true, format: "json", ...params, }), /** * @description You can use the following request to add a Number Range Object.<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 update integration flows. * * @tags Number Ranges * @name NumberRangesCreate * @summary Add a Number Range Object. * @request POST:/NumberRanges * @secure */ numberRangesCreate: (NumberRanges, params = {}) => this.request({ path: `/NumberRanges`, method: "POST", body: NumberRanges, secure: true, type: ContentType.Json, ...params, }), }; this.numberRangesObjectName = { /** * @description You can use the following request to get the Number Range Object by a name.<br> There are two Number Ranges defined in API sandbox: '__NumberRange1__' and '__NumberRange2__' * * @tags Number Ranges * @name NumberRangesList * @summary Get specific Number Range by it's name'. * @request GET:/NumberRanges('{objectName}') * @secure */ numberRangesList: (objectName, params = {}) => this.request({ path: `/NumberRanges('${objectName}')`, method: "GET", secure: true, format: "json", ...params, }), /** * @description You can use the following request to update a Number Range Object.<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 update integration flows. * * @tags Number Ranges * @name NumberRangesUpdate * @summary Update a Number Range Object. * @request PUT:/NumberRanges('{objectName}') * @secure */ numberRangesUpdate: (objectName, NumberRanges, params = {}) => this.request({ path: `/NumberRanges('${objectName}')`, method: "PUT", body: NumberRanges, secure: true, type: ContentType.Json, ...params, }), /** * @description You can use the following request to delete a Number Range Object.<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 update integration flows. * * @tags Number Ranges * @name NumberRangesDelete * @summary Delete a Number Range Object. * @request DELETE:/NumberRanges('{objectName}') * @secure */ numberRangesDelete: (objectName, params = {}) => this.request({ path: `/NumberRanges('${objectName}')`, method: "DELETE", secure: true, ...params, }), }; this.dataStores = { /** * @description You can use the following request to get the Data Stores available on the tenant.<br> * * @tags Data Stores * @name DataStoresList * @summary Get available Data Stores. * @request GET:/DataStores * @secure */ dataStoresList: (query, params = {}) => this.request({ path: `/DataStores`, method: "GET", query: query, secure: true, format: "json", ...params, }), }; this.dataStoresDataStoreNameDataStoreNameIntegrationFlowIntegrationFlowIdTypeType = { /** * @description You can use the following request to get the Data Store by a name.<br> * * @tags Data Stores * @name DataStoresDataStoreNameIntegrationFlowTypeList * @summary Get specific Data Store by it's name'. * @request GET:/DataStores(DataStoreName='{DataStoreName}',IntegrationFlow='{IntegrationFlowId}',Type='{Type}') * @secure */ dataStoresDataStoreNameIntegrationFlowTypeList: (dataStoreName, integrationFlowId, type, params = {}) => this.request({ path: `/DataStores(DataStoreName='${dataStoreName}',IntegrationFlow='${integrationFlowId}',Type='${type}')`, method: "GET", secure: true, format: "json", ...params, }), /** * @description You can use the following request to delete a Data Store.<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 Data Stores. * * @tags Data Stores * @name DataStoresDataStoreNameIntegrationFlowTypeDelete * @summary Delete a Data Store. * @request DELETE:/DataStores(DataStoreName='{DataStoreName}',IntegrationFlow='{IntegrationFlowId}',Type='{Type}') * @secure */ dataStoresDataStoreNameIntegrationFlowTypeDelete: (dataStoreName, integrationFlowId, type, params = {}) => this.request({ path: `/DataStores(DataStoreName='${dataStoreName}',IntegrationFlow='${integrationFlowId}',Type='${type}')`, method: "DELETE", secure: true, ...params, }), /** * @description You can use the following request to get al Data Store entries for a specific Data Store available on the tenant.<br> * * @tags Data Stores * @name EntriesList * @summary Get all Data Store entries for a specific Data Store. * @request GET:/DataStores(DataStoreName='{DataStoreName}',IntegrationFlow='{IntegrationFlowId}',Type='{Type}')/Entries * @secure */ entriesList: (dataStoreName, integrationFlowId, type, query, params = {}) => this.request({ path: `/DataStores(DataStoreName='${dataStoreName}',IntegrationFlow='${integrationFlowId}',Type='${type}')/Entries`, method: "GET", query: query, secure: true, format: "json", ...params, }), }; this.dataStoreEntries = { /** * @description You can use the following request to get all Data Store entries available on the tenant.<br> * * @tags Data Stores * @name DataStoreEntriesList * @summary Get all Data Store entries. * @request GET:/DataStoreEntries * @secure */ dataStoreEntriesList: (query, params = {}) => this.request({ path: `/DataStoreEntries`, method: "GET", query: query, secure: true, format: "json", ...params, }), }; this.dataStoreEntriesIdIdDataStoreNameDataStoreNameIntegrationFlowIntegrationFlowIdTypeType = { /** * @description You can use the following request to get a Data Store entry.<br> * * @tags Data Stores * @name DataStoreEntriesIdDataStoreNameIntegrationFlowTypeList * @summary Get specific Data Store entry by it's Id'. * @request GET:/DataStoreEntries(Id='{Id}',DataStoreName='{DataStoreName}',IntegrationFlow='{IntegrationFlowId}',Type='{Type}') * @secure */ dataStoreEntriesIdDataStoreNameIntegrationFlowTypeList: (id, dataStoreName, integrationFlowId, type, params = {}) => this.request({ path: `/DataStoreEntries(Id='${id}',DataStoreName='${dataStoreName}',IntegrationFlow='${integrationFlowId}',Type='${type}')`, method: "GET", secure: true, format: "json", ...params, }), /** * @description You can use the following request to delete a Data Store entry.<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 Data Stores. * * @tags Data Stores * @name DataStoreEntriesIdDataStoreNameIntegrationFlowTypeDelete * @summary Delete a Data Store entry. * @request DELETE:/DataStoreEntries(Id='{Id}',DataStoreName='{DataStoreName}',IntegrationFlow='{IntegrationFlowId}',Type='{Type}') * @secure */ dataStoreEntriesIdDataStoreNameIntegrationFlowTypeDelete: (id, dataStoreName, integrationFlowId, type, params = {}) => this.request({ path: `/DataStoreEntries(Id='${id}',DataStoreName='${dataStoreName}',IntegrationFlow='${integrationFlowId}',Type='${type}')`, method: "DELETE", secure: true, ...params, }), /** * @description You can use the following request to download a Data Store entry content.<br> * * @tags Data Stores * @name ValueList * @summary Download content of a specific Data Store entry by it's Id'. * @request GET:/DataStoreEntries(Id='{Id}',DataStoreName='{DataStoreName}',IntegrationFlow='{IntegrationFlowId}',Type='{Type}')/$value * @secure */ valueList: (id, dataStoreName, integrationFlowId, type, params = {}) => this.request({ path: `/DataStoreEntries(Id='${id}',DataStoreName='${dataStoreName}',IntegrationFlow='${integrationFlowId}',Type='${type}')/$value`, method: "GET", secure: true, ...params, }), }; this.variables = { /** * @description You can use the following request to get all Variables entries available on the tenant.<br> * * @tags Variables * @name VariablesList * @summary Get all Variables entries. * @request GET:/Variables * @secure */ variablesList: (params = {}) => this.request({ path: `/Variables`, method: "GET", secure: true, format: "json", ...params, }), }; this.variablesVariableNameVariableNameIntegrationFlowIntegrationFlowId = { /** * @description You can use the following request to get the Variable by a name.<br> * * @tags Variables * @name VariablesVariableNameIntegrationFlowList * @summary Get specific Variable by it's name'. * @request GET:/Variables(VariableName='{VariableName}',IntegrationFlow='{IntegrationFlowId}') * @secure */ variablesVariableNameIntegrationFlowList: (variableName, integrationFlowId, params = {}) => this.request({ path: `/Variables(VariableName='${variableName}',IntegrationFlow='${integrationFlowId}')`, method: "GET", secure: true, format: "json", ...params, }), /** * @description You can use the following request to delete a Variable.<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 Variables. * * @tags Variables * @name VariablesVariableNameIntegrationFlowDelete * @summary Delete a Variable. * @request DELETE:/Variables(VariableName='{VariableName}',IntegrationFlow='{IntegrationFlowId}') * @secure */ variablesVariableNameIntegrationFlowDelete: (variableName, integrationFlowId, params = {}) => this.request({ path: `/Variables(VariableName='${variableName}',IntegrationFlow='${integrationFlowId}')`, method: "DELETE", secure: true, ...params, }), /** * @description You can use the following request to get the content of a Variable by a name.<br> * * @tags Variables * @name ValueList * @summary Downlaod Variable's content by it's name'. * @request GET:/Variables(VariableName='{VariableName}',IntegrationFlow='{IntegrationFlowId}')/$value * @secure */ valueList: (variableName, integrationFlowId, params = {}) => this.request({ path: `/Variables(VariableName='${variableName}',IntegrationFlow='${integrationFlowId}')/$value`, method: "GET", secure: true, ...params, }), }; } } exports.Api = Api;