Skip to content

Commit

Permalink
use import type
Browse files Browse the repository at this point in the history
  • Loading branch information
shevernitskiy committed Apr 11, 2024
1 parent a9e9ccf commit c432a69
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion scripts/type-scraper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DOMParser, Element } from "https://deno.land/x/deno_dom@v0.1.36-alpha/deno-dom-wasm.ts";
import { DOMParser, type Element } from "https://deno.land/x/deno_dom@v0.1.36-alpha/deno-dom-wasm.ts";

type ParseOptions = {
links?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/amo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
Unsorted,
} from "./typings/entities.ts";
import { EventEmitter } from "./core/event-emitter.ts";
import { parseIncomingWebhook, WebhookEventMap } from "./helpers/webhook.ts";
import { parseIncomingWebhook, type WebhookEventMap } from "./helpers/webhook.ts";
import { WebhookError } from "./errors/webhook.ts";
import { RestClient } from "./core/rest-client.ts";
import { LeadApi } from "./api/lead/client.ts";
Expand Down
4 changes: 2 additions & 2 deletions src/api/account/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AccountInfo } from "../../typings/entities.ts";
import { Links } from "../../typings/utility.ts";
import type { AccountInfo } from "../../typings/entities.ts";
import type { Links } from "../../typings/utility.ts";

export type ResponseGetAccountInfo = AccountInfo & Links & {
_embedded: {
Expand Down
2 changes: 1 addition & 1 deletion src/api/catalog/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
ResponseUpdateCatalogs,
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

export class CatalogApi extends Endpoint {
Expand Down
2 changes: 1 addition & 1 deletion src/api/chat-template/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
ResponseUpdateStatusWhatsAppTemplate,
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

import type { JSONValue } from "../../typings/utility.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/api/chat/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createHash, createHmac } from "node:crypto";
import { Endpoint } from "../../core/endpoint.ts";
import { JSONValue } from "../../typings/utility.ts";
import type { JSONValue } from "../../typings/utility.ts";

export class ChatApi extends Endpoint {
headers(
Expand Down
2 changes: 1 addition & 1 deletion src/api/company/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
ResponseUpdateCompany,
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

export class CompanyApi extends Endpoint {
Expand Down
2 changes: 1 addition & 1 deletion src/api/contact/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
ResponseUpdateContacts,
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

export class ContactApi extends Endpoint {
Expand Down
4 changes: 2 additions & 2 deletions src/api/contact/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Contact } from "../../typings/entities.ts";
import { Embedded, Links, Page, RequestId, Total } from "../../typings/utility.ts";
import type { Contact } from "../../typings/entities.ts";
import type { Embedded, Links, Page, RequestId, Total } from "../../typings/utility.ts";

export type ResponseGetContacts = Page & Links & {
_embedded: {
Expand Down
2 changes: 1 addition & 1 deletion src/api/customer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
ResponseUpdateCustomers,
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

export class CustomerApi extends Endpoint {
Expand Down
2 changes: 1 addition & 1 deletion src/api/event/client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { With } from "../../typings/utility.ts";
import type { ResponseGetEventById, ResponseGetEvents, ResponseGetEventsTypes } from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

export class EventApi extends Endpoint {
Expand Down
2 changes: 1 addition & 1 deletion src/api/file/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type {
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { RestClient } from "../../core/rest-client.ts";
import type { RestClient } from "../../core/rest-client.ts";

export class FileApi extends Endpoint {
constructor(rest: RestClient, private drive_url: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/lead/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { query } from "../../helpers/query.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";

export class LeadApi extends Endpoint {
/** Метод позволяет получить список сделок в аккаунте. */
Expand Down
2 changes: 1 addition & 1 deletion src/api/link/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
ResponseGetLinksByEntityType,
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

export class LinkApi extends Endpoint {
Expand Down
2 changes: 1 addition & 1 deletion src/api/note/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
ResponseUpdateNotes,
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

export class NoteApi extends Endpoint {
Expand Down
2 changes: 1 addition & 1 deletion src/api/source/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
ResponseUpdateSources,
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

import type { JSONValue, With } from "../../typings/utility.ts";
Expand Down
2 changes: 1 addition & 1 deletion src/api/tag/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
ResponseGetTags,
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

type Entities = "leads" | "contacts" | "companies" | "customers";
Expand Down
2 changes: 1 addition & 1 deletion src/api/task/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
ResponseUpdateTasks,
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

export class TaskApi extends Endpoint {
Expand Down
2 changes: 1 addition & 1 deletion src/api/unsorted/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
ResponseLinkUnsorted,
} from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

export class UnsortedApi extends Endpoint {
Expand Down
2 changes: 1 addition & 1 deletion src/api/webhook/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RequestAddWebhook, RequestDeleteWebhook, ResponseAddWebhook, ResponseGetWebhooks } from "./types.ts";
import { Endpoint } from "../../core/endpoint.ts";
import { FilterLike } from "../../helpers/filter.ts";
import type { FilterLike } from "../../helpers/filter.ts";
import { query } from "../../helpers/query.ts";

export class WebhookApi extends Endpoint {
Expand Down
2 changes: 1 addition & 1 deletion src/core/endpoint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RestClient } from "./rest-client.ts";
import type { RestClient } from "./rest-client.ts";

export class Endpoint {
constructor(protected rest: RestClient) {}
Expand Down
2 changes: 1 addition & 1 deletion src/errors/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONValue } from "../typings/utility.ts";
import type { JSONValue } from "../typings/utility.ts";

export class ApiError extends Error {
constructor(public response: JSONValue, message?: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/errors/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONValue } from "../typings/utility.ts";
import type { JSONValue } from "../typings/utility.ts";

export class AuthError extends Error {
constructor(public response: JSONValue) {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/order.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Order } from "../typings/utility.ts";
import type { Order } from "../typings/utility.ts";

// deno-lint-ignore no-explicit-any
export function order(value: Order<any>): [string, string] {
Expand Down
14 changes: 7 additions & 7 deletions src/typings/lib.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { OAuth } from "./auth.ts";
import { ApiError } from "../errors/api.ts";
import { AuthError } from "../errors/auth.ts";
import { HttpError } from "../errors/http.ts";
import { NoContentError } from "../errors/no-content.ts";
import { WebhookError } from "../errors/webhook.ts";
import type { OAuth } from "./auth.ts";
import type { ApiError } from "../errors/api.ts";
import type { AuthError } from "../errors/auth.ts";
import type { HttpError } from "../errors/http.ts";
import type { NoContentError } from "../errors/no-content.ts";
import type { WebhookError } from "../errors/webhook.ts";

import { JSONValue } from "./utility.ts";
import type { JSONValue } from "./utility.ts";

export type Options = {
request_delay?: number;
Expand Down

0 comments on commit c432a69

Please sign in to comment.