Search…
Driving License

Driving License Book Client

About

This library implements a client to use Ökunámsbók's Driver's license API through x-road
The client is generated from a copy of the openApi document provided in x-road.

Usage

Updating the open api definition (clientConfig.json)

1
yarn nx run clients-driving-license-book:update-openapi-document
Copied!

Regenerating the client:

1
yarn nx run clients-driving-license-book:schemas/external-openapi-generator
Copied!

Import into other NestJS modules

app.module.ts
1
import { ConfigModule } from '@island.is/nest/config'
2
import { DrivingLicenseBookClientModule, DrivingLicenseBookClientConfig } from '@island.is/clients/driving-license-book'
3
4
@Module({
5
imports: [
6
DrivingLicenseBookClientModule,
7
ConfigModule.forRoot({
8
isGlobal:true,
9
load:[DrivingLicenseBookClientConfig,XRoadConfig]
10
})
11
],
12
})
Copied!
module-name.module.ts
1
import { DrivingLicenseBookClientModule } from '@island.is/clients/driving-license-book'
2
3
imports: [
4
DrivingLicenseBookClientModule
5
],
Copied!
module-name.service.ts
1
import { DrivingLicenseBookClientApiFactory } from '@island.is/clients/driving-license-book'
2
3
4
@Injectable()
5
export class SomeService {
6
constructor(
7
@Inject(DrivingLicenseBookClientApiFactory)
8
private readonly drivingLicenseBookClientApiFactory: DrivingLicenseBookClientApiFactory,
9
) {}
10
11
async someMethod()
12
const api = await this.drivingLicenseBookClientApiFactory.create()
13
return api.apiStudentGetLicenseBookListSsnGet({ssn:nationalId})
Copied!

Code owners and maintainers