-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.js
47 lines (39 loc) · 1.19 KB
/
index.js
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
42
43
44
45
46
// Copyright IBM Corp. 2017. All Rights Reserved.
// Node module: loopback-soap
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
var SoapGenerator = require('./lib/codegen/generator-soap');
function getGenerator() {
var generator = new SoapGenerator();
return generator;
}
/**
* Generate remote methods from soap spec
* @param {Object} spec
* @param {Object} options
* @returns {String}
*/
exports.generateRemoteMethods = function(spec, options) {
return getGenerator().generateRemoteMethods(spec, options);
};
/**
* Generate remote methods for an array of operations
* @param {String|Number} version
* @param {String} modelName
* @param {BaseOperation[]} operations
* @returns {String}
*/
exports.generateCode = function(version, modelName, operations) {
return getGenerator().generateCodeForOperations(modelName, operations);
};
/**
* Generate model definitions
* @param {Object} spec soap spec
* @param {Object} options
* @returns {Object}
*/
exports.generateModels = function(wsdl, operations, options) {
return getGenerator().generateModels(wsdl, operations);
};
exports.getGenerator = getGenerator;