@@ -6,11 +6,13 @@ import type { ClientConfiguration } from "./config";
66import { getConfig , setConfig } from "./config" ;
77import { entities } from "./model" ;
88import type { Activity } from "./model/Activity" ;
9+ import type { EnvironmentAccessRole } from "./model/EnvironmentAccess" ;
910import type {
1011 CreateAccessParams ,
1112 DeleteAccessParams ,
1213 UpdateAccessParams
1314} from "./model/EnvironmentType" ;
15+ import type { InvitationEnvironmentType } from "./model/Invitation" ;
1416import type { Me } from "./model/Me" ;
1517import type { APIObject } from "./model/Ressource" ;
1618import type { TicketQueryParams } from "./model/Ticket" ;
@@ -113,12 +115,6 @@ export default class Client {
113115
114116 /**
115117 * Get a single project by its ID.
116- *
117- * @param string id
118- * @param string hostname
119- * @param bool https
120- *
121- * @return Project|false
122118 */
123119 async getProject ( id : string ) {
124120 return entities . Project . get ( { id } ) ;
@@ -158,7 +154,7 @@ export default class Client {
158154 async getEnvironmentActivities (
159155 projectId : string ,
160156 environmentId : string ,
161- type ?: string ,
157+ type ?: string | string [ ] ,
162158 starts_at ?: Date
163159 ) {
164160 const startsAt = starts_at ?. toISOString ( ) ;
@@ -365,7 +361,7 @@ export default class Client {
365361 async getIntegrationActivities (
366362 projectId : string ,
367363 integrationId : string ,
368- type : string ,
364+ type : string | string [ ] ,
369365 starts_at ?: Date
370366 ) {
371367 const { api_url } = getConfig ( ) ;
@@ -1389,7 +1385,7 @@ export default class Client {
13891385 *
13901386 * @return Promise<Ticket>
13911387 */
1392- async updateTicketStatus ( ticketId : string , status : string ) {
1388+ async updateTicketStatus ( ticketId : string | number , status : string ) {
13931389 return entities . Ticket . patch ( ticketId , { status } ) . then ( ticket => ticket ) ;
13941390 }
13951391
@@ -1426,7 +1422,7 @@ export default class Client {
14261422 *
14271423 * @return Promise<Attachment[]>
14281424 */
1429- async getTicketAttachments ( ticketId : string ) {
1425+ async getTicketAttachments ( ticketId : string | number ) {
14301426 const response = await entities . Ticket . getAttachments ( ticketId ) ;
14311427 const { attachments } = response ;
14321428 return Object . entries ( attachments || { } ) . map ( ( [ filename , attachment ] ) => ( {
@@ -1443,7 +1439,7 @@ export default class Client {
14431439 *
14441440 * @return Promise<Attachment[]>
14451441 */
1446- async getAllTicketAttachments ( ticketId : string ) {
1442+ async getAllTicketAttachments ( ticketId : string | number ) {
14471443 const response = await entities . Ticket . getAllAttachments ( ticketId ) ;
14481444 return response . map ( attachment => ( {
14491445 filename : attachment . filename ,
@@ -1518,7 +1514,7 @@ export default class Client {
15181514 * Updates the user profile picture
15191515 *
15201516 * @param {string } userId User identifier
1521- * @param {FormData } FormData object containign picture File object to be
1517+ * @param {FormData } picture object containing picture File object to be
15221518 * uploaded.
15231519 *
15241520 * @returns {Promise<{url: string}> } Promise that returns the url to the new
@@ -1624,8 +1620,8 @@ export default class Client {
16241620 projectId : string ,
16251621 role : string ,
16261622 permissions : {
1627- type : "production" | "development" | "staging" ;
1628- role : "viewer" | "contributor" | "admin" ;
1623+ type : InvitationEnvironmentType ;
1624+ role : EnvironmentAccessRole ;
16291625 } [ ] ,
16301626 force = false
16311627 ) {
0 commit comments