Skip to content

Commit

Permalink
Merge pull request #9 from Zimbra/PREAPPS-548
Browse files Browse the repository at this point in the history
PREAPPS-548 Remove unused and shouldn't be used calendars and folders queries
  • Loading branch information
billneff79 authored May 1, 2018
2 parents f386453 + 7a1c9d6 commit 8bb1923
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 43 deletions.
12 changes: 1 addition & 11 deletions src/batch-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
Folder,
FolderAction,
FreeBusy,
GetFolderResponse,
MessageInfo,
SearchResponse,
ShareNotification
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -286,7 +276,7 @@ export class ZimbraBatchClient {
...options,
tr: traverseMountpoints
}
}).then(normalize(GetFolderResponse));
}).then(normalize(Folder));
};

public getMailboxMetadata = ({ section }: GetMailboxMetadataOptions) =>
Expand Down
4 changes: 0 additions & 4 deletions src/normalize/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,6 @@ Folder.addMapping({
});
export { Folder };

export const GetFolderResponse = new Entity({
folder: ['folders', Folder]
});

const FreeBusyInstance = new Entity({
s: 'start',
e: 'end'
Expand Down
25 changes: 8 additions & 17 deletions src/schema/generated-schema-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -541,10 +539,6 @@ export interface ContactFrequencyDataPoints {
value?: number | null;
}

export interface GetFolderResponse {
folders?: Folder[] | null;
}

export interface MailboxMetadata {
meta?: MailboxMetadataMeta[] | null;
}
Expand Down Expand Up @@ -639,12 +633,6 @@ export interface SignatureResponse {
id: string;
}

export interface FolderQueryInput {
uuid?: string | null;
id?: string | null;
view?: FolderView | null;
}

export interface MailItemHeaderInput {
n: string;
}
Expand Down Expand Up @@ -914,12 +902,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;
Expand Down
10 changes: 2 additions & 8 deletions src/schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,6 @@ type Folder {
query: String
}

type GetFolderResponse {
folders: [Folder]
}

type ACL {
grant: [ACLGrant]
}
Expand Down Expand Up @@ -1058,9 +1054,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(
Expand All @@ -1083,7 +1077,7 @@ type Query {
depth: Int,
traverseMountpoints: Boolean
folder: GetFolderFolderInput
): GetFolderResponse
): Folder
getMailboxMetadata(section: String): MailboxMetadata
getMessage(
id: ID!,
Expand All @@ -1097,7 +1091,7 @@ type Query {
read: Boolean,
ridZ: String
): MessageInfo
getSearchFolder: GetFolderResponse
getSearchFolder: Folder
getTask(inviteId: ID!): Boolean
noop: Boolean
preferences: Preferences
Expand Down
3 changes: 0 additions & 3 deletions src/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
CreateFolderOptions,
CreateSearchFolderOptions,
FolderOptions,
FoldersOptions,
FreeBusyOptions,
GetContactFrequencyOptions,
GetContactOptions,
Expand Down Expand Up @@ -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) =>
Expand Down

0 comments on commit 8bb1923

Please sign in to comment.