From dc1f058ae70cf5beb7bd004233bc3e1972613bc0 Mon Sep 17 00:00:00 2001 From: Bill Neff Date: Mon, 16 Apr 2018 22:13:57 -0400 Subject: [PATCH] PREAPPS-548 Remove unushed and shouldn't be used calendars and folders queries --- package-lock.json | 2 +- src/batch-client/index.ts | 12 +----------- src/normalize/entities.ts | 4 ---- src/schema/generated-schema-types.ts | 25 ++++++++----------------- src/schema/schema.graphql | 10 ++-------- src/schema/schema.ts | 3 --- 6 files changed, 12 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index 75ab03b23..10ed0017f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@zimbra/api-client", - "version": "0.1.2", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/batch-client/index.ts b/src/batch-client/index.ts index 880cc8d65..f389db2f6 100644 --- a/src/batch-client/index.ts +++ b/src/batch-client/index.ts @@ -8,7 +8,6 @@ import { Folder, FolderAction, FreeBusy, - GetFolderResponse, MessageInfo, SearchResponse, ShareNotification @@ -115,15 +114,6 @@ export class ZimbraBatchClient { }); }; - public calendars = () => - this.jsonRequest({ - name: 'GetFolder', - body: { - view: FolderView.appointment, - tr: true - } - }).then(res => normalize(Folder)(res.folder[0].folder)); - public cancelTask = ({ inviteId }: any) => this.jsonRequest({ name: 'CancelTask', @@ -286,7 +276,7 @@ export class ZimbraBatchClient { ...options, tr: traverseMountpoints } - }).then(normalize(GetFolderResponse)); + }).then(normalize(Folder)); }; public getMailboxMetadata = ({ section }: GetMailboxMetadataOptions) => diff --git a/src/normalize/entities.ts b/src/normalize/entities.ts index f9326bf93..d27dfc869 100644 --- a/src/normalize/entities.ts +++ b/src/normalize/entities.ts @@ -195,10 +195,6 @@ Folder.addMapping({ }); export { Folder }; -export const GetFolderResponse = new Entity({ - folder: ['folders', Folder] -}); - const FreeBusyInstance = new Entity({ s: 'start', e: 'end' diff --git a/src/schema/generated-schema-types.ts b/src/schema/generated-schema-types.ts index 4375182b5..373b6418f 100644 --- a/src/schema/generated-schema-types.ts +++ b/src/schema/generated-schema-types.ts @@ -21,17 +21,15 @@ export interface MailItem { /* Zimbra GraphQL Queries- [[SOAP API Reference]](https://files.zimbra.com/docs/soap_api/8.7.11/api-reference/index.html)- [[SOAP Documentation]](https://github.com/Zimbra/zm-mailbox/blob/develop/store/docs/soap.txt)- [[SOAP XML-to-JSON Documentation]](https://wiki.zimbra.com/wiki/Json_format_to_represent_soap) */ export interface Query { accountInfo?: AccountInfo | null; - calendars?: Folder[] | null; folder?: Folder | null; - folders?: Folder[] | null; freeBusy?: FreeBusy[] | null; getContact?: Contact | null; getContactFrequency?: ContactFrequencyResponse | null; getConversation?: Conversation | null; - getFolder?: GetFolderResponse | null; + getFolder?: Folder | null; getMailboxMetadata?: MailboxMetadata | null; getMessage?: MessageInfo | null; - getSearchFolder?: GetFolderResponse | null; + getSearchFolder?: Folder | null; getTask?: boolean | null; noop?: boolean | null; preferences?: Preferences | null; @@ -448,10 +446,6 @@ export interface ContactFrequencyDataPoints { value?: number | null; } -export interface GetFolderResponse { - folders?: Folder[] | null; -} - export interface MailboxMetadata { meta?: MailboxMetadataMeta[] | null; } @@ -546,12 +540,6 @@ export interface SignatureResponse { id: string; } -export interface FolderQueryInput { - uuid?: string | null; - id?: string | null; - view?: FolderView | null; -} - export interface MailItemHeaderInput { n: string; } @@ -821,12 +809,15 @@ export interface ExternalAccount { username: string; password: string; } + +export interface FolderQueryInput { + uuid?: string | null; + id?: string | null; + view?: FolderView | null; +} export interface FolderQueryArgs { id: string; } -export interface FoldersQueryArgs { - ids: FolderQueryInput[]; -} export interface FreeBusyQueryArgs { names?: string[] | null; start?: number | null; diff --git a/src/schema/schema.graphql b/src/schema/schema.graphql index b3843e536..9939c76d2 100644 --- a/src/schema/schema.graphql +++ b/src/schema/schema.graphql @@ -404,10 +404,6 @@ type Folder { query: String } -type GetFolderResponse { - folders: [Folder] -} - type ACL { grant: [ACLGrant] } @@ -951,9 +947,7 @@ input MailItemHeaderInput { # - [[SOAP XML-to-JSON Documentation]](https://wiki.zimbra.com/wiki/Json_format_to_represent_soap) type Query { accountInfo: AccountInfo - calendars: [Folder] folder(id: ID!): Folder - folders(ids: [FolderQueryInput]!): [Folder] freeBusy(names: [String!], start: Float, end: Float): [FreeBusy] getContact(id: ID!): Contact getContactFrequency( @@ -976,7 +970,7 @@ type Query { depth: Int, traverseMountpoints: Boolean folder: GetFolderFolderInput - ): GetFolderResponse + ): Folder getMailboxMetadata(section: String): MailboxMetadata getMessage( id: ID!, @@ -990,7 +984,7 @@ type Query { read: Boolean, ridZ: String ): MessageInfo - getSearchFolder: GetFolderResponse + getSearchFolder: Folder getTask(inviteId: ID!): Boolean noop: Boolean preferences: Preferences diff --git a/src/schema/schema.ts b/src/schema/schema.ts index 7039aca93..12f6ffaca 100644 --- a/src/schema/schema.ts +++ b/src/schema/schema.ts @@ -22,7 +22,6 @@ import { CreateFolderOptions, CreateSearchFolderOptions, FolderOptions, - FoldersOptions, FreeBusyOptions, GetContactFrequencyOptions, GetContactOptions, @@ -51,9 +50,7 @@ export function createZimbraSchema( resolvers: { Query: { accountInfo: client.accountInfo, - calendars: client.calendars, folder: (_, variables) => client.folder(variables as FolderOptions), - folders: (_, variables) => client.folders(variables as FoldersOptions), freeBusy: (_, variables) => client.freeBusy(variables as FreeBusyOptions), getContact: (_, variables) =>