Skip to content

Commit

Permalink
fix: fixed typo of data models
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubrekowski committed Oct 20, 2024
1 parent 9d30c25 commit 088e181
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 27 deletions.
55 changes: 46 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<img src="./assets/un_notice.svg" height="150px" alt="UN Notice" />
</a>

A TypeScript library for easily interacting with the Interpol public Notices API. This library provides a convenient, type-safe way to access data on Red, Yellow, and possibly in the future, other Interpol notices.
A TypeScript library for easily interacting with the Interpol public Notices API. This library provides a convenient, type-safe way to access data on Red, Yellow Interpol notices, and INTERPOL-United Nations Security Council Special Notices.

## Contents

Expand Down Expand Up @@ -66,7 +66,7 @@ It is important to note that Interpol notices are not international arrest warra

## Development Status

Currently, this library focuses on retrieving and interacting with **Red Notices**. Support for **Yellow** and **UN Notices** is planned for future releases but is not yet implemented. Contributions are welcome to accelerate the development of these features!
This library currently supports retrieving and interacting with **Red Notices** and **Yellow Notices**. Support for **INTERPOL-United Nations Security Council Special Notices** is planned for future releases but is not yet implemented. Contributions are welcome to accelerate the development of these features!

You can track the progress of these planned features in the project's issue tracker. We encourage community involvement in prioritizing and implementing support for additional notice types.

Expand Down Expand Up @@ -146,26 +146,47 @@ cancelRedNoticeRequest();

## API Reference

### `InterpolService.getRedNotices(query?: RedNoticesQuery): CancelablePromise<RedNoticesEntitiy>`
### `InterpolService.getRedNotices(query?: RedNoticesQuery): CancelablePromise<RedNoticesEntity>`

Retrieves a list of Red Notices.

- **`query`**: Optional query parameters to filter the results (see `RedNoticesQuery` interface below).
- **Returns**: A `CancelablePromise` that resolves to a `RedNoticesEntitiy` object.
- **Returns**: A `CancelablePromise` that resolves to a `RedNoticesEntity` object.

### `InterpolService.getRedNoticeDetails(noticeID: string): CancelablePromise<RedNoticeDetailsEntitiy>`
### `InterpolService.getRedNoticeDetails(noticeID: string): CancelablePromise<RedNoticeDetailsEntity>`

Retrieves details for a specific Red Notice.

- **`noticeID`**: The ID of the Red Notice.
- **Returns**: A `CancelablePromise` that resolves to a `RedNoticeDetailsEntitiy` object.
- **Returns**: A `CancelablePromise` that resolves to a `RedNoticeDetailsEntity` object.

### `InterpolService.getRedNoticeDetailImages(noticeID: string): CancelablePromise<RedNoticeDetailImagesEntitiy>`
### `InterpolService.getRedNoticeDetailImages(noticeID: string): CancelablePromise<RedNoticeDetailImagesEntity>`

Retrieves images for a specific Red Notice.

- **`noticeID`**: The ID of the Red Notice.
- **Returns**: A `CancelablePromise` that resolves to a `RedNoticeDetailImagesEntitiy` object.
- **Returns**: A `CancelablePromise` that resolves to a `RedNoticeDetailImagesEntity` object.

### `InterpolService.getYellowNotices(query?: YellowNoticesQuery): CancelablePromise<YellowNoticesEntity>`

Retrieves a list of Yellow Notices.

- **`query`**: Optional query parameters to filter the results (see `YellowNoticesQuery` interface below).
- **Returns**: A `CancelablePromise` that resolves to a `YellowNoticesEntity` object.

### `InterpolService.getYellowNoticeDetails(noticeID: string): CancelablePromise<YellowNoticeDetailsEntity>`

Retrieves details for a specific Yellow Notice.

- **`noticeID`**: The ID of the Yellow Notice.
- **Returns**: A `CancelablePromise` that resolves to a `YellowNoticeDetailsEntity` object.

### `InterpolService.getYellowNoticeDetailImages(noticeID: string): CancelablePromise<YellowNoticeDetailImagesEntity>`

Retrieves images for a specific Yellow Notice.

- **`noticeID`**: The ID of the Yellow Notice.
- **Returns**: A `CancelablePromise` that resolves to a `YellowNoticeDetailImagesEntity` object.

### `RedNoticesQuery` Interface

