Skip to content

Commit cf8ca3d

Browse files
committed
fix properties for exchangeservice and exchangeservicebase
breaking: service.HttpHeaders and HttpResponseHeaders are now Disctionary instead of {} EwsUtilities: complete Tracing related methods; pending inclusion in methods EwsTraceListener ported created dummy consts for HttpStatusCode
1 parent 54ef004 commit cf8ca3d

File tree

8 files changed

+5834
-5138
lines changed

8 files changed

+5834
-5138
lines changed

src/js/Core/EwsUtilities.ts

Lines changed: 758 additions & 697 deletions
Large diffs are not rendered by default.

src/js/Core/ExchangeService.ts

Lines changed: 4167 additions & 4058 deletions
Large diffs are not rendered by default.

src/js/Core/ExchangeServiceBase.ts

Lines changed: 790 additions & 358 deletions
Large diffs are not rendered by default.

src/js/Core/Requests/ServiceRequestBase.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -602,13 +602,13 @@ export abstract class ServiceRequestBase {
602602
}
603603

604604
// Emit the MailboxCulture header
605-
if (this.Service.PreferredCulture != null) {
606-
//todo: fix preferred culture.
607-
writer.WriteElementValue(
608-
XmlNamespace.Types,
609-
XmlElementNames.MailboxCulture,
610-
this.Service.PreferredCulture.Name);
611-
}
605+
// if (this.Service.PreferredCulture != null) {
606+
// //todo: fix preferred culture.
607+
// writer.WriteElementValue(
608+
// XmlNamespace.Types,
609+
// XmlElementNames.MailboxCulture,
610+
// this.Service.PreferredCulture.Name);
611+
// }
612612

613613
// Emit the DateTimePrecision header
614614
if (this.Service.DateTimePrecision != DateTimePrecision.Default) {

src/js/Interfaces/ITraceListener.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
2-
export interface ITraceListener {
3-
Trace(traceType: string, traceMessage: string): void;
1+
/**
2+
* ITraceListener handles message tracing.
3+
*/
4+
export interface ITraceListener {
5+
/**
6+
* Handles a trace message
7+
*
8+
* @param {string} traceType Type of trace message.
9+
* @param {string} traceMessage The trace message.
10+
*/
11+
Trace(traceType: string, traceMessage: string): void;
412
}
5-
6-
7-
8-
9-
10-
11-

src/js/Misc/DelegateTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface CustomXmlSerializationDelegate {
2525
//}
2626

2727
export interface ResponseHeadersCapturedHandler {
28-
(responseHeaders: any /*System.Net.WebHeaderCollection*/): any;
28+
(responseHeaders: any /*System.Net.WebHeaderCollection*/): void;
2929
}
3030
//class ResponseHeadersCapturedHandler extends System.MulticastDelegate {
3131
// //BeginInvoke(responseHeaders: System.Net.WebHeaderCollection, callback: System.AsyncCallback, object: any): System.IAsyncResult{ throw new Error("DelegateTypes.ts - BeginInvoke : Not implemented.");}

src/js/Misc/EwsTraceListener.ts

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1+
/**
2+
* @internal EwsTraceListener logs request/responses to a text writer.
3+
*/
14
export class EwsTraceListener {
2-
private writer: any /*System.IO.TextWriter*/;
3-
Trace(traceType: string, traceMessage: string): void{ throw new Error("EwsTraceListener.ts - Trace : Not implemented.");}
4-
}
5-
6-
7-
5+
private writer: TextWriter = null;
86

7+
/**
8+
* @internal Initializes a new instance of the **EwsTraceListener** class.
9+
*/
10+
constructor();
11+
/**
12+
* @internal Initializes a new instance of the **EwsTraceListener** class.
13+
*
14+
* @param {} writer The writer.
15+
*/
16+
constructor(writer: TextWriter);
17+
constructor(writer: TextWriter = { Write: console.log }) {
18+
this.writer = writer;
19+
}
920

21+
/**
22+
* Handles a trace message
23+
*
24+
* @param {string} traceType Type of trace message.
25+
* @param {string} traceMessage The trace message.
26+
*/
27+
Trace(traceType: string, traceMessage: string): void {
28+
this.writer.Write(traceMessage);
29+
}
30+
}
1031

11-
32+
export interface TextWriter {
33+
Write(message): void;
34+
}

src/lib/HttpStatusCode.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
// HTTP status codes as per RFC 2616.
6+
export const enum HttpStatusCode {
7+
// Informational 1xx
8+
Continue = 100,
9+
SwitchingProtocols = 101,
10+
11+
// Successful 2xx
12+
OK = 200,
13+
Created = 201,
14+
Accepted = 202,
15+
NonAuthoritativeInformation = 203,
16+
NoContent = 204,
17+
ResetContent = 205,
18+
PartialContent = 206,
19+
20+
// Redirection 3xx
21+
MultipleChoices = 300,
22+
Ambiguous = 300,
23+
MovedPermanently = 301,
24+
Moved = 301,
25+
Found = 302,
26+
Redirect = 302,
27+
SeeOther = 303,
28+
RedirectMethod = 303,
29+
NotModified = 304,
30+
UseProxy = 305,
31+
Unused = 306,
32+
TemporaryRedirect = 307,
33+
RedirectKeepVerb = 307,
34+
35+
// Client Error 4xx
36+
BadRequest = 400,
37+
Unauthorized = 401,
38+
PaymentRequired = 402,
39+
Forbidden = 403,
40+
NotFound = 404,
41+
MethodNotAllowed = 405,
42+
NotAcceptable = 406,
43+
ProxyAuthenticationRequired = 407,
44+
RequestTimeout = 408,
45+
Conflict = 409,
46+
Gone = 410,
47+
LengthRequired = 411,
48+
PreconditionFailed = 412,
49+
RequestEntityTooLarge = 413,
50+
RequestUriTooLong = 414,
51+
UnsupportedMediaType = 415,
52+
RequestedRangeNotSatisfiable = 416,
53+
ExpectationFailed = 417,
54+
55+
UpgradeRequired = 426,
56+
57+
// Server Error 5xx
58+
InternalServerError = 500,
59+
NotImplemented = 501,
60+
BadGateway = 502,
61+
ServiceUnavailable = 503,
62+
GatewayTimeout = 504,
63+
HttpVersionNotSupported = 505,
64+
65+
66+
67+
// exchange specific
68+
Autodiscover_ContactAdmin = 456,
69+
Autodiscover_PasswordReset = 457,
70+
}

0 commit comments

Comments
 (0)