Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@droz-js/node-zendesk

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@droz-js/node-zendesk - npm Package Compare versions

Comparing version 5.0.8-rc.1 to 5.0.13-rc.1

5

dist/types/clients/client.d.ts

@@ -35,2 +35,6 @@ export type ClientOptions = {

/**
* - Throw the original exception when API requests fail.
*/
throwOriginalException?: boolean;
/**
* - Event target to handle custom events.

@@ -58,2 +62,3 @@ */

* @property {boolean} [throttle] - Flag to enable throttling of requests.
* @property {boolean} [throwOriginalException] - Throw the original exception when API requests fail.
* @property {CustomEventTarget} eventTarget - Event target to handle custom events.

@@ -60,0 +65,0 @@ * @property {Array} sideLoad - Array to handle side-loaded resources.

43

dist/types/clients/core/organizationmemberships.d.ts

@@ -60,4 +60,4 @@ /**

* Create a new organization membership.
* @param {object} organizationMembership - The organization membership data.
* @returns {Promise<object>} A promise resolving to the created organization membership.
* @param {OrganizationMembership} organizationMembership - The organization membership data.
* @returns {Promise<OrganizationMembership>} A promise resolving to the created organization membership.
* @async

@@ -68,3 +68,23 @@ * @see {@link https://developer.zendesk.com/api-reference/ticketing/organizations/organization_memberships/#create-membership}

*/
create(organizationMembership: object): Promise<object>;
create(organizationMembership: {
/**
* The Zendesk identifier of the user.
*/
user_id: number;
/**
* The Zendesk identifier of the
* organization.
*/
organization_id: number;
}): Promise<{
/**
* The Zendesk identifier of the user.
*/
user_id: number;
/**
* The Zendesk identifier of the
* organization.
*/
organization_id: number;
}>;
/**

@@ -74,3 +94,4 @@ * Create a new organization membership for a specific user.

* @param {object} organizationMembership - The organization membership data.
* @returns {Promise<object>} A promise resolving to the created organization membership.
* @param {number} organizationMembership.organization_id - The organization id of the membership.
* @returns {Promise<OrganizationMembership>} A promise resolving to the created organization membership.
* @async

@@ -81,3 +102,15 @@ * @see {@link https://developer.zendesk.com/api-reference/ticketing/organizations/organization_memberships/#create-membership}

*/
createByUser(userID: number, organizationMembership: object): Promise<object>;
createByUser(userID: number, organizationMembership: {
organization_id: number;
}): Promise<{
/**
* The Zendesk identifier of the user.
*/
user_id: number;
/**
* The Zendesk identifier of the
* organization.
*/
organization_id: number;
}>;
/**

@@ -84,0 +117,0 @@ * An object that relates a Zendesk user to a Zendesk organization.

26

dist/types/clients/core/sideconversations.d.ts

@@ -68,3 +68,3 @@ export type Participant = {

external_ids?: {
[x: string]: string;
[key: string]: string;
};

@@ -91,3 +91,3 @@ };

external_ids?: {
[x: string]: string;
[key: string]: string;
};

@@ -170,3 +170,3 @@ /**

external_ids?: {
[x: string]: string;
[key: string]: string;
};

@@ -200,3 +200,3 @@ };

* @property {string[]} [attachment_ids] - List of tokens received from uploading files for comment attachments. The files are attached by creating or updating tickets with the tokens. See Attaching files in Tickets
* @property {Object.<string, string>} [external_ids] - A key-value object where all values are strings. Used for message metadata
* @property {{[key: string]: string}} [external_ids] - A key-value object where all values are strings. Used for message metadata
*/

@@ -211,3 +211,3 @@ /**

* @property {string} created_at - The time the side conversation was created
* @property {Object.<string, string>} [external_ids] - A key-value store of metadata. All values must be strings
* @property {{[key: string]: string}} [external_ids] - A key-value store of metadata. All values must be strings
* @property {string} id - Automatically assigned when the side conversation is created

@@ -236,3 +236,3 @@ * @property {string} message_added_at - The time of the last message on the side conversation

* @property {Message} message - The side conversation object.
* @property {Object.<string, string>} [external_ids] - A key-value object where all values are strings. Used for conversation metadata
* @property {{[key: string]: string}} [external_ids] - A key-value object where all values are strings. Used for conversation metadata
*/

@@ -294,4 +294,4 @@ /**

* List all the Side Conversations tickets.
* @param ticketID
* @returns {Promise<{result: Array<Ticket>}>} An array of tickets.
* @param {number} ticketID - the Id of the ticket.
* @returns {Promise<{result: Array<{ side_conversations: SideConversation[] }>}>} An array of tickets.
* @async

@@ -302,4 +302,6 @@ * @see https://developer.zendesk.com/api-reference/ticketing/side_conversation/side_conversation/#list-side-conversations

*/
list(ticketID: any): Promise<{
result: Array<Ticket>;
list(ticketID: number): Promise<{
result: Array<{
side_conversations: SideConversation[];
}>;
}>;

@@ -324,9 +326,9 @@ /**

* @param {object} options - The file options.
* @param options.filename
* @param {string} options.filename - The name of the file.
* @returns {Promise<SideConversationAttachment>} The attachment details.
*/
attachments(file: ArrayBuffer, { filename }: {
filename: any;
filename: string;
}): Promise<SideConversationAttachment>;
}
import { Client } from "../client";

@@ -0,2 +1,157 @@

export type TicketField = {
/**
* - Whether this field is available
*/
active: boolean;
/**
* - A description of the ticket field that only agents can see
*/
agent_description: string;
/**
* - If true, the field is shown to agents by default. If false, the field is hidden alongside infrequently used fields. Classic interface only
*/
collapsed_for_agents: boolean;
/**
* - The time the custom ticket field was created
*/
created_at: string;
/**
* - Name of the app that created the ticket field, or a null value if no app created the ticket field
*/
creator_app_name: string;
/**
* - The id of the user that created the ticket field, or a value of "-1" if an app created the ticket field
*/
creator_user_id: number;
/**
* - Required and presented for a custom ticket field of type "multiselect" or "tagger"
*/
custom_field_options: any[];
/**
* - List of customized ticket statuses. Only presented for a system ticket field of type "custom_status"
*/
custom_statuses: any[];
/**
* - Describes the purpose of the ticket field to users
*/
description: string;
/**
* - Whether this field is editable by end users in Help Center
*/
editable_in_portal: boolean;
/**
* - Automatically assigned when created
*/
id: number;
/**
* - The relative position of the ticket field on a ticket. Note that for accounts with ticket forms, positions are controlled by the different forms
*/
position: number;
/**
* - The dynamic content placeholder if present, or the description value if not. See Dynamic Content
*/
raw_description: string;
/**
* - The dynamic content placeholder if present, or the title value if not. See Dynamic Content
*/
raw_title: string;
/**
* - The dynamic content placeholder if present, or the "title_in_portal" value if not. See Dynamic Content
*/
raw_title_in_portal: string;
/**
* - For "regexp" fields only. The validation pattern for a field value to be deemed valid
*/
regexp_for_validation: string;
/**
* - A filter definition that allows your autocomplete to filter down results
*/
relationship_filter: object;
/**
* - A representation of what type of object the field references. Options are "zen:user", "zen:organization", "zen:ticket", or "zen:custom_object:{key}" where key is a custom object key. For example "zen:custom_object:apartment".
*/
relationship_target_type: string;
/**
* - If false, this field is a system field that must be present on all tickets
*/
removable: boolean;
/**
* - If true, agents must enter a value in the field to change the ticket status to solved
*/
required: boolean;
/**
* - If true, end users must enter a value in the field to create the request
*/
required_in_portal: boolean;
/**
* - For system ticket fields of type "priority" and "status". Defaults to 0. A "priority" sub type of 1 removes the "Low" and "Urgent" options. A "status" sub type of 1 adds the "On-Hold" option
*/
sub_type_id: number;
/**
* - Presented for a system ticket field of type "tickettype", "priority" or "status"
*/
system_field_options: any[];
/**
* - For "checkbox" fields only. A tag added to tickets when the checkbox field is selected
*/
tag: string;
/**
* - The title of the ticket field
*/
title: string;
/**
* - The title of the ticket field for end users in Help Center
*/
title_in_portal: string;
/**
* - System or custom field type. Editable for custom field types and only on creation. See Create Ticket Field
*/
type: string;
/**
* - The time the custom ticket field was last updated
*/
updated_at: string;
/**
* - The URL for this resource
*/
url: string;
/**
* - Whether this field is visible to end users in Help Center
*/
visible_in_portal: boolean;
};
/**
* @typedef {object} TicketField
* @property {boolean} active - Whether this field is available
* @property {string} agent_description - A description of the ticket field that only agents can see
* @property {boolean} collapsed_for_agents - If true, the field is shown to agents by default. If false, the field is hidden alongside infrequently used fields. Classic interface only
* @property {string} created_at - The time the custom ticket field was created
* @property {string} creator_app_name - Name of the app that created the ticket field, or a null value if no app created the ticket field
* @property {number} creator_user_id - The id of the user that created the ticket field, or a value of "-1" if an app created the ticket field
* @property {Array} custom_field_options - Required and presented for a custom ticket field of type "multiselect" or "tagger"
* @property {Array} custom_statuses - List of customized ticket statuses. Only presented for a system ticket field of type "custom_status"
* @property {string} description - Describes the purpose of the ticket field to users
* @property {boolean} editable_in_portal - Whether this field is editable by end users in Help Center
* @property {number} id - Automatically assigned when created
* @property {number} position - The relative position of the ticket field on a ticket. Note that for accounts with ticket forms, positions are controlled by the different forms
* @property {string} raw_description - The dynamic content placeholder if present, or the description value if not. See Dynamic Content
* @property {string} raw_title - The dynamic content placeholder if present, or the title value if not. See Dynamic Content
* @property {string} raw_title_in_portal - The dynamic content placeholder if present, or the "title_in_portal" value if not. See Dynamic Content
* @property {string} regexp_for_validation - For "regexp" fields only. The validation pattern for a field value to be deemed valid
* @property {object} relationship_filter - A filter definition that allows your autocomplete to filter down results
* @property {string} relationship_target_type - A representation of what type of object the field references. Options are "zen:user", "zen:organization", "zen:ticket", or "zen:custom_object:{key}" where key is a custom object key. For example "zen:custom_object:apartment".
* @property {boolean} removable - If false, this field is a system field that must be present on all tickets
* @property {boolean} required - If true, agents must enter a value in the field to change the ticket status to solved
* @property {boolean} required_in_portal - If true, end users must enter a value in the field to create the request
* @property {number} sub_type_id - For system ticket fields of type "priority" and "status". Defaults to 0. A "priority" sub type of 1 removes the "Low" and "Urgent" options. A "status" sub type of 1 adds the "On-Hold" option
* @property {Array} system_field_options - Presented for a system ticket field of type "tickettype", "priority" or "status"
* @property {string} tag - For "checkbox" fields only. A tag added to tickets when the checkbox field is selected
* @property {string} title - The title of the ticket field
* @property {string} title_in_portal - The title of the ticket field for end users in Help Center
* @property {string} type - System or custom field type. Editable for custom field types and only on creation. See Create Ticket Field
* @property {string} updated_at - The time the custom ticket field was last updated
* @property {string} url - The URL for this resource
* @property {boolean} visible_in_portal - Whether this field is visible to end users in Help Center
*/
/**
* Client for the Zendesk Ticket Fields API.

@@ -10,3 +165,3 @@ * @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_fields/}

* Lists all ticket fields.
* @returns {Promise<Array>} Returns an array of ticket fields.
* @returns {Promise<Array<TicketField>>}>} Returns an array of ticket fields.
* @async

@@ -19,7 +174,7 @@ * @throws {Error} Throws an error if the request fails.

*/
list(): Promise<any[]>;
list(): Promise<Array<TicketField>>;
/**
* Retrieves a specific ticket field by ID.
* @param {number} ticketFieldId - The ID of the ticket field to retrieve.
* @returns {Promise<object>} Returns the details of the ticket field.
* @returns {Promise<TicketField>} Returns the details of the ticket field.
* @async

@@ -32,3 +187,3 @@ * @throws {Error} Throws an error if the request fails.

*/
show(ticketFieldId: number): Promise<object>;
show(ticketFieldId: number): Promise<TicketField>;
/**

@@ -48,3 +203,3 @@ * Retrieves the count of ticket fields.

* @param {object} ticketField - The properties of the ticket field to create.
* @returns {Promise<object>} Returns the created ticket field.
* @returns {Promise<TicketField>} Returns the created ticket field.
* @async

@@ -60,3 +215,3 @@ * @throws {Error} Throws an error if the request fails.

*/
create(ticketField: object): Promise<object>;
create(ticketField: object): Promise<TicketField>;
/**

@@ -66,3 +221,3 @@ * Updates a specific ticket field by ID.

* @param {object} ticketField - The updated properties of the ticket field.
* @returns {Promise<object>} Returns the updated ticket field.
* @returns {Promise<TicketField>} Returns the updated ticket field.
* @async

@@ -77,3 +232,3 @@ * @throws {Error} Throws an error if the request fails.

*/
update(ticketFieldId: number, ticketField: object): Promise<object>;
update(ticketFieldId: number, ticketField: object): Promise<TicketField>;
/**

@@ -80,0 +235,0 @@ * Deletes a specific ticket field by ID.

@@ -340,2 +340,14 @@ export type RecursivePartial = object;

export type Type = 'problem' | 'incident' | 'question' | 'task';
export type CreateOrUpdateTicket = {
/**
* - The ticket object to create or update.
*/
ticket?: any;
};
export type CreateManyTickets = {
/**
* - The ticket object to create many tickets.
*/
tickets?: Array<Ticket>;
};
/**

@@ -450,6 +462,10 @@ * @typedef {object} RecursivePartial

/**
* @typedef {T extends object ? { [K in keyof T]?: RecursivePartial<T[K]> } : T} RecursivePartial
* @template T
* @typedef {object} CreateOrUpdateTicket
* @property {RecursivePartial<Ticket>} [ticket] - The ticket object to create or update.
*/
/**
* @typedef {object} CreateManyTickets
* @property {Array<Ticket>} [tickets] - The ticket object to create many tickets.
*/
/**
* @class

@@ -608,16 +624,18 @@ * Client for the Zendesk API - Tickets.

* Create multiple new tickets.
* @param {Array<CreateOrUpdateTicket>} tickets - An array of ticket objects to create.
* @param {CreateManyTickets} tickets - An object of tickets containing an array of tickets.
* @returns {Promise<Array<Ticket>>} A promise that resolves to an array of created ticket objects.
* @async
* @throws {Error} If the provided `tickets` is not an array or is empty.
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#create-multiple-tickets}
* @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#create-many-tickets}
* @example
* // Create multiple new tickets
* const newTickets = [
* { subject: 'Ticket 1', description: 'Description 1' },
* { subject: 'Ticket 2', description: 'Description 2' },
* ];
* const newTickets = {
* tickets: [
* { subject: 'Ticket 1', description: 'Description 1' },
* { subject: 'Ticket 2', description: 'Description 2' },
* ]
* };
* const createdTickets = await client.tickets.createMany(newTickets);
*/
createMany(tickets: Array<CreateOrUpdateTicket>): Promise<Array<Ticket>>;
createMany(tickets: CreateManyTickets): Promise<Array<Ticket>>;
/**

@@ -627,3 +645,3 @@ * Update an existing ticket by its ID.

* @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

@@ -642,2 +660,6 @@ * @throws {Error} If `ticketId` is not a number or if `ticket` is not an object.

result: Ticket;
response: {
ticket: Ticket;
audit: any[];
};
}>;

@@ -644,0 +666,0 @@ /**

@@ -282,3 +282,3 @@ export type User = {

* @param {number} id - The ID of the user.
* @returns {Promise<User>} The user's details.
* @returns {Promise<{result: User}>} The user's details.
* @async

@@ -289,3 +289,5 @@ * @see {@link https://developer.zendesk.com/api-reference/ticketing/users/users/#show-user}

*/
show(id: number): Promise<User>;
show(id: number): Promise<{
result: User;
}>;
/**

@@ -292,0 +294,0 @@ * Shows details of multiple users by their IDs.

@@ -7,2 +7,6 @@ export type ZendeskClientOptions = {

/**
* - Authentication password.
*/
password?: string;
/**
* - Username for authentication.

@@ -48,2 +52,6 @@ */