Expand All @@ -180,7 +201,23 @@ interface RedNoticesQuery {
sexId?: "F" | "M" | "U"; // Sex ID
arrestWarrantCountryId?: string; // Country ID of arrest warrant (two-digit country code)
page?: number; // Page number for pagination
resultPerPage?: number; // Number of results per page
resultPerPage?: number; // Number of results per page; maximum is 160
}
```

### `YellowNoticesQuery` Interface

```typescript
interface YellowNoticesQuery {
forename?: string; // First name
name?: string; // Last name
nationality?: string; // Nationality (two-digit country code)
ageMax?: number; // Maximum age
ageMin?: number; // Minimum age
freeText?: string; // Free text search
sexId?: "F" | "M" | "U"; // Sex ID
page?: number; // Page number for pagination
resultPerPage?: number; // Number of results per page; maximum is 160
}
```

Expand Down
2 changes: 1 addition & 1 deletion src/models/RedNoticeDetailImages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Represents the Red Notice Detail Images.
*/
export type RedNoticeDetailImagesEntitiy = {
export type RedNoticeDetailImagesEntity = {
/**
* Contains embedded images.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/models/RedNoticeDetails.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Represents the details of a Red Notice entity.
*/
export type RedNoticeDetailsEntitiy = {
export type RedNoticeDetailsEntity = {
/**
* List of arrest warrants associated with the entity.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/models/RedNotices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface RedNoticesQuery {
/**
* Represents a collection of Red Notices.
*/
export type RedNoticesEntitiy = {
export type RedNoticesEntity = {
/**
* The total number of Red Notices.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/models/YellowNoticeDetailImages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Represents the Yellow Notice Detail Images.
*/
export type YellowNoticeDetailImagesEntitiy = {
export type YellowNoticeDetailImagesEntity = {
/**
* Contains embedded images.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/models/YellowNoticeDetails.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Represents the details of a Yellow Notice entity.
*/
export type YellowNoticeDetailsEntitiy = {
export type YellowNoticeDetailsEntity = {
/**
* The country associated with the entity. Two digit country code.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/models/YellowNotices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface YellowNoticesQuery {
/**
* Represents a collection of Yellow Notices.
*/
export type YellowNoticesEntitiy = {
export type YellowNoticesEntity = {
/**
* The total number of Yellow Notices.
*/
Expand Down
24 changes: 12 additions & 12 deletions src/services/InterpolService.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";
import { RedNoticeDetailImagesEntitiy } from "../models/RedNoticeDetailImages";
import { RedNoticeDetailsEntitiy } from "../models/RedNoticeDetails";
import type { RedNoticesEntitiy, RedNoticesQuery } from "../models/RedNotices";
import { YellowNoticeDetailImagesEntitiy } from "../models/YellowNoticeDetailImages";
import { YellowNoticeDetailsEntitiy } from "../models/YellowNoticeDetails";
import { YellowNoticesEntitiy, YellowNoticesQuery } from "../models/YellowNotices";
import { RedNoticeDetailImagesEntity } from "../models/RedNoticeDetailImages";
import { RedNoticeDetailsEntity } from "../models/RedNoticeDetails";
import type { RedNoticesEntity, RedNoticesQuery } from "../models/RedNotices";
import { YellowNoticeDetailImagesEntity } from "../models/YellowNoticeDetailImages";
import { YellowNoticeDetailsEntity } from "../models/YellowNoticeDetails";
import { YellowNoticesEntity, YellowNoticesQuery } from "../models/YellowNotices";

export class InterpolService {
public static getRedNotices(query?: RedNoticesQuery): CancelablePromise<RedNoticesEntitiy> {
public static getRedNotices(query?: RedNoticesQuery): CancelablePromise<RedNoticesEntity> {
return __request(OpenAPI, {
method: "GET",
url: "/notices/v1/red",
query,
});
}

public static getRedNoticeDetails(noticeID: string): CancelablePromise<RedNoticeDetailsEntitiy> {
public static getRedNoticeDetails(noticeID: string): CancelablePromise<RedNoticeDetailsEntity> {
return __request(OpenAPI, {
method: "GET",
url: "/notices/v1/red/{noticeID}",
Expand All @@ -29,7 +29,7 @@ export class InterpolService {

public static getRedNoticeDetailImages(
noticeID: string,
): CancelablePromise<RedNoticeDetailImagesEntitiy> {
): CancelablePromise<RedNoticeDetailImagesEntity> {
return __request(OpenAPI, {
method: "GET",
url: "/notices/v1/red/{noticeID}/images",
Expand All @@ -41,7 +41,7 @@ export class InterpolService {

public static getYellowNotices(
query?: YellowNoticesQuery,
): CancelablePromise<YellowNoticesEntitiy> {
): CancelablePromise<YellowNoticesEntity> {
return __request(OpenAPI, {
method: "GET",
url: "/notices/v1/yellow",
Expand All @@ -51,7 +51,7 @@ export class InterpolService {

public static getYellowNoticeDetails(
noticeID: string,
): CancelablePromise<YellowNoticeDetailsEntitiy> {
): CancelablePromise<YellowNoticeDetailsEntity> {
return __request(OpenAPI, {
method: "GET",
url: "/notices/v1/yellow/{noticeID}",
Expand All @@ -63,7 +63,7 @@ export class InterpolService {

public static getYellowNoticeDetailImages(
noticeID: string,
): CancelablePromise<YellowNoticeDetailImagesEntitiy> {
): CancelablePromise<YellowNoticeDetailImagesEntity> {
return __request(OpenAPI, {
method: "GET",
url: "/notices/v1/yellow/{noticeID}/images",
Expand Down

0 comments on commit 088e181

Please sign in to comment.