Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/types/src/v20170710/assignments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface Assignment extends BaseResource {
started_at: DatableString | null;

/** Unique identifier of the associated subject. */
subject_id: number;
subject_id: SafeInteger;

/** The type of the associated subject. */
subject_type: SubjectType;
Expand All @@ -59,7 +59,7 @@ export interface Assignment extends BaseResource {
};

/** A unique number identifying the assignment. */
id: number;
id: SafeInteger;

/** The kind of object returned. */
object: "assignment";
Expand Down
6 changes: 3 additions & 3 deletions packages/types/src/v20170710/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export interface BaseCollection {
next_url: string | null;

/** Maximum number of items delivered per page for this collection. */
per_page: number;
per_page: SafeInteger;

/**
* The URL of the previous page of results. If there are no results at all or no previous page to go to, the value
Expand All @@ -108,7 +108,7 @@ export interface BaseCollection {
};

/** The total number of items in the collection. */
total_count: number;
total_count: SafeInteger;

/** The URL of the request. For collections, that will contain all the filters and options you've passed to the API. */
url: string;
Expand Down Expand Up @@ -170,7 +170,7 @@ export interface BaseReport {
*/
export interface ApiError {
/** An HTTP status code indicating the type of error. */
code: number;
code: SafeInteger;

/** A message string that describes the error. */
error: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/types/src/v20170710/level-progressions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BaseCollection, BaseResource, DatableString, Level } from "./base.js";
import type { BaseCollection, BaseResource, DatableString, Level, SafeInteger } from "./base.js";

/**
* Level progressions contain information about a user's progress through the WaniKani levels.
Expand Down Expand Up @@ -43,7 +43,7 @@ export interface LevelProgression extends BaseResource {
};

/** A unique number identifying the level progression. */
id: number;
id: SafeInteger;

/** The kind of object returned. */
object: "level_progression";
Expand Down
4 changes: 2 additions & 2 deletions packages/types/src/v20170710/resets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BaseCollection, BaseResource, DatableString, Level } from "./base.js";
import type { BaseCollection, BaseResource, DatableString, Level, SafeInteger } from "./base.js";

/**
* Users can reset their progress back to any level at or below their current level. When they reset to a particular
Expand Down Expand Up @@ -27,7 +27,7 @@ export interface Reset extends BaseResource {
};

/** A unique number identifying the reset. */
id: number;
id: SafeInteger;

/** The kind of object returned. */
object: "reset";
Expand Down
20 changes: 10 additions & 10 deletions packages/types/src/v20170710/review-statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,41 @@ export interface ReviewStatistic extends BaseResource {
hidden: boolean;

/** Total number of correct answers submitted for the meaning of the associated subject. */
meaning_correct: number;
meaning_correct: SafeInteger;

/** The current, uninterrupted series of correct answers given for the meaning of the associated subject. */
meaning_current_streak: number;
meaning_current_streak: SafeInteger;

/** Total number of incorrect answers submitted for the meaning of the associated subject. */
meaning_incorrect: number;
meaning_incorrect: SafeInteger;

/** The longest, uninterrupted series of correct answers ever given for the meaning of the associated subject. */
meaning_max_streak: number;
meaning_max_streak: SafeInteger;

/** The overall correct answer rate by the user for the subject, including both meaning and reading. */
percentage_correct: number;

/** Total number of correct answers submitted for the reading of the associated subject. */
reading_correct: number;
reading_correct: SafeInteger;

/** The current, uninterrupted series of correct answers given for the reading of the associated subject. */
reading_current_streak: number;
reading_current_streak: SafeInteger;

/** Total number of incorrect answers submitted for the reading of the associated subject. */
reading_incorrect: number;
reading_incorrect: SafeInteger;

/** The longest, uninterrupted series of correct answers ever given for the reading of the associated subject. */
reading_max_streak: number;
reading_max_streak: SafeInteger;

/** Unique identifier of the associated subject. */
subject_id: number;
subject_id: SafeInteger;

/** The type of the associated subject. */
subject_type: SubjectType;
};

/** A unique number identifying the review statistic. */
id: number;
id: SafeInteger;

/** The kind of object returned. */
object: "review_statistic";
Expand Down
12 changes: 6 additions & 6 deletions packages/types/src/v20170710/reviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface Review extends BaseResource {
/** Data for the returned review. */
data: {
/** Unique identifier of the associated assignment. */
assignment_id: number;
assignment_id: SafeInteger;

/** Timestamp when the review was created. */
created_at: DatableString;
Expand All @@ -28,23 +28,23 @@ export interface Review extends BaseResource {
ending_srs_stage: SpacedRepetitionSystemStageNumber;

/** The number of times the user has answered the meaning incorrectly. */
incorrect_meaning_answers: number;
incorrect_meaning_answers: SafeInteger;

/** The number of times the user has answered the reading incorrectly. */
incorrect_reading_answers: number;
incorrect_reading_answers: SafeInteger;

/** Unique identifier of the associated `spaced_repetition_system`. */
spaced_repetition_system_id: number;
spaced_repetition_system_id: SafeInteger;

/** The starting SRS stage interval, with valid values ranging from `1` to `8`. */
starting_srs_stage: SpacedRepetitionSystemStageNumber;

/** Unique identifier of the associated subject. */
subject_id: number;
subject_id: SafeInteger;
};

/** A unique number identifying the review. */
id: number;
id: SafeInteger;

/** The kind of object returned. */
object: "review";
Expand Down
6 changes: 3 additions & 3 deletions packages/types/src/v20170710/spaced-repetition-systems.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BaseCollection, BaseResource, DatableString } from "./base.js";
import type { BaseCollection, BaseResource, DatableString, SafeInteger } from "./base.js";

/**
* The minimum SRS Stage Number used in WaniKani's SRS; exported for use in lieu of a Magic Number.
Expand Down Expand Up @@ -36,7 +36,7 @@ export type SpacedRepetitionSystemStageNumber = number & {};
*/
export interface SpacedRepetitionSystemStage {
/** The length of time added to the time of review registration, adjusted to the beginning of the hour. */
interval: number | null;
interval: SafeInteger | null;

/** Unit of time. Can be the following: `milliseconds`, `seconds`, `minutes`, `hours`, `days`, and `weeks`. */
interval_unit: "days" | "hours" | "milliseconds" | "minutes" | "seconds" | "weeks" | null;
Expand Down Expand Up @@ -82,7 +82,7 @@ export interface SpacedRepetitionSystem extends BaseResource {
};

/** A unique number identifying the Spaced Repetition System. */
id: number;
id: SafeInteger;

/** The kind of object returned. */
object: "spaced_repetition_system";
Expand Down
4 changes: 2 additions & 2 deletions packages/types/src/v20170710/study-materials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ export interface StudyMaterial extends BaseResource {
hidden: boolean;

/** Unique identifier of the associated subject. */
subject_id: number;
subject_id: SafeInteger;

/** The type of the associated subject. */
subject_type: SubjectType;
};

/** A unique number identifying the study material. */
id: number;
id: SafeInteger;

/** The kind of object returned. */
object: "study_material";
Expand Down
22 changes: 11 additions & 11 deletions packages/types/src/v20170710/subjects.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BaseCollection, BaseResource, CollectionParameters, DatableString, Level } from "./base.js";
import type { BaseCollection, BaseResource, CollectionParameters, DatableString, Level, SafeInteger } from "./base.js";

/**
* The types of subjects used on WaniKani and its API.
Expand Down Expand Up @@ -79,7 +79,7 @@ export interface SubjectBaseData {
* The position that the subject appears in lessons. Note that the value is scoped to the level of the subject, so
* there are duplicate values across levels.
*/
lesson_position: number;
lesson_position: SafeInteger;

/** The level of the subject, from `1` to `60`. */
level: Level;
Expand All @@ -97,7 +97,7 @@ export interface SubjectBaseData {
slug: string;

/** Unique identifier of the associated Spaced Repetition System. */
spaced_repetition_system_id: number;
spaced_repetition_system_id: SafeInteger;
}

/**
Expand Down Expand Up @@ -143,7 +143,7 @@ export type RadicalCharacterImage = {
*/
export interface RadicalData extends SubjectBaseData {
/** An array of numeric identifiers for the kanji that have the radical as a component. */
amalgamation_subject_ids: number[];
amalgamation_subject_ids: SafeInteger[];

/** A collection of images of the radical. */
character_images: RadicalCharacterImage[];
Expand Down Expand Up @@ -183,7 +183,7 @@ export interface KanjiReading {
*/
export interface KanjiData extends SubjectBaseData {
/** An array of numeric identifiers for the vocabulary that have the kanji as a component. */
amalgamation_subject_ids: number[];
amalgamation_subject_ids: SafeInteger[];

/** The UTF-8 characters for the subject, including kanji and hiragana. */
characters: string;
Expand All @@ -192,7 +192,7 @@ export interface KanjiData extends SubjectBaseData {
* An array of numeric identifiers for the radicals that make up this kanji. Note that these are the subjects that
* must have passed assignments in order to unlock this subject's assignment.
*/
component_subject_ids: number[];
component_subject_ids: SafeInteger[];

/** Meaning hint for the kanji. */
meaning_hint: string | null;
Expand All @@ -207,7 +207,7 @@ export interface KanjiData extends SubjectBaseData {
readings: KanjiReading[];

/** An array of numeric identifiers for kanji which are visually similar to the kanji in question. */
visually_similar_subject_ids: number[];
visually_similar_subject_ids: SafeInteger[];
}

/**
Expand Down Expand Up @@ -243,10 +243,10 @@ export interface VocabularyPronunciationAudio {
pronunciation: string;

/** A unique ID shared between same source pronunciation audio. */
source_id: number;
source_id: SafeInteger;

/** A unique ID belonging to the voice actor. */
voice_actor_id: number;
voice_actor_id: SafeInteger;

/** Humanized name of the voice actor. */
voice_actor_name: string;
Expand Down Expand Up @@ -290,7 +290,7 @@ export interface VocabularyData extends SubjectBaseData {
* An array of numeric identifiers for the kanji that make up this vocabulary. Note that these are the subjects that
* must be have passed assignments in order to unlock this subject's assignment.
*/
component_subject_ids: number[];
component_subject_ids: SafeInteger[];

/** A collection of context sentences. */
context_sentences: VocabularyContextSentence[];
Expand Down Expand Up @@ -341,7 +341,7 @@ export interface KanaVocabularyData extends SubjectBaseData {
*/
export type Subject = BaseResource & {
/** A unique number identifying the subject. */
id: number;
id: SafeInteger;
} & (
| {
/** Data for the returned kana-only vocabulary. */
Expand Down
4 changes: 2 additions & 2 deletions packages/types/src/v20170710/summary.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BaseReport, DatableString } from "./base.js";
import type { BaseReport, DatableString, SafeInteger } from "./base.js";

/**
* Details about subjects listed as available for lessons in the Summary report.
Expand All @@ -14,7 +14,7 @@ export interface SummaryInterval {
available_at: DatableString;

/** Collection of unique identifiers for subjects. */
subject_ids: number[];
subject_ids: SafeInteger[];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/types/src/v20170710/user.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BaseResource, DatableString, Level } from "./base.js";
import type { BaseResource, DatableString, Level, SafeInteger } from "./base.js";

/**
* The minimum batch size for lessons in the WaniKani app; exported for use in lieu of a Magic Number.
Expand Down Expand Up @@ -32,7 +32,7 @@ export interface UserPreferences {
* @deprecated This is a deprecated user preference. It will always return `1` and cannot be set. It exists only to
* ensure existing consumers of this API don't break.
*/
default_voice_actor_id: number;
default_voice_actor_id: SafeInteger;

/** Automatically play pronunciation audio for vocabulary during extra study. */
extra_study_autoplay_audio: boolean;
Expand Down
4 changes: 2 additions & 2 deletions packages/types/src/v20170710/voice-actors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BaseCollection, BaseResource, DatableString } from "./base.js";
import type { BaseCollection, BaseResource, DatableString, SafeInteger } from "./base.js";

/**
* Available voice actors used for vocabulary reading pronunciation audio.
Expand All @@ -24,7 +24,7 @@ export interface VoiceActor extends BaseResource {
};

/** A unique number identifying the voice actor. */
id: number;
id: SafeInteger;

/** The kind of object returned. */
object: "voice_actor";
Expand Down
16 changes: 8 additions & 8 deletions packages/valibot/src/v20170710/assignments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ export const Assignment = v.object(
BaseResource,
v.object({
data: v.object({
available_at: v.union([DatableString, v.null()]),
burned_at: v.union([DatableString, v.null()]),
available_at: v.nullable(DatableString),
burned_at: v.nullable(DatableString),
created_at: DatableString,
hidden: v.boolean(),
passed_at: v.union([DatableString, v.null()]),
resurrected_at: v.union([DatableString, v.null()]),
passed_at: v.nullable(DatableString),
resurrected_at: v.nullable(DatableString),
srs_stage: SpacedRepetitionSystemStageNumber,
started_at: v.union([DatableString, v.null()]),
subject_id: v.number(),
started_at: v.nullable(DatableString),
subject_id: SafeInteger,
subject_type: SubjectType,
unlocked_at: v.union([DatableString, v.null()]),
unlocked_at: v.nullable(DatableString),
}),
id: v.number(),
id: SafeInteger,
object: v.literal("assignment"),
}),
]),
Expand Down
12 changes: 6 additions & 6 deletions packages/valibot/src/v20170710/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ export const BaseResource = v.object({
*/
export type BaseCollection = Types.BaseCollection;
export const BaseCollection = v.object({
data_updated_at: v.union([DatableString, v.null()]),
data_updated_at: v.nullable(DatableString),
object: v.literal("collection"),
pages: v.object({
next_url: v.union([v.string(), v.null()]),
per_page: v.number(),
previous_url: v.union([v.string(), v.null()]),
next_url: v.nullable(v.string()),
per_page: SafeInteger,
previous_url: v.nullable(v.string()),
}),
total_count: v.number(),
total_count: SafeInteger,
url: v.string(),
});

Expand Down Expand Up @@ -159,7 +159,7 @@ export const BaseReport = v.object({
*/
export type ApiError = Types.ApiError;
export const ApiError = v.object({
code: v.number(),
code: SafeInteger,
error: v.string(),
});

Expand Down
Loading
Loading