UNPKG

11.4 kBTypeScriptView Raw
1import basem = require('./ClientApiBases');
2import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
3import NotificationInterfaces = require("./interfaces/NotificationInterfaces");
4import VSSInterfaces = require("./interfaces/common/VSSInterfaces");
5export interface INotificationApi extends basem.ClientApiBase {
6 performBatchNotificationOperations(operation: NotificationInterfaces.BatchNotificationOperation): Promise<void>;
7 listLogs(source: string, entryId?: string, startTime?: Date, endTime?: Date): Promise<NotificationInterfaces.INotificationDiagnosticLog[]>;
8 getSubscriptionDiagnostics(subscriptionId: string): Promise<NotificationInterfaces.SubscriptionDiagnostics>;
9 updateSubscriptionDiagnostics(updateParameters: NotificationInterfaces.UpdateSubscripitonDiagnosticsParameters, subscriptionId: string): Promise<NotificationInterfaces.SubscriptionDiagnostics>;
10 publishEvent(notificationEvent: VSSInterfaces.VssNotificationEvent): Promise<VSSInterfaces.VssNotificationEvent>;
11 transformEvent(transformRequest: NotificationInterfaces.EventTransformRequest): Promise<NotificationInterfaces.EventTransformResult>;
12 queryEventTypes(inputValuesQuery: NotificationInterfaces.FieldValuesQuery, eventType: string): Promise<NotificationInterfaces.NotificationEventField[]>;
13 getEventType(eventType: string): Promise<NotificationInterfaces.NotificationEventType>;
14 listEventTypes(publisherId?: string): Promise<NotificationInterfaces.NotificationEventType[]>;
15 getNotificationReasons(notificationId: number): Promise<NotificationInterfaces.NotificationReason>;
16 listNotificationReasons(notificationIds?: number): Promise<NotificationInterfaces.NotificationReason[]>;
17 getSettings(): Promise<NotificationInterfaces.NotificationAdminSettings>;
18 updateSettings(updateParameters: NotificationInterfaces.NotificationAdminSettingsUpdateParameters): Promise<NotificationInterfaces.NotificationAdminSettings>;
19 getSubscriber(subscriberId: string): Promise<NotificationInterfaces.NotificationSubscriber>;
20 updateSubscriber(updateParameters: NotificationInterfaces.NotificationSubscriberUpdateParameters, subscriberId: string): Promise<NotificationInterfaces.NotificationSubscriber>;
21 querySubscriptions(subscriptionQuery: NotificationInterfaces.SubscriptionQuery): Promise<NotificationInterfaces.NotificationSubscription[]>;
22 createSubscription(createParameters: NotificationInterfaces.NotificationSubscriptionCreateParameters): Promise<NotificationInterfaces.NotificationSubscription>;
23 deleteSubscription(subscriptionId: string): Promise<void>;
24 getSubscription(subscriptionId: string, queryFlags?: NotificationInterfaces.SubscriptionQueryFlags): Promise<NotificationInterfaces.NotificationSubscription>;
25 listSubscriptions(targetId?: string, ids?: string[], queryFlags?: NotificationInterfaces.SubscriptionQueryFlags): Promise<NotificationInterfaces.NotificationSubscription[]>;
26 updateSubscription(updateParameters: NotificationInterfaces.NotificationSubscriptionUpdateParameters, subscriptionId: string): Promise<NotificationInterfaces.NotificationSubscription>;
27 getSubscriptionTemplates(): Promise<NotificationInterfaces.NotificationSubscriptionTemplate[]>;
28 publishTokenEvent(notificationEvent: VSSInterfaces.VssNotificationEvent): Promise<VSSInterfaces.VssNotificationEvent>;
29 updateSubscriptionUserSettings(userSettings: NotificationInterfaces.SubscriptionUserSettings, subscriptionId: string, userId: string): Promise<NotificationInterfaces.SubscriptionUserSettings>;
30}
31export declare class NotificationApi extends basem.ClientApiBase implements INotificationApi {
32 constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], options?: VsoBaseInterfaces.IRequestOptions);
33 /**
34 * @param {NotificationInterfaces.BatchNotificationOperation} operation
35 */
36 performBatchNotificationOperations(operation: NotificationInterfaces.BatchNotificationOperation): Promise<void>;
37 /**
38 * Get a list of diagnostic logs for this service.
39 *
40 * @param {string} source - ID specifying which type of logs to check diagnostics for.
41 * @param {string} entryId - The ID of the specific log to query for.
42 * @param {Date} startTime - Start time for the time range to query in.
43 * @param {Date} endTime - End time for the time range to query in.
44 */
45 listLogs(source: string, entryId?: string, startTime?: Date, endTime?: Date): Promise<NotificationInterfaces.INotificationDiagnosticLog[]>;
46 /**
47 * Get the diagnostics settings for a subscription.
48 *
49 * @param {string} subscriptionId - The id of the notifications subscription.
50 */
51 getSubscriptionDiagnostics(subscriptionId: string): Promise<NotificationInterfaces.SubscriptionDiagnostics>;
52 /**
53 * Update the diagnostics settings for a subscription.
54 *
55 * @param {NotificationInterfaces.UpdateSubscripitonDiagnosticsParameters} updateParameters
56 * @param {string} subscriptionId - The id of the notifications subscription.
57 */
58 updateSubscriptionDiagnostics(updateParameters: NotificationInterfaces.UpdateSubscripitonDiagnosticsParameters, subscriptionId: string): Promise<NotificationInterfaces.SubscriptionDiagnostics>;
59 /**
60 * Publish an event. This request must be directed to the service "extmgmt".
61 *
62 * @param {VSSInterfaces.VssNotificationEvent} notificationEvent
63 */
64 publishEvent(notificationEvent: VSSInterfaces.VssNotificationEvent): Promise<VSSInterfaces.VssNotificationEvent>;
65 /**
66 * Tranform a notification event.
67 *
68 * @param {NotificationInterfaces.EventTransformRequest} transformRequest - Object to be transformed.
69 */
70 transformEvent(transformRequest: NotificationInterfaces.EventTransformRequest): Promise<NotificationInterfaces.EventTransformResult>;
71 /**
72 * @param {NotificationInterfaces.FieldValuesQuery} inputValuesQuery
73 * @param {string} eventType
74 */
75 queryEventTypes(inputValuesQuery: NotificationInterfaces.FieldValuesQuery, eventType: string): Promise<NotificationInterfaces.NotificationEventField[]>;
76 /**
77 * Get a specific event type.
78 *
79 * @param {string} eventType - The ID of the event type.
80 */
81 getEventType(eventType: string): Promise<NotificationInterfaces.NotificationEventType>;
82 /**
83 * List available event types for this service. Optionally filter by only event types for the specified publisher.
84 *
85 * @param {string} publisherId - Limit to event types for this publisher
86 */
87 listEventTypes(publisherId?: string): Promise<NotificationInterfaces.NotificationEventType[]>;
88 /**
89 * @param {number} notificationId
90 */
91 getNotificationReasons(notificationId: number): Promise<NotificationInterfaces.NotificationReason>;
92 /**
93 * @param {number} notificationIds
94 */
95 listNotificationReasons(notificationIds?: number): Promise<NotificationInterfaces.NotificationReason[]>;
96 /**
97 */
98 getSettings(): Promise<NotificationInterfaces.NotificationAdminSettings>;
99 /**
100 * @param {NotificationInterfaces.NotificationAdminSettingsUpdateParameters} updateParameters
101 */
102 updateSettings(updateParameters: NotificationInterfaces.NotificationAdminSettingsUpdateParameters): Promise<NotificationInterfaces.NotificationAdminSettings>;
103 /**
104 * Get delivery preferences of a notifications subscriber.
105 *
106 * @param {string} subscriberId - ID of the user or group.
107 */
108 getSubscriber(subscriberId: string): Promise<NotificationInterfaces.NotificationSubscriber>;
109 /**
110 * Update delivery preferences of a notifications subscriber.
111 *
112 * @param {NotificationInterfaces.NotificationSubscriberUpdateParameters} updateParameters
113 * @param {string} subscriberId - ID of the user or group.
114 */
115 updateSubscriber(updateParameters: NotificationInterfaces.NotificationSubscriberUpdateParameters, subscriberId: string): Promise<NotificationInterfaces.NotificationSubscriber>;
116 /**
117 * Query for subscriptions. A subscription is returned if it matches one or more of the specified conditions.
118 *
119 * @param {NotificationInterfaces.SubscriptionQuery} subscriptionQuery
120 */
121 querySubscriptions(subscriptionQuery: NotificationInterfaces.SubscriptionQuery): Promise<NotificationInterfaces.NotificationSubscription[]>;
122 /**
123 * Create a new subscription.
124 *
125 * @param {NotificationInterfaces.NotificationSubscriptionCreateParameters} createParameters
126 */
127 createSubscription(createParameters: NotificationInterfaces.NotificationSubscriptionCreateParameters): Promise<NotificationInterfaces.NotificationSubscription>;
128 /**
129 * Delete a subscription.
130 *
131 * @param {string} subscriptionId
132 */
133 deleteSubscription(subscriptionId: string): Promise<void>;
134 /**
135 * Get a notification subscription by its ID.
136 *
137 * @param {string} subscriptionId
138 * @param {NotificationInterfaces.SubscriptionQueryFlags} queryFlags
139 */
140 getSubscription(subscriptionId: string, queryFlags?: NotificationInterfaces.SubscriptionQueryFlags): Promise<NotificationInterfaces.NotificationSubscription>;
141 /**
142 * Get a list of notification subscriptions, either by subscription IDs or by all subscriptions for a given user or group.
143 *
144 * @param {string} targetId - User or Group ID
145 * @param {string[]} ids - List of subscription IDs
146 * @param {NotificationInterfaces.SubscriptionQueryFlags} queryFlags
147 */
148 listSubscriptions(targetId?: string, ids?: string[], queryFlags?: NotificationInterfaces.SubscriptionQueryFlags): Promise<NotificationInterfaces.NotificationSubscription[]>;
149 /**
150 * Update an existing subscription. Depending on the type of subscription and permissions, the caller can update the description, filter settings, channel (delivery) settings and more.
151 *
152 * @param {NotificationInterfaces.NotificationSubscriptionUpdateParameters} updateParameters
153 * @param {string} subscriptionId
154 */
155 updateSubscription(updateParameters: NotificationInterfaces.NotificationSubscriptionUpdateParameters, subscriptionId: string): Promise<NotificationInterfaces.NotificationSubscription>;
156 /**
157 * Get available subscription templates.
158 *
159 */
160 getSubscriptionTemplates(): Promise<NotificationInterfaces.NotificationSubscriptionTemplate[]>;
161 /**
162 * Publish an event. This request is only for the Token service since it's a deploy only service.
163 *
164 * @param {VSSInterfaces.VssNotificationEvent} notificationEvent
165 */
166 publishTokenEvent(notificationEvent: VSSInterfaces.VssNotificationEvent): Promise<VSSInterfaces.VssNotificationEvent>;
167 /**
168 * Update the specified user's settings for the specified subscription. This API is typically used to opt in or out of a shared subscription. User settings can only be applied to shared subscriptions, like team subscriptions or default subscriptions.
169 *
170 * @param {NotificationInterfaces.SubscriptionUserSettings} userSettings
171 * @param {string} subscriptionId
172 * @param {string} userId - ID of the user
173 */
174 updateSubscriptionUserSettings(userSettings: NotificationInterfaces.SubscriptionUserSettings, subscriptionId: string, userId: string): Promise<NotificationInterfaces.SubscriptionUserSettings>;
175}