gd-sprest-def
Advanced tools
Comparing version 1.6.5 to 1.6.6
24
main.js
@@ -726,3 +726,4 @@ let fs = require("fs"); | ||
let methods = []; | ||
let odataMethods = []; | ||
let odataResults = []; | ||
let prevName = null; | ||
for (let method of entity.methods) { | ||
@@ -741,8 +742,19 @@ // Add the method | ||
let methodsType = returnType == "void" || isComplexType || isCollection ? "" : " & " + returnTypeName + "Methods"; | ||
methods.push(`\t${method.name}(${argStrings.join(", ")}): ${isCollection ? "IBaseCollection" : "IBaseQuery"}<${returnTypeName}${isCollection && !isComplexType ? ", " + returnTypeName + "OData" : ""}>${methodsType}${method.returnType2 && getGraphType(method.returnType2, true) ? " & " + getGraphType(method.returnType2, true) : ""};`); | ||
let methodString = `\t${method.name}(${argStrings.join(", ")}): ${isCollection ? "IBaseCollection" : "IBaseQuery"}<${returnTypeName}${isCollection && !isComplexType ? ", " + returnTypeName + "OData" : ""}>${methodsType}${method.returnType2 && getGraphType(method.returnType2, true) ? " & " + getGraphType(method.returnType2, true) : ""};`; | ||
methods.push(methodString); | ||
// See if this is a collection | ||
if (isCollection) { | ||
odataMethods.push(`\t${method.name}: ${isCollection ? "IBaseResults<" : ""}${returnTypeName}${isCollection ? ">" : ""};`); | ||
// Ensure we haven't already added it | ||
if (method.name != prevName) { | ||
// See if it has args | ||
if (argStrings.length > 0) { | ||
// Add the odata result | ||
odataResults.push(methodString); | ||
} else { | ||
// Add the odata result | ||
odataResults.push(`\t${method.name}: ${isCollection ? "IBaseResults<" : ""}${returnTypeName}${isCollection ? ">" : ""};`); | ||
} | ||
} | ||
// Set the previous name | ||
prevName = method.name; | ||
} | ||
@@ -762,3 +774,3 @@ | ||
export interface ${name}OData { | ||
${odataMethods.join('\n')} | ||
${odataResults.join('\n')} | ||
}`); | ||
@@ -765,0 +777,0 @@ } |
{ | ||
"name": "gd-sprest-def", | ||
"version": "1.6.5", | ||
"version": "1.6.6", | ||
"description": "TypeScript definition files generated from the $metadata REST endpoint in SharePoint.", | ||
@@ -5,0 +5,0 @@ "author": "Gunjan Datta <me@dattabase.com> (https://gunjandatta.github.io)", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11058569
111126