//---------------------- // // Generated using the NSwag toolchain v9.10.19.0 (Newtonsoft.Json v9.0.0.0) (http://NJsonSchema.org) // //---------------------- /* tslint:disable:member-access jsdoc-format */ /** Alias for when a string is actually a base64 representation of a byte array. */ type stringBase64 = string; /** Describes the kind of data to be formatted. */ export enum DataFormat { Default = 'default', Email = 'email', Token = 'token', Path = 'path', Text = 'text', Uri = 'uri', Omit = 'omit', OmitDefault = 'omitDefault', Hide = 'hide', SingleMember = 'singleMember', } /** Creates a decorator that saves the property format in a map attached to the class constructor. */ export function dataFormat(...format: any[]) { return function (target: any, propertyKey: string) { if (!target.constructor.dataFormat) { target.constructor.dataFormat = {}; } target.constructor.dataFormat[propertyKey] = format; }; } export class EventArgs { } /** Notification class for contact service */ export class NotifyContactServiceEventArgs extends EventArgs { type!: string; body?: any; } /** The presence status default options */ export enum PresenceStatus { Unknown = 'unknown', Available = 'available', Busy = 'busy', DoNotDisturb = 'doNotDisturb', Away = 'away', Invisible = 'invisible', Offline = 'offline', } /** Contact property types */ export enum ContactProperty { DisplayName = 'displayName', Email = 'email', AvatarUri = 'avatarUri', Status = 'status', } /** Contact entity */ export class Contact { id!: string; displayName?: string; email?: string; status?: PresenceStatus; avatarUri?: string; } /** Empty parameters */ export class EmptyRequest { } /** Empty result */ export class EmptyResponse { } /** Parameters passed during Initialize method */ export class InitializeRequest { clientID!: string; workspaceFolders?: WorkspaceFolder[]; enablePublish?: boolean; } /** Definition of a workspace folder */ export class WorkspaceFolder { uri?: WorkspaceUri; name?: string; index?: number; } /** A workspace Uri from vscode */ export class WorkspaceUri { scheme?: string; path?: string; query?: string; } /** Capabilities that a service would offer */ export class Capabilities { supportsDispose?: boolean; supportsPresence?: boolean; supportsPublishPresence?: boolean; supportsInviteLink?: boolean; supportsContactPresenceRequest?: boolean; supportsAvailableContacts?: boolean; supportsSelfContact?: boolean; supportsSearchContacts?: boolean; supportsMessageRequest?: boolean; } /** Returned on the Initialized method */ export class InitializeResponse { /** Description name to display when refering to this provider */ description!: string; /** Supported capabilities */ @dataFormat(Capabilities) capabilities!: Capabilities; /** Priority of this provider */ providerPriority?: number; } /** A presence status changed for a contact entity */ export class ContactPresenceUpdate { contactId!: string; status!: PresenceStatus; } /** Batch of presence changed for multiple contacts */ export class PresenceChangedNotification { @dataFormat(ContactPresenceUpdate) changes!: ContactPresenceUpdate[]; } export class ContactPropertyValueChanged { property!: ContactProperty; value?: any; } export class ContactChangedNotification { changes!: { [key: string]: ContactPropertyValueChanged[]; }; } export class InviteRequest { targetContactId!: string; link!: string; } export class InviteReceivedNotification { fromContactId!: string; link!: string; @dataFormat(Contact) fromContact?: Contact; } export class PublishPresenceRequest { status!: PresenceStatus; } export class SelfContactNotification { @dataFormat(Contact) contact!: Contact; } export class ContactsNotification { @dataFormat(Contact) contacts!: Contact[]; } export class ContactPresenceRequest { @dataFormat(Contact) contacts!: Contact[]; } export class ContactResponse { contactId!: string; @dataFormat(Contact) contact!: Contact; } export class ContactPresenceResponse { @dataFormat(ContactResponse) contacts!: ContactResponse[]; } export class ContactPresenceDisposeRequest { contactIds!: string[]; } export class SearchContactProperty { property!: ContactProperty; expression!: string; options?: number; } export class SearchContactsRequest { @dataFormat(SearchContactProperty) queryOptions!: SearchContactProperty[]; maxCount?: number; } export class SearchContactsResponse { @dataFormat(Contact) results!: Contact[]; } export class MessagePayload { type!: string; body?: any; } export class SendMessageRequest extends MessagePayload { targetContactId!: string; } export class MessageReceivedNotification extends MessagePayload { fromContactId!: string; } export enum Methods { RequestInitializeName = 'initialize', RequestDisposeName = 'dispose', RequestInviteName = 'inviteLink', RequestPublishPresenceName = 'publishPresence', RequestContactPresenceName = 'contactPresenceRequest', RequestContactPresenceDisposeName = 'contactPresenceDispose', RequestSearchContactsName = 'searchContacts', RequestSendMessageName = 'sendMessageRequest', NotifyPresenceChangedName = 'presenceChanged', NotifySelfContactName = 'selfContact', NotifyAvailableUsersName = 'availableUsers', NotifyAvailableUsersAddedName = 'availableUsersAdded', NotifyAvailableUsersRemovedName = 'availableUsersRemoved', NotifyInviteReceivedName = 'inviteLinkReceived', NotifyContactChangedName = 'contactChanged', NotifySuggestedUsersName = 'suggestedUsers', NotifyCapabilitiesUpdateName = 'capabilitiesUpdate', NotifyMessageReceivedName = 'messageReceived', } import { CancellationToken, Event, Progress } from 'vscode'; /** * Interface to implement a contact service provider */ export interface ContactServiceProvider { requestAsync( type: string, parameters: Object, cancellationToken?: CancellationToken) : Promise; readonly onNotified: Event; } /** * Metadata required to generate proxies for the service interfaces * (because TypeScript interfaces cannot be reflected at runtime). */ export interface ServiceInfo { readonly name?: string; readonly methods: string[]; readonly voidMethods?: string[]; readonly events: string[]; } /* tslint:disable:variable-name */ export const ContactServiceProvider: ServiceInfo = { methods: [ 'request' ], events: [ 'notified' ], };