/**
* - Throw the original exception when API requests fail.
*/
throwOriginalException?: boolean;
/**
* - Enables or disables debug logging.

@@ -67,2 +75,3 @@ */

* @property {string} [token] - Authentication token.
* @property {string} [password] - Authentication password.
* @property {string} [username] - Username for authentication.

@@ -78,2 +87,3 @@ * @property {string} [subdomain] - Subdomain for the Zendesk account (e.g., 'mycompany' for 'mycompany.zendesk.com'). If `endpointUri` is provided, this is ignored.

* @property {boolean} [throttle] - Enables request throttling.
* @property {boolean} [throwOriginalException] - Throw the original exception when API requests fail.
* @property {boolean} [debug=false] - Enables or disables debug logging.

@@ -132,5 +142,5 @@ * @property {object} [logger=ConsoleLogger] - Logger for logging. Defaults to a basic console logger.

/**
* @returns {Groups}
* @returns {import('./clients/core/groups.js').Groups} The Group client.
*/
get groups(): import("./clients/core/groups").Groups;
get groups(): import("./clients/core/groups.js").Groups;
get imports(): import("./clients/core/imports").Imports;

@@ -154,5 +164,5 @@ get installations(): import("./clients/core/installations").Installations;

/**
* @returns {SideConversations}
* @returns {import('./clients/core/sideconversations.js').SideConversations} The SideConversations client.
*/
get sideconversations(): import("./clients/core/sideconversations").SideConversations;
get sideconversations(): import("./clients/core/sideconversations.js").SideConversations;
get suspendedtickets(): import("./clients/core/suspendedtickets").SuspendedTickets;

