From dd87307dcc4b76b6749e6421a59b112f2b5f1a0a Mon Sep 17 00:00:00 2001 From: Zijian Date: Thu, 21 Nov 2024 20:03:07 +1000 Subject: [PATCH] updated for .NET 9 --- .github/workflows/dotnetRelease.yml | 2 +- DemoCoreWeb/DemoCoreWeb.csproj | 4 +- DemoGodAssemblyWeb/DemoGodAssemblyWeb.csproj | 2 +- .../Fonlow.DateOnlyExtensions.csproj | 4 +- .../Fonlow.DateOnlyExtensionsTextJson.csproj | 4 +- .../Fonlow.DocCommentCore.csproj | 4 +- .../Fonlow.IntegralExtensions.csproj | 2 +- .../Fonlow.IntegralExtensionsTextJson.csproj | 2 +- Fonlow.Poco2TsCore/Fonlow.Poco2TsCore.csproj | 6 +- .../WebApiCoreNG2FormGroupClientAuto.ts | 269 ++++++++---------- .../src/clientapi/WebApiCoreNg2ClientAuto.ts | 189 +++++++----- Poco2TsCore/Poco2TsCore.csproj | 4 +- .../DateOnlyExtensionsTextJsonTests.csproj | 2 +- .../IntegrationTestsCore.csproj | 6 +- .../IntegrationTestsTextJson.csproj | 4 +- .../Poco2NgFormTests/Poco2NgFormTests.csproj | 2 +- .../Poco2TsTestsCore/Poco2TsTestsCore.csproj | 2 +- .../WebApiClientGenCore.Abstract.csproj | 4 +- .../WebApiClientGenCore.Aurelia.csproj | 4 +- .../WebApiClientGenCore.Axios.csproj | 4 +- .../WebApiClientGenCore.Fetch.csproj | 4 +- .../WebApiClientGenCore.NG2.csproj | 4 +- .../WebApiClientGenCore.NG2FormGroup.csproj | 4 +- .../WebApiClientGenCore.jQuery.csproj | 4 +- .../WebApiClientGenCore.csproj | 4 +- .../clientapi/WebApiCoreAureliaClientAuto.ts | 189 +++++++----- .../clientapi/WebApiCoreAxiosClientAuto.ts | 188 +++++++----- .../clientapi/WebApiCoreFetchClientAuto.ts | 188 +++++++----- 28 files changed, 626 insertions(+), 479 deletions(-) diff --git a/.github/workflows/dotnetRelease.yml b/.github/workflows/dotnetRelease.yml index bf88931a..f646ac26 100644 --- a/.github/workflows/dotnetRelease.yml +++ b/.github/workflows/dotnetRelease.yml @@ -19,7 +19,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Restore dependencies run: dotnet restore - name: Build diff --git a/DemoCoreWeb/DemoCoreWeb.csproj b/DemoCoreWeb/DemoCoreWeb.csproj index 618c4baf..884789d3 100644 --- a/DemoCoreWeb/DemoCoreWeb.csproj +++ b/DemoCoreWeb/DemoCoreWeb.csproj @@ -29,8 +29,8 @@ - - + + diff --git a/DemoGodAssemblyWeb/DemoGodAssemblyWeb.csproj b/DemoGodAssemblyWeb/DemoGodAssemblyWeb.csproj index f683ba03..14354e8c 100644 --- a/DemoGodAssemblyWeb/DemoGodAssemblyWeb.csproj +++ b/DemoGodAssemblyWeb/DemoGodAssemblyWeb.csproj @@ -8,7 +8,7 @@ - + diff --git a/Fonlow.DateOnlyExtensions/Fonlow.DateOnlyExtensions.csproj b/Fonlow.DateOnlyExtensions/Fonlow.DateOnlyExtensions.csproj index af77d021..f073dd7c 100644 --- a/Fonlow.DateOnlyExtensions/Fonlow.DateOnlyExtensions.csproj +++ b/Fonlow.DateOnlyExtensions/Fonlow.DateOnlyExtensions.csproj @@ -13,9 +13,9 @@ MIT True True - 1.3.1 + 1.4 Handle DateOnly in ASP.NET 6 - * Handle ISO8601 DateTime string in ASP.NET 7 + .NET 9 https://github.com/zijianhuang/webapiclientgen README.md diff --git a/Fonlow.DateOnlyExtensionsNet/Fonlow.DateOnlyExtensionsTextJson.csproj b/Fonlow.DateOnlyExtensionsNet/Fonlow.DateOnlyExtensionsTextJson.csproj index 4f7a4a62..956bdc01 100644 --- a/Fonlow.DateOnlyExtensionsNet/Fonlow.DateOnlyExtensionsTextJson.csproj +++ b/Fonlow.DateOnlyExtensionsNet/Fonlow.DateOnlyExtensionsTextJson.csproj @@ -13,9 +13,9 @@ MIT True True - 1.1 + 1.2 Handle DateOnly in ASP.NET 6 - * Handle ISO8601 DateTime string in ASP.NET 7 + .NET 9 https://github.com/zijianhuang/webapiclientgen README.md diff --git a/Fonlow.DocCommentCore/Fonlow.DocCommentCore.csproj b/Fonlow.DocCommentCore/Fonlow.DocCommentCore.csproj index 4ed9c1e3..093359b8 100644 --- a/Fonlow.DocCommentCore/Fonlow.DocCommentCore.csproj +++ b/Fonlow.DocCommentCore/Fonlow.DocCommentCore.csproj @@ -3,9 +3,9 @@ net9.0 true - 1.7 + 1.8 Basic functions of accessing XML Doc Comments. - .NET 8 + .NET 9 Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year) https://github.com/zijianhuang/webapiclientgen diff --git a/Fonlow.IntegralExtension/Fonlow.IntegralExtensions.csproj b/Fonlow.IntegralExtension/Fonlow.IntegralExtensions.csproj index 003b7f3c..ef304a8a 100644 --- a/Fonlow.IntegralExtension/Fonlow.IntegralExtensions.csproj +++ b/Fonlow.IntegralExtension/Fonlow.IntegralExtensions.csproj @@ -13,7 +13,7 @@ MIT True True - 1.1 + 1.2 Make ASP.NET serialize integral types of 64bit and BigInteger as JSON string object. https://github.com/zijianhuang/webapiclientgen README.md diff --git a/Fonlow.IntegralExtensionsTextJson/Fonlow.IntegralExtensionsTextJson.csproj b/Fonlow.IntegralExtensionsTextJson/Fonlow.IntegralExtensionsTextJson.csproj index bcb28351..3d0402bc 100644 --- a/Fonlow.IntegralExtensionsTextJson/Fonlow.IntegralExtensionsTextJson.csproj +++ b/Fonlow.IntegralExtensionsTextJson/Fonlow.IntegralExtensionsTextJson.csproj @@ -12,7 +12,7 @@ MIT True True - 1.1 + 1.2 Make ASP.NET serialize integral types of 64bit and BigInteger as JSON string object, utilizing System.Text.Json. https://github.com/zijianhuang/webapiclientgen README.md diff --git a/Fonlow.Poco2TsCore/Fonlow.Poco2TsCore.csproj b/Fonlow.Poco2TsCore/Fonlow.Poco2TsCore.csproj index bdcc5455..9c75ec13 100644 --- a/Fonlow.Poco2TsCore/Fonlow.Poco2TsCore.csproj +++ b/Fonlow.Poco2TsCore/Fonlow.Poco2TsCore.csproj @@ -4,7 +4,7 @@ net9.0 true true - 3.9.1 + 3.10 Zijian Huang Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year) @@ -14,7 +14,7 @@ https://github.com/zijianhuang/webapiclientgen TypeScript,Code DOM - .NET 8 + .NET 9 en MIT @@ -35,7 +35,7 @@ - + diff --git a/HeroesDemo/src/clientapi/WebApiCoreNG2FormGroupClientAuto.ts b/HeroesDemo/src/clientapi/WebApiCoreNG2FormGroupClientAuto.ts index 956c4cf1..cbfb596f 100644 --- a/HeroesDemo/src/clientapi/WebApiCoreNG2FormGroupClientAuto.ts +++ b/HeroesDemo/src/clientapi/WebApiCoreNG2FormGroupClientAuto.ts @@ -116,6 +116,10 @@ export namespace DemoWebApi_Controllers_Client { } + + /** + * For testing different commbinations of parameters and returns + */ @Injectable() export class DateTypes { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -137,6 +141,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return DateTimeOffset.Now * GET api/DateTypes/ForDateTimeOffset */ getDateTimeOffset(headersHandler?: () => HttpHeaders): Observable { @@ -151,6 +156,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * If Dt is not defined, add a hour from now * GET api/DateTypes/NextHourNullable?n={n}&dt={dt} * @param {number} n Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -166,6 +172,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * If Dt is not defined, add a year from now * GET api/DateTypes/NextYearNullable?n={n}&dt={dt} * @param {number} n Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -174,6 +181,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Client should send DateTime.Date * POST api/DateTypes/IsDateTimeDate */ isDateTimeDate(dt?: Date | null, headersHandler?: () => HttpHeaders): Observable<{item1: Date, item2: Date}> { @@ -218,6 +226,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return d; * POST api/DateTypes/ForDateTimeOffset */ postDateTimeOffset(d?: Date | null, headersHandler?: () => HttpHeaders): Observable { @@ -225,6 +234,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return d.ToString("O") * POST api/DateTypes/ForDateTimeOffsetForO */ postDateTimeOffsetForO(d?: Date | null, headersHandler?: () => HttpHeaders): Observable { @@ -239,6 +249,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Returned is DateTimeOffset? * POST api/DateTypes/DateTimeOffsetNullable */ postDateTimeOffsetNullable(d?: Date | null, headersHandler?: () => HttpHeaders): Observable { @@ -275,13 +286,21 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return Tuple DateTime?, DateTime? * GET api/DateTypes/SearchDateRange?startDate={startDate}&endDate={endDate} + * @param {Date | null} startDate DateTime? startDate = null + * @param {Date | null} endDate DateTime? endDate = null */ searchDateRange(startDate?: Date | null, endDate?: Date | null, headersHandler?: () => HttpHeaders): Observable<{item1: Date | null, item2: Date | null}> { return this.http.get<{item1: Date | null, item2: Date | null}>(this.baseUri + 'api/DateTypes/SearchDateRange?' + (startDate ? 'startDate=' + startDate?.toISOString() : '') + (endDate ? '&endDate=' + endDate?.toISOString() : ''), { headers: headersHandler ? headersHandler() : undefined }); } } + + /** + * Entities, Person and Company + * Some with AuthorizeAttribute + */ @Injectable() export class Entities { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -372,6 +391,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post MyGeneric string, decimal, double * POST api/Entities/MyGeneric */ getMyGeneric(s?: DemoWebApi_DemoData_Client.MyGeneric | null, headersHandler?: () => HttpHeaders): Observable> { @@ -379,6 +399,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post MyGeneric string, decimal, Person * POST api/Entities/MyGenericPerson */ getMyGenericPerson(s?: DemoWebApi_DemoData_Client.MyGeneric | null, headersHandler?: () => HttpHeaders): Observable> { @@ -386,6 +407,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body, status 204. MaybeNull * GET api/Entities/NullCompany */ getNullCompany(headersHandler?: () => HttpHeaders): Observable { @@ -393,8 +415,11 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a person + * so to know the person * GET api/Entities/getPerson/{id} - * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} id unique id of that guy + * @return {DemoWebApi_DemoData_Client.Person} person in db */ getPerson(id?: string | null, headersHandler?: () => HttpHeaders): Observable { return this.http.get(this.baseUri + 'api/Entities/getPerson/' + id, { headers: headersHandler ? headersHandler() : undefined }); @@ -417,6 +442,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH * PATCH api/Entities/patchPerson */ patchPerson(person?: DemoWebApi_DemoData_Client.Person | null, headersHandler?: () => HttpHeaders): Observable { @@ -438,6 +464,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * Heroes operations. Decorated by nullable directive. + */ @Injectable() export class Heroes { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -459,6 +489,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a hero. Nullable reference. MaybeNull * GET api/Heroes/{id} * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ @@ -467,6 +498,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get all heroes. * GET api/Heroes */ getHeroes(headersHandler?: () => HttpHeaders): Observable> { @@ -474,6 +506,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/Heroes/super?id={id} * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ @@ -489,13 +522,17 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Add a hero. The client will not expect null. NotNull * POST api/Heroes/q?name={name} + * @param {string} name name of hero + * @return {DemoWebApi_Controllers_Client.Hero} Always object. */ postWithQuery(name?: string | null, headersHandler?: () => HttpHeaders): Observable { return this.http.post(this.baseUri + 'api/Heroes/q?name=' + (!name ? '' : encodeURIComponent(name)), null, { headers: headersHandler ? headersHandler() : undefined }); } /** + * Update hero. * PUT api/Heroes */ put(hero?: DemoWebApi_Controllers_Client.Hero | null, headersHandler?: () => HttpHeaders): Observable { @@ -503,13 +540,20 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Search heroes * GET api/Heroes/search/{name} + * @param {string} name keyword contained in hero name. + * @return {Array} Hero array matching the keyword. */ search(name?: string | null, headersHandler?: () => HttpHeaders): Observable> { return this.http.get>(this.baseUri + 'api/Heroes/search/' + (!name ? '' : encodeURIComponent(name)), { headers: headersHandler ? headersHandler() : undefined }); } } + + /** + * For testing different commbinations of parameters and returns + */ @Injectable() export class Numbers { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -526,8 +570,7 @@ export namespace DemoWebApi_Controllers_Client { /** * GET api/Numbers/byteWithRange?d={d} - * @param {number} d Type: byte - * Range: inclusive between 0 and 100 + * @param {number} d Byte for small number. * @return {number} Type: byte, 0 to 255 */ getByteWithRange(d?: number | null, headersHandler?: () => HttpHeaders): Observable { @@ -663,6 +706,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Range is with double, not long. Precision of double: ~15-17 digits, while long.MaxValue 9223372036854775807 has 19 decimal digits. * POST api/Numbers/longRange * @param {string} d Type: long * Range: inclusive between 1000 and 9223372036854775800 @@ -691,14 +735,21 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing posting and getting string data. Returned string is JSON object. + */ @Injectable() export class StringData { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { } /** + * Athlethe Search * GET api/StringData/AthletheSearch?take={take}&skip={skip}&order={order}&sort={sort}&search={search} - * @param {number} skip Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number | null} take Generic optional parameter. Default 10 + * @param {number} skip Default 0 + * @param {string} order default null */ athletheSearch(take?: number | null, skip?: number | null, order?: string | null, sort?: string | null, search?: string | null, headersHandler?: () => HttpHeaders): Observable { return this.http.get(this.baseUri + 'api/StringData/AthletheSearch?' + (take ? 'take=' + take.toString() : '') + '&skip=' + skip + '&order=' + (!order ? '' : encodeURIComponent(order)) + '&sort=' + (!sort ? '' : encodeURIComponent(sort)) + '&search=' + (!search ? '' : encodeURIComponent(search)), { headers: headersHandler ? headersHandler() : undefined, responseType: 'text' }); @@ -712,6 +763,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty string JSON object. Status 200. * GET api/StringData/EmptyString */ getEmptyString(headersHandler?: () => HttpHeaders): Observable { @@ -719,6 +771,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 204 No Content, even though the default mime type is application/json. MaybeNull * GET api/StringData/NullString */ getNullString(headersHandler?: () => HttpHeaders): Observable { @@ -726,6 +779,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing different commbinations of parameters and returns + */ @Injectable() export class SuperDemo { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -820,6 +877,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo * GET api/SuperDemo/decimalArrayQ?a={a} */ getDecimalArrayQ(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -873,6 +931,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Result of 0.1d + 0.2d - 0.3d * GET api/SuperDemo/DoubleZero * @return {number} Type: double */ @@ -881,6 +940,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo IEnumerable Days * GET api/SuperDemo/enumArrayDays?a={a} */ getEnumArrayDays(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -938,6 +998,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[]; * GET api/SuperDemo/intArrayQ?a={a} */ getIntArrayQ(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -945,6 +1006,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo IEnumerable long * GET api/SuperDemo/intArrayQ2?a={a} */ getIntArrayQ2(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -989,6 +1051,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * False to return null, and true to return 1000 * GET api/SuperDemo/NullableDecimal/{hasValue} */ getNullableDecimal(hasValue?: boolean | null, headersHandler?: () => HttpHeaders): Observable { @@ -996,6 +1059,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/SuperDemo/NullObject */ getNullPerson(headersHandler?: () => HttpHeaders): Observable { @@ -1033,6 +1097,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo string array * GET api/SuperDemo/stringArrayQ?a={a} */ getStringArrayQ(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -1040,6 +1105,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo List string * GET api/SuperDemo/stringArrayQ2?a={a} */ getStringArrayQ2(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -1047,6 +1113,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * ActionResult with FileStreamResult * GET api/SuperDemo/TextStream */ getTextStream(headersHandler?: () => HttpHeaders): Observable> { @@ -1099,6 +1166,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post a collection of person * POST api/SuperDemo/Collection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1114,6 +1182,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo Dic string and person * POST api/SuperDemo/StringPersonDic * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1129,6 +1198,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post ICollection of person * POST api/SuperDemo/ICollection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1137,6 +1207,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post IList of person * POST api/SuperDemo/IList * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1152,6 +1223,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[][] * POST api/SuperDemo/int2djagged */ postInt2DJagged(a?: Array> | null, headersHandler?: () => HttpHeaders): Observable { @@ -1159,6 +1231,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[] * POST api/SuperDemo/intArray * @param {Array} a Min length: 1 * Max length: 10 @@ -1168,6 +1241,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post IReadOnlyCollection of person * POST api/SuperDemo/IReadOnlyCollection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1176,6 +1250,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post e of person * POST api/SuperDemo/IReadOnlyList * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1184,6 +1259,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post a list of person * POST api/SuperDemo/List * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1200,6 +1276,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing posting and getting string data. String returned is text/plain by default + */ @Injectable() export class TextData { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -1221,6 +1301,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 200. * GET api/TextData/EmptyString */ getEmptyString(headersHandler?: () => HttpHeaders): Observable { @@ -1228,6 +1309,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/TextData/NullableString */ getNullableString(headersHandler?: () => HttpHeaders): Observable { @@ -1235,6 +1317,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 204 No Content. * GET api/TextData/NullString */ getNullString(headersHandler?: () => HttpHeaders): Observable { @@ -1242,12 +1325,17 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.3.3 + */ @Injectable() export class Tuple { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { } /** + * Update in a transaction * PUT api/Tuple/A1TupleArray */ a1TupleArray(idAndOrderArray?: Array<{item1: string, item2: number}> | null, headersHandler?: () => HttpHeaders): Observable> { @@ -1255,6 +1343,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Update IEnumerable Tuple in a transaction * PUT api/Tuple/A2TupleArray */ a2TupleIEnumerable(idAndOrderArray?: Array<{item1: string, item2: number}> | null, headersHandler?: () => HttpHeaders): Observable> { @@ -1262,6 +1351,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post tuple * POST api/Tuple/ChangeName */ changeName(d?: {item1: string, item2: DemoWebApi_DemoData_Client.Person} | null, headersHandler?: () => HttpHeaders): Observable { @@ -1269,6 +1359,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get Tuple in return. MaybeNull * GET api/Tuple/PeopleCompany4 */ getPeopleCompany4(headersHandler?: () => HttpHeaders): Observable<{item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Company} | null> { @@ -1276,6 +1367,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/Tuple/PeopleCompany5 */ getPeopleCompany5(headersHandler?: () => HttpHeaders): Observable<{item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Person, item5: DemoWebApi_DemoData_Client.Company} | null> { @@ -1332,6 +1424,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post nested tuple * GET api/Tuple/Tuple8 */ getTuple8(headersHandler?: () => HttpHeaders): Observable<{item1: string, item2: string, item3: string, item4: string, item5: string, item6: string, item7: number, rest: {item1: string, item2: string, item3: string}}> { @@ -1374,6 +1467,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post long tuple * POST api/Tuple/PeopleCompany7 */ linkPeopleCompany7(peopleAndCompany?: {item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Person, item5: DemoWebApi_DemoData_Client.Person, item6: DemoWebApi_DemoData_Client.Person, item7: DemoWebApi_DemoData_Client.Company} | null, headersHandler?: () => HttpHeaders): Observable { @@ -1403,6 +1497,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post tuple string int * POST api/Tuple/Tuple2 */ postTuple2(tuple?: {item1: string, item2: number} | null, headersHandler?: () => HttpHeaders): Observable { @@ -1466,6 +1561,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a list of value * GET api/Values */ get(headersHandler?: () => HttpHeaders): Observable> { @@ -1473,6 +1569,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by both Id and name * GET api/Values/Name/{id}?name={name} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1481,6 +1578,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by name * GET api/Values?name={name} */ getByNameOfString(name?: string | null, headersHandler?: () => HttpHeaders): Observable { @@ -1488,6 +1586,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by Id * GET api/Values/{id} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1496,6 +1595,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a list of value async, it is get2 * GET api/Values/Get2 */ get2(headersHandler?: () => HttpHeaders): Observable> { @@ -1510,6 +1610,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Update with valjue * PUT api/Values/{id} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1797,16 +1898,6 @@ export namespace DemoWebApi_DemoData_Client { } - export interface Constants { - } - export interface ConstantsFormProperties { - } - export function CreateConstantsFormGroup() { - return new FormGroup({ - }); - - } - export enum Days { Sat = 1, Sun = 2, @@ -2110,7 +2201,7 @@ export namespace DemoWebApi_Models_Client { export interface AddExternalLoginBindingModel { /** Required */ - externalAccessToken: string; + externalAccessToken?: string | null; } export interface AddExternalLoginBindingModelFormProperties { @@ -2169,57 +2260,20 @@ export namespace DemoWebApi_Models_Client { } - export interface ExternalLoginViewModel { - name?: string | null; - state?: string | null; - url?: string | null; - } - export interface ExternalLoginViewModelFormProperties { - name: FormControl, - state: FormControl, - url: FormControl, - } - export function CreateExternalLoginViewModelFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - state: new FormControl(undefined), - url: new FormControl(undefined), - }); - - } - - export interface ManageInfoViewModel { - email?: string | null; - externalLoginProviders?: Array; - localLoginProvider?: string | null; - logins?: Array; - } - export interface ManageInfoViewModelFormProperties { - email: FormControl, - localLoginProvider: FormControl, - } - export function CreateManageInfoViewModelFormGroup() { - return new FormGroup({ - email: new FormControl(undefined), - localLoginProvider: new FormControl(undefined), - }); - - } - export interface RegisterBindingModel { /** Data type: Password */ confirmPassword?: string | null; /** Required */ - email: string; + email?: string | null; /** * Required * String length: inclusive between 6 and 100 * Data type: Password */ - password: string; + password?: string | null; } export interface RegisterBindingModelFormProperties { @@ -2248,7 +2302,7 @@ export namespace DemoWebApi_Models_Client { export interface RegisterExternalBindingModel { /** Required */ - email: string; + email?: string | null; } export interface RegisterExternalBindingModelFormProperties { @@ -2265,10 +2319,10 @@ export namespace DemoWebApi_Models_Client { export interface RemoveLoginBindingModel { /** Required */ - loginProvider: string; + loginProvider?: string | null; /** Required */ - providerKey: string; + providerKey?: string | null; } export interface RemoveLoginBindingModelFormProperties { @@ -2296,7 +2350,7 @@ export namespace DemoWebApi_Models_Client { * String length: inclusive between 6 and 100 * Data type: Password */ - newPassword: string; + newPassword?: string | null; } export interface SetPasswordBindingModelFormProperties { @@ -2358,84 +2412,6 @@ export namespace DemoWebApi_Models_Client { } - export interface UserInfoViewModel { - email?: string | null; - hasRegistered?: boolean | null; - loginProvider?: string | null; - dummy1?: string | null; - dumy2?: string | null; - } - export interface UserInfoViewModelFormProperties { - email: FormControl, - hasRegistered: FormControl, - loginProvider: FormControl, - dummy1: FormControl, - dumy2: FormControl, - } - export function CreateUserInfoViewModelFormGroup() { - return new FormGroup({ - email: new FormControl(undefined), - hasRegistered: new FormControl(undefined), - loginProvider: new FormControl(undefined), - dummy1: new FormControl(undefined), - dumy2: new FormControl(undefined), - }); - - } - - export interface UserLoginInfoViewModel { - loginProvider?: string | null; - providerKey?: string | null; - } - export interface UserLoginInfoViewModelFormProperties { - loginProvider: FormControl, - providerKey: FormControl, - } - export function CreateUserLoginInfoViewModelFormGroup() { - return new FormGroup({ - loginProvider: new FormControl(undefined), - providerKey: new FormControl(undefined), - }); - - } - -} - -export namespace WebApplication1_Client { - export interface WeatherForecast { - - /** Type: DateOnly */ - date?: Date | null; - summary?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureC?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureF?: number | null; - } - export interface WeatherForecastFormProperties { - - /** Type: DateOnly */ - date: FormControl, - summary: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureC: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureF: FormControl, - } - export function CreateWeatherForecastFormGroup() { - return new FormGroup({ - date: new FormControl(undefined), - summary: new FormControl(undefined), - temperatureC: new FormControl(undefined), - temperatureF: new FormControl(undefined), - }); - - } - } export namespace DemoCoreWeb_Controllers_Client { @@ -2445,13 +2421,16 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Anonymous Dynamic of C# * GET api/SpecialTypes/AnonymousDynamic + * @return {any} dyanmic things */ getAnonymousDynamic(headersHandler?: () => HttpHeaders): Observable> { return this.http.get(this.baseUri + 'api/SpecialTypes/AnonymousDynamic', { headers: headersHandler ? headersHandler() : undefined, observe: 'response', responseType: 'text' }); } /** + * Async function returing dynamic * GET api/SpecialTypes/AnonymousDynamic2 */ getAnonymousDynamic2(headersHandler?: () => HttpHeaders): Observable> { @@ -2466,6 +2445,7 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Async function returning object * GET api/SpecialTypes/AnonymousObject2 */ getAnonymousObject2(headersHandler?: () => HttpHeaders): Observable> { @@ -2480,6 +2460,7 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Async returning object, Post dynamic * POST api/SpecialTypes/AnonymousObject2 */ postAnonymousObject2(obj?: any, headersHandler?: () => HttpHeaders): Observable> { @@ -2489,19 +2470,3 @@ export namespace DemoCoreWeb_Controllers_Client { } -export namespace WebApplication1_Controllers_Client { - @Injectable() - export class WeatherForecast { - constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { - } - - /** - * GET WeatherForecast - */ - get(headersHandler?: () => HttpHeaders): Observable> { - return this.http.get>(this.baseUri + 'WeatherForecast', { headers: headersHandler ? headersHandler() : undefined }); - } - } - -} - diff --git a/HeroesDemo/src/clientapi/WebApiCoreNg2ClientAuto.ts b/HeroesDemo/src/clientapi/WebApiCoreNg2ClientAuto.ts index 7c4aaffa..45f9c09a 100644 --- a/HeroesDemo/src/clientapi/WebApiCoreNg2ClientAuto.ts +++ b/HeroesDemo/src/clientapi/WebApiCoreNg2ClientAuto.ts @@ -49,6 +49,10 @@ export namespace DemoWebApi_Controllers_Client { super?: boolean | null; } + + /** + * For testing different commbinations of parameters and returns + */ @Injectable() export class DateTypes { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -70,6 +74,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return DateTimeOffset.Now * GET api/DateTypes/ForDateTimeOffset */ getDateTimeOffset(headersHandler?: () => HttpHeaders): Observable { @@ -84,6 +89,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * If Dt is not defined, add a hour from now * GET api/DateTypes/NextHourNullable?n={n}&dt={dt} * @param {number} n Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -99,6 +105,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * If Dt is not defined, add a year from now * GET api/DateTypes/NextYearNullable?n={n}&dt={dt} * @param {number} n Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -107,6 +114,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Client should send DateTime.Date * POST api/DateTypes/IsDateTimeDate */ isDateTimeDate(dt?: Date | null, headersHandler?: () => HttpHeaders): Observable<{item1: Date, item2: Date}> { @@ -151,6 +159,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return d; * POST api/DateTypes/ForDateTimeOffset */ postDateTimeOffset(d?: Date | null, headersHandler?: () => HttpHeaders): Observable { @@ -158,6 +167,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return d.ToString("O") * POST api/DateTypes/ForDateTimeOffsetForO */ postDateTimeOffsetForO(d?: Date | null, headersHandler?: () => HttpHeaders): Observable { @@ -172,6 +182,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Returned is DateTimeOffset? * POST api/DateTypes/DateTimeOffsetNullable */ postDateTimeOffsetNullable(d?: Date | null, headersHandler?: () => HttpHeaders): Observable { @@ -208,13 +219,21 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return Tuple DateTime?, DateTime? * GET api/DateTypes/SearchDateRange?startDate={startDate}&endDate={endDate} + * @param {Date | null} startDate DateTime? startDate = null + * @param {Date | null} endDate DateTime? endDate = null */ searchDateRange(startDate?: Date | null, endDate?: Date | null, headersHandler?: () => HttpHeaders): Observable<{item1: Date | null, item2: Date | null}> { return this.http.get<{item1: Date | null, item2: Date | null}>(this.baseUri + 'api/DateTypes/SearchDateRange?' + (startDate ? 'startDate=' + startDate?.toISOString() : '') + (endDate ? '&endDate=' + endDate?.toISOString() : ''), { headers: headersHandler ? headersHandler() : undefined }); } } + + /** + * Entities, Person and Company + * Some with AuthorizeAttribute + */ @Injectable() export class Entities { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -305,6 +324,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post MyGeneric string, decimal, double * POST api/Entities/MyGeneric */ getMyGeneric(s?: DemoWebApi_DemoData_Client.MyGeneric | null, headersHandler?: () => HttpHeaders): Observable> { @@ -312,6 +332,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post MyGeneric string, decimal, Person * POST api/Entities/MyGenericPerson */ getMyGenericPerson(s?: DemoWebApi_DemoData_Client.MyGeneric | null, headersHandler?: () => HttpHeaders): Observable> { @@ -319,6 +340,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body, status 204. MaybeNull * GET api/Entities/NullCompany */ getNullCompany(headersHandler?: () => HttpHeaders): Observable { @@ -326,8 +348,11 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a person + * so to know the person * GET api/Entities/getPerson/{id} - * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} id unique id of that guy + * @return {DemoWebApi_DemoData_Client.Person} person in db */ getPerson(id?: string | null, headersHandler?: () => HttpHeaders): Observable { return this.http.get(this.baseUri + 'api/Entities/getPerson/' + id, { headers: headersHandler ? headersHandler() : undefined }); @@ -350,6 +375,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH * PATCH api/Entities/patchPerson */ patchPerson(person?: DemoWebApi_DemoData_Client.Person | null, headersHandler?: () => HttpHeaders): Observable { @@ -371,6 +397,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * Heroes operations. Decorated by nullable directive. + */ @Injectable() export class Heroes { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -392,6 +422,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a hero. Nullable reference. MaybeNull * GET api/Heroes/{id} * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ @@ -400,6 +431,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get all heroes. * GET api/Heroes */ getHeroes(headersHandler?: () => HttpHeaders): Observable> { @@ -407,6 +439,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/Heroes/super?id={id} * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ @@ -422,13 +455,17 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Add a hero. The client will not expect null. NotNull * POST api/Heroes/q?name={name} + * @param {string} name name of hero + * @return {DemoWebApi_Controllers_Client.Hero} Always object. */ postWithQuery(name?: string | null, headersHandler?: () => HttpHeaders): Observable { return this.http.post(this.baseUri + 'api/Heroes/q?name=' + (!name ? '' : encodeURIComponent(name)), null, { headers: headersHandler ? headersHandler() : undefined }); } /** + * Update hero. * PUT api/Heroes */ put(hero?: DemoWebApi_Controllers_Client.Hero | null, headersHandler?: () => HttpHeaders): Observable { @@ -436,13 +473,20 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Search heroes * GET api/Heroes/search/{name} + * @param {string} name keyword contained in hero name. + * @return {Array} Hero array matching the keyword. */ search(name?: string | null, headersHandler?: () => HttpHeaders): Observable> { return this.http.get>(this.baseUri + 'api/Heroes/search/' + (!name ? '' : encodeURIComponent(name)), { headers: headersHandler ? headersHandler() : undefined }); } } + + /** + * For testing different commbinations of parameters and returns + */ @Injectable() export class Numbers { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -459,8 +503,7 @@ export namespace DemoWebApi_Controllers_Client { /** * GET api/Numbers/byteWithRange?d={d} - * @param {number} d Type: byte - * Range: inclusive between 0 and 100 + * @param {number} d Byte for small number. * @return {number} Type: byte, 0 to 255 */ getByteWithRange(d?: number | null, headersHandler?: () => HttpHeaders): Observable { @@ -596,6 +639,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Range is with double, not long. Precision of double: ~15-17 digits, while long.MaxValue 9223372036854775807 has 19 decimal digits. * POST api/Numbers/longRange * @param {string} d Type: long * Range: inclusive between 1000 and 9223372036854775800 @@ -624,14 +668,21 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing posting and getting string data. Returned string is JSON object. + */ @Injectable() export class StringData { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { } /** + * Athlethe Search * GET api/StringData/AthletheSearch?take={take}&skip={skip}&order={order}&sort={sort}&search={search} - * @param {number} skip Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number | null} take Generic optional parameter. Default 10 + * @param {number} skip Default 0 + * @param {string} order default null */ athletheSearch(take?: number | null, skip?: number | null, order?: string | null, sort?: string | null, search?: string | null, headersHandler?: () => HttpHeaders): Observable { return this.http.get(this.baseUri + 'api/StringData/AthletheSearch?' + (take ? 'take=' + take.toString() : '') + '&skip=' + skip + '&order=' + (!order ? '' : encodeURIComponent(order)) + '&sort=' + (!sort ? '' : encodeURIComponent(sort)) + '&search=' + (!search ? '' : encodeURIComponent(search)), { headers: headersHandler ? headersHandler() : undefined, responseType: 'text' }); @@ -645,6 +696,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty string JSON object. Status 200. * GET api/StringData/EmptyString */ getEmptyString(headersHandler?: () => HttpHeaders): Observable { @@ -652,6 +704,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 204 No Content, even though the default mime type is application/json. MaybeNull * GET api/StringData/NullString */ getNullString(headersHandler?: () => HttpHeaders): Observable { @@ -659,6 +712,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing different commbinations of parameters and returns + */ @Injectable() export class SuperDemo { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -753,6 +810,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo * GET api/SuperDemo/decimalArrayQ?a={a} */ getDecimalArrayQ(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -806,6 +864,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Result of 0.1d + 0.2d - 0.3d * GET api/SuperDemo/DoubleZero * @return {number} Type: double */ @@ -814,6 +873,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo IEnumerable Days * GET api/SuperDemo/enumArrayDays?a={a} */ getEnumArrayDays(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -871,6 +931,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[]; * GET api/SuperDemo/intArrayQ?a={a} */ getIntArrayQ(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -878,6 +939,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo IEnumerable long * GET api/SuperDemo/intArrayQ2?a={a} */ getIntArrayQ2(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -922,6 +984,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * False to return null, and true to return 1000 * GET api/SuperDemo/NullableDecimal/{hasValue} */ getNullableDecimal(hasValue?: boolean | null, headersHandler?: () => HttpHeaders): Observable { @@ -929,6 +992,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/SuperDemo/NullObject */ getNullPerson(headersHandler?: () => HttpHeaders): Observable { @@ -966,6 +1030,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo string array * GET api/SuperDemo/stringArrayQ?a={a} */ getStringArrayQ(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -973,6 +1038,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo List string * GET api/SuperDemo/stringArrayQ2?a={a} */ getStringArrayQ2(a?: Array | null, headersHandler?: () => HttpHeaders): Observable> { @@ -980,6 +1046,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * ActionResult with FileStreamResult * GET api/SuperDemo/TextStream */ getTextStream(headersHandler?: () => HttpHeaders): Observable> { @@ -1032,6 +1099,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post a collection of person * POST api/SuperDemo/Collection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1047,6 +1115,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo Dic string and person * POST api/SuperDemo/StringPersonDic * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1062,6 +1131,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post ICollection of person * POST api/SuperDemo/ICollection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1070,6 +1140,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post IList of person * POST api/SuperDemo/IList * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1085,6 +1156,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[][] * POST api/SuperDemo/int2djagged */ postInt2DJagged(a?: Array> | null, headersHandler?: () => HttpHeaders): Observable { @@ -1092,6 +1164,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[] * POST api/SuperDemo/intArray * @param {Array} a Min length: 1 * Max length: 10 @@ -1101,6 +1174,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post IReadOnlyCollection of person * POST api/SuperDemo/IReadOnlyCollection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1109,6 +1183,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post e of person * POST api/SuperDemo/IReadOnlyList * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1117,6 +1192,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post a list of person * POST api/SuperDemo/List * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1133,6 +1209,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing posting and getting string data. String returned is text/plain by default + */ @Injectable() export class TextData { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { @@ -1154,6 +1234,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 200. * GET api/TextData/EmptyString */ getEmptyString(headersHandler?: () => HttpHeaders): Observable { @@ -1161,6 +1242,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/TextData/NullableString */ getNullableString(headersHandler?: () => HttpHeaders): Observable { @@ -1168,6 +1250,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 204 No Content. * GET api/TextData/NullString */ getNullString(headersHandler?: () => HttpHeaders): Observable { @@ -1175,12 +1258,17 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.3.3 + */ @Injectable() export class Tuple { constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { } /** + * Update in a transaction * PUT api/Tuple/A1TupleArray */ a1TupleArray(idAndOrderArray?: Array<{item1: string, item2: number}> | null, headersHandler?: () => HttpHeaders): Observable> { @@ -1188,6 +1276,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Update IEnumerable Tuple in a transaction * PUT api/Tuple/A2TupleArray */ a2TupleIEnumerable(idAndOrderArray?: Array<{item1: string, item2: number}> | null, headersHandler?: () => HttpHeaders): Observable> { @@ -1195,6 +1284,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post tuple * POST api/Tuple/ChangeName */ changeName(d?: {item1: string, item2: DemoWebApi_DemoData_Client.Person} | null, headersHandler?: () => HttpHeaders): Observable { @@ -1202,6 +1292,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get Tuple in return. MaybeNull * GET api/Tuple/PeopleCompany4 */ getPeopleCompany4(headersHandler?: () => HttpHeaders): Observable<{item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Company} | null> { @@ -1209,6 +1300,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/Tuple/PeopleCompany5 */ getPeopleCompany5(headersHandler?: () => HttpHeaders): Observable<{item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Person, item5: DemoWebApi_DemoData_Client.Company} | null> { @@ -1265,6 +1357,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post nested tuple * GET api/Tuple/Tuple8 */ getTuple8(headersHandler?: () => HttpHeaders): Observable<{item1: string, item2: string, item3: string, item4: string, item5: string, item6: string, item7: number, rest: {item1: string, item2: string, item3: string}}> { @@ -1307,6 +1400,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post long tuple * POST api/Tuple/PeopleCompany7 */ linkPeopleCompany7(peopleAndCompany?: {item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Person, item5: DemoWebApi_DemoData_Client.Person, item6: DemoWebApi_DemoData_Client.Person, item7: DemoWebApi_DemoData_Client.Company} | null, headersHandler?: () => HttpHeaders): Observable { @@ -1336,6 +1430,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post tuple string int * POST api/Tuple/Tuple2 */ postTuple2(tuple?: {item1: string, item2: number} | null, headersHandler?: () => HttpHeaders): Observable { @@ -1399,6 +1494,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a list of value * GET api/Values */ get(headersHandler?: () => HttpHeaders): Observable> { @@ -1406,6 +1502,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by both Id and name * GET api/Values/Name/{id}?name={name} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1414,6 +1511,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by name * GET api/Values?name={name} */ getByNameOfString(name?: string | null, headersHandler?: () => HttpHeaders): Observable { @@ -1421,6 +1519,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by Id * GET api/Values/{id} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1429,6 +1528,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a list of value async, it is get2 * GET api/Values/Get2 */ get2(headersHandler?: () => HttpHeaders): Observable> { @@ -1443,6 +1543,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Update with valjue * PUT api/Values/{id} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1580,9 +1681,6 @@ export namespace DemoWebApi_DemoData_Client { lines?: Array; } - export interface Constants { - } - export enum Days { Sat = 1, Sun = 2, @@ -1735,7 +1833,7 @@ export namespace DemoWebApi_Models_Client { export interface AddExternalLoginBindingModel { /** Required */ - externalAccessToken: string; + externalAccessToken?: string | null; } export interface ChangePasswordBindingModel { @@ -1757,48 +1855,35 @@ export namespace DemoWebApi_Models_Client { OldPwd: string; } - export interface ExternalLoginViewModel { - name?: string | null; - state?: string | null; - url?: string | null; - } - - export interface ManageInfoViewModel { - email?: string | null; - externalLoginProviders?: Array; - localLoginProvider?: string | null; - logins?: Array; - } - export interface RegisterBindingModel { /** Data type: Password */ confirmPassword?: string | null; /** Required */ - email: string; + email?: string | null; /** * Required * String length: inclusive between 6 and 100 * Data type: Password */ - password: string; + password?: string | null; } export interface RegisterExternalBindingModel { /** Required */ - email: string; + email?: string | null; } export interface RemoveLoginBindingModel { /** Required */ - loginProvider: string; + loginProvider?: string | null; /** Required */ - providerKey: string; + providerKey?: string | null; } export interface SetPasswordBindingModel { @@ -1811,7 +1896,7 @@ export namespace DemoWebApi_Models_Client { * String length: inclusive between 6 and 100 * Data type: Password */ - newPassword: string; + newPassword?: string | null; } @@ -1829,35 +1914,6 @@ export namespace DemoWebApi_Models_Client { username?: string | null; } - export interface UserInfoViewModel { - email?: string | null; - hasRegistered?: boolean | null; - loginProvider?: string | null; - dummy1?: string | null; - dumy2?: string | null; - } - - export interface UserLoginInfoViewModel { - loginProvider?: string | null; - providerKey?: string | null; - } - -} - -export namespace WebApplication1_Client { - export interface WeatherForecast { - - /** Type: DateOnly */ - date?: Date | null; - summary?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureC?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureF?: number | null; - } - } export namespace DemoCoreWeb_Controllers_Client { @@ -1867,13 +1923,16 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Anonymous Dynamic of C# * GET api/SpecialTypes/AnonymousDynamic + * @return {any} dyanmic things */ getAnonymousDynamic(headersHandler?: () => HttpHeaders): Observable> { return this.http.get(this.baseUri + 'api/SpecialTypes/AnonymousDynamic', { headers: headersHandler ? headersHandler() : undefined, observe: 'response', responseType: 'text' }); } /** + * Async function returing dynamic * GET api/SpecialTypes/AnonymousDynamic2 */ getAnonymousDynamic2(headersHandler?: () => HttpHeaders): Observable> { @@ -1888,6 +1947,7 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Async function returning object * GET api/SpecialTypes/AnonymousObject2 */ getAnonymousObject2(headersHandler?: () => HttpHeaders): Observable> { @@ -1902,6 +1962,7 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Async returning object, Post dynamic * POST api/SpecialTypes/AnonymousObject2 */ postAnonymousObject2(obj?: any, headersHandler?: () => HttpHeaders): Observable> { @@ -1911,19 +1972,3 @@ export namespace DemoCoreWeb_Controllers_Client { } -export namespace WebApplication1_Controllers_Client { - @Injectable() - export class WeatherForecast { - constructor(@Inject('baseUri') private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/', private http: HttpClient) { - } - - /** - * GET WeatherForecast - */ - get(headersHandler?: () => HttpHeaders): Observable> { - return this.http.get>(this.baseUri + 'WeatherForecast', { headers: headersHandler ? headersHandler() : undefined }); - } - } - -} - diff --git a/Poco2TsCore/Poco2TsCore.csproj b/Poco2TsCore/Poco2TsCore.csproj index 851e94b1..bf4baff6 100644 --- a/Poco2TsCore/Poco2TsCore.csproj +++ b/Poco2TsCore/Poco2TsCore.csproj @@ -4,8 +4,8 @@ Exe net9.0 true - 1.6.1 - Build for .NET 8 + 1.7 + Build for .NET 9 en MIT https://github.com/zijianhuang/webapiclientgen diff --git a/Tests/DateOnlyExtensionsTextJsonTests/DateOnlyExtensionsTextJsonTests.csproj b/Tests/DateOnlyExtensionsTextJsonTests/DateOnlyExtensionsTextJsonTests.csproj index 63b6d995..f65508c8 100644 --- a/Tests/DateOnlyExtensionsTextJsonTests/DateOnlyExtensionsTextJsonTests.csproj +++ b/Tests/DateOnlyExtensionsTextJsonTests/DateOnlyExtensionsTextJsonTests.csproj @@ -12,7 +12,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/Tests/IntegrationTestsCore/IntegrationTestsCore.csproj b/Tests/IntegrationTestsCore/IntegrationTestsCore.csproj index d3a7f241..dce82ed1 100644 --- a/Tests/IntegrationTestsCore/IntegrationTestsCore.csproj +++ b/Tests/IntegrationTestsCore/IntegrationTestsCore.csproj @@ -29,9 +29,9 @@ - - - + + + all diff --git a/Tests/IntegrationTestsTextJson/IntegrationTestsTextJson.csproj b/Tests/IntegrationTestsTextJson/IntegrationTestsTextJson.csproj index 060b8980..6f668457 100644 --- a/Tests/IntegrationTestsTextJson/IntegrationTestsTextJson.csproj +++ b/Tests/IntegrationTestsTextJson/IntegrationTestsTextJson.csproj @@ -25,8 +25,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all diff --git a/Tests/Poco2NgFormTests/Poco2NgFormTests.csproj b/Tests/Poco2NgFormTests/Poco2NgFormTests.csproj index 3d4cef9d..fdfdbd24 100644 --- a/Tests/Poco2NgFormTests/Poco2NgFormTests.csproj +++ b/Tests/Poco2NgFormTests/Poco2NgFormTests.csproj @@ -10,7 +10,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Tests/Poco2TsTestsCore/Poco2TsTestsCore.csproj b/Tests/Poco2TsTestsCore/Poco2TsTestsCore.csproj index 23085262..e56683e9 100644 --- a/Tests/Poco2TsTestsCore/Poco2TsTestsCore.csproj +++ b/Tests/Poco2TsTestsCore/Poco2TsTestsCore.csproj @@ -11,7 +11,7 @@ - + all diff --git a/WebApiClientGenCore.Abstract/WebApiClientGenCore.Abstract.csproj b/WebApiClientGenCore.Abstract/WebApiClientGenCore.Abstract.csproj index 3feca7a7..964ef198 100644 --- a/WebApiClientGenCore.Abstract/WebApiClientGenCore.Abstract.csproj +++ b/WebApiClientGenCore.Abstract/WebApiClientGenCore.Abstract.csproj @@ -8,9 +8,9 @@ Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year) Zijian Huang https://github.com/zijianhuang/webapiclientgen - 3.4.1 + 3.5 MIT - .NET 8 + .NET 9 README.md 1701;1702;IDE0057 latest-all diff --git a/WebApiClientGenCore.Aurelia/WebApiClientGenCore.Aurelia.csproj b/WebApiClientGenCore.Aurelia/WebApiClientGenCore.Aurelia.csproj index 5a492b2c..8ad2082e 100644 --- a/WebApiClientGenCore.Aurelia/WebApiClientGenCore.Aurelia.csproj +++ b/WebApiClientGenCore.Aurelia/WebApiClientGenCore.Aurelia.csproj @@ -8,13 +8,13 @@ Plugin for WebApiClientGen 3.0+ to generate client API codes with Aurelia. Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year) aurelia TypeScript - .NET 8 + .NET 9 https://github.com/zijianhuang/webapiclientgen false MIT true Fonlow.WebApiClientGenCore.Aurelia - 4.0 + 4.1 README.md https://github.com/zijianhuang/webapiclientgen latest-all diff --git a/WebApiClientGenCore.Axios/WebApiClientGenCore.Axios.csproj b/WebApiClientGenCore.Axios/WebApiClientGenCore.Axios.csproj index 1262edaa..6a168cf9 100644 --- a/WebApiClientGenCore.Axios/WebApiClientGenCore.Axios.csproj +++ b/WebApiClientGenCore.Axios/WebApiClientGenCore.Axios.csproj @@ -5,7 +5,7 @@ Fonlow.WebApiClientGenCore.Axios Zijian Huang Plugin for WebApiClientGen 3.0+ to generate client API codes with AXIOS. - .NET 8 + .NET 9 en https://github.com/zijianhuang/webapiclientgen Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year) @@ -14,7 +14,7 @@ MIT true Fonlow.WebApiClientGenCore.Axios - 4.0 + 4.1 README.md https://github.com/zijianhuang/webapiclientgen latest-all diff --git a/WebApiClientGenCore.Fetch/WebApiClientGenCore.Fetch.csproj b/WebApiClientGenCore.Fetch/WebApiClientGenCore.Fetch.csproj index 58a7641c..4f88b338 100644 --- a/WebApiClientGenCore.Fetch/WebApiClientGenCore.Fetch.csproj +++ b/WebApiClientGenCore.Fetch/WebApiClientGenCore.Fetch.csproj @@ -7,14 +7,14 @@ MIT https://github.com/zijianhuang/webapiclientgen Fetch TypeScript - .NET 8 + .NET 9 Plugin for WebApiClientGen 3.0+ to generate client API codes with Fetch API. en Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year) Zijian Huang false true - 4.0 + 4.1 README.md https://github.com/zijianhuang/webapiclientgen latest-all diff --git a/WebApiClientGenCore.NG2/WebApiClientGenCore.NG2.csproj b/WebApiClientGenCore.NG2/WebApiClientGenCore.NG2.csproj index a096f4bd..dcefa943 100644 --- a/WebApiClientGenCore.NG2/WebApiClientGenCore.NG2.csproj +++ b/WebApiClientGenCore.NG2/WebApiClientGenCore.NG2.csproj @@ -5,7 +5,7 @@ Fonlow.WebApiClientGenCore.NG2 Zijian Huang Plugin for WebApiClientGen 3.0+ to generate client API codes with Angular 6+. - .NET 8 + .NET 9 en https://github.com/zijianhuang/webapiclientgen Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year) @@ -13,7 +13,7 @@ MIT true Fonlow.WebApiClientGenCore.NG2 - 4.0 + 4.1 Angular https://github.com/zijianhuang/webapiclientgen README.md diff --git a/WebApiClientGenCore.NG2FormGroup/WebApiClientGenCore.NG2FormGroup.csproj b/WebApiClientGenCore.NG2FormGroup/WebApiClientGenCore.NG2FormGroup.csproj index 1a7b5227..9a0b969e 100644 --- a/WebApiClientGenCore.NG2FormGroup/WebApiClientGenCore.NG2FormGroup.csproj +++ b/WebApiClientGenCore.NG2FormGroup/WebApiClientGenCore.NG2FormGroup.csproj @@ -5,7 +5,7 @@ Fonlow.WebApiClientGenCore.NG2FormGroup Zijian Huang Plugin for WebApiClientGen 3.0+ to generate client API codes with Angular 6+, plus helper interfaces and functions for creating FormGroup of Angular Reactive Forms. - With TypeScript CodeDOM v3.2; decent supports for 64bit, 128bit and BigInteger. + .NET 9 en https://github.com/zijianhuang/webapiclientgen Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year) @@ -13,7 +13,7 @@ MIT true Fonlow.WebApiClientGenCore.NG2FormGroup - 1.7 + 1.8 Angular README.md https://github.com/zijianhuang/webapiclientgen diff --git a/WebApiClientGenCore.jQuery/WebApiClientGenCore.jQuery.csproj b/WebApiClientGenCore.jQuery/WebApiClientGenCore.jQuery.csproj index 9eb2906b..551c9b04 100644 --- a/WebApiClientGenCore.jQuery/WebApiClientGenCore.jQuery.csproj +++ b/WebApiClientGenCore.jQuery/WebApiClientGenCore.jQuery.csproj @@ -8,12 +8,12 @@ Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year) en Plugin for WebApiClientGen 3.0+ to generate client API codes with jQuery. This requires a HttpClient library at https://github.com/zijianhuang/webapiclientgen/blob/master/DemoWebApi/Scripts/ClientApi/HttpClient.ts. - .NET 8 + .NET 9 false MIT true Fonlow.WebApiClientGenCore.jQuery - 4.0 + 4.1 jQuery README.md https://github.com/zijianhuang/webapiclientgen diff --git a/WebApiClientGenCore/WebApiClientGenCore.csproj b/WebApiClientGenCore/WebApiClientGenCore.csproj index 06a97d8e..775f44e2 100644 --- a/WebApiClientGenCore/WebApiClientGenCore.csproj +++ b/WebApiClientGenCore/WebApiClientGenCore.csproj @@ -5,14 +5,14 @@ Fonlow.CodeDom.Web true Fonlow.WebApiClientGenCore - 7.8.2 + 7.9 Generate strongly typed client API in C# or TypeScript for .NET Core Web API. Strongly Typed Client API Generator generates C# and TypeScript codes of strongly typed client API similar to what generated by SvcUtil.exe of WCF, provided you have access to the ASP.NET Web API source codes or assemblies. Then you may provide or publish either the source codes in C# and TypeScript or the compiled client API library to other developers who are developing client programs of your Web API. The TypeScript outputs support jQuery, Angular 2+, AXIOS and Aurelia. Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year) https://github.com/zijianhuang/webapiclientgen ASP API Web Client webapi rest restful aspnet aspnetwebapi httpclient .net core aspnetcore jquery angular - For https://github.com/dotnet/runtime/issues/104716, for synchronous HttpClient Send, uses HttpClient.SendAsync().Result. + .NET 9 true en diff --git a/aurelia/src/clientapi/WebApiCoreAureliaClientAuto.ts b/aurelia/src/clientapi/WebApiCoreAureliaClientAuto.ts index a8f7ef02..f3da3080 100644 --- a/aurelia/src/clientapi/WebApiCoreAureliaClientAuto.ts +++ b/aurelia/src/clientapi/WebApiCoreAureliaClientAuto.ts @@ -48,6 +48,10 @@ export namespace DemoWebApi_Controllers_Client { super?: boolean | null; } + + /** + * For testing different commbinations of parameters and returns + */ @autoinject() export class DateTypes { constructor(private http: HttpClient) { @@ -69,6 +73,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return DateTimeOffset.Now * GET api/DateTypes/ForDateTimeOffset */ getDateTimeOffset(headersHandler?: () => {[header: string]: string}): Promise { @@ -83,6 +88,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * If Dt is not defined, add a hour from now * GET api/DateTypes/NextHourNullable?n={n}&dt={dt} * @param {number} n Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -98,6 +104,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * If Dt is not defined, add a year from now * GET api/DateTypes/NextYearNullable?n={n}&dt={dt} * @param {number} n Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -106,6 +113,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Client should send DateTime.Date * POST api/DateTypes/IsDateTimeDate */ isDateTimeDate(dt: Date | null, headersHandler?: () => {[header: string]: string}): Promise<{item1: Date, item2: Date}> { @@ -150,6 +158,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return d; * POST api/DateTypes/ForDateTimeOffset */ postDateTimeOffset(d: Date | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -157,6 +166,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return d.ToString("O") * POST api/DateTypes/ForDateTimeOffsetForO */ postDateTimeOffsetForO(d: Date | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -171,6 +181,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Returned is DateTimeOffset? * POST api/DateTypes/DateTimeOffsetNullable */ postDateTimeOffsetNullable(d: Date | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -207,13 +218,21 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return Tuple DateTime?, DateTime? * GET api/DateTypes/SearchDateRange?startDate={startDate}&endDate={endDate} + * @param {Date} startDate DateTime? startDate = null + * @param {Date} endDate DateTime? endDate = null */ searchDateRange(startDate: Date | null, endDate: Date | null, headersHandler?: () => {[header: string]: string}): Promise<{item1: Date, item2: Date}> { return this.http.get('api/DateTypes/SearchDateRange?' + (startDate ? 'startDate=' + startDate?.toISOString() : '') + (endDate ? '&endDate=' + endDate?.toISOString() : ''), { headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.json(); throw d;}); } } + + /** + * Entities, Person and Company + * Some with AuthorizeAttribute + */ @autoinject() export class Entities { constructor(private http: HttpClient) { @@ -304,6 +323,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post MyGeneric string, decimal, double * POST api/Entities/MyGeneric */ getMyGeneric(s: DemoWebApi_DemoData_Client.MyGeneric | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -311,6 +331,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post MyGeneric string, decimal, Person * POST api/Entities/MyGenericPerson */ getMyGenericPerson(s: DemoWebApi_DemoData_Client.MyGeneric | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -318,6 +339,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body, status 204. MaybeNull * GET api/Entities/NullCompany */ getNullCompany(headersHandler?: () => {[header: string]: string}): Promise { @@ -325,8 +347,11 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a person + * so to know the person * GET api/Entities/getPerson/{id} - * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} id unique id of that guy + * @return {DemoWebApi_DemoData_Client.Person} person in db */ getPerson(id: string | null, headersHandler?: () => {[header: string]: string}): Promise { return this.http.get('api/Entities/getPerson/' + id, { headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.json(); throw d;}); @@ -349,6 +374,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH * PATCH api/Entities/patchPerson */ patchPerson(person: DemoWebApi_DemoData_Client.Person | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -370,6 +396,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * Heroes operations. Decorated by nullable directive. + */ @autoinject() export class Heroes { constructor(private http: HttpClient) { @@ -391,6 +421,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a hero. Nullable reference. MaybeNull * GET api/Heroes/{id} * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ @@ -399,6 +430,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get all heroes. * GET api/Heroes */ getHeroes(headersHandler?: () => {[header: string]: string}): Promise> { @@ -406,6 +438,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/Heroes/super?id={id} * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ @@ -421,13 +454,17 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Add a hero. The client will not expect null. NotNull * POST api/Heroes/q?name={name} + * @param {string} name name of hero + * @return {DemoWebApi_Controllers_Client.Hero} Always object. */ postWithQuery(name: string | null, headersHandler?: () => {[header: string]: string}): Promise { return this.http.post('api/Heroes/q?name=' + (!name ? '' : encodeURIComponent(name)), null, { headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.json(); throw d;}); } /** + * Update hero. * PUT api/Heroes */ put(hero: DemoWebApi_Controllers_Client.Hero | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -435,13 +472,20 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Search heroes * GET api/Heroes/search/{name} + * @param {string} name keyword contained in hero name. + * @return {Array} Hero array matching the keyword. */ search(name: string | null, headersHandler?: () => {[header: string]: string}): Promise> { return this.http.get('api/Heroes/search/' + (!name ? '' : encodeURIComponent(name)), { headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.json(); throw d;}); } } + + /** + * For testing different commbinations of parameters and returns + */ @autoinject() export class Numbers { constructor(private http: HttpClient) { @@ -458,8 +502,7 @@ export namespace DemoWebApi_Controllers_Client { /** * GET api/Numbers/byteWithRange?d={d} - * @param {number} d Type: byte - * Range: inclusive between 0 and 100 + * @param {number} d Byte for small number. * @return {number} Type: byte, 0 to 255 */ getByteWithRange(d: number | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -595,6 +638,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Range is with double, not long. Precision of double: ~15-17 digits, while long.MaxValue 9223372036854775807 has 19 decimal digits. * POST api/Numbers/longRange * @param {string} d Type: long * Range: inclusive between 1000 and 9223372036854775800 @@ -623,14 +667,21 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing posting and getting string data. Returned string is JSON object. + */ @autoinject() export class StringData { constructor(private http: HttpClient) { } /** + * Athlethe Search * GET api/StringData/AthletheSearch?take={take}&skip={skip}&order={order}&sort={sort}&search={search} - * @param {number} skip Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} take Generic optional parameter. Default 10 + * @param {number} skip Default 0 + * @param {string} order default null */ athletheSearch(take: number | null, skip: number | null, order: string | null, sort: string | null, search: string | null, headersHandler?: () => {[header: string]: string}): Promise { return this.http.get('api/StringData/AthletheSearch?' + (take ? 'take=' + take.toString() : '') + '&skip=' + skip + '&order=' + (!order ? '' : encodeURIComponent(order)) + '&sort=' + (!sort ? '' : encodeURIComponent(sort)) + '&search=' + (!search ? '' : encodeURIComponent(search)), { headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); @@ -644,6 +695,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty string JSON object. Status 200. * GET api/StringData/EmptyString */ getEmptyString(headersHandler?: () => {[header: string]: string}): Promise { @@ -651,6 +703,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 204 No Content, even though the default mime type is application/json. MaybeNull * GET api/StringData/NullString */ getNullString(headersHandler?: () => {[header: string]: string}): Promise { @@ -658,6 +711,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing different commbinations of parameters and returns + */ @autoinject() export class SuperDemo { constructor(private http: HttpClient) { @@ -752,6 +809,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo * GET api/SuperDemo/decimalArrayQ?a={a} */ getDecimalArrayQ(a: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -805,6 +863,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Result of 0.1d + 0.2d - 0.3d * GET api/SuperDemo/DoubleZero * @return {number} Type: double */ @@ -813,6 +872,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo IEnumerable Days * GET api/SuperDemo/enumArrayDays?a={a} */ getEnumArrayDays(a: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -870,6 +930,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[]; * GET api/SuperDemo/intArrayQ?a={a} */ getIntArrayQ(a: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -877,6 +938,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo IEnumerable long * GET api/SuperDemo/intArrayQ2?a={a} */ getIntArrayQ2(a: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -921,6 +983,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * False to return null, and true to return 1000 * GET api/SuperDemo/NullableDecimal/{hasValue} */ getNullableDecimal(hasValue: boolean | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -928,6 +991,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/SuperDemo/NullObject */ getNullPerson(headersHandler?: () => {[header: string]: string}): Promise { @@ -965,6 +1029,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo string array * GET api/SuperDemo/stringArrayQ?a={a} */ getStringArrayQ(a: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -972,6 +1037,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo List string * GET api/SuperDemo/stringArrayQ2?a={a} */ getStringArrayQ2(a: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -979,6 +1045,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * ActionResult with FileStreamResult * GET api/SuperDemo/TextStream */ getTextStream(headersHandler?: () => {[header: string]: string}): Promise { @@ -1031,6 +1098,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post a collection of person * POST api/SuperDemo/Collection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1046,6 +1114,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo Dic string and person * POST api/SuperDemo/StringPersonDic * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1061,6 +1130,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post ICollection of person * POST api/SuperDemo/ICollection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1069,6 +1139,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post IList of person * POST api/SuperDemo/IList * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1084,6 +1155,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[][] * POST api/SuperDemo/int2djagged */ postInt2DJagged(a: Array> | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1091,6 +1163,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[] * POST api/SuperDemo/intArray * @param {Array} a Min length: 1 * Max length: 10 @@ -1100,6 +1173,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post IReadOnlyCollection of person * POST api/SuperDemo/IReadOnlyCollection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1108,6 +1182,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post e of person * POST api/SuperDemo/IReadOnlyList * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1116,6 +1191,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post a list of person * POST api/SuperDemo/List * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1132,6 +1208,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing posting and getting string data. String returned is text/plain by default + */ @autoinject() export class TextData { constructor(private http: HttpClient) { @@ -1153,6 +1233,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 200. * GET api/TextData/EmptyString */ getEmptyString(headersHandler?: () => {[header: string]: string}): Promise { @@ -1160,6 +1241,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/TextData/NullableString */ getNullableString(headersHandler?: () => {[header: string]: string}): Promise { @@ -1167,6 +1249,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 204 No Content. * GET api/TextData/NullString */ getNullString(headersHandler?: () => {[header: string]: string}): Promise { @@ -1174,12 +1257,17 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.3.3 + */ @autoinject() export class Tuple { constructor(private http: HttpClient) { } /** + * Update in a transaction * PUT api/Tuple/A1TupleArray */ a1TupleArray(idAndOrderArray: Array<{item1: string, item2: number}> | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1187,6 +1275,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Update IEnumerable Tuple in a transaction * PUT api/Tuple/A2TupleArray */ a2TupleIEnumerable(idAndOrderArray: Array<{item1: string, item2: number}> | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1194,6 +1283,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post tuple * POST api/Tuple/ChangeName */ changeName(d: {item1: string, item2: DemoWebApi_DemoData_Client.Person} | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1201,6 +1291,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get Tuple in return. MaybeNull * GET api/Tuple/PeopleCompany4 */ getPeopleCompany4(headersHandler?: () => {[header: string]: string}): Promise<{item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Company}> { @@ -1208,6 +1299,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/Tuple/PeopleCompany5 */ getPeopleCompany5(headersHandler?: () => {[header: string]: string}): Promise<{item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Person, item5: DemoWebApi_DemoData_Client.Company}> { @@ -1264,6 +1356,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post nested tuple * GET api/Tuple/Tuple8 */ getTuple8(headersHandler?: () => {[header: string]: string}): Promise<{item1: string, item2: string, item3: string, item4: string, item5: string, item6: string, item7: number, rest: {item1: string, item2: string, item3: string}}> { @@ -1306,6 +1399,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post long tuple * POST api/Tuple/PeopleCompany7 */ linkPeopleCompany7(peopleAndCompany: {item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Person, item5: DemoWebApi_DemoData_Client.Person, item6: DemoWebApi_DemoData_Client.Person, item7: DemoWebApi_DemoData_Client.Company} | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1335,6 +1429,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post tuple string int * POST api/Tuple/Tuple2 */ postTuple2(tuple: {item1: string, item2: number} | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1398,6 +1493,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a list of value * GET api/Values */ get(headersHandler?: () => {[header: string]: string}): Promise> { @@ -1405,6 +1501,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by both Id and name * GET api/Values/Name/{id}?name={name} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1413,6 +1510,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by name * GET api/Values?name={name} */ getByNameOfString(name: string | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1420,6 +1518,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by Id * GET api/Values/{id} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1428,6 +1527,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a list of value async, it is get2 * GET api/Values/Get2 */ get2(headersHandler?: () => {[header: string]: string}): Promise> { @@ -1442,6 +1542,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Update with valjue * PUT api/Values/{id} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1579,9 +1680,6 @@ export namespace DemoWebApi_DemoData_Client { lines?: Array; } - export interface Constants { - } - export enum Days { Sat = 1, Sun = 2, @@ -1734,7 +1832,7 @@ export namespace DemoWebApi_Models_Client { export interface AddExternalLoginBindingModel { /** Required */ - externalAccessToken: string; + externalAccessToken?: string | null; } export interface ChangePasswordBindingModel { @@ -1756,48 +1854,35 @@ export namespace DemoWebApi_Models_Client { OldPwd: string; } - export interface ExternalLoginViewModel { - name?: string | null; - state?: string | null; - url?: string | null; - } - - export interface ManageInfoViewModel { - email?: string | null; - externalLoginProviders?: Array; - localLoginProvider?: string | null; - logins?: Array; - } - export interface RegisterBindingModel { /** Data type: Password */ confirmPassword?: string | null; /** Required */ - email: string; + email?: string | null; /** * Required * String length: inclusive between 6 and 100 * Data type: Password */ - password: string; + password?: string | null; } export interface RegisterExternalBindingModel { /** Required */ - email: string; + email?: string | null; } export interface RemoveLoginBindingModel { /** Required */ - loginProvider: string; + loginProvider?: string | null; /** Required */ - providerKey: string; + providerKey?: string | null; } export interface SetPasswordBindingModel { @@ -1810,7 +1895,7 @@ export namespace DemoWebApi_Models_Client { * String length: inclusive between 6 and 100 * Data type: Password */ - newPassword: string; + newPassword?: string | null; } @@ -1828,35 +1913,6 @@ export namespace DemoWebApi_Models_Client { username?: string | null; } - export interface UserInfoViewModel { - email?: string | null; - hasRegistered?: boolean | null; - loginProvider?: string | null; - dummy1?: string | null; - dumy2?: string | null; - } - - export interface UserLoginInfoViewModel { - loginProvider?: string | null; - providerKey?: string | null; - } - -} - -export namespace WebApplication1_Client { - export interface WeatherForecast { - - /** Type: DateOnly */ - date?: Date | null; - summary?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureC?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureF?: number | null; - } - } export namespace DemoCoreWeb_Controllers_Client { @@ -1866,13 +1922,16 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Anonymous Dynamic of C# * GET api/SpecialTypes/AnonymousDynamic + * @return {any} dyanmic things */ getAnonymousDynamic(headersHandler?: () => {[header: string]: string}): Promise { return this.http.get('api/SpecialTypes/AnonymousDynamic', { headers: headersHandler ? headersHandler() : undefined }); } /** + * Async function returing dynamic * GET api/SpecialTypes/AnonymousDynamic2 */ getAnonymousDynamic2(headersHandler?: () => {[header: string]: string}): Promise { @@ -1887,6 +1946,7 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Async function returning object * GET api/SpecialTypes/AnonymousObject2 */ getAnonymousObject2(headersHandler?: () => {[header: string]: string}): Promise { @@ -1901,6 +1961,7 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Async returning object, Post dynamic * POST api/SpecialTypes/AnonymousObject2 */ postAnonymousObject2(obj: any, headersHandler?: () => {[header: string]: string}): Promise { @@ -1910,19 +1971,3 @@ export namespace DemoCoreWeb_Controllers_Client { } -export namespace WebApplication1_Controllers_Client { - @autoinject() - export class WeatherForecast { - constructor(private http: HttpClient) { - } - - /** - * GET WeatherForecast - */ - get(headersHandler?: () => {[header: string]: string}): Promise> { - return this.http.get('WeatherForecast', { headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - -} - diff --git a/axios/src/clientapi/WebApiCoreAxiosClientAuto.ts b/axios/src/clientapi/WebApiCoreAxiosClientAuto.ts index 7f57793c..4787fc34 100644 --- a/axios/src/clientapi/WebApiCoreAxiosClientAuto.ts +++ b/axios/src/clientapi/WebApiCoreAxiosClientAuto.ts @@ -48,6 +48,10 @@ export namespace DemoWebApi_Controllers_Client { super?: boolean | null; } + + /** + * For testing different commbinations of parameters and returns + */ export class DateTypes { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -68,6 +72,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return DateTimeOffset.Now * GET api/DateTypes/ForDateTimeOffset */ getDateTimeOffset(headersHandler?: () => {[header: string]: string}): Promise { @@ -82,6 +87,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * If Dt is not defined, add a hour from now * GET api/DateTypes/NextHourNullable?n={n}&dt={dt} * @param {number} n Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -97,6 +103,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * If Dt is not defined, add a year from now * GET api/DateTypes/NextYearNullable?n={n}&dt={dt} * @param {number} n Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -105,6 +112,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Client should send DateTime.Date * POST api/DateTypes/IsDateTimeDate */ isDateTimeDate(dt?: Date | null, headersHandler?: () => {[header: string]: string}): Promise<{item1: Date, item2: Date}> { @@ -149,6 +157,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return d; * POST api/DateTypes/ForDateTimeOffset */ postDateTimeOffset(d?: Date | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -156,6 +165,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return d.ToString("O") * POST api/DateTypes/ForDateTimeOffsetForO */ postDateTimeOffsetForO(d?: Date | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -170,6 +180,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Returned is DateTimeOffset? * POST api/DateTypes/DateTimeOffsetNullable */ postDateTimeOffsetNullable(d?: Date | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -206,13 +217,21 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return Tuple DateTime?, DateTime? * GET api/DateTypes/SearchDateRange?startDate={startDate}&endDate={endDate} + * @param {Date | null} startDate DateTime? startDate = null + * @param {Date | null} endDate DateTime? endDate = null */ searchDateRange(startDate?: Date | null, endDate?: Date | null, headersHandler?: () => {[header: string]: string}): Promise<{item1: Date | null, item2: Date | null}> { return Axios.get<{item1: Date | null, item2: Date | null}>(this.baseUri + 'api/DateTypes/SearchDateRange?' + (startDate ? 'startDate=' + startDate?.toISOString() : '') + (endDate ? '&endDate=' + endDate?.toISOString() : ''), { headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.data; throw d;}); } } + + /** + * Entities, Person and Company + * Some with AuthorizeAttribute + */ export class Entities { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -302,6 +321,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post MyGeneric string, decimal, double * POST api/Entities/MyGeneric */ getMyGeneric(s?: DemoWebApi_DemoData_Client.MyGeneric | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -309,6 +329,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post MyGeneric string, decimal, Person * POST api/Entities/MyGenericPerson */ getMyGenericPerson(s?: DemoWebApi_DemoData_Client.MyGeneric | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -316,6 +337,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body, status 204. MaybeNull * GET api/Entities/NullCompany */ getNullCompany(headersHandler?: () => {[header: string]: string}): Promise { @@ -323,8 +345,11 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a person + * so to know the person * GET api/Entities/getPerson/{id} - * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} id unique id of that guy + * @return {DemoWebApi_DemoData_Client.Person} person in db */ getPerson(id?: string | null, headersHandler?: () => {[header: string]: string}): Promise { return Axios.get(this.baseUri + 'api/Entities/getPerson/' + id, { headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.data; throw d;}); @@ -347,6 +372,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH * PATCH api/Entities/patchPerson */ patchPerson(person?: DemoWebApi_DemoData_Client.Person | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -368,6 +394,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * Heroes operations. Decorated by nullable directive. + */ export class Heroes { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -388,6 +418,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a hero. Nullable reference. MaybeNull * GET api/Heroes/{id} * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ @@ -396,6 +427,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get all heroes. * GET api/Heroes */ getHeroes(headersHandler?: () => {[header: string]: string}): Promise> { @@ -403,6 +435,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/Heroes/super?id={id} * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ @@ -418,13 +451,17 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Add a hero. The client will not expect null. NotNull * POST api/Heroes/q?name={name} + * @param {string} name name of hero + * @return {DemoWebApi_Controllers_Client.Hero} Always object. */ postWithQuery(name?: string | null, headersHandler?: () => {[header: string]: string}): Promise { return Axios.post(this.baseUri + 'api/Heroes/q?name=' + (!name ? '' : encodeURIComponent(name)), null, { headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.data; throw d;}); } /** + * Update hero. * PUT api/Heroes */ put(hero?: DemoWebApi_Controllers_Client.Hero | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -432,13 +469,20 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Search heroes * GET api/Heroes/search/{name} + * @param {string} name keyword contained in hero name. + * @return {Array} Hero array matching the keyword. */ search(name?: string | null, headersHandler?: () => {[header: string]: string}): Promise> { return Axios.get>(this.baseUri + 'api/Heroes/search/' + (!name ? '' : encodeURIComponent(name)), { headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.data; throw d;}); } } + + /** + * For testing different commbinations of parameters and returns + */ export class Numbers { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -454,8 +498,7 @@ export namespace DemoWebApi_Controllers_Client { /** * GET api/Numbers/byteWithRange?d={d} - * @param {number} d Type: byte - * Range: inclusive between 0 and 100 + * @param {number} d Byte for small number. * @return {number} Type: byte, 0 to 255 */ getByteWithRange(d?: number | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -591,6 +634,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Range is with double, not long. Precision of double: ~15-17 digits, while long.MaxValue 9223372036854775807 has 19 decimal digits. * POST api/Numbers/longRange * @param {string} d Type: long * Range: inclusive between 1000 and 9223372036854775800 @@ -619,13 +663,20 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing posting and getting string data. Returned string is JSON object. + */ export class StringData { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } /** + * Athlethe Search * GET api/StringData/AthletheSearch?take={take}&skip={skip}&order={order}&sort={sort}&search={search} - * @param {number} skip Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number | null} take Generic optional parameter. Default 10 + * @param {number} skip Default 0 + * @param {string} order default null */ athletheSearch(take?: number | null, skip?: number | null, order?: string | null, sort?: string | null, search?: string | null, headersHandler?: () => {[header: string]: string}): Promise { return Axios.get(this.baseUri + 'api/StringData/AthletheSearch?' + (take ? 'take=' + take.toString() : '') + '&skip=' + skip + '&order=' + (!order ? '' : encodeURIComponent(order)) + '&sort=' + (!sort ? '' : encodeURIComponent(sort)) + '&search=' + (!search ? '' : encodeURIComponent(search)), { headers: headersHandler ? headersHandler() : undefined, responseType: 'text' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.data; throw d;}); @@ -639,6 +690,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty string JSON object. Status 200. * GET api/StringData/EmptyString */ getEmptyString(headersHandler?: () => {[header: string]: string}): Promise { @@ -646,6 +698,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 204 No Content, even though the default mime type is application/json. MaybeNull * GET api/StringData/NullString */ getNullString(headersHandler?: () => {[header: string]: string}): Promise { @@ -653,6 +706,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing different commbinations of parameters and returns + */ export class SuperDemo { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -746,6 +803,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo * GET api/SuperDemo/decimalArrayQ?a={a} */ getDecimalArrayQ(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -799,6 +857,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Result of 0.1d + 0.2d - 0.3d * GET api/SuperDemo/DoubleZero * @return {number} Type: double */ @@ -807,6 +866,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo IEnumerable Days * GET api/SuperDemo/enumArrayDays?a={a} */ getEnumArrayDays(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -864,6 +924,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[]; * GET api/SuperDemo/intArrayQ?a={a} */ getIntArrayQ(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -871,6 +932,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo IEnumerable long * GET api/SuperDemo/intArrayQ2?a={a} */ getIntArrayQ2(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -915,6 +977,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * False to return null, and true to return 1000 * GET api/SuperDemo/NullableDecimal/{hasValue} */ getNullableDecimal(hasValue?: boolean | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -922,6 +985,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/SuperDemo/NullObject */ getNullPerson(headersHandler?: () => {[header: string]: string}): Promise { @@ -959,6 +1023,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo string array * GET api/SuperDemo/stringArrayQ?a={a} */ getStringArrayQ(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -966,6 +1031,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo List string * GET api/SuperDemo/stringArrayQ2?a={a} */ getStringArrayQ2(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -973,6 +1039,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * ActionResult with FileStreamResult * GET api/SuperDemo/TextStream */ getTextStream(headersHandler?: () => {[header: string]: string}): Promise> { @@ -1025,6 +1092,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post a collection of person * POST api/SuperDemo/Collection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1040,6 +1108,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo Dic string and person * POST api/SuperDemo/StringPersonDic * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1055,6 +1124,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post ICollection of person * POST api/SuperDemo/ICollection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1063,6 +1133,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post IList of person * POST api/SuperDemo/IList * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1078,6 +1149,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[][] * POST api/SuperDemo/int2djagged */ postInt2DJagged(a?: Array> | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1085,6 +1157,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[] * POST api/SuperDemo/intArray * @param {Array} a Min length: 1 * Max length: 10 @@ -1094,6 +1167,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post IReadOnlyCollection of person * POST api/SuperDemo/IReadOnlyCollection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1102,6 +1176,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post e of person * POST api/SuperDemo/IReadOnlyList * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1110,6 +1185,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post a list of person * POST api/SuperDemo/List * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1126,6 +1202,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing posting and getting string data. String returned is text/plain by default + */ export class TextData { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -1146,6 +1226,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 200. * GET api/TextData/EmptyString */ getEmptyString(headersHandler?: () => {[header: string]: string}): Promise { @@ -1153,6 +1234,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/TextData/NullableString */ getNullableString(headersHandler?: () => {[header: string]: string}): Promise { @@ -1160,6 +1242,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 204 No Content. * GET api/TextData/NullString */ getNullString(headersHandler?: () => {[header: string]: string}): Promise { @@ -1167,11 +1250,16 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.3.3 + */ export class Tuple { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } /** + * Update in a transaction * PUT api/Tuple/A1TupleArray */ a1TupleArray(idAndOrderArray?: Array<{item1: string, item2: number}> | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1179,6 +1267,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Update IEnumerable Tuple in a transaction * PUT api/Tuple/A2TupleArray */ a2TupleIEnumerable(idAndOrderArray?: Array<{item1: string, item2: number}> | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1186,6 +1275,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post tuple * POST api/Tuple/ChangeName */ changeName(d?: {item1: string, item2: DemoWebApi_DemoData_Client.Person} | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1193,6 +1283,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get Tuple in return. MaybeNull * GET api/Tuple/PeopleCompany4 */ getPeopleCompany4(headersHandler?: () => {[header: string]: string}): Promise<{item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Company} | null> { @@ -1200,6 +1291,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/Tuple/PeopleCompany5 */ getPeopleCompany5(headersHandler?: () => {[header: string]: string}): Promise<{item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Person, item5: DemoWebApi_DemoData_Client.Company} | null> { @@ -1256,6 +1348,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post nested tuple * GET api/Tuple/Tuple8 */ getTuple8(headersHandler?: () => {[header: string]: string}): Promise<{item1: string, item2: string, item3: string, item4: string, item5: string, item6: string, item7: number, rest: {item1: string, item2: string, item3: string}}> { @@ -1298,6 +1391,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post long tuple * POST api/Tuple/PeopleCompany7 */ linkPeopleCompany7(peopleAndCompany?: {item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Person, item5: DemoWebApi_DemoData_Client.Person, item6: DemoWebApi_DemoData_Client.Person, item7: DemoWebApi_DemoData_Client.Company} | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1327,6 +1421,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post tuple string int * POST api/Tuple/Tuple2 */ postTuple2(tuple?: {item1: string, item2: number} | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1389,6 +1484,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a list of value * GET api/Values */ get(headersHandler?: () => {[header: string]: string}): Promise> { @@ -1396,6 +1492,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by both Id and name * GET api/Values/Name/{id}?name={name} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1404,6 +1501,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by name * GET api/Values?name={name} */ getByNameOfString(name?: string | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1411,6 +1509,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by Id * GET api/Values/{id} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1419,6 +1518,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a list of value async, it is get2 * GET api/Values/Get2 */ get2(headersHandler?: () => {[header: string]: string}): Promise> { @@ -1433,6 +1533,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Update with valjue * PUT api/Values/{id} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1570,9 +1671,6 @@ export namespace DemoWebApi_DemoData_Client { lines?: Array; } - export interface Constants { - } - export enum Days { Sat = 1, Sun = 2, @@ -1725,7 +1823,7 @@ export namespace DemoWebApi_Models_Client { export interface AddExternalLoginBindingModel { /** Required */ - externalAccessToken: string; + externalAccessToken?: string | null; } export interface ChangePasswordBindingModel { @@ -1747,48 +1845,35 @@ export namespace DemoWebApi_Models_Client { OldPwd: string; } - export interface ExternalLoginViewModel { - name?: string | null; - state?: string | null; - url?: string | null; - } - - export interface ManageInfoViewModel { - email?: string | null; - externalLoginProviders?: Array; - localLoginProvider?: string | null; - logins?: Array; - } - export interface RegisterBindingModel { /** Data type: Password */ confirmPassword?: string | null; /** Required */ - email: string; + email?: string | null; /** * Required * String length: inclusive between 6 and 100 * Data type: Password */ - password: string; + password?: string | null; } export interface RegisterExternalBindingModel { /** Required */ - email: string; + email?: string | null; } export interface RemoveLoginBindingModel { /** Required */ - loginProvider: string; + loginProvider?: string | null; /** Required */ - providerKey: string; + providerKey?: string | null; } export interface SetPasswordBindingModel { @@ -1801,7 +1886,7 @@ export namespace DemoWebApi_Models_Client { * String length: inclusive between 6 and 100 * Data type: Password */ - newPassword: string; + newPassword?: string | null; } @@ -1819,35 +1904,6 @@ export namespace DemoWebApi_Models_Client { username?: string | null; } - export interface UserInfoViewModel { - email?: string | null; - hasRegistered?: boolean | null; - loginProvider?: string | null; - dummy1?: string | null; - dumy2?: string | null; - } - - export interface UserLoginInfoViewModel { - loginProvider?: string | null; - providerKey?: string | null; - } - -} - -export namespace WebApplication1_Client { - export interface WeatherForecast { - - /** Type: DateOnly */ - date?: Date | null; - summary?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureC?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureF?: number | null; - } - } export namespace DemoCoreWeb_Controllers_Client { @@ -1856,13 +1912,16 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Anonymous Dynamic of C# * GET api/SpecialTypes/AnonymousDynamic + * @return {any} dyanmic things */ getAnonymousDynamic(headersHandler?: () => {[header: string]: string}): Promise { return Axios.get(this.baseUri + 'api/SpecialTypes/AnonymousDynamic', { headers: headersHandler ? headersHandler() : undefined }); } /** + * Async function returing dynamic * GET api/SpecialTypes/AnonymousDynamic2 */ getAnonymousDynamic2(headersHandler?: () => {[header: string]: string}): Promise { @@ -1877,6 +1936,7 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Async function returning object * GET api/SpecialTypes/AnonymousObject2 */ getAnonymousObject2(headersHandler?: () => {[header: string]: string}): Promise { @@ -1891,6 +1951,7 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Async returning object, Post dynamic * POST api/SpecialTypes/AnonymousObject2 */ postAnonymousObject2(obj?: any, headersHandler?: () => {[header: string]: string}): Promise { @@ -1900,18 +1961,3 @@ export namespace DemoCoreWeb_Controllers_Client { } -export namespace WebApplication1_Controllers_Client { - export class WeatherForecast { - constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { - } - - /** - * GET WeatherForecast - */ - get(headersHandler?: () => {[header: string]: string}): Promise> { - return Axios.get>(this.baseUri + 'WeatherForecast', { headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - -} - diff --git a/fetchapi/src/clientapi/WebApiCoreFetchClientAuto.ts b/fetchapi/src/clientapi/WebApiCoreFetchClientAuto.ts index 03c3c8fc..ee367dfd 100644 --- a/fetchapi/src/clientapi/WebApiCoreFetchClientAuto.ts +++ b/fetchapi/src/clientapi/WebApiCoreFetchClientAuto.ts @@ -46,6 +46,10 @@ export namespace DemoWebApi_Controllers_Client { super?: boolean | null; } + + /** + * For testing different commbinations of parameters and returns + */ export class DateTypes { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -66,6 +70,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return DateTimeOffset.Now * GET api/DateTypes/ForDateTimeOffset */ getDateTimeOffset(headersHandler?: () => {[header: string]: string}): Promise { @@ -80,6 +85,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * If Dt is not defined, add a hour from now * GET api/DateTypes/NextHourNullable?n={n}&dt={dt} * @param {number} n Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -95,6 +101,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * If Dt is not defined, add a year from now * GET api/DateTypes/NextYearNullable?n={n}&dt={dt} * @param {number} n Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -103,6 +110,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Client should send DateTime.Date * POST api/DateTypes/IsDateTimeDate */ isDateTimeDate(dt?: Date | null, headersHandler?: () => {[header: string]: string}): Promise<{item1: Date, item2: Date}> { @@ -147,6 +155,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return d; * POST api/DateTypes/ForDateTimeOffset */ postDateTimeOffset(d?: Date | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -154,6 +163,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * return d.ToString("O") * POST api/DateTypes/ForDateTimeOffsetForO */ postDateTimeOffsetForO(d?: Date | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -168,6 +178,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Returned is DateTimeOffset? * POST api/DateTypes/DateTimeOffsetNullable */ postDateTimeOffsetNullable(d?: Date | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -204,13 +215,21 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return Tuple DateTime?, DateTime? * GET api/DateTypes/SearchDateRange?startDate={startDate}&endDate={endDate} + * @param {Date | null} startDate DateTime? startDate = null + * @param {Date | null} endDate DateTime? endDate = null */ searchDateRange(startDate?: Date | null, endDate?: Date | null, headersHandler?: () => {[header: string]: string}): Promise<{item1: Date | null, item2: Date | null}> { return fetch(this.baseUri + 'api/DateTypes/SearchDateRange?' + (startDate ? 'startDate=' + startDate?.toISOString() : '') + (endDate ? '&endDate=' + endDate?.toISOString() : ''), { method: 'get', headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); } } + + /** + * Entities, Person and Company + * Some with AuthorizeAttribute + */ export class Entities { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -300,6 +319,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post MyGeneric string, decimal, double * POST api/Entities/MyGeneric */ getMyGeneric(s?: DemoWebApi_DemoData_Client.MyGeneric | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -307,6 +327,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post MyGeneric string, decimal, Person * POST api/Entities/MyGenericPerson */ getMyGenericPerson(s?: DemoWebApi_DemoData_Client.MyGeneric | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -314,6 +335,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body, status 204. MaybeNull * GET api/Entities/NullCompany */ getNullCompany(headersHandler?: () => {[header: string]: string}): Promise { @@ -321,8 +343,11 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a person + * so to know the person * GET api/Entities/getPerson/{id} - * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} id unique id of that guy + * @return {DemoWebApi_DemoData_Client.Person} person in db */ getPerson(id?: string | null, headersHandler?: () => {[header: string]: string}): Promise { return fetch(this.baseUri + 'api/Entities/getPerson/' + id, { method: 'get', headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); @@ -345,6 +370,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH * PATCH api/Entities/patchPerson */ patchPerson(person?: DemoWebApi_DemoData_Client.Person | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -366,6 +392,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * Heroes operations. Decorated by nullable directive. + */ export class Heroes { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -386,6 +416,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a hero. Nullable reference. MaybeNull * GET api/Heroes/{id} * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ @@ -394,6 +425,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get all heroes. * GET api/Heroes */ getHeroes(headersHandler?: () => {[header: string]: string}): Promise> { @@ -401,6 +433,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/Heroes/super?id={id} * @param {string} id Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ @@ -416,13 +449,17 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Add a hero. The client will not expect null. NotNull * POST api/Heroes/q?name={name} + * @param {string} name name of hero + * @return {DemoWebApi_Controllers_Client.Hero} Always object. */ postWithQuery(name?: string | null, headersHandler?: () => {[header: string]: string}): Promise { return fetch(this.baseUri + 'api/Heroes/q?name=' + (!name ? '' : encodeURIComponent(name)), { method: 'post', headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); } /** + * Update hero. * PUT api/Heroes */ put(hero?: DemoWebApi_Controllers_Client.Hero | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -430,13 +467,20 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Search heroes * GET api/Heroes/search/{name} + * @param {string} name keyword contained in hero name. + * @return {Array} Hero array matching the keyword. */ search(name?: string | null, headersHandler?: () => {[header: string]: string}): Promise> { return fetch(this.baseUri + 'api/Heroes/search/' + (!name ? '' : encodeURIComponent(name)), { method: 'get', headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); } } + + /** + * For testing different commbinations of parameters and returns + */ export class Numbers { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -452,8 +496,7 @@ export namespace DemoWebApi_Controllers_Client { /** * GET api/Numbers/byteWithRange?d={d} - * @param {number} d Type: byte - * Range: inclusive between 0 and 100 + * @param {number} d Byte for small number. * @return {number} Type: byte, 0 to 255 */ getByteWithRange(d?: number | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -589,6 +632,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Range is with double, not long. Precision of double: ~15-17 digits, while long.MaxValue 9223372036854775807 has 19 decimal digits. * POST api/Numbers/longRange * @param {string} d Type: long * Range: inclusive between 1000 and 9223372036854775800 @@ -617,13 +661,20 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing posting and getting string data. Returned string is JSON object. + */ export class StringData { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } /** + * Athlethe Search * GET api/StringData/AthletheSearch?take={take}&skip={skip}&order={order}&sort={sort}&search={search} - * @param {number} skip Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number | null} take Generic optional parameter. Default 10 + * @param {number} skip Default 0 + * @param {string} order default null */ athletheSearch(take?: number | null, skip?: number | null, order?: string | null, sort?: string | null, search?: string | null, headersHandler?: () => {[header: string]: string}): Promise { return fetch(this.baseUri + 'api/StringData/AthletheSearch?' + (take ? 'take=' + take.toString() : '') + '&skip=' + skip + '&order=' + (!order ? '' : encodeURIComponent(order)) + '&sort=' + (!sort ? '' : encodeURIComponent(sort)) + '&search=' + (!search ? '' : encodeURIComponent(search)), { method: 'get', headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); @@ -637,6 +688,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty string JSON object. Status 200. * GET api/StringData/EmptyString */ getEmptyString(headersHandler?: () => {[header: string]: string}): Promise { @@ -644,6 +696,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 204 No Content, even though the default mime type is application/json. MaybeNull * GET api/StringData/NullString */ getNullString(headersHandler?: () => {[header: string]: string}): Promise { @@ -651,6 +704,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing different commbinations of parameters and returns + */ export class SuperDemo { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -744,6 +801,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo * GET api/SuperDemo/decimalArrayQ?a={a} */ getDecimalArrayQ(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -797,6 +855,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Result of 0.1d + 0.2d - 0.3d * GET api/SuperDemo/DoubleZero * @return {number} Type: double */ @@ -805,6 +864,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo IEnumerable Days * GET api/SuperDemo/enumArrayDays?a={a} */ getEnumArrayDays(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -862,6 +922,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[]; * GET api/SuperDemo/intArrayQ?a={a} */ getIntArrayQ(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -869,6 +930,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo IEnumerable long * GET api/SuperDemo/intArrayQ2?a={a} */ getIntArrayQ2(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -913,6 +975,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * False to return null, and true to return 1000 * GET api/SuperDemo/NullableDecimal/{hasValue} */ getNullableDecimal(hasValue?: boolean | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -920,6 +983,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/SuperDemo/NullObject */ getNullPerson(headersHandler?: () => {[header: string]: string}): Promise { @@ -957,6 +1021,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo string array * GET api/SuperDemo/stringArrayQ?a={a} */ getStringArrayQ(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -964,6 +1029,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo List string * GET api/SuperDemo/stringArrayQ2?a={a} */ getStringArrayQ2(a?: Array | null, headersHandler?: () => {[header: string]: string}): Promise> { @@ -971,6 +1037,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * ActionResult with FileStreamResult * GET api/SuperDemo/TextStream */ getTextStream(headersHandler?: () => {[header: string]: string}): Promise { @@ -1023,6 +1090,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post a collection of person * POST api/SuperDemo/Collection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1038,6 +1106,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo Dic string and person * POST api/SuperDemo/StringPersonDic * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1053,6 +1122,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post ICollection of person * POST api/SuperDemo/ICollection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1061,6 +1131,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post IList of person * POST api/SuperDemo/IList * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1076,6 +1147,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[][] * POST api/SuperDemo/int2djagged */ postInt2DJagged(a?: Array> | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1083,6 +1155,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Demo int[] * POST api/SuperDemo/intArray * @param {Array} a Min length: 1 * Max length: 10 @@ -1092,6 +1165,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post IReadOnlyCollection of person * POST api/SuperDemo/IReadOnlyCollection * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1100,6 +1174,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post e of person * POST api/SuperDemo/IReadOnlyList * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1108,6 +1183,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post a list of person * POST api/SuperDemo/List * @return {number} Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1124,6 +1200,10 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * For testing posting and getting string data. String returned is text/plain by default + */ export class TextData { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } @@ -1144,6 +1224,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 200. * GET api/TextData/EmptyString */ getEmptyString(headersHandler?: () => {[header: string]: string}): Promise { @@ -1151,6 +1232,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/TextData/NullableString */ getNullableString(headersHandler?: () => {[header: string]: string}): Promise { @@ -1158,6 +1240,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Return empty body with status 204 No Content. * GET api/TextData/NullString */ getNullString(headersHandler?: () => {[header: string]: string}): Promise { @@ -1165,11 +1248,16 @@ export namespace DemoWebApi_Controllers_Client { } } + + /** + * https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.3.3 + */ export class Tuple { constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { } /** + * Update in a transaction * PUT api/Tuple/A1TupleArray */ a1TupleArray(idAndOrderArray?: Array<{item1: string, item2: number}> | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1177,6 +1265,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Update IEnumerable Tuple in a transaction * PUT api/Tuple/A2TupleArray */ a2TupleIEnumerable(idAndOrderArray?: Array<{item1: string, item2: number}> | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1184,6 +1273,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post tuple * POST api/Tuple/ChangeName */ changeName(d?: {item1: string, item2: DemoWebApi_DemoData_Client.Person} | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1191,6 +1281,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get Tuple in return. MaybeNull * GET api/Tuple/PeopleCompany4 */ getPeopleCompany4(headersHandler?: () => {[header: string]: string}): Promise<{item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Company} | null> { @@ -1198,6 +1289,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * MaybeNull * GET api/Tuple/PeopleCompany5 */ getPeopleCompany5(headersHandler?: () => {[header: string]: string}): Promise<{item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Person, item5: DemoWebApi_DemoData_Client.Company} | null> { @@ -1254,6 +1346,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post nested tuple * GET api/Tuple/Tuple8 */ getTuple8(headersHandler?: () => {[header: string]: string}): Promise<{item1: string, item2: string, item3: string, item4: string, item5: string, item6: string, item7: number, rest: {item1: string, item2: string, item3: string}}> { @@ -1296,6 +1389,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post long tuple * POST api/Tuple/PeopleCompany7 */ linkPeopleCompany7(peopleAndCompany?: {item1: DemoWebApi_DemoData_Client.Person, item2: DemoWebApi_DemoData_Client.Person, item3: DemoWebApi_DemoData_Client.Person, item4: DemoWebApi_DemoData_Client.Person, item5: DemoWebApi_DemoData_Client.Person, item6: DemoWebApi_DemoData_Client.Person, item7: DemoWebApi_DemoData_Client.Company} | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1325,6 +1419,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Post tuple string int * POST api/Tuple/Tuple2 */ postTuple2(tuple?: {item1: string, item2: number} | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1387,6 +1482,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a list of value * GET api/Values */ get(headersHandler?: () => {[header: string]: string}): Promise> { @@ -1394,6 +1490,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by both Id and name * GET api/Values/Name/{id}?name={name} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1402,6 +1499,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by name * GET api/Values?name={name} */ getByNameOfString(name?: string | null, headersHandler?: () => {[header: string]: string}): Promise { @@ -1409,6 +1507,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get by Id * GET api/Values/{id} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1417,6 +1516,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Get a list of value async, it is get2 * GET api/Values/Get2 */ get2(headersHandler?: () => {[header: string]: string}): Promise> { @@ -1431,6 +1531,7 @@ export namespace DemoWebApi_Controllers_Client { } /** + * Update with valjue * PUT api/Values/{id} * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 */ @@ -1568,9 +1669,6 @@ export namespace DemoWebApi_DemoData_Client { lines?: Array; } - export interface Constants { - } - export enum Days { Sat = 1, Sun = 2, @@ -1723,7 +1821,7 @@ export namespace DemoWebApi_Models_Client { export interface AddExternalLoginBindingModel { /** Required */ - externalAccessToken: string; + externalAccessToken?: string | null; } export interface ChangePasswordBindingModel { @@ -1745,48 +1843,35 @@ export namespace DemoWebApi_Models_Client { OldPwd: string; } - export interface ExternalLoginViewModel { - name?: string | null; - state?: string | null; - url?: string | null; - } - - export interface ManageInfoViewModel { - email?: string | null; - externalLoginProviders?: Array; - localLoginProvider?: string | null; - logins?: Array; - } - export interface RegisterBindingModel { /** Data type: Password */ confirmPassword?: string | null; /** Required */ - email: string; + email?: string | null; /** * Required * String length: inclusive between 6 and 100 * Data type: Password */ - password: string; + password?: string | null; } export interface RegisterExternalBindingModel { /** Required */ - email: string; + email?: string | null; } export interface RemoveLoginBindingModel { /** Required */ - loginProvider: string; + loginProvider?: string | null; /** Required */ - providerKey: string; + providerKey?: string | null; } export interface SetPasswordBindingModel { @@ -1799,7 +1884,7 @@ export namespace DemoWebApi_Models_Client { * String length: inclusive between 6 and 100 * Data type: Password */ - newPassword: string; + newPassword?: string | null; } @@ -1817,35 +1902,6 @@ export namespace DemoWebApi_Models_Client { username?: string | null; } - export interface UserInfoViewModel { - email?: string | null; - hasRegistered?: boolean | null; - loginProvider?: string | null; - dummy1?: string | null; - dumy2?: string | null; - } - - export interface UserLoginInfoViewModel { - loginProvider?: string | null; - providerKey?: string | null; - } - -} - -export namespace WebApplication1_Client { - export interface WeatherForecast { - - /** Type: DateOnly */ - date?: Date | null; - summary?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureC?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - temperatureF?: number | null; - } - } export namespace DemoCoreWeb_Controllers_Client { @@ -1854,13 +1910,16 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Anonymous Dynamic of C# * GET api/SpecialTypes/AnonymousDynamic + * @return {any} dyanmic things */ getAnonymousDynamic(headersHandler?: () => {[header: string]: string}): Promise { return fetch(this.baseUri + 'api/SpecialTypes/AnonymousDynamic', { method: 'get', headers: headersHandler ? headersHandler() : undefined }); } /** + * Async function returing dynamic * GET api/SpecialTypes/AnonymousDynamic2 */ getAnonymousDynamic2(headersHandler?: () => {[header: string]: string}): Promise { @@ -1875,6 +1934,7 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Async function returning object * GET api/SpecialTypes/AnonymousObject2 */ getAnonymousObject2(headersHandler?: () => {[header: string]: string}): Promise { @@ -1889,6 +1949,7 @@ export namespace DemoCoreWeb_Controllers_Client { } /** + * Async returning object, Post dynamic * POST api/SpecialTypes/AnonymousObject2 */ postAnonymousObject2(obj?: any, headersHandler?: () => {[header: string]: string}): Promise { @@ -1898,18 +1959,3 @@ export namespace DemoCoreWeb_Controllers_Client { } -export namespace WebApplication1_Controllers_Client { - export class WeatherForecast { - constructor(private baseUri: string = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + '/') { - } - - /** - * GET WeatherForecast - */ - get(headersHandler?: () => {[header: string]: string}): Promise> { - return fetch(this.baseUri + 'WeatherForecast', { method: 'get', headers: headersHandler ? headersHandler() : undefined }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - -} -