From f1388d88ad5df72abc27b8e7724d2f7d1bf3fbe1 Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Thu, 5 Jan 2023 14:39:42 +0000 Subject: [PATCH 01/15] Bump the version. --- version.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle.kts b/version.gradle.kts index f85eeb1b..b476a09a 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -29,5 +29,5 @@ val spineTimeVersion: String by extra("1.9.0-SNAPSHOT.5") val spineCoreVersion: String by extra("1.9.0-SNAPSHOT.6") val spineVersion: String by extra(spineCoreVersion) -val versionToPublish: String by extra("1.9.0-SNAPSHOT.8") +val versionToPublish: String by extra("1.9.0-SNAPSHOT.9") val versionToPublishJs: String by extra(versionToPublish) From 2208fb33555f7b13a75613527bb380641175035f Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Thu, 5 Jan 2023 16:49:15 +0000 Subject: [PATCH 02/15] Make the currently used ctors `public`. Get rid of the outdated docs. --- client-js/main/client/firebase-client.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/client-js/main/client/firebase-client.js b/client-js/main/client/firebase-client.js index d5358816..712b8c69 100644 --- a/client-js/main/client/firebase-client.js +++ b/client-js/main/client/firebase-client.js @@ -138,15 +138,11 @@ class EventSubscription extends SpineSubscription { class FirebaseQueryingClient extends QueryingClient { /** - * A protected constructor for customization. - * - * Use `FirebaseClient#usingFirebase()` for instantiation + * Creates an instance of the client. * * @param {!HttpEndpoint} endpoint the server endpoint to execute queries and commands * @param {!FirebaseDatabaseClient} firebaseDatabase the client to read the query results from * @param {!ActorRequestFactory} actorRequestFactory a factory to instantiate the actor requests with - * - * @protected */ constructor(endpoint, firebaseDatabase, actorRequestFactory) { super(actorRequestFactory); @@ -176,9 +172,7 @@ const EVENT_TYPE_URL = 'type.spine.io/spine.core.Event'; class FirebaseSubscribingClient extends SubscribingClient { /** - * A protected constructor for customization. - * - * Use `FirebaseClient#usingFirebase()` for instantiation. + * Creates an instance of the client. * * @param {!HttpEndpoint} endpoint * the server endpoint to execute queries and commands @@ -188,8 +182,6 @@ class FirebaseSubscribingClient extends SubscribingClient { * a factory to instantiate the actor requests with * @param {!FirebaseSubscriptionService} subscriptionService * a service handling the subscriptions - * - * @protected */ constructor(endpoint, firebaseDatabase, actorRequestFactory, subscriptionService) { super(actorRequestFactory); From f14850116ce60deef438cc76be06404064b9c44a Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Fri, 6 Jan 2023 13:10:31 +0000 Subject: [PATCH 03/15] Extract some methods within `HttpClient` in order to make it extensible. --- client-js/main/client/http-client.js | 42 +++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/client-js/main/client/http-client.js b/client-js/main/client/http-client.js index 1c707876..df64d6d9 100644 --- a/client-js/main/client/http-client.js +++ b/client-js/main/client/http-client.js @@ -49,27 +49,55 @@ export class HttpClient { } /** - * Sends the given message to the given endpoint. + * Sends the given message to the given endpoint via `POST` request. * * The message is sent as in form of a Base64-encoded byte string. * * @param {!string} endpoint a endpoint to send the message to * @param {!TypedMessage} message a message to send, as a {@link TypedMessage} - * @return {Promise} a message sending promise to be fulfilled with a response, or rejected if - * an error occurs + * @return {Promise} a message sending promise to be fulfilled with a response, + * or rejected if an error occurs + * @see toBody + * @see headers */ postMessage(endpoint, message) { - const messageString = message.toBase64(); + const messageString = this.toBody(message); const path = endpoint.startsWith('/') ? endpoint : '/' + endpoint; const url = this._appBaseUrl + path; const request = { method: 'POST', body: messageString, - headers: { - 'Content-Type': 'application/x-protobuf' - }, + headers: this.headers(message), mode: 'cors' }; return fetch(url, request); } + + /** + * Returns the string-typed map of HTTP header names to header values, + * which to use in order to send the passed message. + * + * In this implementation, returns {'Content-Type': 'application/x-protobuf'}. + * + * @param {!TypedMessage} message a message to send, as a {@link TypedMessage} + * @returns {{"Content-Type": string}} + */ + // noinspection JSUnusedLocalSymbols + headers(message) { + return { + 'Content-Type': 'application/x-protobuf' + }; + } + + /** + * Transforms the given message to a string, which would become a POST request body. + * + * Uses {@link TypedMessage#toBase64 Base64 encoding} to transform the message. + * + * @param {!TypedMessage} message a message to transform into a POST body + * @returns {!string} transformed message + */ + toBody(message) { + return message.toBase64(); + } } From 6ded92afa8f4379e4868872ca86389650e0dafea Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Fri, 6 Jan 2023 13:59:31 +0000 Subject: [PATCH 04/15] Allow to pass a custom `HttpClient`. --- client-js/main/client/client-factory.js | 31 ++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/client-js/main/client/client-factory.js b/client-js/main/client/client-factory.js index 3cef1da4..6ccad80d 100644 --- a/client-js/main/client/client-factory.js +++ b/client-js/main/client/client-factory.js @@ -39,6 +39,8 @@ import {HttpEndpoint} from "./http-endpoint"; * the list of the `index.js` files generated by {@link https://github.com/SpineEventEngine/base/tree/master/tools/proto-js-plugin the Protobuf plugin for JS} * @property {?string} endpointUrl * the URL of the Spine-based backend endpoint + * @property {?HttpClient} httpClient + * the custom implementation of HTTP client to use; defaults to {@link HttpClient}. * @property {?firebase.database.Database} firebaseDatabase * the Firebase Database that will be used to retrieve data from * @property {?ActorProvider} actorProvider @@ -114,13 +116,36 @@ export class AbstractClientFactory { * @return {CommandingClient} a `CommandingClient` instance */ static createCommanding(options) { - const httpClient = new HttpClient(options.endpointUrl); + const httpClient = this._createHttpClient(options); const endpoint = new HttpEndpoint(httpClient, options.routing); const requestFactory = ActorRequestFactory.create(options); return new CommandingClient(endpoint, requestFactory); } + /** + * Creates an HTTP client basing on the passed {@link ClientOptions}. + * + * In case a custom HTTP client is specified via the `options`, this instance is returned. + * Otherwise, a new instance of `HttpClient` is returned. + * + * @param {!ClientOptions} options client initialization options + * @return {HttpClient} an instance of HTTP client + * @protected + */ + static _createHttpClient(options) { + const customClient = options.httpClient; + if (!!customClient) { + if (!customClient instanceof HttpClient) { + throw new Error('The custom HTTP client implementation passed via `options.httpClient` ' + + 'must extend `HttpClient`.'); + } + return customClient; + } else { + return new HttpClient(options.endpointUrl); + } + } + /** * Ensures whether options object is sufficient for client initialization. * @@ -218,8 +243,8 @@ export class CustomClientFactory extends AbstractClientFactory { super._ensureOptionsSufficient(options); const customClient = options.implementation; if (!customClient || !(customClient instanceof Client)) { - throw new Error('Unable to initialize custom implementation.' + - ' The `ClientOptions.implementation` should extend Client.'); + throw new Error('Unable to initialize custom client implementation.' + + ' The `ClientOptions.implementation` must extend `Client`.'); } } } From fea8362b768f78fd1522a1fb5c9026a3528ee91c Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Fri, 6 Jan 2023 14:01:06 +0000 Subject: [PATCH 05/15] Update the report files. --- client-js/package.json | 2 +- integration-tests/js-tests/package.json | 2 +- license-report.md | 32 ++++++++++++------------- pom.xml | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/client-js/package.json b/client-js/package.json index 6ac5491c..8d5ff85f 100644 --- a/client-js/package.json +++ b/client-js/package.json @@ -1,6 +1,6 @@ { "name": "spine-web", - "version": "1.9.0-SNAPSHOT.8", + "version": "1.9.0-SNAPSHOT.9", "license": "Apache-2.0", "description": "A JS client for interacting with Spine applications.", "homepage": "https://spine.io", diff --git a/integration-tests/js-tests/package.json b/integration-tests/js-tests/package.json index 60b0b184..8143d89e 100644 --- a/integration-tests/js-tests/package.json +++ b/integration-tests/js-tests/package.json @@ -1,6 +1,6 @@ { "name": "client-js-tests", - "version": "1.9.0-SNAPSHOT.8", + "version": "1.9.0-SNAPSHOT.9", "license": "Apache-2.0", "description": "Tests of a `spine-web` JS library against the Spine-based application.", "scripts": { diff --git a/license-report.md b/license-report.md index 82e8e756..f7936426 100644 --- a/license-report.md +++ b/license-report.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine:spine-client-js:1.9.0-SNAPSHOT.8` +# Dependencies of `io.spine:spine-client-js:1.9.0-SNAPSHOT.9` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -368,10 +368,10 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Jan 04 15:35:39 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Jan 06 13:54:50 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -#NPM dependencies of `spine-web@1.9.0-SNAPSHOT.8` +#NPM dependencies of `spine-web@1.9.0-SNAPSHOT.9` ## `Production` dependencies: @@ -405,7 +405,7 @@ This report was generated on **Wed Jan 04 15:35:39 WET 2023** using [Gradle-Lice 1. **rxjs@6.5.5** * Licenses: Apache-2.0 * Repository: [https://github.com/reactivex/rxjs](https://github.com/reactivex/rxjs) -1. **spine-web@1.9.0-SNAPSHOT.8** +1. **spine-web@1.9.0-SNAPSHOT.9** * Licenses: Apache-2.0 * Repository: [https://github.com/SpineEventEngine/web](https://github.com/SpineEventEngine/web) 1. **tr46@0.0.3** @@ -1958,7 +1958,7 @@ This report was generated on **Wed Jan 04 15:35:39 WET 2023** using [Gradle-Lice 1. **spdx-satisfies@4.0.1** * Licenses: MIT * Repository: [https://github.com/kemitchell/spdx-satisfies.js](https://github.com/kemitchell/spdx-satisfies.js) -1. **spine-web@1.9.0-SNAPSHOT.8** +1. **spine-web@1.9.0-SNAPSHOT.9** * Licenses: Apache-2.0 * Repository: [https://github.com/SpineEventEngine/web](https://github.com/SpineEventEngine/web) 1. **sprintf-js@1.0.3** @@ -2140,12 +2140,12 @@ This report was generated on **Wed Jan 04 15:35:39 WET 2023** using [Gradle-Lice * Repository: [https://github.com/sindresorhus/yocto-queue](https://github.com/sindresorhus/yocto-queue) -This report was generated on **Wed Jan 04 2023 15:35:40 GMT+0000 (Western European Standard Time)** using [NPM License Checker](https://github.com/davglass/license-checker) library. +This report was generated on **Fri Jan 06 2023 13:54:51 GMT+0000 (Western European Standard Time)** using [NPM License Checker](https://github.com/davglass/license-checker) library. -# Dependencies of `io.spine.gcloud:spine-firebase-web:1.9.0-SNAPSHOT.8` +# Dependencies of `io.spine.gcloud:spine-firebase-web:1.9.0-SNAPSHOT.9` ## Runtime 1. **Group:** com.fasterxml.jackson.core **Name:** jackson-annotations **Version:** 2.9.10 @@ -2932,12 +2932,12 @@ This report was generated on **Wed Jan 04 2023 15:35:40 GMT+0000 (Western Europe The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Jan 04 15:35:45 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Jan 06 13:54:57 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-js-tests:1.9.0-SNAPSHOT.8` +# Dependencies of `io.spine:spine-js-tests:1.9.0-SNAPSHOT.9` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -3327,12 +3327,12 @@ This report was generated on **Wed Jan 04 15:35:45 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Jan 04 15:35:50 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Jan 06 13:55:02 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-test-app:1.9.0-SNAPSHOT.8` +# Dependencies of `io.spine:spine-test-app:1.9.0-SNAPSHOT.9` ## Runtime 1. **Group:** com.fasterxml.jackson.core **Name:** jackson-annotations **Version:** 2.9.10 @@ -4906,12 +4906,12 @@ This report was generated on **Wed Jan 04 15:35:50 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Jan 04 15:35:51 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Jan 06 13:55:04 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-testutil-web:1.9.0-SNAPSHOT.8` +# Dependencies of `io.spine:spine-testutil-web:1.9.0-SNAPSHOT.9` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -5370,12 +5370,12 @@ This report was generated on **Wed Jan 04 15:35:51 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Jan 04 15:35:53 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Fri Jan 06 13:55:06 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-web:1.9.0-SNAPSHOT.8` +# Dependencies of `io.spine:spine-web:1.9.0-SNAPSHOT.9` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -5873,4 +5873,4 @@ This report was generated on **Wed Jan 04 15:35:53 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Wed Jan 04 15:35:57 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Fri Jan 06 13:55:10 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6c8ed70a..40a93f8e 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ all modules and does not describe the project structure per-subproject. io.spine spine-web -1.9.0-SNAPSHOT.8 +1.9.0-SNAPSHOT.9 2015 From 677214de7071a2b1d8a85ae56d84e05e72c8ee26 Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Fri, 6 Jan 2023 14:23:27 +0000 Subject: [PATCH 06/15] Update the documentation. --- .../web/subscription/servlet/SubscriptionBulkKeepUpServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/main/java/io/spine/web/subscription/servlet/SubscriptionBulkKeepUpServlet.java b/web/src/main/java/io/spine/web/subscription/servlet/SubscriptionBulkKeepUpServlet.java index b45d7476..83815af8 100644 --- a/web/src/main/java/io/spine/web/subscription/servlet/SubscriptionBulkKeepUpServlet.java +++ b/web/src/main/java/io/spine/web/subscription/servlet/SubscriptionBulkKeepUpServlet.java @@ -34,7 +34,7 @@ import static com.google.common.base.Preconditions.checkNotNull; /** - * An abstract servlet handling the bulk {@link io.spine.client.Subscription Subscription}s + * A servlet handling the bulk {@link io.spine.client.Subscription Subscription}s * keep-up requests. * *

This servlet parses the client requests and passes it to the {@link SubscriptionBridge} From e9940d9996ad23d9b26c8f97f530110376822365 Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Fri, 6 Jan 2023 14:24:37 +0000 Subject: [PATCH 07/15] Make the servlet `abstract` and document accordingly. --- .../subscription/servlet/SubscriptionBulkKeepUpServlet.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/main/java/io/spine/web/subscription/servlet/SubscriptionBulkKeepUpServlet.java b/web/src/main/java/io/spine/web/subscription/servlet/SubscriptionBulkKeepUpServlet.java index 83815af8..2a6f33ff 100644 --- a/web/src/main/java/io/spine/web/subscription/servlet/SubscriptionBulkKeepUpServlet.java +++ b/web/src/main/java/io/spine/web/subscription/servlet/SubscriptionBulkKeepUpServlet.java @@ -34,14 +34,15 @@ import static com.google.common.base.Preconditions.checkNotNull; /** - * A servlet handling the bulk {@link io.spine.client.Subscription Subscription}s + * An abstract servlet handling the bulk {@link io.spine.client.Subscription Subscription}s * keep-up requests. * *

This servlet parses the client requests and passes it to the {@link SubscriptionBridge} * to process. After, a processing result is written to the servlet response. */ @SuppressWarnings("serial") // Java serialization is not supported. -public class SubscriptionBulkKeepUpServlet extends MessageServlet { +public abstract class SubscriptionBulkKeepUpServlet + extends MessageServlet { private final SubscriptionBridge bridge; From 714fc82c35d746ba9d29f9658f93d6f366441454 Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Fri, 6 Jan 2023 14:31:29 +0000 Subject: [PATCH 08/15] Improve the docs. --- web/src/main/java/io/spine/web/future/Completion.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/main/java/io/spine/web/future/Completion.java b/web/src/main/java/io/spine/web/future/Completion.java index bc0a10c9..3a792729 100644 --- a/web/src/main/java/io/spine/web/future/Completion.java +++ b/web/src/main/java/io/spine/web/future/Completion.java @@ -45,7 +45,7 @@ private Completion() { } /** - * Logs the exception of the given stage if any. + * Logs the exception raised at the given stage, if any. * *

Does nothing if the stage completes successfully. * @@ -53,7 +53,7 @@ private Completion() { * is complete. * * @param completionStage - * stage which may complete exceptionally + * stage which may complete with an exception */ public static void dispose(CompletionStage completionStage) { completionStage.whenComplete((result, exception) -> logException(exception)); From 9afa17f8f3b17264333d05bea9049b8e68f9d6b0 Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Fri, 6 Jan 2023 15:30:10 +0000 Subject: [PATCH 09/15] Extract one more method to allow overriding. --- client-js/main/client/http-client.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/client-js/main/client/http-client.js b/client-js/main/client/http-client.js index df64d6d9..ebf0888c 100644 --- a/client-js/main/client/http-client.js +++ b/client-js/main/client/http-client.js @@ -68,11 +68,23 @@ export class HttpClient { method: 'POST', body: messageString, headers: this.headers(message), - mode: 'cors' + mode: this.requestMode(message) }; return fetch(url, request); } + /** + * Returns the mode in which the HTTP request transferring the given message is sent. + * + * This implementation returns `cors`. + * + * @param {!TypedMessage} message a message to send, as a {@link TypedMessage} + * @return {string} the mode of HTTP requests to use + */ + requestMode(message) { + return 'cors'; + } + /** * Returns the string-typed map of HTTP header names to header values, * which to use in order to send the passed message. From a41b589faee18806f6872257b5b0f355607a68e6 Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Fri, 6 Jan 2023 17:13:06 +0000 Subject: [PATCH 10/15] Extract the `HttpResponseHandler`. --- client-js/main/client/http-endpoint.js | 85 +----------- .../main/client/http-response-handler.js | 131 ++++++++++++++++++ 2 files changed, 137 insertions(+), 79 deletions(-) create mode 100644 client-js/main/client/http-response-handler.js diff --git a/client-js/main/client/http-endpoint.js b/client-js/main/client/http-endpoint.js index 817024a8..621f4db5 100644 --- a/client-js/main/client/http-endpoint.js +++ b/client-js/main/client/http-endpoint.js @@ -27,8 +27,8 @@ "use strict"; import {TypedMessage} from './typed-message'; -import {ClientError, ConnectionError, ServerError, SpineError} from './errors'; import {Subscriptions} from '../proto/spine/web/keeping_up_pb'; +import {HttpResponseHandler} from "./http-response-handler"; /** * @typedef {Object} SubscriptionRouting @@ -238,6 +238,7 @@ export class HttpEndpoint extends Endpoint { super(); this._httpClient = httpClient; this._routing = routing; + this._responseHandler = new HttpResponseHandler(); } /** @@ -365,85 +366,11 @@ export class HttpEndpoint extends Endpoint { return new Promise((resolve, reject) => { this._httpClient .postMessage(endpoint, message) - .then(HttpEndpoint._jsonOrError, HttpEndpoint._connectionError) + .then(this._responseHandler.handle + .bind(this._responseHandler), + this._responseHandler.onConnectionError + .bind(this._responseHandler)) .then(resolve, reject); }); } - - /** - * Retrieves the JSON data from the given response if it was successful, rejects - * with a respective error otherwise. - * - * @param {!Response} response an HTTP request response - * @return {Promise} a promise of a successful server response JSON data, - * rejected if the client response is not `2xx`, - * or if JSON parsing fails - * @private - */ - static _jsonOrError(response) { - const statusCode = response.status; - if (HttpEndpoint._isSuccessfulResponse(statusCode)) { - return HttpEndpoint._parseJson(response); - } - else if (HttpEndpoint._isClientErrorResponse(statusCode)) { - return Promise.reject(new ClientError(response.statusText, response)); - } - else if(HttpEndpoint._isServerErrorResponse(statusCode)) { - return Promise.reject(new ServerError(response)); - } - } - - /** - * Parses the given response JSON data, rejects if parsing fails. - * - * @param {!Response} response an HTTP request response - * @return {Promise} a promise of a server response parsing to be fulfilled - * with a JSON data or rejected with {@link SpineError} if - * JSON parsing fails. - * @private - */ - static _parseJson(response) { - return response.json() - .then(json => Promise.resolve(json)) - .catch(error => Promise.reject(new SpineError('Failed to parse response JSON', error))); - } - - /** - * Gets the error caught from the {@link HttpClient#postMessage} and returns - * a rejected promise with a given error wrapped into {@link ConnectionError}. - * - * @param {!Error} error an error which occurred upon message sending - * @return {Promise} a rejected promise with a `ConnectionError` - * @private - */ - static _connectionError(error) { - return Promise.reject(new ConnectionError(error)); - } - - /** - * @param {!number} statusCode an HTTP request response status code - * @return {boolean} `true` if the response status code is from 200 to 299, `false` otherwise - * @private - */ - static _isSuccessfulResponse(statusCode) { - return 200 <= statusCode && statusCode < 300; - } - - /** - * @param {!number} statusCode an HTTP request response status code - * @return {boolean} `true` if the response status code is from 400 to 499, `false` otherwise - * @private - */ - static _isClientErrorResponse(statusCode) { - return 400 <= statusCode && statusCode < 500; - } - - /** - * @param {!number} statusCode an HTTP request response status code - * @return {boolean} `true` if the response status code is from 500, `false` otherwise - * @private - */ - static _isServerErrorResponse(statusCode) { - return 500 <= statusCode; - } } diff --git a/client-js/main/client/http-response-handler.js b/client-js/main/client/http-response-handler.js new file mode 100644 index 00000000..77db72d3 --- /dev/null +++ b/client-js/main/client/http-response-handler.js @@ -0,0 +1,131 @@ +/* + * Copyright 2023, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +"use strict"; + +import {ClientError, ConnectionError, ServerError, SpineError} from "./errors"; + +/** + * Receives the HTTP response, and turns it into a JS object. + * + * Handles the response failures as well, in which case a corresponding error object + * is returned via a `Promise`. + * + * Only `2xx` response codes count as successful. All other response + * codes are considered erroneous. + * + * By default, expects the input to be a JSON string. Users may choose to customize the behavior + * by extending this type, and supplying the custom implementation via {@link ClientOptions}. + */ +export class HttpResponseHandler { + + /** + * Retrieves the JS object by transforming the contents + * of the given HTTP response if it was successful, + * rejects with a respective error otherwise. + * + * @param {!Response} response an HTTP request response + * @return {Promise} a promise of a successful server response data, + * rejected if the client response is not `2xx`, + * or if the transformation-to-object fails + * for the response contents. + * @see _parse + */ + handle(response) { + const statusCode = response.status; + if (HttpResponseHandler._isSuccessfulResponse(statusCode)) { + return this._parse(response); + } else if (HttpResponseHandler._isClientErrorResponse(statusCode)) { + return Promise.reject(new ClientError(response.statusText, response)); + } else if (HttpResponseHandler._isServerErrorResponse(statusCode)) { + return Promise.reject(new ServerError(response)); + } + } + + /** + * Transforms the response into JS object by parsing the response contents. + * + * This implementation expects the response to contain JSON data. + * + * @param response an HTTP response + * @return {Promise} a promise of JS object, + * or a rejection with the corresponding `SpineError` + * @protected + */ + _parse(response) { + return response.json() + .then(json => Promise.resolve(json)) + .catch(error => + Promise.reject(new SpineError('Failed to parse response JSON', error)) + ); + } + + /** + * Obtains the error caught from and erroneous HTTP request, and returns + * a rejected promise with a given error wrapped into {@link ConnectionError}. + * + * This handling method differs from others, since it is designed to handle the issues + * which were caused by an inability to send the HTTP request itself — so in this case + * there is no HTTP response. Note, that {@link handle} is designed + * to process the HTTP response, including erroneous responses. + * + * @param {!Error} error an error which occurred upon sending an HTTP request + * @return {Promise} a rejected promise with a `ConnectionError` + */ + onConnectionError(error) { + return Promise.reject(new ConnectionError(error)); + } + + /** + * @param {!number} statusCode an HTTP request response status code + * @return {boolean} `true` if the response status code is from 200 to 299, + * `false` otherwise + * @protected + */ + static _isSuccessfulResponse(statusCode) { + return 200 <= statusCode && statusCode < 300; + } + + /** + * @param {!number} statusCode an HTTP request response status code + * @return {boolean} `true` if the response status code is from 400 to 499, + * `false` otherwise + * @protected + */ + static _isClientErrorResponse(statusCode) { + return 400 <= statusCode && statusCode < 500; + } + + /** + * @param {!number} statusCode an HTTP request response status code + * @return {boolean} `true` if the response status code is from 500, + * `false` otherwise + * @protected + */ + static _isServerErrorResponse(statusCode) { + return 500 <= statusCode; + } +} \ No newline at end of file From 5e63e112892674b012289d210f0e0412390e0f91 Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Tue, 10 Jan 2023 14:40:52 +0000 Subject: [PATCH 11/15] Allow to customise `HttpClient` and `HttpResponseHandler` for command-, query-, and subscription-specific `Client`s via `ClientOptions`. --- client-js/main/client/client-factory.js | 31 +++++++- client-js/main/client/direct-client.js | 11 +-- client-js/main/client/firebase-client.js | 15 ++-- client-js/main/client/http-endpoint.js | 5 +- client-js/test/client/client-factory-test.js | 80 ++++++++++++++++++++ client-js/test/client/http-endpoint-test.js | 3 +- 6 files changed, 129 insertions(+), 16 deletions(-) diff --git a/client-js/main/client/client-factory.js b/client-js/main/client/client-factory.js index 6ccad80d..bc247c74 100644 --- a/client-js/main/client/client-factory.js +++ b/client-js/main/client/client-factory.js @@ -31,6 +31,7 @@ import {Client} from './client'; import {CommandingClient} from "./commanding-client"; import {HttpClient} from "./http-client"; import {HttpEndpoint} from "./http-endpoint"; +import {HttpResponseHandler} from "./http-response-handler"; /** * @typedef {Object} ClientOptions a type of object for initialization of Spine client @@ -40,7 +41,9 @@ import {HttpEndpoint} from "./http-endpoint"; * @property {?string} endpointUrl * the URL of the Spine-based backend endpoint * @property {?HttpClient} httpClient - * the custom implementation of HTTP client to use; defaults to {@link HttpClient}. + * custom implementation of HTTP client to use; defaults to {@link HttpClient}. + * @property {?HttpResponseHandler} httpResponseHandler + * custom implementation of HTTP response handler; defaults to {@link HttpResponseHandler} * @property {?firebase.database.Database} firebaseDatabase * the Firebase Database that will be used to retrieve data from * @property {?ActorProvider} actorProvider @@ -117,7 +120,8 @@ export class AbstractClientFactory { */ static createCommanding(options) { const httpClient = this._createHttpClient(options); - const endpoint = new HttpEndpoint(httpClient, options.routing); + const httpResponseHandler = this._createHttpResponseHandler(options) + const endpoint = new HttpEndpoint(httpClient, httpResponseHandler, options.routing); const requestFactory = ActorRequestFactory.create(options); return new CommandingClient(endpoint, requestFactory); @@ -146,6 +150,29 @@ export class AbstractClientFactory { } } + /** + * Creates an HTTP response handler judging on the passed {@link ClientOptions}. + * + * In case a custom HTTP response handler is specified via the `options`, + * this instance is returned. Otherwise, a new instance of `HttpResponseHandler` is returned. + * + * @param {!ClientOptions} options client initialization options + * @return {HttpResponseHandler} an instance of HTTP response handler + * @protected + */ + static _createHttpResponseHandler(options) { + const customHandler = options.httpResponseHandler; + if (!!customHandler) { + if (!customHandler instanceof HttpResponseHandler) { + throw new Error('The custom HTTP response handler implementation' + + ' passed via `options.httpResponseHandler` must extend `HttpResponseHandler`.'); + } + return customHandler; + } else { + return new HttpResponseHandler(); + } + } + /** * Ensures whether options object is sufficient for client initialization. * diff --git a/client-js/main/client/direct-client.js b/client-js/main/client/direct-client.js index db04fe49..992a372e 100644 --- a/client-js/main/client/direct-client.js +++ b/client-js/main/client/direct-client.js @@ -51,8 +51,9 @@ import TypeParsers from "./parser/type-parsers"; export class DirectClientFactory extends AbstractClientFactory { static _clientFor(options) { - const httpClient = new HttpClient(options.endpointUrl); - const endpoint = new HttpEndpoint(httpClient, options.routing); + const httpClient = this._createHttpClient(options); + const httpResponseHandler = this._createHttpResponseHandler(options); + const endpoint = new HttpEndpoint(httpClient, httpResponseHandler, options.routing); const requestFactory = ActorRequestFactory.create(options); const querying = new DirectQueryingClient(endpoint, requestFactory); @@ -62,10 +63,10 @@ export class DirectClientFactory extends AbstractClientFactory { } static createQuerying(options) { - const httpClient = new HttpClient(options.endpointUrl); - const endpoint = new HttpEndpoint(httpClient, options.routing); + const httpClient = this._createHttpClient(options); + const httpResponseHandler = this._createHttpResponseHandler(options); + const endpoint = new HttpEndpoint(httpClient, httpResponseHandler, options.routing); const requestFactory = ActorRequestFactory.create(options); - return new DirectQueryingClient(endpoint, requestFactory); } diff --git a/client-js/main/client/firebase-client.js b/client-js/main/client/firebase-client.js index 712b8c69..6a61d0e7 100644 --- a/client-js/main/client/firebase-client.js +++ b/client-js/main/client/firebase-client.js @@ -320,8 +320,9 @@ export class FirebaseClientFactory extends AbstractClientFactory { * @override */ static _clientFor(options) { - const httpClient = new HttpClient(options.endpointUrl); - const endpoint = new HttpEndpoint(httpClient, options.routing); + const httpClient = this._createHttpClient(options); + const httpResponseHandler = this._createHttpResponseHandler(options); + const endpoint = new HttpEndpoint(httpClient, httpResponseHandler, options.routing); const firebaseDatabaseClient = new FirebaseDatabaseClient(options.firebaseDatabase); const requestFactory = ActorRequestFactory.create(options); const subscriptionService = @@ -337,8 +338,9 @@ export class FirebaseClientFactory extends AbstractClientFactory { } static createQuerying(options) { - const httpClient = new HttpClient(options.endpointUrl); - const endpoint = new HttpEndpoint(httpClient, options.routing); + const httpClient = this._createHttpClient(options); + const httpResponseHandler = this._createHttpResponseHandler(options); + const endpoint = new HttpEndpoint(httpClient, httpResponseHandler, options.routing); const firebaseDatabaseClient = new FirebaseDatabaseClient(options.firebaseDatabase); const requestFactory = ActorRequestFactory.create(options); @@ -346,8 +348,9 @@ export class FirebaseClientFactory extends AbstractClientFactory { } static createSubscribing(options) { - const httpClient = new HttpClient(options.endpointUrl); - const endpoint = new HttpEndpoint(httpClient, options.routing); + const httpClient = this._createHttpClient(options); + const httpResponseHandler = this._createHttpResponseHandler(options); + const endpoint = new HttpEndpoint(httpClient, httpResponseHandler, options.routing); const firebaseDatabaseClient = new FirebaseDatabaseClient(options.firebaseDatabase); const requestFactory = ActorRequestFactory.create(options); const subscriptionService = diff --git a/client-js/main/client/http-endpoint.js b/client-js/main/client/http-endpoint.js index 621f4db5..6c198cd9 100644 --- a/client-js/main/client/http-endpoint.js +++ b/client-js/main/client/http-endpoint.js @@ -232,13 +232,14 @@ export class HttpEndpoint extends Endpoint { /** * @param {!HttpClient} httpClient a client sending requests to server + * @param {!HttpResponseHandler} responseHandler a handle for the HTTP responses from server * @param {Routing} routing endpoint routing parameters */ - constructor(httpClient, routing) { + constructor(httpClient, responseHandler, routing) { super(); this._httpClient = httpClient; this._routing = routing; - this._responseHandler = new HttpResponseHandler(); + this._responseHandler = responseHandler; } /** diff --git a/client-js/test/client/client-factory-test.js b/client-js/test/client/client-factory-test.js index 5ae4b46e..be54a133 100644 --- a/client-js/test/client/client-factory-test.js +++ b/client-js/test/client/client-factory-test.js @@ -32,9 +32,23 @@ import {ActorProvider} from '@lib/client/actor-request-factory'; import {init} from '@lib/client/spine'; import {Client} from "@lib/client/client"; import {CompositeClient} from "@lib/client/composite-client"; +import {HttpClient} from "../../main/client/http-client"; +import {HttpResponseHandler} from "../../main/client/http-response-handler"; class TestClient extends Client {} +class QueryHttpClient extends HttpClient {} + +class SubscriptionHttpClient extends HttpClient {} + +class CommandHttpClient extends HttpClient {} + +class QueryResponseHandler extends HttpResponseHandler {} + +class SubscriptionResponseHandler extends HttpResponseHandler {} + +class CommandResponseHandler extends HttpResponseHandler {} + describe('Client factory should', () => { it('create composite client', done => { @@ -62,4 +76,70 @@ describe('Client factory should', () => { assert.ok(client._commanding instanceof TestClient); done(); }); + + it('allow to customize `HttpClient`', done => { + const endpoint = 'example.com'; + const userId = new UserId(); + userId.value = 'me'; + const queryEndpoint = `${endpoint}/q/`; + const subscriptionEndpoint = `${endpoint}/s/`; + const commandEndpoint = `${endpoint}/c/`; + const client = init({ + protoIndexFiles: [types, testTypes], + forQueries: { + endpointUrl: queryEndpoint, + actorProvider: new ActorProvider(userId), + httpClient: new QueryHttpClient(queryEndpoint) + }, + forSubscriptions: { + endpointUrl: subscriptionEndpoint, + actorProvider: new ActorProvider(userId), + firebaseDatabase: "mock database", + httpClient: new SubscriptionHttpClient(subscriptionEndpoint) + }, + forCommands: { + endpointUrl: commandEndpoint, + actorProvider: new ActorProvider(userId), + httpClient: new CommandHttpClient(commandEndpoint) + } + }); + assert.ok(client._commanding._endpoint._httpClient instanceof CommandHttpClient); + assert.strictEqual(client._commanding._endpoint._httpClient._appBaseUrl, commandEndpoint,); + + assert.ok(client._subscribing._endpoint._httpClient instanceof SubscriptionHttpClient); + assert.strictEqual(client._subscribing._endpoint._httpClient._appBaseUrl, subscriptionEndpoint); + + assert.ok(client._querying._endpoint._httpClient instanceof QueryHttpClient); + assert.strictEqual(client._querying._endpoint._httpClient._appBaseUrl, queryEndpoint); + done(); + }) + + it('allow to customize `HttpResponseHandler`', done => { + const endpoint = 'example.com'; + const userId = new UserId(); + userId.value = 'me'; + const client = init({ + protoIndexFiles: [types, testTypes], + forQueries: { + endpointUrl: endpoint, + actorProvider: new ActorProvider(userId), + httpResponseHandler: new QueryResponseHandler() + }, + forSubscriptions: { + endpointUrl: endpoint, + actorProvider: new ActorProvider(userId), + firebaseDatabase: "mock database", + httpResponseHandler: new SubscriptionResponseHandler() + }, + forCommands: { + endpointUrl: endpoint, + actorProvider: new ActorProvider(userId), + httpResponseHandler: new CommandResponseHandler() + } + }); + assert.ok(client._commanding._endpoint._responseHandler instanceof CommandResponseHandler); + assert.ok(client._subscribing._endpoint._responseHandler instanceof SubscriptionResponseHandler); + assert.ok(client._querying._endpoint._responseHandler instanceof QueryResponseHandler); + done(); + }) }); diff --git a/client-js/test/client/http-endpoint-test.js b/client-js/test/client/http-endpoint-test.js index 502eba98..87e49797 100644 --- a/client-js/test/client/http-endpoint-test.js +++ b/client-js/test/client/http-endpoint-test.js @@ -34,6 +34,7 @@ import {CreateTask} from '@testProto/spine/test/js/commands_pb'; import {ClientError, ConnectionError, ServerError, SpineError} from '@lib/client/errors'; import {Duration} from '@lib/client/time-utils'; import {fail} from './test-helpers'; +import {HttpResponseHandler} from "../../main/client/http-response-handler"; const MOCK_RESPONSE_STATUS_TEXT = 'Status text'; @@ -108,7 +109,7 @@ Given.HTTP_RESPONSE = { }; const httpClient = Given.httpClient(); -const httpEndpoint = new HttpEndpoint(httpClient); +const httpEndpoint = new HttpEndpoint(httpClient, new HttpResponseHandler()); describe('HttpEndpoint.command', function () { const timeoutDuration = new Duration({seconds: 5}); From c8a3ee44acc54d1e49f86126700fef3b1da3409f Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Tue, 10 Jan 2023 14:41:09 +0000 Subject: [PATCH 12/15] Improve the doc formatting. --- client-js/main/client/http-client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client-js/main/client/http-client.js b/client-js/main/client/http-client.js index ebf0888c..0379111c 100644 --- a/client-js/main/client/http-client.js +++ b/client-js/main/client/http-client.js @@ -41,8 +41,8 @@ export class HttpClient { /** * Creates a new instance of HttpClient. * - * @param {!string} appBaseUrl an application base URL (the protocol and the domain name) represented as - * a string + * @param {!string} appBaseUrl an application base URL (the protocol and the domain name) + * represented as a string */ constructor(appBaseUrl) { this._appBaseUrl = appBaseUrl; From f3162cfc515f843d128b104639e307a5a510daaa Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Thu, 12 Jan 2023 11:32:37 +0000 Subject: [PATCH 13/15] Rename the protected method, so that it does not look private to those who might want to override it. --- client-js/main/client/http-response-handler.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client-js/main/client/http-response-handler.js b/client-js/main/client/http-response-handler.js index 77db72d3..93d7263a 100644 --- a/client-js/main/client/http-response-handler.js +++ b/client-js/main/client/http-response-handler.js @@ -52,12 +52,12 @@ export class HttpResponseHandler { * rejected if the client response is not `2xx`, * or if the transformation-to-object fails * for the response contents. - * @see _parse + * @see parse */ handle(response) { const statusCode = response.status; if (HttpResponseHandler._isSuccessfulResponse(statusCode)) { - return this._parse(response); + return this.parse(response); } else if (HttpResponseHandler._isClientErrorResponse(statusCode)) { return Promise.reject(new ClientError(response.statusText, response)); } else if (HttpResponseHandler._isServerErrorResponse(statusCode)) { @@ -75,7 +75,7 @@ export class HttpResponseHandler { * or a rejection with the corresponding `SpineError` * @protected */ - _parse(response) { + parse(response) { return response.json() .then(json => Promise.resolve(json)) .catch(error => From 58f2942f7aff45adb89eac2bcee41076c3765ad3 Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Thu, 12 Jan 2023 13:12:57 +0000 Subject: [PATCH 14/15] Update the report file. --- license-report.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/license-report.md b/license-report.md index f7936426..b4f2ad18 100644 --- a/license-report.md +++ b/license-report.md @@ -368,7 +368,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Jan 06 13:54:50 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Jan 12 11:34:36 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). #NPM dependencies of `spine-web@1.9.0-SNAPSHOT.9` @@ -2140,7 +2140,7 @@ This report was generated on **Fri Jan 06 13:54:50 WET 2023** using [Gradle-Lice * Repository: [https://github.com/sindresorhus/yocto-queue](https://github.com/sindresorhus/yocto-queue) -This report was generated on **Fri Jan 06 2023 13:54:51 GMT+0000 (Western European Standard Time)** using [NPM License Checker](https://github.com/davglass/license-checker) library. +This report was generated on **Thu Jan 12 2023 11:34:37 GMT+0000 (Western European Standard Time)** using [NPM License Checker](https://github.com/davglass/license-checker) library. @@ -2932,7 +2932,7 @@ This report was generated on **Fri Jan 06 2023 13:54:51 GMT+0000 (Western Europe The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Jan 06 13:54:57 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Jan 12 11:34:44 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3327,7 +3327,7 @@ This report was generated on **Fri Jan 06 13:54:57 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Jan 06 13:55:02 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Jan 12 11:34:50 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4906,7 +4906,7 @@ This report was generated on **Fri Jan 06 13:55:02 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Jan 06 13:55:04 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Jan 12 11:34:52 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5370,7 +5370,7 @@ This report was generated on **Fri Jan 06 13:55:04 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Jan 06 13:55:06 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Jan 12 11:34:54 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5873,4 +5873,4 @@ This report was generated on **Fri Jan 06 13:55:06 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Jan 06 13:55:10 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Thu Jan 12 11:34:58 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file From 95a010598399c4f29244cedb44ab3d4c53ca7a90 Mon Sep 17 00:00:00 2001 From: Alex Tymchenko Date: Thu, 12 Jan 2023 13:45:15 +0000 Subject: [PATCH 15/15] Remove a weird warning suppression. --- client-js/main/client/http-client.js | 1 - license-report.md | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/client-js/main/client/http-client.js b/client-js/main/client/http-client.js index 0379111c..59e8da73 100644 --- a/client-js/main/client/http-client.js +++ b/client-js/main/client/http-client.js @@ -94,7 +94,6 @@ export class HttpClient { * @param {!TypedMessage} message a message to send, as a {@link TypedMessage} * @returns {{"Content-Type": string}} */ - // noinspection JSUnusedLocalSymbols headers(message) { return { 'Content-Type': 'application/x-protobuf' diff --git a/license-report.md b/license-report.md index b4f2ad18..324379a7 100644 --- a/license-report.md +++ b/license-report.md @@ -368,7 +368,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Jan 12 11:34:36 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Jan 12 13:42:53 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). #NPM dependencies of `spine-web@1.9.0-SNAPSHOT.9` @@ -2140,7 +2140,7 @@ This report was generated on **Thu Jan 12 11:34:36 WET 2023** using [Gradle-Lice * Repository: [https://github.com/sindresorhus/yocto-queue](https://github.com/sindresorhus/yocto-queue) -This report was generated on **Thu Jan 12 2023 11:34:37 GMT+0000 (Western European Standard Time)** using [NPM License Checker](https://github.com/davglass/license-checker) library. +This report was generated on **Thu Jan 12 2023 13:42:54 GMT+0000 (Western European Standard Time)** using [NPM License Checker](https://github.com/davglass/license-checker) library. @@ -2932,7 +2932,7 @@ This report was generated on **Thu Jan 12 2023 11:34:37 GMT+0000 (Western Europe The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Jan 12 11:34:44 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Jan 12 13:42:59 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3327,7 +3327,7 @@ This report was generated on **Thu Jan 12 11:34:44 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Jan 12 11:34:50 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Jan 12 13:43:04 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4906,7 +4906,7 @@ This report was generated on **Thu Jan 12 11:34:50 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Jan 12 11:34:52 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Jan 12 13:43:06 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5370,7 +5370,7 @@ This report was generated on **Thu Jan 12 11:34:52 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Jan 12 11:34:54 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Thu Jan 12 13:43:08 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5873,4 +5873,4 @@ This report was generated on **Thu Jan 12 11:34:54 WET 2023** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Jan 12 11:34:58 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Thu Jan 12 13:43:11 WET 2023** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file