Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
3159b38
Add notion of discrete client requests
dmitrykuzmin Nov 27, 2019
42c587f
Add filtering logic to client requests
dmitrykuzmin Nov 29, 2019
b80b181
Implement missing methods
dmitrykuzmin Nov 29, 2019
8804f8b
Add notion of observed types to command request
dmitrykuzmin Nov 30, 2019
7c0778a
Add observed types implementation to the command request
dmitrykuzmin Nov 30, 2019
5fa19f3
Resolve issues with the wrong type of client specified to requests
dmitrykuzmin Dec 1, 2019
e919478
Delete `SimpleTarget` type which is now unused
dmitrykuzmin Dec 1, 2019
c2e61ba
Move request creation to the corresponding clients
dmitrykuzmin Dec 1, 2019
98043cf
Split entity and event subscriptions
dmitrykuzmin Dec 2, 2019
8c6b0e8
Return `EventSubscriptionObject` from command request
dmitrykuzmin Dec 2, 2019
15079bb
Update doc
dmitrykuzmin Dec 2, 2019
35ef6be
Improve doc of the methods and classes
dmitrykuzmin Dec 2, 2019
b5c76fa
Fix declared return types of the methods
dmitrykuzmin Dec 2, 2019
4d588e1
Limit method visibility to `@protected` where appropriate
dmitrykuzmin Dec 2, 2019
6d4912b
Extract method for identity conversion function
dmitrykuzmin Dec 2, 2019
5c01e6d
Fix fields visibility
dmitrykuzmin Dec 2, 2019
9abcd80
Remove `FirebaseClient` from the exported types
dmitrykuzmin Dec 2, 2019
59d443f
Handle non-`OK` server response on subscription keep-up
dmitrykuzmin Dec 2, 2019
82f11b7
Reword doc
dmitrykuzmin Dec 2, 2019
07b18c9
Update Spine version to `1.2.6`
dmitrykuzmin Dec 3, 2019
6fb39f4
Remove redundant overrides
dmitrykuzmin Dec 3, 2019
b7bcd89
Repair the tests
dmitrykuzmin Dec 3, 2019
c54d044
Fix the IDs used in query test
dmitrykuzmin Dec 4, 2019
c080f3d
Remove temporary test config
dmitrykuzmin Dec 4, 2019
037f6c2
Add more integration tests for subscriptions
dmitrykuzmin Dec 4, 2019
f428151
Store empty subscription updates as real `null`s in Firebase database
dmitrykuzmin Dec 4, 2019
5be8d5b
Add tests for observing events generated by the command
dmitrykuzmin Dec 4, 2019
d5a5f78
Fix an issue with ID packing
dmitrykuzmin Dec 4, 2019
e15280a
Remove an unused import
dmitrykuzmin Dec 4, 2019
9f771a0
Remove excessive test logging
dmitrykuzmin Dec 4, 2019
dfe3912
Fix issue with `null` grand origin specified to the filter
dmitrykuzmin Dec 5, 2019
c16ead9
Update Spine version to `1.2.9`
dmitrykuzmin Dec 5, 2019
a9011c8
Resolve "Send command" test errors
dmitrykuzmin Dec 5, 2019
b1e2bbd
Post command after the observed events subscriptions are done
dmitrykuzmin Dec 5, 2019
ca6bda6
Add a test for query request creation
dmitrykuzmin Dec 6, 2019
8402c3e
Add a `SubscriptionRequest` test
dmitrykuzmin Dec 6, 2019
686a9c3
Fix a race condition when subscribing to command-produced events
dmitrykuzmin Dec 6, 2019
92572ad
Improve formatting
dmitrykuzmin Dec 6, 2019
6a7ceef
Resolve todos, clean up the code
dmitrykuzmin Dec 9, 2019
c30ef06
Add doc to client requests
dmitrykuzmin Dec 9, 2019
b378305
Add/update the `Client` doc
dmitrykuzmin Dec 9, 2019
74cc6b4
Add doc to the composite client
dmitrykuzmin Dec 9, 2019
4823329
Reword doc
dmitrykuzmin Dec 9, 2019
afd034e
Add doc to the new `FirebaseClient`-related entities
dmitrykuzmin Dec 9, 2019
9457c40
Add doc to the filtering request test
dmitrykuzmin Dec 9, 2019
adacc9e
Improve doc wording and formatting
dmitrykuzmin Dec 10, 2019
7de6f9b
Fix a code example
dmitrykuzmin Dec 10, 2019
da62a18
Remove redundant braces
dmitrykuzmin Dec 10, 2019
1504c96
Fix the code example
dmitrykuzmin Dec 10, 2019
4527e81
Resolve todos
dmitrykuzmin Dec 10, 2019
f9396f8
Update `config`
dmitrykuzmin Dec 10, 2019
abd396d
Improve `CommandRequest.observe(...)` and related API
dmitrykuzmin Dec 11, 2019
86435be
Bring back the old API
dmitrykuzmin Dec 11, 2019
1702c07
Optimize imports
dmitrykuzmin Dec 11, 2019
9b4d77a
Set indent to 2 spaces in all JS files
dmitrykuzmin Dec 11, 2019
8dcbd73
Remove a redundant empty line
dmitrykuzmin Dec 11, 2019
f00421a
Add a comment about why `Function.identity()` can't be used
dmitrykuzmin Dec 11, 2019
1e979c1
Revert the increased timeout of a test
dmitrykuzmin Dec 11, 2019
08a997a
Remove the no longer relevant todo
dmitrykuzmin Dec 11, 2019
ceaa482
Fix string formatting in tests
dmitrykuzmin Dec 11, 2019
0791b15
Fix more formatting
dmitrykuzmin Dec 11, 2019
ccb7588
Fix a comment formatting
dmitrykuzmin Dec 11, 2019
01b28cb
Re-enable test which is now working
dmitrykuzmin Dec 11, 2019
7a672b0
Fix the example code
dmitrykuzmin Dec 11, 2019
31cf592
Split `client-request` into several JS files
dmitrykuzmin Dec 12, 2019
c4e2b8c
Reword doc in client-js/main/client/client.js
dmitrykuzmin Dec 12, 2019
eb3e50b
Fix doc formatting in firebase-web/src/main/java/io/spine/web/firebas…
dmitrykuzmin Dec 12, 2019
78b19c9
Split the `composite-client` into several JS files
dmitrykuzmin Dec 12, 2019
118d61f
Optimize imports
dmitrykuzmin Dec 12, 2019
14d9c63
Reword the doc which looks disconnected after the classes are split
dmitrykuzmin Dec 12, 2019
cc16470
Merge remote-tracking branch 'origin/client-js-api-update' into clien…
dmitrykuzmin Dec 12, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ script:
- ./gradlew check --stacktrace

# Run integration tests of `spine-web` library.
# - ./gradlew integrationTest
# TODO:2019-11-11:dmytro.dashenkov: Run integration tests when https://github.com/gretty-gradle-plugin/gretty/issues/130 is resolved.
- ./gradlew integrationTest

# The publishing script should be executed in `script` section in order to
# fail the Travis build if execution of this script is failed.
Expand Down
4 changes: 2 additions & 2 deletions client-js/main/client/actor-request-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ class CommandFactory {
* Creates a `Command` from the given command message.
*
* @param {!Message} message a command message
* @return {TypedMessage<Command>} a typed representation of the Spine Command
* @return {Command} a Spine Command
*/
create(message) {
const id = CommandFactory._newCommandId();
Expand All @@ -825,7 +825,7 @@ class CommandFactory {
result.setId(id);
result.setMessage(messageAny);
result.setContext(context);
return TypedMessage.of(result);
return result;
}

_commandContext() {
Expand Down
4 changes: 2 additions & 2 deletions client-js/main/client/client-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

"use strict";

import {ActorRequestFactory} from "./actor-request-factory";
import {Client} from './client';
import {CommandingClient} from "./commanding-client";
import {HttpClient} from "./http-client";
import {HttpEndpoint} from "./http-endpoint";
import {ActorRequestFactory} from "./actor-request-factory";
import {CommandingClient} from "./composite-client";

/**
* @typedef {Object} ClientOptions a type of object for initialization of Spine client
Expand Down
49 changes: 49 additions & 0 deletions client-js/main/client/client-request.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright 2019, TeamDev. All rights reserved.
*
* 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";

/**
* A request from a client to the Spine backend.
*
* @abstract
*/
export class ClientRequest {

/**
* @protected
*/
constructor(client, requestFactory) {

/**
* @type Client
*
* @protected
*/
this._client = client;

/**
* @type ActorRequestFactory
*
* @protected
*/
this._requestFactory = requestFactory;
}
}
Loading