Skip to content

Commit 2cfe5dc

Browse files
committed
chore: upgrade typedoc and fix all warnings
1 parent 6af931c commit 2cfe5dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+90
-469
lines changed

examples/create-oauth-token.js

-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const setupClient = (config) => {
2424
* Retrieves the numeric ID of an OAuth client based on its unique identifier.
2525
* @param {string} identifier - The unique identifier of the OAuth client.
2626
* @returns {Promise<number|null>} The numeric ID of the OAuth client or null if not found.
27-
* @async
2827
* @throws {Error} If there's an error in retrieving the OAuth client list.
2928
*/
3029
async function getClientId(identifier) {
@@ -43,7 +42,6 @@ async function getClientId(identifier) {
4342
* Creates a read-only OAuth token for accessing users and tickets.
4443
* This function first retrieves the OAuth client ID using its unique identifier,
4544
* and then uses this ID to create a token with the specified scopes.
46-
* @async
4745
* @throws {Error} If the OAuth client ID is not found or if there's an error in creating the OAuth token.
4846
*/
4947
async function createReadOnlyOAuthToken() {

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@
155155
"dotenv": "^16.4.0",
156156
"eslint-plugin-jsdoc": "^48.0.2",
157157
"nock": "^13.5.0",
158-
"typedoc": "^0.25.7",
159-
"typedoc-plugin-markdown": "^3.17.1",
158+
"typedoc": "^0.26.5",
159+
"typedoc-plugin-markdown": "^4.2.3",
160160
"vitepress": "1.3.1",
161161
"vitepress-sidebar": "1.24.1",
162162
"vitest": "^1.2.1",

src/clients/client.js

+8-15
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,14 @@ const {
1212
} = require('./helpers');
1313

1414
/**
15-
* @typedef {object} ClientOptions
16-
* @property {string} subdomain - Subdomain for the Zendesk instance.
17-
* @property {string} [password] - Password for authentication.
18-
* @property {string} [token] - Token for authentication.
19-
* @property {boolean} [useOAuth] - Flag to indicate if OAuth is used.
20-
* @property {string} [username] - Username for authentication.
21-
* @property {string} [asUser] - Optional header for making requests on behalf of a user.
22-
* @property {object} [customHeaders] - Any additional custom headers for the request.
23-
* @property {boolean} [throttle] - Flag to enable throttling of requests.
24-
* @property {boolean} [throwOriginalException] - Throw the original exception when API requests fail.
25-
* @property {CustomEventTarget} eventTarget - Event target to handle custom events.
26-
* @property {Array} sideLoad - Array to handle side-loaded resources.
27-
* @property {Array} jsonAPINames - Array to hold names used in the JSON API.
15+
* @typedef {import('../index').ZendeskClientOptions} ZendeskClientOptions
16+
*/
17+
18+
/**
19+
* @typedef {ZendeskClientOptions} ClientOptions
20+
*
21+
* This type extends `ZendeskClientOptions` to be used for configuring the Client instance.
22+
* All properties of `ZendeskClientOptions` are available here.
2823
*/
2924

3025
/**
@@ -33,7 +28,6 @@ const {
3328
* @class
3429
* @property {ClientOptions} options - Configuration options for the client.
3530
* @property {Array} sideLoad - Array to handle side-loaded resources.
36-
* @property {string} userAgent - User agent for the client.
3731
* @property {Array} jsonAPINames - Array to hold names used in the JSON API.
3832
* @property {boolean} useDotJson - Flag to indicate if the API endpoint should use '.json' ending.
3933
* @property {ApiTypes} apiType - Type of Zendesk API to initialize (e.g., 'core', 'helpcenter').
@@ -42,7 +36,6 @@ const {
4236
*/
4337
class Client {
4438
/**
45-
* @constructs Client
4639
* @param {ClientOptions} options - Configuration options for the client.
4740
* @param {ApiTypes} apiType - Type of Zendesk API to initialize (e.g., 'core', 'helpcenter').
4841
*/

src/clients/core/accountsettings.js

-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const {Client} = require('../client');
55
/**
66
* The AccountSettings class provides methods for interacting with account settings in the Zendesk JSON API.
77
* {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/account_settings/ | See the Zendesk API documentation for more details}.
8-
* @augments Client
98
*/
109
class AccountSettings extends Client {
1110
constructor(options) {
@@ -17,7 +16,6 @@ class AccountSettings extends Client {
1716
* Retrieves the account settings.
1817
* @returns {Promise<object>} A promise that resolves to the account settings.
1918
* {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/account_settings/#show-settings | See the Zendesk API documentation for more details}.
20-
* @async
2119
* @example
2220
* const settings = await client.accountsettings.show();
2321
*/
@@ -30,7 +28,6 @@ class AccountSettings extends Client {
3028
* @param {object} settings - The settings to update.
3129
* @returns {Promise<object>} A promise that resolves to the updated account settings.
3230
* {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/account_settings/#update-account-settings | See the Zendesk API documentation for more details}.
33-
* @async
3431
* @example
3532
* const settings = await client.accountsettings.update({ "settings": { "active_features": { "customer_satisfaction": false }}});
3633
*/

src/clients/core/activitystream.js

-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ const {Client} = require('../client');
55
/**
66
* `ActivityStream` provides methods to interact with Zendesk ticket activities.
77
* This class extends the base Client class and is tailored to fetch activity data.
8-
* @class
9-
* @augments {Client}
108
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/activity_stream/ | Zendesk Activity Stream API}
119
* @example
1210
* const client = new Client({ /* ...options... * / });
@@ -25,7 +23,6 @@ class ActivityStream extends Client {
2523
/**
2624
* Lists all ticket activities from the Zendesk API.
2725
* @returns {Array<object>} An array of activity objects.
28-
* @async
2926
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/activity_stream/#list-activities | Zendesk API - List Activities}
3027
* @example
3128
* const activities = await client.activitystream.list();
@@ -38,7 +35,6 @@ class ActivityStream extends Client {
3835
* Retrieves a specific ticket activity by its ID.
3936
* @param {number} activityID - The unique ID of the activity to fetch.
4037
* @returns {Promise<object>} A promise that resolves to the activity object corresponding to the provided activityID.
41-
* @async
4238
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/activity_stream/#show-activity | Zendesk API - Show Activity}
4339
* @example
4440
* const activity = await client.activitystream.show(12345); // Where 12345 is an activity ID.
@@ -55,7 +51,6 @@ class ActivityStream extends Client {
5551
* Note: When the count exceeds 100,000, count[refreshed_at] may occasionally be null. This indicates
5652
* that the count is being updated in the background, and count[value] is limited to 100,000 until the update is complete.
5753
* @returns {Promise<object>} A promise that resolves to an object containing the activity count and the refreshed_at timestamp.
58-
* @async
5954
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/activity_stream/#count-activities | Zendesk API - Count Activities}
6055
* @example
6156
* const activityCount = await client.activitystream.count();

src/clients/core/attachments.js

-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const {Client} = require('../client');
33

44
/**
55
* Represents the Attachments functionality of the Zendesk API.
6-
* @augments {Client}
76
* @see [Zendesk Attachments API]{@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-attachments/}
87
*/
98
class Attachments extends Client {
@@ -19,7 +18,6 @@ class Attachments extends Client {
1918
* @param {boolean} fileOptions.binary - If the file is binary or not.
2019
* @param {string} [fileOptions.token] - Token received from previous uploads (if multiple files are being attached).
2120
* @returns {Promise<object>} Returns the server's response.
22-
* @async
2321
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-attachments/#upload-files}
2422
* @example
2523
* const response = await client.attachments.upload(fileBuffer, { filename: "example.png", binary: true });
@@ -49,7 +47,6 @@ class Attachments extends Client {
4947
* Delete an uploaded file.
5048
* @param {string} token - The token of the uploaded attachment.
5149
* @returns {Promise<object>} Returns the server's response.
52-
* @async
5350
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-attachments/#delete-upload}
5451
* @example
5552
* const response = await client.attachments.deleteUpload("exampleToken");
@@ -62,7 +59,6 @@ class Attachments extends Client {
6259
* Retrieve details of a specific attachment.
6360
* @param {number} attachmentID - The ID of the attachment.
6461
* @returns {Promise<object>} Returns the details of the attachment.
65-
* @async
6662
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-attachments/#show-attachment}
6763
* @example
6864
* const attachmentDetails = await client.attachments.show(12345);
@@ -77,7 +73,6 @@ class Attachments extends Client {
7773
* @param {number} commentID - The ID of the comment.
7874
* @param {number} attachmentID - The ID of the attachment.
7975
* @returns {Promise<object>} Returns the server's response.
80-
* @async
8176
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-attachments/#redact-comment-attachment}
8277
* @example
8378
* const response = await client.attachments.redactAttachmentComment(1, 2, 3);
@@ -102,7 +97,6 @@ class Attachments extends Client {
10297
* @param {number} attachmentID - The ID of the attachment.
10398
* @param {boolean} malwareAccessOverride - Whether to override malware access. If true, agent can access attachment flagged as malware.
10499
* @returns {Promise<object>} The response from the Zendesk API.
105-
* @async
106100
* @throws {Error} Throws an error if the request fails.
107101
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-attachments/#update-attachment-for-malware}
108102
* @example

src/clients/core/automations.js

-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const {Client} = require('../client');
88
/**
99
* The Automations class provides methods for interacting with the Zendesk Automation API.
1010
* {@link https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/| See the Zendesk API documentation for more details}.
11-
* @augments Client
1211
*/
1312
class Automations extends Client {
1413
constructor(options) {
@@ -19,7 +18,6 @@ class Automations extends Client {
1918
/**
2019
* List all automations.
2120
* @returns {Promise<Array>} Returns a list of automations.
22-
* @async
2321
* @see {@link https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#list-automations}
2422
* @example const automations = await client.automations.list();
2523
*/
@@ -30,7 +28,6 @@ class Automations extends Client {
3028
/**
3129
* List all active automations.
3230
* @returns {Promise<Array>} Returns a list of active automations.
33-
* @async
3431
* @see {@link https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#list-active-automations}
3532
* @example const activeAutomations = await client.automations.listActive();
3633
*/
@@ -42,7 +39,6 @@ class Automations extends Client {
4239
* Get details of a specific automation by ID.
4340
* @param {number} automationID - The ID of the automation.
4441
* @returns {Promise<object>} Returns details of the automation.
45-
* @async
4642
* @see {@link https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#show-automation}
4743
* @example const automationDetails = await client.automations.show(123456);
4844
*/
@@ -54,7 +50,6 @@ class Automations extends Client {
5450
* Create a new automation.
5551
* @param {object} automationData - Data for the new automation.
5652
* @returns {Promise<object>} Returns the created automation.
57-
* @async
5853
* @see {@link https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#create-automation}
5954
* @example
6055
* const automation = await client.automations.create({
@@ -72,7 +67,6 @@ class Automations extends Client {
7267
* @param {number} automationID - ID of the automation to update.
7368
* @param {object} updatedData - Updated data for the automation.
7469
* @returns {Promise<object>} Returns the updated automation.
75-
* @async
7670
* @see {@link https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#update-automation}
7771
* @example
7872
* const updatedAutomation = await client.automations.update(12345, {
@@ -87,7 +81,6 @@ class Automations extends Client {
8781
* Update many automations in bulk.
8882
* @param {Array<object>} automations - Array of automation data with their IDs to be updated.
8983
* @returns {Promise<object>} Returns the status of the bulk update.
90-
* @async
9184
* @see {@link https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#update-many-automation}
9285
* @example
9386
* const status = await client.automations.updateMany([{id: 123, position: 1}, {id: 124, position: 2}]);
@@ -100,7 +93,6 @@ class Automations extends Client {
10093
* Delete an automation.
10194
* @param {number} automationID - ID of the automation to be deleted.
10295
* @returns {Promise<void>}
103-
* @async
10496
* @see {@link https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#delete-automation}
10597
* @example
10698
* await client.automations.delete(12345);
@@ -113,7 +105,6 @@ class Automations extends Client {
113105
* Bulk delete automations.
114106
* @param {Array<number>} ids - Array of automation IDs to be deleted.
115107
* @returns {Promise<void>}
116-
* @async
117108
* @see {@link https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#bulk-delete-automation}
118109
* @example
119110
* await client.automations.bulkDelete([12345, 67890]);
@@ -126,7 +117,6 @@ class Automations extends Client {
126117
* Search automations by with query.
127118
* @param {object} searchQuery - The parameters to search for ['active', 'include', 'query', 'sort_by', 'sort_order'].
128119
* @returns {Promise<Array>} Returns automations matching the search query.
129-
* @async
130120
* @see {@link https://developer.zendesk.com/api-reference/ticketing/business-rules/automations/#search-automation}
131121
* @example const foundAutomations = await client.automations.search('close');
132122
*/
@@ -138,7 +128,6 @@ class Automations extends Client {
138128
* Reorder the list of automations.
139129
* @param {Array<number>} automationIDs - Array of automation IDs in the desired order.
140130
* @returns {Promise<object>} Returns the status of the reorder.
141-
* @async
142131
* @example
143132
* const status = await client.automations.reorder([67890, 12345]);
144133
* @deprecated This may now be deprecated, please notify developers if you find this to be the case.

src/clients/core/brand.js

-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class Brand extends Client {
1313
/**
1414
* List all brands.
1515
* @returns {Promise<object>} The list of brands.
16-
* @async
1716
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/brands/#list-brands}
1817
* @example const brands = await client.brands.list();
1918
*/
@@ -25,7 +24,6 @@ class Brand extends Client {
2524
* Show a specific brand by ID.
2625
* @param {number} brandId - The ID of the brand.
2726
* @returns {Promise<object>} The brand details.
28-
* @async
2927
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/brands/#show-a-brand}
3028
* @example const brand = await client.brands.show(47);
3129
*/
@@ -37,7 +35,6 @@ class Brand extends Client {
3735
* Create a new brand.
3836
* @param {object} brand - The brand data.
3937
* @returns {Promise<object>} The created brand details.
40-
* @async
4138
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/brands/#create-brand}
4239
* @example const newBrand = await client.brands.create({name: "Brand 1", subdomain: "Brand1"});
4340
*/
@@ -50,7 +47,6 @@ class Brand extends Client {
5047
* @param {object} brand - The updated brand data.
5148
* @param {number} brandId - The ID of the brand to update.
5249
* @returns {Promise<object>} The updated brand details.
53-
* @async
5450
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/brands/#update-a-brand}
5551
* @example const updatedBrand = await client.brands.update({name: "Updated Brand"}, 47);
5652
*/
@@ -62,7 +58,6 @@ class Brand extends Client {
6258
* Delete a brand.
6359
* @param {number} brandId - The ID of the brand to delete.
6460
* @returns {Promise<object>} The deletion status.
65-
* @async
6661
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/brands/#delete-a-brand}
6762
* @example await client.brands.delete(47);
6863
*/
@@ -75,7 +70,6 @@ class Brand extends Client {
7570
* @param {string} hostMapping - The host mapping to check.
7671
* @param {string} subdomain - The subdomain to check.
7772
* @returns {Promise<object>} The check result.
78-
* @async
7973
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/brands/#check-host-mapping-validity}
8074
* @example await client.brands.checkHostMapping("brand1.com", "brand1");
8175
*/
@@ -91,7 +85,6 @@ class Brand extends Client {
9185
* Check host mapping validity for an existing brand.
9286
* @param {number} brandId - The ID of the brand to check.
9387
* @returns {Promise<object>} The check result.
94-
* @async
9588
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/brands/#check-host-mapping-validity-for-an-existing-brand}
9689
* @example await client.brands.checkHostMappingForExistingBrand(47);
9790
*/

src/clients/core/customagentroles.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
const {Client} = require('../client');
33

44
/**
5-
* @class
6-
* @classdesc Client for Zendesk's Custom Agent Roles API.
5+
* Client for Zendesk's Custom Agent Roles API.
76
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/custom_roles/}
87
*/
98
class CustomAgentRoles extends Client {
@@ -15,7 +14,6 @@ class CustomAgentRoles extends Client {
1514
/**
1615
* List all Custom Agent Roles.
1716
* @returns {Promise<object[]>} Returns a promise that resolves with the list of custom agent roles.
18-
* @async
1917
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/custom_roles/#list-custom-roles}
2018
* @example
2119
* const client = createClient({...});
@@ -29,7 +27,6 @@ class CustomAgentRoles extends Client {
2927
* Retrieve a specific Custom Agent Role by its ID.
3028
* @param {number} roleId The ID of the custom agent role to retrieve.
3129
* @returns {Promise<object>} Returns a promise that resolves with the specified custom agent role.
32-
* @async
3330
* @throws Will throw an error if unable to retrieve the role.
3431
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/custom_roles/#show-custom-role}
3532
* @example
@@ -44,7 +41,6 @@ class CustomAgentRoles extends Client {
4441
* Creates a new custom agent role.
4542
* @param {object} roleData - The data for the new custom agent role.
4643
* @returns {Promise<object>} The created custom agent role.
47-
* @async
4844
* @throws Will throw an error if creation fails.
4945
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/custom_roles/#create-custom-role}
5046
* @example
@@ -64,7 +60,6 @@ class CustomAgentRoles extends Client {
6460
* @param {number} customRoleId - The ID of the custom agent role to update.
6561
* @param {object} updatedData - The updated data for the custom agent role.
6662
* @returns {Promise<object>} The updated custom agent role.
67-
* @async
6863
* @throws Will throw an error if the update fails or custom agent role ID is not found.
6964
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/custom_roles/#update-custom-role}
7065
* @example
@@ -79,7 +74,6 @@ class CustomAgentRoles extends Client {
7974
* Delete a specific Custom Agent Role by its ID.
8075
* @param {number} roleId The ID of the custom agent role to delete.
8176
* @returns {Promise<void>} Returns a promise that resolves when the role is deleted.
82-
* @async
8377
* @throws Will throw an error if unable to delete the role.
8478
* @see {@link https://developer.zendesk.com/api-reference/ticketing/account-configuration/custom_roles/#delete-custom-role}
8579
* @example

0 commit comments

Comments
 (0)