Skip to content

Commit

Permalink
fix: Handle raw message in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Dec 3, 2019
1 parent 97c26cc commit 53ffa0d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/daf-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import './services'
import './data-explorer'
import './graphql'
import './sdr'
import './msg'

program.parse(process.argv)
if (!process.argv.slice(2).length) {
Expand Down
21 changes: 21 additions & 0 deletions packages/daf-cli/src/msg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { core } from './setup'
import program from 'commander'

program
.command('msg <raw>')
.description('Handle raw message (JWT)')
.action(async raw => {
try {
const result = await core.onRawMessage({
raw,
meta: [
{
sourceType: 'cli',
},
],
})
console.log(result)
} catch (e) {
console.error(e)
}
})

0 comments on commit 53ffa0d

Please sign in to comment.