Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
silentsakky committed Oct 17, 2018
2 parents c2db8a1 + ed22b36 commit 6e420a8
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 10 deletions.
9 changes: 9 additions & 0 deletions src/batch-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { denormalize, normalize } from '../normalize';
import {
ActionOptions as ActionOptionsEntity,
AutoComplete as AutoCompleteEntity,
AutoCompleteGALResponse,
AutoCompleteResponse as AutoCompleteResponseEntity,
CalendarItemCreateModifyRequest,
CalendarItemHitInfo,
Expand Down Expand Up @@ -71,6 +72,7 @@ import {
import {
ActionOptions,
ActionType,
AutoCompleteGALOptions,
AutoCompleteOptions,
ChangePasswordOptions,
CreateFolderOptions,
Expand Down Expand Up @@ -189,6 +191,13 @@ export class ZimbraBatchClient {
body: denormalize(AutoCompleteEntity)(options)
}).then(normalize(AutoCompleteResponseEntity));

public autoCompleteGAL = (options: AutoCompleteGALOptions) =>
this.jsonRequest({
name: 'AutoCompleteGal',
namespace: Namespace.Account,
body: options
}).then(res => normalize(AutoCompleteGALResponse)(res));

public cancelTask = ({ inviteId }: any) =>
this.jsonRequest({
name: 'CancelTask',
Expand Down
6 changes: 6 additions & 0 deletions src/batch-client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ export interface AutoCompleteOptions {
needExp?: boolean;
type?: GalSearchType;
}
export interface AutoCompleteGALOptions {
limit?: number;
name: string;
needExp?: boolean;
type?: GalSearchType;
}

export interface Notification {
created?: any;
Expand Down
23 changes: 14 additions & 9 deletions src/normalize/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ const CalendarItemDateTime = new Entity({
const CalendarItemAttendees = new Entity({
ptst: 'participationStatus',
a: 'address',
d: 'name'
d: 'name',
cutype: 'calendarUserType'
});

const CalendarItemOrganizer = new Entity({
Expand Down Expand Up @@ -300,6 +301,14 @@ export const ActionOptions = new Entity({
grant: ACLGrant
});

export const Contact = new Entity({
d: 'date',
l: 'folderId',
rev: 'revision',
sf: 'sortField',
_attrs: 'attributes'
});

export const AutoComplete = new Entity({
t: 'type'
});
Expand All @@ -312,6 +321,10 @@ export const AutoCompleteResponse = new Entity({
match: AutoCompleteMatch
});

export const AutoCompleteGALResponse = new Entity({
cn: ['contacts', Contact]
});

export const ShareNotification = new Entity({
e: ['address', ShareNotificationAddress]
});
Expand All @@ -321,14 +334,6 @@ export const ExternalCalendar = new Entity({
l: 'folderId'
});

export const Contact = new Entity({
d: 'date',
l: 'folderId',
rev: 'revision',
sf: 'sortField',
_attrs: 'attributes'
});

export const Appointment = new Entity({
alarm: 'alarm',
inst: ['instances', Instance]
Expand Down
15 changes: 14 additions & 1 deletion src/schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,7 @@ type ContactAttributes {
website: String
notes: String
userCertificate: String
zimbraCalResType: String

# Used for contact lists
fileAs: String
Expand Down Expand Up @@ -1348,6 +1349,10 @@ type AutoCompleteResponse {
match: [AutoCompleteMatch]
}

type AutoCompleteGALResponse {
contacts: [Contact]
}

type AutoCompleteMatch {
email: String
type: AutoCompleteMatchType
Expand Down Expand Up @@ -1450,14 +1455,16 @@ type CalendarItemAttendee {
rsvp: Boolean
address: String
name: String
calendarUserType: String
}

input CalendarItemAttendeesInput {
role: ParticipationRole
participationStatus: ParticipationStatus
rsvp: Boolean
address: String!
name: String
name: String,
calendarUserType: String
}

type CalendarItemAlarmTriggerRelative {
Expand Down Expand Up @@ -2003,6 +2010,12 @@ type Query {
folders: String,
includeGal: Boolean
): AutoCompleteResponse
autoCompleteGAL(
limit: Int
name: String!
type: GalSearchType
needExp: Boolean
): AutoCompleteGALResponse
downloadMessage(id: ID!): SMimeMessage
freeBusy(names: [String!], start: Float, end: Float): [FreeBusy]
getContact(id: ID!): Contact
Expand Down
3 changes: 3 additions & 0 deletions src/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { ZimbraNotifications } from './notifications';
import { GraphQLSchema } from 'graphql';
import {
ActionOptions,
AutoCompleteGALOptions,
AutoCompleteOptions,
ChangePasswordOptions,
CreateFolderOptions,
Expand Down Expand Up @@ -73,6 +74,8 @@ export function createZimbraSchema(
accountInfo: client.accountInfo,
autoComplete: (_, variables) =>
client.autoComplete(variables as AutoCompleteOptions),
autoCompleteGAL: (_, variables) =>
client.autoCompleteGAL(variables as AutoCompleteGALOptions),
downloadMessage: (_, variables) => client.downloadMessage(variables),
freeBusy: (_, variables) =>
client.freeBusy(variables as FreeBusyOptions),
Expand Down

0 comments on commit 6e420a8

Please sign in to comment.