<commit_before>import { IContractServerResponse } from "./ContractServerResponse";
import { EndpointContractRoleType } from "../Contract/EndpointContract";

export type ContractServerRequestResponseFunction = (response: IContractServerResponse) => Promise<void>;

export interface IContractServerRequestArgument {
    key: string;
    value: any;
}

export interface IContractServerRequest {
    arguments: IContractServerRequestArgument[];
    respond: ContractServerRequestResponseFunction;
    rpccode: string;
    role: EndpointContractRoleType;
}

export class ContractServerRequest implements IContractServerRequest {

    arguments: IContractServerRequestArgument[];
    respond: ContractServerRequestResponseFunction;
    rpccode: string;
    role: EndpointContractRoleType;

    constructor(role: EndpointContractRoleType, rpccode: string, args: IContractServerRequestArgument[], callback: ContractServerRequestResponseFunction) {
        this.arguments = args;
        this.respond = callback;
        this.role = role;
        this.rpccode = rpccode;
    }

}<commit_msg>renamed rpccode to rpc, allowed also undefined<commit_after>import { IContractServerResponse } from "./ContractServerResponse";
import { EndpointContractRoleType } from "../Contract/EndpointContract";

export type ContractServerRequestResponseFunction = (response: IContractServerResponse) => Promise<void>;

export interface IContractServerRequestArgument {
    key: string;
    value: any;
}

export interface IContractServerRequest {
    arguments: IContractServerRequestArgument[];
    respond: ContractServerRequestResponseFunction;
    rpc: string | undefined;
    role: EndpointContractRoleType;
}

export class ContractServerRequest implements IContractServerRequest {

    arguments: IContractServerRequestArgument[];
    respond: ContractServerRequestResponseFunction;
    rpc: string;
    role: EndpointContractRoleType;

    constructor(role: EndpointContractRoleType, rpc: string, args: IContractServerRequestArgument[], callback: ContractServerRequestResponseFunction) {
        this.arguments = args;
        this.respond = callback;
        this.role = role;
        this.rpc = rpc;
    }

}
{'fraction_non_alphanumeric': 0.0767473732297853, 'fraction_numerical': 0.0, 'mean_word_length': 5.100278551532034, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '7373001', 'n_tokens_mistral': 539, 'n_tokens_neox': 535, 'n_words': 129}