@@ -168,9 +178,9 @@ get tags(): import("./clients/core/tags").Tags;

/**
* @returns {TicketMetrics}
* @returns {import('./clients/core/ticketmetrics.js').TicketMetrics} The TicketMetrics client
*/
get ticketmetrics(): import("./clients/core/ticketmetrics").TicketMetrics;
get ticketmetrics(): import("./clients/core/ticketmetrics.js").TicketMetrics;
/**
* @returns {Tickets}
* @returns {import('./clients/core/tickets.js').Tickets} The Tickets client.
*/
get tickets(): import("./clients/core/tickets").Tickets;
get tickets(): import("./clients/core/tickets.js").Tickets;
get triggers(): import("./clients/core/triggers").Triggers;

@@ -180,5 +190,5 @@ get userfields(): import("./clients/core/userfields").UserFields;

/**
* @returns {Users}
* @returns {import('./clients/core/users.js').Users} The Users Instance
*/
get users(): import("./clients/core/users").Users;
get users(): import("./clients/core/users.js").Users;
get views(): import("./clients/core/views").Views;

@@ -185,0 +195,0 @@ get webhooks(): import("./clients/core/webhooks").Webhooks;

{
"name": "@droz-js/node-zendesk",
"version": "5.0.8-rc.1",
"version": "5.0.13-rc.1",
"type": "commonjs",

@@ -49,2 +49,32 @@ "description": "A trusted Zendesk API client library for Node.js and the browser, lovingly maintained for over 10 years.",

}
},
"./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"
}
}

@@ -125,11 +155,11 @@ },

"devDependencies": {
"@vitest/coverage-v8": "^0.34.3",
"dotenv": "^16.3.1",
"eslint-plugin-jsdoc": "^46.8.2",
"nock": "^13.3.3",
"typedoc": "^0.25.2",
"typedoc-plugin-markdown": "^3.16.0",
"vitepress": "^1.0.0-rc.20",
"vitepress-sidebar": "^1.18.0",
"vitest": "^0.34.3",
"@vitest/coverage-v8": "^1.2.1",
"dotenv": "^16.4.0",
"eslint-plugin-jsdoc": "^48.0.2",
"nock": "^13.5.0",
"typedoc": "^0.25.7",
"typedoc-plugin-markdown": "^3.17.1",
"vitepress": "1.0.0-rc.40",
"vitepress-sidebar": "^1.18.6",
"vitest": "^1.2.1",
"vue-github-button": "^3.1.0",

@@ -136,0 +166,0 @@ "xo": "^0.56.0"

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc