UNPKG

@contiva/sap-integration-suite-client

Version:
131 lines (130 loc) 4.06 kB
/** * SAP Cloud Platform Integration API Client * * A complete library for interacting with SAP Cloud Integration APIs. * Provides type-safe access to all SAP CPI API endpoints with built-in authentication handling. * * @packageDocumentation * @module sap-integration-suite-client * @example * // Using the default client (requires environment variables) * import { defaultClient } from 'sap-integration-suite-client'; * * const packages = await defaultClient.integrationContent.integrationPackages.integrationPackagesList(); * * @example * // Creating a custom client * import SapClient from 'sap-integration-suite-client'; * * const client = new SapClient({ * baseUrl: 'https://tenant.sap-api.com/api/v1', * oauthClientId: 'client-id', * oauthClientSecret: 'client-secret', * oauthTokenUrl: 'https://tenant.authentication.sap.hana.ondemand.com/oauth/token' * }); */ import SapClient, { SapClientConfig } from './clients/sap-client'; import { IntegrationContentClient } from './wrapper/integration-content-client'; import { IntegrationContentAdvancedClient } from './wrapper/custom/integration-content-advanced-client'; import { LogFilesClient } from './wrapper/log-files-client'; import { MessageProcessingLogsClient } from './wrapper/message-processing-logs-client'; import { MessageStoreClient } from './wrapper/message-store-client'; import { SecurityContentClient } from './wrapper/security-content-client'; import { formatSapTimestampsInObject, SapDateUtils } from './utils/date-formatter'; import { enhanceLogsWithDates } from './utils/log-enhancer'; import { buildODataFilter } from './utils/odata-filter-builder'; import * as IntegrationContentTypes from './types/sap.IntegrationContent'; import * as LogFilesTypes from './types/sap.LogFiles'; import * as MessageProcessingLogsTypes from './types/sap.MessageProcessingLogs'; import * as MessageStoreTypes from './types/sap.MessageStore'; import * as SecurityContentTypes from './types/sap.SecurityContent'; import * as EnhancedLogTypes from './types/enhanced-logs'; declare const defaultClientProxy: SapClient; export default SapClient; /** * Export named components from the library */ export { /** * Default client instance that reads from environment variables * Use only if you have environment variables properly configured * * Note: This client is lazy-loaded - it will only be created when actually accessed, * not at import time. This helps avoid environment variable issues during import. */ defaultClientProxy as defaultClient, /** * Configuration interface for creating SapClient instances */ SapClientConfig, /** * Main client class for interacting with SAP APIs */ SapClient, /** * Utility function to format SAP timestamps in API responses * * @param {any} obj - The object containing SAP timestamps to format * @returns {any} - The same object with formatted timestamps */ formatSapTimestampsInObject, /** * Utility class for SAP date handling */ SapDateUtils, /** * Utility function to enhance SAP logs with Date objects */ enhanceLogsWithDates, /** * Utility function to build OData filter expressions */ buildODataFilter, /** * Type definitions for Integration Content API */ IntegrationContentTypes, /** * Type definitions for Log Files API */ LogFilesTypes, /** * Type definitions for Message Processing Logs API */ MessageProcessingLogsTypes, /** * Type definitions for Message Store API */ MessageStoreTypes, /** * Type definitions for Security Content API */ SecurityContentTypes, /** * Enhanced type definitions for Message Processing Logs */ EnhancedLogTypes, /** * Integration Content Client */ IntegrationContentClient, /** * Integration Content Advanced Client with extended functionality */ IntegrationContentAdvancedClient, /** * Log Files Client Wrapper */ LogFilesClient, /** * Message Processing Logs Client Wrapper */ MessageProcessingLogsClient, /** * Message Store Client Wrapper */ MessageStoreClient, /** * Security Content Client Wrapper */ SecurityContentClient };