plexiform-build-apicmds
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ # MyProject |
@@ -12,3 +12,3 @@ /* jshint esversion: 6, laxcomma: true */ | ||
name: "plexiform-build-apicmds", | ||
version: "0.1.0", | ||
version: "0.2.0", | ||
author: "Raith" | ||
@@ -15,0 +15,0 @@ }; |
{ | ||
"name": "plexiform-build-apicmds", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "A plexiform build script for generating a class library of Commands implementations for a back-end api", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ # plexiform-build-apicmds |
@@ -6,9 +6,2 @@ // jshint esversion: 6 | ||
function buildClassCommand (com) { | ||
var cs = ""; | ||
cs += `\n\t\tpublic ${com.name}ResponsePayload ${com.name} (${com.name}RequestPayload payload)`; | ||
cs += `{\n\t\t\treturn null;\n\t\t}`; | ||
return cs; | ||
} | ||
return `${u.header()} | ||
@@ -24,5 +17,26 @@ | ||
public class Commands : ICommands { | ||
${ | ||
(x.commands || []).map(buildClassCommand).join("\n") | ||
${ (x.commands || []).map(com => ` | ||
public ${com.name}ResponsePayload ${com.name} (${com.name}RequestPayload payload) | ||
{ | ||
/* REQUEST payload | ||
${(com.request_params || []).map(p => `${u.paramIsObject(p) ? p.type : c.types[p.type].cs} ${p.name}`).join('\n\t\t\t\t') } | ||
*/ | ||
var response = new ${com.name}ResponsePayload(); | ||
/* RESPONSE payload | ||
${(com.response_params || []).map(p => `${u.paramIsObject(p) ? p.type : c.types[p.type].cs} ${p.name}`).join('\n\t\t\t\t') } | ||
*/ | ||
using (var db = new ${c.namespaces.data || c.namespaces.entity}.${c.application.name}DbContext()) { | ||
// CRUD for all entities | ||
${c.entities ? c.entities.map(e => `var crud${e.name} = new Crudus<${e.name}>(db);`).join('\n\t\t\t\t') : ''} | ||
// Implement your business logic and data manipulation here | ||
Console.WriteLine("CMD: plugin implementation of ${com.name}"); | ||
} | ||
return response; | ||
} | ||
`).join("\n") } | ||
} | ||
@@ -29,0 +43,0 @@ } |
@@ -10,3 +10,3 @@ // jshint esversion: 6 | ||
<ItemGroup> | ||
<ProjectReference Include="..\\${c.application.name}\\${c.application.name}.csproj" /> | ||
<ProjectReference Include="..\\${c.application.name}Service\\${c.application.name}Service.csproj" /> | ||
</ItemGroup> | ||
@@ -13,0 +13,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
11576
225
1