Skip to content

Commit

Permalink
feat: tickets & users types + adjustments on types exports
Browse files Browse the repository at this point in the history
  • Loading branch information
onhate committed Aug 1, 2024
1 parent e396120 commit cfc37f9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,36 @@
"types": "./dist/types/index.d.ts",
"default": "./dist/index.js"
}
},
"./clients/*": {
"import": {
"types": "./dist/types/clients/*.d.ts",
"default": "./dist/clients/*.js"
},
"require": {
"types": "./dist/types/clients/*.d.ts",
"default": "./dist/clients/*.js"
}
},
"./clients/*/*": {
"import": {
"types": "./dist/types/clients/*/*.d.ts",
"default": "./dist/clients/*/*.js"
},
"require": {
"types": "./dist/types/clients/*/*.d.ts",
"default": "./dist/clients/*/*.js"
}
},
"./clients/*/*/*": {
"import": {
"types": "./dist/types/clients/*/*/*.d.ts",
"default": "./dist/clients/*/*/*.js"
},
"require": {
"types": "./dist/types/clients/*/*/*.d.ts",
"default": "./dist/clients/*/*/*.js"
}
}
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/clients/core/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class Tickets extends Client {
* Update an existing ticket by its ID.
* @param {number} ticketId - The ID of the ticket to update.
* @param {CreateOrUpdateTicket} ticket - The updated ticket data as an object.
* @returns {Promise<{result: Ticket}>} A promise that resolves to the updated ticket object.
* @returns {Promise<{result: Ticket, response: {ticket:Ticket, audit:any[]}}>} A promise that resolves to the updated ticket object.
* @async
* @throws {Error} If `ticketId` is not a number or if `ticket` is not an object.
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#update-ticket}
Expand Down
2 changes: 1 addition & 1 deletion src/clients/core/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class Users extends Client {
/**
* Shows details of a user by ID.
* @param {number} id - The ID of the user.
* @returns {Promise<User>} The user's details.
* @returns {Promise<{result: User}>} The user's details.
* @async
* @see {@link https://developer.zendesk.com/api-reference/ticketing/users/users/#show-user}
* @example
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {ZendeskClientVoice} = require('./clients/voice');
/**
* @typedef {object} ZendeskClientOptions
* @property {string} [token] - Authentication token.
* @property {string} [password] - Authentication password.
* @property {string} [username] - Username for authentication.
* @property {string} [subdomain] - Subdomain for the Zendesk account (e.g., 'mycompany' for 'mycompany.zendesk.com'). If `endpointUri` is provided, this is ignored.
* @property {string[]} [apiType=['core']] - Type of Zendesk API (e.g., 'core', 'helpcenter'). Determines the sub-client to use.
Expand Down

0 comments on commit cfc37f9

Please sign in to comment.