From 07621669406a184960c01de406e06eda5905ec8c Mon Sep 17 00:00:00 2001 From: Lizandro Ramirez <117939390+lizandro-mc@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:28:51 -0400 Subject: [PATCH 1/9] fix: paginator info in get leads --- package.json | 2 +- src/queries/leads.query.ts | 6 +++++- src/types/leads.ts | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index c8f4f1c1..aea83b1b 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.0.33", + "version": "0.0.35", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/src/queries/leads.query.ts b/src/queries/leads.query.ts index 18ddd443..802a4e44 100644 --- a/src/queries/leads.query.ts +++ b/src/queries/leads.query.ts @@ -2,7 +2,11 @@ import { gql } from '@apollo/client/core'; export const GET_ALL_LEADS_QUERY = gql` query GetLeads($first: Int, $page: Int) { - leads(first: $first, page: $page) { + leads( + first: $first + page: $page + orderBy: { column: CREATED_AT, order: DESC } + ) { data { id uuid diff --git a/src/types/leads.ts b/src/types/leads.ts index 67c0796a..b6389a43 100644 --- a/src/types/leads.ts +++ b/src/types/leads.ts @@ -95,7 +95,6 @@ export interface CreateLeadData { pipeline?: Pipeline | null; people?: People; followers?: { data: Follower[] }; - paginatorInfo?: PaginatorInfo; files?: File[]; } @@ -145,5 +144,5 @@ export interface LeadsDashboardData { } export interface LeadsData { - leads: { data: CreateLeadData[] }; + leads: { data: CreateLeadData[], paginatorInfo?: PaginatorInfo }; } From a75c618e06ab0b74f410eccd2b49a31c5e996bfd Mon Sep 17 00:00:00 2001 From: Lizandro Ramirez <117939390+lizandro-mc@users.noreply.github.com> Date: Tue, 12 Sep 2023 17:27:18 -0400 Subject: [PATCH 2/9] fix: sdk version 0.0.34 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aea83b1b..699f024c 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.0.35", + "version": "0.0.34", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", From 1076b6484f595f0b15db51642d634500ba248649 Mon Sep 17 00:00:00 2001 From: Lizandro Date: Thu, 2 Nov 2023 21:27:31 -0400 Subject: [PATCH 3/9] refactor: multiple file upload method --- src/modules/users/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/users/index.ts b/src/modules/users/index.ts index 97344464..a9d5e11f 100644 --- a/src/modules/users/index.ts +++ b/src/modules/users/index.ts @@ -100,7 +100,7 @@ export class Users { return response.data; } - public async multiUpload(files: []): Promise { + public async multipleUploadFiles(files: File[]): Promise { const response = await this.client.mutate({ mutation: MULTIPLE_UPLOAD_FILES, variables: { From f8af4a412b35611ec7192b64033f97b8490783fe Mon Sep 17 00:00:00 2001 From: Lizandro Ramirez <117939390+lizandro-mc@users.noreply.github.com> Date: Sat, 11 Nov 2023 01:30:55 -0400 Subject: [PATCH 4/9] feat: add files to lead by uuid query --- src/queries/leads.query.ts | 6 ++++++ src/types/leads.ts | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/queries/leads.query.ts b/src/queries/leads.query.ts index 5e8c4f04..b5da5f38 100644 --- a/src/queries/leads.query.ts +++ b/src/queries/leads.query.ts @@ -168,6 +168,12 @@ export const GET_LEAD_BY_UUID_QUERY = gql` value } } + files { + data { + name + url + } + } } } } diff --git a/src/types/leads.ts b/src/types/leads.ts index 8797486c..8366eab4 100644 --- a/src/types/leads.ts +++ b/src/types/leads.ts @@ -49,7 +49,7 @@ interface Receiver { uuid: string; } -interface File { +interface LeadAttachment { name: string; url: string; } @@ -96,7 +96,7 @@ export interface CreateLeadData { pipeline?: Pipeline | null; people?: People; followers?: { data: Follower[] }; - files?: File[]; + files?: { data: LeadAttachment[] }; } export interface LeadInput { @@ -113,7 +113,7 @@ export interface LeadInput { reason_lost: string; pipeline_stage_id: number; custom_fields: CustomFieldInput[]; - files?: File[]; + files?: LeadAttachment[]; } export interface WhereCondition { From f0ec16d5c4ca5a5b4a2360c099198b06980fda61 Mon Sep 17 00:00:00 2001 From: Lizandro Date: Sun, 12 Nov 2023 14:11:05 -0400 Subject: [PATCH 5/9] chore: update package json 0.0.58 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ac209df..bf091c62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "version": "0.0.57", + "version": "0.0.58", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", From 34749d39c612f9167ba060aa8aeff589260d1da9 Mon Sep 17 00:00:00 2001 From: Lizandro Date: Sun, 12 Nov 2023 22:23:32 -0400 Subject: [PATCH 6/9] fix: add paginator field to lead create data --- src/types/leads.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/leads.ts b/src/types/leads.ts index 8366eab4..4f11c616 100644 --- a/src/types/leads.ts +++ b/src/types/leads.ts @@ -96,6 +96,7 @@ export interface CreateLeadData { pipeline?: Pipeline | null; people?: People; followers?: { data: Follower[] }; + paginatorInfo?: PaginatorInfo; files?: { data: LeadAttachment[] }; } From 3f7480cd7daa626d7a864cd30823ef508b668d59 Mon Sep 17 00:00:00 2001 From: Lizandro Date: Sun, 12 Nov 2023 22:31:37 -0400 Subject: [PATCH 7/9] refactor: remove multiple file upload users method --- src/modules/users/index.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/modules/users/index.ts b/src/modules/users/index.ts index d33e12f0..88f4b52c 100644 --- a/src/modules/users/index.ts +++ b/src/modules/users/index.ts @@ -101,17 +101,6 @@ export class Users { return response.data; } - public async multipleUploadFiles(files: File[]): Promise { - const response = await this.client.mutate({ - mutation: MULTIPLE_UPLOAD_FILES, - variables: { - files, - }, - }); - - return response.data; - } - public isAdmin(user: UserData): boolean { const roles = user.roles; if (Array.isArray(roles)) { From 871eb9576a5c2e0aabffedb2d062e193f0dee8c7 Mon Sep 17 00:00:00 2001 From: Lizandro Date: Sun, 12 Nov 2023 22:32:36 -0400 Subject: [PATCH 8/9] refactor: remove multiple file upload mutation --- src/modules/users/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/users/index.ts b/src/modules/users/index.ts index 88f4b52c..24e9f9a7 100644 --- a/src/modules/users/index.ts +++ b/src/modules/users/index.ts @@ -6,7 +6,6 @@ import { UPDATE_USER_MUTATION, INVITE_USER_MUTATION, SWITCH_COMPANY_BRANCH_MUTATION, - MULTIPLE_UPLOAD_FILES, } from '../../mutations'; import { UserInterface, From 4672406a7f761ed3d42164fc25f964e59b5942fe Mon Sep 17 00:00:00 2001 From: Lizandro Date: Sun, 12 Nov 2023 22:35:35 -0400 Subject: [PATCH 9/9] fix: missing declared but never read --- src/modules/users/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/users/index.ts b/src/modules/users/index.ts index 24e9f9a7..f3f3777c 100644 --- a/src/modules/users/index.ts +++ b/src/modules/users/index.ts @@ -17,7 +17,6 @@ import { InviteUserParams, WhereCondition, RoleData, - MultiUpload, RolesEnum, } from '../../types';