1.0.6 • Published 12 months ago

trace-prisma v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

The application is intended to log certain transactions in the mongodb database, each transaction has a name, status and a trace(optional), a trace has a name, status, body(json). Each time your code runs and has the "transaction.start" method, a new transaction will be created When using one of the methods that will update the transaction, only the most current transaction will be changed. The transaction has five methods: - start: creates a transaction (with pending status) - alert: sets the status to alert - rejected: sets the status to rejected - error: sets the status to error - success: sets the status to success - trace: create a trace

npm i trace-prisma
const { Transection } = require('trace-prisma')

const transaction = new Transection('646faf02b716b92a81bfc181') //Job id

async function test() {
    await transaction.start('Transaction_name')

    await transaction.trace('Transaction_name', {body: {name: 'Jhon', age: 20}}, 'success', 'traceName')
    
    if (true){
        await transaction.success('Transaction_name')
    }
}

test()
1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago