From 088e1819b3adf88b50419416ac2d537cb77d4c97 Mon Sep 17 00:00:00 2001 From: Jakub Rekowski Date: Mon, 21 Oct 2024 01:21:13 +0200 Subject: [PATCH] fix: fixed typo of data models --- README.md | 55 +++++++++++++++++++++----- src/models/RedNoticeDetailImages.ts | 2 +- src/models/RedNoticeDetails.ts | 2 +- src/models/RedNotices.ts | 2 +- src/models/YellowNoticeDetailImages.ts | 2 +- src/models/YellowNoticeDetails.ts | 2 +- src/models/YellowNotices.ts | 2 +- src/services/InterpolService.ts | 24 +++++------ 8 files changed, 64 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index b7b66f8..c41edd6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ UN Notice -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 @@ -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. @@ -146,26 +146,47 @@ cancelRedNoticeRequest(); ## API Reference -### `InterpolService.getRedNotices(query?: RedNoticesQuery): CancelablePromise` +### `InterpolService.getRedNotices(query?: RedNoticesQuery): CancelablePromise` 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` +### `InterpolService.getRedNoticeDetails(noticeID: string): CancelablePromise` 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` +### `InterpolService.getRedNoticeDetailImages(noticeID: string): CancelablePromise` 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` + +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` + +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` + +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 @@ -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 } ``` diff --git a/src/models/RedNoticeDetailImages.ts b/src/models/RedNoticeDetailImages.ts index 3cf29c8..50031f8 100644 --- a/src/models/RedNoticeDetailImages.ts +++ b/src/models/RedNoticeDetailImages.ts @@ -1,7 +1,7 @@ /** * Represents the Red Notice Detail Images. */ -export type RedNoticeDetailImagesEntitiy = { +export type RedNoticeDetailImagesEntity = { /** * Contains embedded images. */ diff --git a/src/models/RedNoticeDetails.ts b/src/models/RedNoticeDetails.ts index 5b3839d..d96145e 100644 --- a/src/models/RedNoticeDetails.ts +++ b/src/models/RedNoticeDetails.ts @@ -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. */ diff --git a/src/models/RedNotices.ts b/src/models/RedNotices.ts index 191e32e..b28a1bd 100644 --- a/src/models/RedNotices.ts +++ b/src/models/RedNotices.ts @@ -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. */ diff --git a/src/models/YellowNoticeDetailImages.ts b/src/models/YellowNoticeDetailImages.ts index 3110bb7..0252ef0 100644 --- a/src/models/YellowNoticeDetailImages.ts +++ b/src/models/YellowNoticeDetailImages.ts @@ -1,7 +1,7 @@ /** * Represents the Yellow Notice Detail Images. */ -export type YellowNoticeDetailImagesEntitiy = { +export type YellowNoticeDetailImagesEntity = { /** * Contains embedded images. */ diff --git a/src/models/YellowNoticeDetails.ts b/src/models/YellowNoticeDetails.ts index f93cfef..8d12893 100644 --- a/src/models/YellowNoticeDetails.ts +++ b/src/models/YellowNoticeDetails.ts @@ -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. */ diff --git a/src/models/YellowNotices.ts b/src/models/YellowNotices.ts index 6a5ab7c..c037d6d 100644 --- a/src/models/YellowNotices.ts +++ b/src/models/YellowNotices.ts @@ -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. */ diff --git a/src/services/InterpolService.ts b/src/services/InterpolService.ts index 6e024b0..f6cd227 100644 --- a/src/services/InterpolService.ts +++ b/src/services/InterpolService.ts @@ -1,15 +1,15 @@ 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 { + public static getRedNotices(query?: RedNoticesQuery): CancelablePromise { return __request(OpenAPI, { method: "GET", url: "/notices/v1/red", @@ -17,7 +17,7 @@ export class InterpolService { }); } - public static getRedNoticeDetails(noticeID: string): CancelablePromise { + public static getRedNoticeDetails(noticeID: string): CancelablePromise { return __request(OpenAPI, { method: "GET", url: "/notices/v1/red/{noticeID}", @@ -29,7 +29,7 @@ export class InterpolService { public static getRedNoticeDetailImages( noticeID: string, - ): CancelablePromise { + ): CancelablePromise { return __request(OpenAPI, { method: "GET", url: "/notices/v1/red/{noticeID}/images", @@ -41,7 +41,7 @@ export class InterpolService { public static getYellowNotices( query?: YellowNoticesQuery, - ): CancelablePromise { + ): CancelablePromise { return __request(OpenAPI, { method: "GET", url: "/notices/v1/yellow", @@ -51,7 +51,7 @@ export class InterpolService { public static getYellowNoticeDetails( noticeID: string, - ): CancelablePromise { + ): CancelablePromise { return __request(OpenAPI, { method: "GET", url: "/notices/v1/yellow/{noticeID}", @@ -63,7 +63,7 @@ export class InterpolService { public static getYellowNoticeDetailImages( noticeID: string, - ): CancelablePromise { + ): CancelablePromise { return __request(OpenAPI, { method: "GET", url: "/notices/v1/yellow/{noticeID}/images",