@digigov-oss/search-identity-by-id-pol-client
v1.0.2
Published
Client for searchIdentitiesByIdPol service of GSIS
Readme
Client for searchIdentitiesByIdPol service of KED
Client to connect to police service, useful for nextjs/nodejs projects.
Example:
import searchIdentitiesByIdPol from '@digigov-oss/search-identity-by-id-pol-client';
const test = async () => {
const overrides = {
prod:false,
auditInit: {
auditUnit: 'grnet.gr',
},
auditStoragePath: '/auditStorage',
}
try {
return await searchIdentitiesByIdPol("777777777", 'Test', "username", "password", overrides);
} catch (error) {
console.log(error);
}
}
test().then((x) => { console.log('searchIdentitiesByIdPolOutputRecord', x); });- you can use
overridesto override the default values - for your tests, you don't need to use the
overridesmecahnism,in that case, the default storage path will be used ie/tmp - look at KED standard guides for records you can use on auditInit"
Also, you can use
overridesto override the default storage engine.
import searchIdentitiesByIdPol from '@digigov-oss/search-identity-by-id-pol-client';
import {PostgreSqlEngine} from '@digigov-oss/gsis-audit-record-db';
const test = async () => {
try {
const overrides = {
auditEngine: new PostgreSqlEngine('postgres://postgres:postgres@localhost:5432/postgres'),
auditInit: {
auditUnit: 'grnet.gr',
},
}
return await searchIdentitiesByIdPol("777777777", 'Test', "username", "password", overrides);
} catch (error) {
console.log(error);
}
}
test().then((x) => { console.log('searchIdentitiesByIdPolOutputRecord', x); });Look at module AuditRecordDB for more details on how to use the AuditEngine.
If you plan to use only the FileEngine, you can skip the installation of other engines by ignoring optional dependencies.
i.e.yarn install --ignore-optional
Returns
an object like the following:
TODO
Available ids for testing
777777777
* Notes
you have to ask KED for policeIdentitySearchService_v0.98.pdf documentation to get more info about the output and error fields.
* known issues
If KED advertises a wrong endpoint for the production system, you can override the endpoint by
settings the endpoint property on the overrides object.
