@quorum/schematics
Advanced tools
Comparing version 0.0.10 to 0.0.11
{ | ||
"name": "@quorum/schematics", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "A schematics Library for Quorum", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -12,3 +12,3 @@ import { StoredProcedure } from "common/message-broker"; | ||
export class <%= classify(name) %>s { | ||
export class <%= classify(name) %> { | ||
@@ -15,0 +15,0 @@ static create<%= classify(nameSingular) %>(<%= nameSingular %> : <%= classify(nameSingular) %>, routingDetails: any): BrokerMessagePayload { |
import { Server } from 'restify'; | ||
import { EventEmitter } from 'events'; | ||
import { <%= classify(nameSingular) %>s } from './<%= dasherize(nameSingular) %>.class'; | ||
import { <%= classify(nameSingular) %>s } from './<%= dasherize(nameSingular) %>s.class'; | ||
import { MessageBrokerDataTerminal } from 'common/message-broker/message-broker-dataterminal'; | ||
@@ -34,3 +34,3 @@ import { BrokerMessage } from 'common/message-broker/models/dataterminal/broker-message'; | ||
emitter.removeAllListeners(); | ||
res.json(msg.payload.recordsets[0][0]); | ||
res.json(msg.payloads[0].recordsets[0][0]); | ||
}); | ||
@@ -65,3 +65,3 @@ dtBroker.consumeQueue(queue, emitter); | ||
//res.json([]); | ||
res.json(msg.payload.recordsets[0]); | ||
res.json(msg.payloads[0].recordsets[0]); | ||
}); | ||
@@ -86,3 +86,3 @@ dtBroker.consumeQueue(queue, emitter); | ||
); | ||
brokerMessage.payloads.push( <%= classify(nameSingular) %>.create<%= classify(nameSingular) %>(req.body, { | ||
brokerMessage.payloads.push( <%= classify(nameSingular) %>s.create<%= classify(nameSingular) %>(req.body, { | ||
server: req.routingDetails.databaseServer, | ||
@@ -100,3 +100,3 @@ dsn: req.routingDetails.databaseName, | ||
//res.json([]); | ||
res.json(msg.payload.recordsets[0]); | ||
res.json(msg.payloads[0].recordsets[0]); | ||
}); | ||
@@ -133,3 +133,3 @@ dtBroker.consumeQueue(queue, emitter); | ||
emitter.removeAllListeners(); | ||
res.json(msg.payload.recordsets[0][0]); | ||
res.json(msg.payloads[0].recordsets[0][0]); | ||
}); | ||
@@ -136,0 +136,0 @@ dtBroker.consumeQueue(queue, emitter); |
@@ -42,7 +42,7 @@ import { StoredProcedure } from "common/message-broker"; | ||
); | ||
result.payload = <%= classify(nameSingular) %>s.create<%= classify(nameSingular) %>(<%= nameSingular %> , { | ||
result.payloads.push( <%= classify(nameSingular) %>s.create<%= classify(nameSingular) %>(<%= nameSingular %> , { | ||
server: process.env.TESTING_SERVER, | ||
dsn: process.env.TEMP_DB, | ||
version: 1 | ||
}); | ||
})); | ||
@@ -62,3 +62,3 @@ eventHandler.handleRequest(result) | ||
it('it should have 1 record', () => { | ||
expect(response.payload.recordsets[0].length).to.equal(1); | ||
expect(response.payloads[0].recordsets[0].length).to.equal(1); | ||
}); | ||
@@ -73,7 +73,7 @@ }); | ||
); | ||
result.payload = <%= classify(nameSingular) %>s.get<%= classify(nameSingular) %>(<%= nameSingular %>.id, { | ||
result.payloads.push(<%= classify(nameSingular) %>s.get<%= classify(nameSingular) %>(<%= nameSingular %>.id, { | ||
server: process.env.TESTING_SERVER, | ||
dsn: process.env.TEMP_DB, | ||
version: 1 | ||
}); | ||
})); | ||
eventHandler.handleRequest(result).then((res: BrokerMessage) => { | ||
@@ -87,6 +87,6 @@ response = res; | ||
it('it should have 1 record', () => { | ||
expect(response.payload.recordsets[0].length).to.equal(1); | ||
expect(response.payloads[0].recordsets[0].length).to.equal(1); | ||
}); | ||
it('it should have all the correct properties', () => { | ||
expect(response.payload.recordsets[0][0]).to.have.all.keys(<%= nameSingular %>); | ||
expect(response.payloads[0].recordsets[0][0]).to.have.all.keys(<%= nameSingular %>); | ||
}); | ||
@@ -93,0 +93,0 @@ }); |
29324