<commit_before>//
// Copyright 2015, TeamDev Ltd. 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.
//
syntax = "proto3";

package spine.client;

option java_generate_equals_and_hash = true;
option java_multiple_files = true;
option java_outer_classname = "ClientProto";
option java_package = "org.spine3.client";

// Version of the code executed on the client.
message CodeVersion {
    int32 major = 1;
    int32 minor = 2;
    int32 patch_level = 3;
    int32 build_number = 4;
}

// Operating System information.
message OsInfo {
    string name = 1;

    CodeVersion version = 2;
}


// Meta-information about the client computer device and client code.
message Client {

    enum Type {
        // Reserved value.
        UNKNOWN = 0;

        BROWSER = 1;

        BROWSER_MOBILE = 2;

        IOS_IPHONE = 3;

        IOS_IPAD = 4;

        ANDROID_PHONE = 5;

        ANDROID_TABLET = 6;

        reserved 7 to 99;

        SERVICE = 100;
    }

    Type type = 1;

    CodeVersion version = 2;

    OsInfo os_info = 3;
}<commit_msg>Define ClientService.<commit_after>//
// Copyright 2015, TeamDev Ltd. 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.
//
syntax = "proto3";

package spine.client;

option java_generate_equals_and_hash = true;
option java_multiple_files = true;
option java_outer_classname = "ClientProto";
option java_package = "org.spine3.client";

import public "spine/base/event.proto";

// Version of the code executed on the client.
message CodeVersion {
    int32 major = 1;
    int32 minor = 2;
    int32 patch_level = 3;
    int32 build_number = 4;
}

// Operating System information.
message OsInfo {
    // The name of the operating system.
    string name = 1;

    // The version of the OS.
    CodeVersion version = 2;
}

// The identifier of a client at the server.
//
// The server knows to which client send information by this ID.
// The value of the client ID can be anything, which makes sense to the
// design of the application. It can be login information, UUID, a user-selected
// screen name, a cookie, etc.
message ClientId {
    string value = 1;
}

// Meta-information about the client computer device and client code.
message Client {

    // The ID of the client.
    ClientId id = 1;

    // Enumeration of possible types of the computing devices running the code of the application.
    enum Type {
        // Reserved value.
        UNKNOWN = 0;

        BROWSER = 1;

        BROWSER_MOBILE = 2;

        // reserved 3 to 19;

        PHONE_ANDROID = 20;

        PHONE_IOS = 21;

        PHONE_WINDOWS = 22;

        // reserved 23 to 39;

        TABLET_ANDROID = 40;

        TABLET_IOS = 41;

        TABLET_WINDOWS = 42;

        // reserved 43 to 49;

        WATCH_ANDROID = 50;

        WATCH_APPLE = 51;

        // reserved 52 to 99;

        SERVICE = 100;
    }

    // The type of the computing device executing the code.
    Type type = 2;

    // The version of the application.
    CodeVersion version = 3;

    // Operating system running the code of the application.
    OsInfo os_info = 4;
}

// The service handling client connections to the server-side of the application.
service ClientService {
    // Connects the client to the server.
    rpc Connect(Client) returns (Connection);

    // Opens the event stream from the server.
    rpc Open(Connection) returns (stream spine.base.EventRecord);
}

// Connection wraps implementation details of the client-server connection.
message Connection {
    oneof type {
        Channel channel = 1;
    }
}

// Channel information required for working with Channel API.
//
// See https://cloud.google.com/appengine/docs/java/channel/
message Channel {
    // The token for the client created by the server.
    //
    // Tokens expire after two hours and should also be treated as secret
    // (e.g. avoid using tokens in URLs).
    string token = 1;
}

{'fraction_non_alphanumeric': 0.07741935483870968, 'fraction_numerical': 0.017436791630340016, 'mean_word_length': 2.7961614824619456, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6031502', 'n_tokens_mistral': 1770, 'n_tokens_neox': 1531, 'n_words': 704}