-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from partik03/oracle_parser
Oracle SDK Parser
- Loading branch information
Showing
25 changed files
with
45,868 additions
and
12,103 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
"use strict"; | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.filterAWSMethods = exports.groupAWSMethods = void 0; | ||
function groupAWSMethods(methods) { | ||
var methodArr = Object.values( | ||
methods.reduce(function(result, _a) { | ||
var functionName = _a.functionName, | ||
SDKFunctionName = _a.SDKFunctionName, | ||
params = _a.params; | ||
// Create new group | ||
if (!result[functionName]) | ||
result[functionName] = { | ||
functionName: functionName, | ||
array: [] | ||
}; | ||
// Append to group | ||
result[functionName].array.push({ | ||
functionName: functionName, | ||
SDKFunctionName: SDKFunctionName, | ||
params: params | ||
}); | ||
return result; | ||
}, {}) | ||
); | ||
return methodArr; | ||
var methodArr = Object.values( | ||
methods.reduce(function(result, _a) { | ||
var functionName = _a.functionName, | ||
SDKFunctionName = _a.SDKFunctionName, | ||
params = _a.params; | ||
// Create new group | ||
if (!result[functionName]) | ||
result[functionName] = { | ||
functionName: functionName, | ||
array: [], | ||
}; | ||
// Append to group | ||
result[functionName].array.push({ | ||
functionName: functionName, | ||
SDKFunctionName: SDKFunctionName, | ||
params: params, | ||
}); | ||
return result; | ||
}, {}) | ||
); | ||
return methodArr; | ||
} | ||
exports.groupAWSMethods = groupAWSMethods; | ||
function filterAWSMethods(groupedMethods) { | ||
var methods = []; | ||
groupedMethods.map(function(group) { | ||
group.array.sort(function(a, b) { | ||
return a.params.length - b.params.length; | ||
}); | ||
methods.push(group.array.slice(-1)[0]); | ||
}); | ||
return methods; | ||
var methods = []; | ||
groupedMethods.map(function(group) { | ||
group.array.sort(function(a, b) { | ||
return a.params.length - b.params.length; | ||
}); | ||
methods.push(group.array.slice(-1)[0]); | ||
}); | ||
return methods; | ||
} | ||
exports.filterAWSMethods = filterAWSMethods; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,60 @@ | ||
"use strict"; | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.filterAzureMethods = exports.groupAzureMethods = void 0; | ||
function groupAzureMethods(methods) { | ||
var methodArr = Object.values( | ||
methods.reduce(function(result, _a) { | ||
var functionName = _a.functionName, | ||
SDKFunctionName = _a.SDKFunctionName, | ||
params = _a.params, | ||
pkgName = _a.pkgName, | ||
fileName = _a.fileName, | ||
client = _a.client, | ||
returnType = _a.returnType; | ||
// Create new group | ||
if (!result[functionName]) | ||
result[functionName] = { | ||
functionName: functionName, | ||
array: [] | ||
}; | ||
// Append to group | ||
result[functionName].array.push({ | ||
functionName: functionName, | ||
SDKFunctionName: SDKFunctionName, | ||
params: params, | ||
pkgName: pkgName, | ||
fileName: fileName, | ||
client: client, | ||
returnType: returnType | ||
}); | ||
return result; | ||
}, {}) | ||
); | ||
return methodArr; | ||
var methodArr = Object.values( | ||
methods.reduce(function(result, _a) { | ||
var functionName = _a.functionName, | ||
SDKFunctionName = _a.SDKFunctionName, | ||
params = _a.params, | ||
pkgName = _a.pkgName, | ||
fileName = _a.fileName, | ||
client = _a.client, | ||
returnType = _a.returnType; | ||
// Create new group | ||
if (!result[functionName]) | ||
result[functionName] = { | ||
functionName: functionName, | ||
array: [], | ||
}; | ||
// Append to group | ||
result[functionName].array.push({ | ||
functionName: functionName, | ||
SDKFunctionName: SDKFunctionName, | ||
params: params, | ||
pkgName: pkgName, | ||
fileName: fileName, | ||
client: client, | ||
returnType: returnType, | ||
}); | ||
return result; | ||
}, {}) | ||
); | ||
return methodArr; | ||
} | ||
exports.groupAzureMethods = groupAzureMethods; | ||
function filterAzureMethods(groupedMethods) { | ||
var methods = []; | ||
groupedMethods.map(function(group) { | ||
if (group.array.length === 1) { | ||
methods.push(group.array[0]); | ||
} else { | ||
var methodPushed_1 = false; | ||
group.array.map(function(method) { | ||
if ( | ||
!method.params.find(function(param) { | ||
return param.name === "callback"; | ||
}) | ||
) { | ||
methods.push(method); | ||
methodPushed_1 = true; | ||
} | ||
}); | ||
if (!methodPushed_1) { | ||
methods.push(group.array[0]); | ||
} | ||
} | ||
}); | ||
return methods; | ||
var methods = []; | ||
groupedMethods.map(function(group) { | ||
if (group.array.length === 1) { | ||
methods.push(group.array[0]); | ||
} else { | ||
var methodPushed_1 = false; | ||
group.array.map(function(method) { | ||
if ( | ||
!method.params.find(function(param) { | ||
return param.name === 'callback'; | ||
}) | ||
) { | ||
methods.push(method); | ||
methodPushed_1 = true; | ||
} | ||
}); | ||
if (!methodPushed_1) { | ||
methods.push(group.array[0]); | ||
} | ||
} | ||
}); | ||
return methods; | ||
} | ||
exports.filterAzureMethods = filterAzureMethods; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,64 @@ | ||
"use strict"; | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.filterGCPMethods = exports.groupGCPMethods = void 0; | ||
function groupGCPMethods(methods) { | ||
var methodArr = Object.values( | ||
methods.reduce(function(result, _a) { | ||
var functionName = _a.functionName, | ||
SDKFunctionName = _a.SDKFunctionName, | ||
params = _a.params, | ||
pkgName = _a.pkgName, | ||
fileName = _a.fileName, | ||
client = _a.client, | ||
returnType = _a.returnType, | ||
returnTypeName = _a.returnTypeName, | ||
classConstructorData = _a.classConstructorData; | ||
// Create new group | ||
if (!result[functionName]) | ||
result[functionName] = { | ||
functionName: functionName, | ||
array: [] | ||
}; | ||
// Append to group | ||
result[functionName].array.push({ | ||
functionName: functionName, | ||
SDKFunctionName: SDKFunctionName, | ||
params: params, | ||
pkgName: pkgName, | ||
fileName: fileName, | ||
client: client, | ||
returnType: returnType, | ||
returnTypeName: returnTypeName, | ||
classConstructorData: classConstructorData | ||
}); | ||
return result; | ||
}, {}) | ||
); | ||
return methodArr; | ||
var methodArr = Object.values( | ||
methods.reduce(function(result, _a) { | ||
var functionName = _a.functionName, | ||
SDKFunctionName = _a.SDKFunctionName, | ||
params = _a.params, | ||
pkgName = _a.pkgName, | ||
fileName = _a.fileName, | ||
client = _a.client, | ||
returnType = _a.returnType, | ||
returnTypeName = _a.returnTypeName, | ||
classConstructorData = _a.classConstructorData; | ||
// Create new group | ||
if (!result[functionName]) | ||
result[functionName] = { | ||
functionName: functionName, | ||
array: [], | ||
}; | ||
// Append to group | ||
result[functionName].array.push({ | ||
functionName: functionName, | ||
SDKFunctionName: SDKFunctionName, | ||
params: params, | ||
pkgName: pkgName, | ||
fileName: fileName, | ||
client: client, | ||
returnType: returnType, | ||
returnTypeName: returnTypeName, | ||
classConstructorData: classConstructorData, | ||
}); | ||
return result; | ||
}, {}) | ||
); | ||
return methodArr; | ||
} | ||
exports.groupGCPMethods = groupGCPMethods; | ||
function filterGCPMethods(groupedMethods) { | ||
var methods = []; | ||
groupedMethods.map(function(group) { | ||
if (group.array.length === 1) { | ||
methods.push(group.array[0]); | ||
} else { | ||
var methodPushed_1 = false; | ||
group.array.map(function(method) { | ||
if ( | ||
!method.params.find(function(param) { | ||
return param.name === "callback"; | ||
}) | ||
) { | ||
methods.push(method); | ||
methodPushed_1 = true; | ||
} | ||
}); | ||
if (!methodPushed_1) { | ||
methods.push(group.array[0]); | ||
} | ||
} | ||
}); | ||
return methods; | ||
var methods = []; | ||
groupedMethods.map(function(group) { | ||
if (group.array.length === 1) { | ||
methods.push(group.array[0]); | ||
} else { | ||
var methodPushed_1 = false; | ||
group.array.map(function(method) { | ||
if ( | ||
!method.params.find(function(param) { | ||
return param.name === 'callback'; | ||
}) | ||
) { | ||
methods.push(method); | ||
methodPushed_1 = true; | ||
} | ||
}); | ||
if (!methodPushed_1) { | ||
methods.push(group.array[0]); | ||
} | ||
} | ||
}); | ||
return methods; | ||
} | ||
exports.filterGCPMethods = filterGCPMethods; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
"use strict"; | ||
'use strict'; | ||
exports.__esModule = true; | ||
exports.getDir = exports.filters = exports.groupers = exports.printFile = void 0; | ||
var fs = require("fs"); | ||
var awsHelper_1 = require("../lib/aws/awsHelper"); | ||
var gcpHelper_1 = require("../lib/googleCloud/gcpHelper"); | ||
var azureHelper_1 = require("../lib/azure/azureHelper"); | ||
var awsHelper_2 = require("../lib/aws/awsHelper"); | ||
var gcpHelper_2 = require("../lib/googleCloud/gcpHelper"); | ||
var azureHelper_2 = require("../lib/azure/azureHelper"); | ||
exports.groupers = exports.getDir = exports.filters = exports.printFile = void 0; | ||
var fs = require('fs'); | ||
var awsHelper_1 = require('../lib/aws/awsHelper'); | ||
var awsHelper_2 = require('../lib/aws/awsHelper'); | ||
var azureHelper_1 = require('../lib/azure/azureHelper'); | ||
var azureHelper_2 = require('../lib/azure/azureHelper'); | ||
var gcpHelper_1 = require('../lib/googleCloud/gcpHelper'); | ||
var gcpHelper_2 = require('../lib/googleCloud/gcpHelper'); | ||
var dirMap = { | ||
appServices: ["PaaS"], | ||
compute: ["ComputeInstance", "Kubernetes", "Container"], | ||
database: ["NoSqlIndexed", "RDBMS", "NoSql"], | ||
management: ["Monitoring", "KeyManagement", "NotificationService"], | ||
network: ["DNS", "LoadBalancer"], | ||
security: ["IAM"], | ||
storage: ["StorageBucket", "BlockStorage", "ArchivalStorage"], | ||
artificialinteligence: ["Translation"] | ||
appServices: ['PaaS'], | ||
compute: ['ComputeInstance', 'Kubernetes', 'Container'], | ||
database: ['NoSqlIndexed', 'RDBMS', 'NoSql'], | ||
management: ['Monitoring', 'KeyManagement', 'NotificationService'], | ||
network: ['DNS', 'LoadBalancer'], | ||
security: ['IAM'], | ||
storage: ['StorageBucket', 'BlockStorage', 'ArchivalStorage'], | ||
artificialinteligence: ['Translation'], | ||
}; | ||
function printFile(fileName, data) { | ||
fs.writeFile(fileName, data, function(err) { | ||
if (err) throw err; | ||
}); | ||
fs.writeFile(fileName, data, function(err) { | ||
if (err) throw err; | ||
}); | ||
} | ||
exports.printFile = printFile; | ||
var groupers = { | ||
aws: awsHelper_1.groupAWSMethods, | ||
gcp: gcpHelper_1.groupGCPMethods, | ||
azure: azureHelper_1.groupAzureMethods | ||
aws: awsHelper_1.groupAWSMethods, | ||
gcp: gcpHelper_1.groupGCPMethods, | ||
azure: azureHelper_1.groupAzureMethods, | ||
}; | ||
exports.groupers = groupers; | ||
var filters = { | ||
aws: awsHelper_2.filterAWSMethods, | ||
gcp: gcpHelper_2.filterGCPMethods, | ||
azure: azureHelper_2.filterAzureMethods | ||
aws: awsHelper_2.filterAWSMethods, | ||
gcp: gcpHelper_2.filterGCPMethods, | ||
azure: azureHelper_2.filterAzureMethods, | ||
}; | ||
exports.filters = filters; | ||
var getDir = function(service) { | ||
for (var dir in dirMap) { | ||
if (dirMap[dir].includes(service)) { | ||
return dir; | ||
} | ||
} | ||
throw new Error("Not a valid service: " + service); | ||
for (var dir in dirMap) { | ||
if (dirMap[dir].includes(service)) { | ||
return dir; | ||
} | ||
} | ||
throw new Error('Not a valid service: ' + service); | ||
}; | ||
exports.getDir = getDir; |
Oops, something went wrong.