Commit f94e9bf1 authored by Panagiotis Skarvelis's avatar Panagiotis Skarvelis
Browse files

revert has benefits

parent d466b3bf
......@@ -2,16 +2,16 @@ import soap from './soap';
import {generateAuditRecord,AuditRecord} from '@digigov-oss/gsis-audit-record-db';
export type Overides = {
test?:boolean;
prod?:boolean;
auditInit?: AuditRecord;
auditStoragePath?: string;
}
import config from './config.json';
export const getIdentity = async (afm:string, user:string, pass:string, overides?:Overides) => {
const test = overides?.test ?? false;
const prod = overides?.prod ?? false;
const auditInit = overides?.auditInit ?? {} as AuditRecord;
const auditStoragePath = overides?.auditStoragePath ?? "/tmp"
const wsdl = test==true? config.test.wsdl : config.prod.wsdl;
const wsdl = prod==true? config.prod.wsdl : config.test.wsdl;
const auditRecord = generateAuditRecord(auditInit, auditStoragePath);
if (!auditRecord) throw new Error('Audit record is not initialized');
......
import getIdentity from '../src/index';
import config from './config.json';
const test = async () => {
const overides = {
test:true,
auditInit: {
auditUnit: 'test',
},
auditStoragePath: '/tmp',
}
try {
const Identity = await getIdentity("052704062", config.user, config.pass,overides);
const Identity = await getIdentity("052704062", config.user, config.pass);
console.log("getNncIdentityOutputRecord=", Identity);
} catch (error) {
console.log(error);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment