mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-06 20:42:27 +00:00
use typed imports
This commit is contained in:
parent
5440fc60e1
commit
26b17e5cf8
54 changed files with 80 additions and 77 deletions
|
@ -2,7 +2,7 @@ import { faker } from "@faker-js/faker";
|
|||
import { expect } from "vitest";
|
||||
import { overrideParts } from "../../base/urls";
|
||||
import { PublicApi } from "../../public";
|
||||
import { ItemField, LabelCreate, LocationCreate, UserRegistration } from "../../types/data-contracts";
|
||||
import type { ItemField, LabelCreate, LocationCreate, UserRegistration } from "../../types/data-contracts";
|
||||
import * as config from "../../../../test/config";
|
||||
import { UserClient } from "../../user";
|
||||
import { Requests } from "../../../requests";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { beforeAll, expect } from "vitest";
|
||||
import { faker } from "@faker-js/faker";
|
||||
import { UserClient } from "../user";
|
||||
import type { UserClient } from "../user";
|
||||
import { factories } from "./factories";
|
||||
|
||||
const cache = {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { faker } from "@faker-js/faker";
|
||||
import { describe, test, expect } from "vitest";
|
||||
import { ItemField, ItemUpdate, LocationOut } from "../../types/data-contracts";
|
||||
import type { ItemField, ItemUpdate, LocationOut } from "../../types/data-contracts";
|
||||
import { AttachmentTypes } from "../../types/non-generated";
|
||||
import { UserClient } from "../../user";
|
||||
import type { UserClient } from "../../user";
|
||||
import { factories } from "../factories";
|
||||
import { sharedUserClient } from "../test-utils";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { describe, expect, test } from "vitest";
|
||||
import { LabelOut } from "../../types/data-contracts";
|
||||
import { UserClient } from "../../user";
|
||||
import type { LabelOut } from "../../types/data-contracts";
|
||||
import type { UserClient } from "../../user";
|
||||
import { factories } from "../factories";
|
||||
import { sharedUserClient } from "../test-utils";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { describe, expect, test } from "vitest";
|
||||
import { LocationOut } from "../../types/data-contracts";
|
||||
import { UserClient } from "../../user";
|
||||
import type { LocationOut } from "../../types/data-contracts";
|
||||
import type { UserClient } from "../../user";
|
||||
import { factories } from "../factories";
|
||||
import { sharedUserClient } from "../test-utils";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { faker } from "@faker-js/faker";
|
||||
import { beforeAll, describe, expect, test } from "vitest";
|
||||
import { UserClient } from "../../user";
|
||||
import type { UserClient } from "../../user";
|
||||
import { factories } from "../factories";
|
||||
|
||||
type ImportObj = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Requests } from "../../requests";
|
||||
import type { Requests } from "../../requests";
|
||||
import { route } from ".";
|
||||
|
||||
const ZERO_DATE = "0001-01-01T00:00:00Z";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { BaseAPI, route } from "../base";
|
||||
import { ActionAmountResult } from "../types/data-contracts";
|
||||
import type { ActionAmountResult } from "../types/data-contracts";
|
||||
|
||||
export class ActionsAPI extends BaseAPI {
|
||||
ensureAssetIDs() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { BaseAPI, route } from "../base";
|
||||
import { ItemSummary } from "../types/data-contracts";
|
||||
import { PaginationResult } from "../types/non-generated";
|
||||
import type { ItemSummary } from "../types/data-contracts";
|
||||
import type { PaginationResult } from "../types/non-generated";
|
||||
|
||||
export class AssetsApi extends BaseAPI {
|
||||
async get(id: string, page = 1, pageSize = 50) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { BaseAPI, route } from "../base";
|
||||
import {
|
||||
import type {
|
||||
CurrenciesCurrency,
|
||||
Group,
|
||||
GroupInvitation,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { BaseAPI, route } from "../base";
|
||||
import { parseDate } from "../base/base-api";
|
||||
import {
|
||||
import type {
|
||||
ItemAttachmentUpdate,
|
||||
ItemCreate,
|
||||
ItemOut,
|
||||
|
@ -13,8 +13,8 @@ import {
|
|||
MaintenanceEntryUpdate,
|
||||
MaintenanceLog,
|
||||
} from "../types/data-contracts";
|
||||
import { AttachmentTypes, PaginationResult } from "../types/non-generated";
|
||||
import { Requests } from "~~/lib/requests";
|
||||
import type { AttachmentTypes, PaginationResult } from "../types/non-generated";
|
||||
import type { Requests } from "~~/lib/requests";
|
||||
|
||||
export type ItemsQuery = {
|
||||
orderBy?: string;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { BaseAPI, route } from "../base";
|
||||
import { LabelCreate, LabelOut } from "../types/data-contracts";
|
||||
import type { LabelCreate, LabelOut } from "../types/data-contracts";
|
||||
|
||||
export class LabelsApi extends BaseAPI {
|
||||
getAll() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { BaseAPI, route } from "../base";
|
||||
import { LocationOutCount, LocationCreate, LocationOut, LocationUpdate, TreeItem } from "../types/data-contracts";
|
||||
import type { LocationOutCount, LocationCreate, LocationOut, LocationUpdate, TreeItem } from "../types/data-contracts";
|
||||
|
||||
export type LocationsQuery = {
|
||||
filterChildren: boolean;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { BaseAPI, route } from "../base";
|
||||
import { NotifierCreate, NotifierOut, NotifierUpdate } from "../types/data-contracts";
|
||||
import type { NotifierCreate, NotifierOut, NotifierUpdate } from "../types/data-contracts";
|
||||
|
||||
export class NotifiersAPI extends BaseAPI {
|
||||
getAll() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { BaseAPI, route } from "../base";
|
||||
import { GroupStatistics, TotalsByOrganizer, ValueOverTime } from "../types/data-contracts";
|
||||
import type { GroupStatistics, TotalsByOrganizer, ValueOverTime } from "../types/data-contracts";
|
||||
|
||||
function YYYY_MM_DD(date?: Date): string {
|
||||
if (!date) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { BaseAPI, route } from "../base";
|
||||
import { ChangePassword, UserOut } from "../types/data-contracts";
|
||||
import { Result } from "../types/non-generated";
|
||||
import type { ChangePassword, UserOut } from "../types/data-contracts";
|
||||
import type { Result } from "../types/non-generated";
|
||||
|
||||
export class UserApi extends BaseAPI {
|
||||
public self() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { BaseAPI, route } from "./base";
|
||||
import { APISummary, LoginForm, TokenResponse, UserRegistration } from "./types/data-contracts";
|
||||
import type { APISummary, LoginForm, TokenResponse, UserRegistration } from "./types/data-contracts";
|
||||
|
||||
export type StatusResult = {
|
||||
health: boolean;
|
||||
|
|
|
@ -9,7 +9,7 @@ import { StatsAPI } from "./classes/stats";
|
|||
import { AssetsApi } from "./classes/assets";
|
||||
import { ReportsAPI } from "./classes/reports";
|
||||
import { NotifiersAPI } from "./classes/notifiers";
|
||||
import { Requests } from "~~/lib/requests";
|
||||
import type { Requests } from "~~/lib/requests";
|
||||
|
||||
export class UserClient extends BaseAPI {
|
||||
locations: LocationsApi;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue