Skip to content

Type corrections #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 4, 2025
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
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"semi": [
"error",
"always"
]
],
"no-unused-vars": 0
}
}
8 changes: 4 additions & 4 deletions src/APIError.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ class APIError extends Error {

/** Returns the machine-readable code of the error.
*
* @returns {string} The machine-readable error code.
* @type {string} The machine-readable error code.
*/
code() {
get code() {
return this.#code;
}

/** Returns the human-readable message of the error.
*
* @returns {string} The human-readable error message.
* @type {string} The human-readable error message.
*/
message() {
get message() {
return this.#message;
}

Expand Down
2 changes: 1 addition & 1 deletion src/SortOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SortOptions {

/** Returns whether or not any sort options have been set.
*
* @returns {bool} Whether or not any sort options have been set.
* @returns {boolean} Whether or not any sort options have been set.
*/
isSet() {
return this.sort || this.order || this.page;
Expand Down
2 changes: 2 additions & 0 deletions src/Token.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2021-2022 BuiltByBit (Mick Capital Pty. Ltd.)
// MIT License (https://github.com/BuiltByBit/js-api-wrapper/blob/main/LICENSE)

const { TokenType } = require("./TokenType");

/** A type representing an API authentication token. */
class Token {
#type;
Expand Down
1 change: 1 addition & 0 deletions src/Wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

const axios = require("axios");

const { Token } = require("./Token");
const { Http } = require("./Http.js");
const { APIError } = require("./APIError.js");
const { Throttler } = require("./Throttler.js");
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/AlertsHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2021-2022 BuiltByBit (Mick Capital Pty. Ltd.)
// MIT License (https://github.com/BuiltByBit/js-api-wrapper/blob/main/LICENSE)

const { SortOptions } = require("../SortOptions");

/**
* @typedef {object} Alert
* @property {number} caused_member_id
Expand Down
4 changes: 3 additions & 1 deletion src/helpers/ConversationsHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2021-2022 BuiltByBit (Mick Capital Pty. Ltd.)
// MIT License (https://github.com/BuiltByBit/js-api-wrapper/blob/main/LICENSE)

const { SortOptions } = require("../SortOptions");

/**
* @typedef {object} Conversation
* @property {number} conversation_id
Expand All @@ -9,7 +11,7 @@
* @property {number} creator_id
* @property {number} last_message_date
* @property {number} last_read_date
* @property {bool} open
* @property {boolean} open
* @property {number} reply_count
* @property {Array<number>} recipient_ids
*/
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/ThreadsHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2021-2022 BuiltByBit (Mick Capital Pty. Ltd.)
// MIT License (https://github.com/BuiltByBit/js-api-wrapper/blob/main/LICENSE)

const { SortOptions } = require("../SortOptions");

/**
* @typedef {object} BasicThread
* @property {number} thread_id
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/members/ProfilePostsHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2021-2022 BuiltByBit (Mick Capital Pty. Ltd.)
// MIT License (https://github.com/BuiltByBit/js-api-wrapper/blob/main/LICENSE)

const { SortOptions } = require("../../SortOptions");

/**
* @typedef {object} ProfilePost
* @property {number} profile_post_id
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/resources/DownloadsHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2021-2022 BuiltByBit (Mick Capital Pty. Ltd.)
// MIT License (https://github.com/BuiltByBit/js-api-wrapper/blob/main/LICENSE)

const { SortOptions } = require("../../SortOptions");

/**
* @typedef {object} Download
* @property {number} download_id
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/resources/LicensesHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2021-2022 BuiltByBit (Mick Capital Pty. Ltd.)
// MIT License (https://github.com/BuiltByBit/js-api-wrapper/blob/main/LICENSE)

const { SortOptions } = require("../../SortOptions");

/**
* @typedef {object} License
* @property {number} license_id
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/resources/PurchasesHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2021-2022 BuiltByBit (Mick Capital Pty. Ltd.)
// MIT License (https://github.com/BuiltByBit/js-api-wrapper/blob/main/LICENSE)

const { SortOptions } = require("../../SortOptions");

/**
* @typedef {object} Purchase
* @property {number} purchase_id
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/resources/ResourcesHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const { ReviewsHelper } = require("./ReviewsHelper.js");
const { UpdatesHelper } = require("./UpdatesHelper.js");
const { VersionsHelper } = require("./VersionsHelper.js");

const { SortOptions } = require("../../SortOptions");

/**
* @typedef {object} BasicResource
* @property {number} resource_id
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/resources/ReviewsHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2021-2022 BuiltByBit (Mick Capital Pty. Ltd.)
// MIT License (https://github.com/BuiltByBit/js-api-wrapper/blob/main/LICENSE)

const { SortOptions } = require("../../SortOptions");

/**
* @typedef {object} Review
* @property {number} review_id
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/resources/UpdatesHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2021-2022 BuiltByBit (Mick Capital Pty. Ltd.)
// MIT License (https://github.com/BuiltByBit/js-api-wrapper/blob/main/LICENSE)

const { SortOptions } = require("../../SortOptions");

/**
* @typedef {object} Update
* @property {number} update_id
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/resources/VersionsHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2021-2022 BuiltByBit (Mick Capital Pty. Ltd.)
// MIT License (https://github.com/BuiltByBit/js-api-wrapper/blob/main/LICENSE)

const { SortOptions } = require("../../SortOptions");

/**
* @typedef {object} Version
* @property {number} version_id
Expand Down
8 changes: 4 additions & 4 deletions types/APIError.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export class APIError extends Error {
constructor(json: any);
/** Returns the machine-readable code of the error.
*
* @returns {string} The machine-readable error code.
* @type {string} The machine-readable error code.
*/
code(): string;
get code(): string;
/** Returns the human-readable message of the error.
*
* @returns {string} The human-readable error message.
* @type {string} The human-readable error message.
*/
message(): string;
get message(): string;
#private;
}
//# sourceMappingURL=APIError.d.ts.map
2 changes: 1 addition & 1 deletion types/APIError.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions types/SortOptions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export class SortOptions {
toQueryString(): string;
/** Returns whether or not any sort options have been set.
*
* @returns {bool} Whether or not any sort options have been set.
* @returns {boolean} Whether or not any sort options have been set.
*/
isSet(): bool;
isSet(): boolean;
}
//# sourceMappingURL=SortOptions.d.ts.map
2 changes: 1 addition & 1 deletion types/SortOptions.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions types/Token.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export class Token {
};
#private;
}
import { TokenType } from "./TokenType";
//# sourceMappingURL=Token.d.ts.map
2 changes: 1 addition & 1 deletion types/Token.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions types/Wrapper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class Wrapper {
http(): Http;
#private;
}
import { Token } from "./Token";
import { AlertsHelper } from "./helpers/AlertsHelper.js";
import { ConversationsHelper } from "./helpers/ConversationsHelper.js";
import { ThreadsHelper } from "./helpers/ThreadsHelper.js";
Expand Down
2 changes: 1 addition & 1 deletion types/Wrapper.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions types/helpers/AlertsHelper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ export class AlertsHelper {
markAsRead(): Promise<any>;
#private;
}
import { SortOptions } from "../SortOptions";
//# sourceMappingURL=AlertsHelper.d.ts.map
2 changes: 1 addition & 1 deletion types/helpers/AlertsHelper.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions types/helpers/ConversationsHelper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type Conversation = {
creator_id: number;
last_message_date: number;
last_read_date: number;
open: bool;
open: boolean;
reply_count: number;
recipient_ids: Array<number>;
};
Expand All @@ -23,7 +23,7 @@ export type Reply = {
* @property {number} creator_id
* @property {number} last_message_date
* @property {number} last_read_date
* @property {bool} open
* @property {boolean} open
* @property {number} reply_count
* @property {Array<number>} recipient_ids
*/
Expand Down Expand Up @@ -102,4 +102,5 @@ export class ConversationsHelper {
reply(conversationId: number, message: string): number;
#private;
}
import { SortOptions } from "../SortOptions";
//# sourceMappingURL=ConversationsHelper.d.ts.map
2 changes: 1 addition & 1 deletion types/helpers/ConversationsHelper.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions types/helpers/ThreadsHelper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,5 @@ export class ThreadsHelper {
reply(threadId: number, message: string): number;
#private;
}
import { SortOptions } from "../SortOptions";
//# sourceMappingURL=ThreadsHelper.d.ts.map
2 changes: 1 addition & 1 deletion types/helpers/ThreadsHelper.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions types/helpers/members/ProfilePostsHelper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ export class ProfilePostsHelper {
delete(profilePostId: number): Promise<any>;
#private;
}
import { SortOptions } from "../../SortOptions";
//# sourceMappingURL=ProfilePostsHelper.d.ts.map
2 changes: 1 addition & 1 deletion types/helpers/members/ProfilePostsHelper.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions types/helpers/resources/DownloadsHelper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,5 @@ export class DownloadsHelper {
listByVersionUntil(resourceId: number, versionId: number, shouldContinue: (arg0: Download) => boolean, sort: SortOptions | undefined): Array<Download>;
#private;
}
import { SortOptions } from "../../SortOptions";
//# sourceMappingURL=DownloadsHelper.d.ts.map
2 changes: 1 addition & 1 deletion types/helpers/resources/DownloadsHelper.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions types/helpers/resources/LicensesHelper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ export class LicensesHelper {
modifyTemporary(resourceId: number, licenseId: number, startDate: number, endDate: number): Promise<any>;
#private;
}
import { SortOptions } from "../../SortOptions";
//# sourceMappingURL=LicensesHelper.d.ts.map
Loading