All files index.js

100% Statements 3/3
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41                          1x                                       2x     1x        
'use strict';
 
/**
 * @module @onlineapps/conn-orch-api-mapper
 * @description API mapping connector that maps cookbook operations to HTTP endpoints.
 * Handles OpenAPI parsing, request transformation, and response mapping.
 *
 * @see {@link https://github.com/onlineapps/oa-drive/tree/main/shared/connector/conn-orch-api-mapper|GitHub Repository}
 * @author OA Drive Team
 * @license MIT
 * @since 1.0.0
 */
 
const ApiMapper = require('./ApiMapper');
 
/**
 * Create API mapper instance
 * @function create
 * @param {Object} config - Configuration options
 * @param {Object|string} config.openApiSpec - OpenAPI specification object or path
 * @param {string} config.serviceUrl - Base URL of the service
 * @param {Object} [config.service] - Express app instance for direct calls
 * @param {boolean} [config.directCall=false] - Use direct Express calls instead of HTTP
 * @param {Object} [config.logger] - Logger instance
 * @returns {ApiMapper} New API mapper instance
 *
 * @example
 * const apiMapper = create({
 *   openApiSpec: require('./openapi.json'),
 *   serviceUrl: 'http://localhost:3000'
 * });
 */
function create(config) {
  return new ApiMapper(config);
}
 
module.exports = {
  ApiMapper,
  create,
  VERSION: '1.0.0'
};