Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DigiGov-OSS
getNncIdentityClient
Commits
f94e9bf1
Commit
f94e9bf1
authored
Jan 10, 2022
by
Panagiotis Skarvelis
Browse files
revert has benefits
parent
d466b3bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/index.ts
View file @
f94e9bf1
...
...
@@ -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
'
);
...
...
test/test.ts
View file @
f94e9bf1
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment