Add some working typescript code that imports manually compiled protos.
This commit is contained in:
parent
e601ae0149
commit
e384370e24
|
@ -2,3 +2,5 @@
|
||||||
todo.org
|
todo.org
|
||||||
*.sqlite*
|
*.sqlite*
|
||||||
*.sqlite.*
|
*.sqlite.*
|
||||||
|
node_modules
|
||||||
|
static/scripts/ts/build
|
||||||
|
|
11
build.rs
11
build.rs
|
@ -1,14 +1,13 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
|
//TODO
|
||||||
|
// - invoke npm install?
|
||||||
|
// - invoke protoc to build ts/js protos
|
||||||
|
// - invoke npm run webpack from ts directory
|
||||||
|
|
||||||
let mut config = prost_build::Config::new();
|
let mut config = prost_build::Config::new();
|
||||||
config.btree_map(&["."]);
|
config.btree_map(&["."]);
|
||||||
config.type_attribute(".", "#[derive(Serialize)]");
|
config.type_attribute(".", "#[derive(Serialize)]");
|
||||||
config.type_attribute(".", "#[serde(rename_all = \"camelCase\")]");
|
config.type_attribute(".", "#[serde(rename_all = \"camelCase\")]");
|
||||||
// config
|
|
||||||
// .compile_protos(
|
|
||||||
// &["proto/cofd.proto", "proto/cofd_api.proto"],
|
|
||||||
// &["src/", "proto/"],
|
|
||||||
// )
|
|
||||||
// .unwrap();
|
|
||||||
|
|
||||||
tonic_build::configure()
|
tonic_build::configure()
|
||||||
.build_server(true)
|
.build_server(true)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"name": "tenebrous-sheets",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "An open source character sheet service for tabletop roleplaying games.",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"webpack-dev": "cd static/scripts/ts && webpack serve --watch --inline --port 8081 --host 0.0.0.0 --output-path=./build",
|
||||||
|
"build:protobuf": "mkdir -p static/scripts/ts/_proto && protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts -I ./proto --js_out=import_style=commonjs,binary:./static/scripts/ts/_proto --ts_out=service=grpc-web:./static/scripts/ts/_proto ./proto/*.proto",
|
||||||
|
"build:webpack": "cd static/scripts/ts && webpack"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "ssh://git@git.agnos.is:22022/projectmoon/tenebrous-sheets.git"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@improbable-eng/grpc-web": "^0.13.0",
|
||||||
|
"google-protobuf": "^3.14.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/google-protobuf": "^3.7.4",
|
||||||
|
"ts-loader": "^8.0.13",
|
||||||
|
"ts-protoc-gen": "^0.14.0",
|
||||||
|
"typescript": "^4.1.3",
|
||||||
|
"webpack": "^5.11.1",
|
||||||
|
"webpack-cli": "^4.3.1",
|
||||||
|
"webpack-dev-server": "^3.11.1"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,264 @@
|
||||||
|
// package: models.proto.cofd.api
|
||||||
|
// file: cofd_api.proto
|
||||||
|
|
||||||
|
import * as jspb from "google-protobuf";
|
||||||
|
import * as cofd_pb from "./cofd_pb";
|
||||||
|
|
||||||
|
export class BasicInfo extends jspb.Message {
|
||||||
|
getName(): string;
|
||||||
|
setName(value: string): void;
|
||||||
|
|
||||||
|
getGender(): string;
|
||||||
|
setGender(value: string): void;
|
||||||
|
|
||||||
|
getConcept(): string;
|
||||||
|
setConcept(value: string): void;
|
||||||
|
|
||||||
|
getChronicle(): string;
|
||||||
|
setChronicle(value: string): void;
|
||||||
|
|
||||||
|
getAge(): number;
|
||||||
|
setAge(value: number): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): BasicInfo.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: BasicInfo): BasicInfo.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: BasicInfo, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): BasicInfo;
|
||||||
|
static deserializeBinaryFromReader(message: BasicInfo, reader: jspb.BinaryReader): BasicInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace BasicInfo {
|
||||||
|
export type AsObject = {
|
||||||
|
name: string,
|
||||||
|
gender: string,
|
||||||
|
concept: string,
|
||||||
|
chronicle: string,
|
||||||
|
age: number,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Attributes extends jspb.Message {
|
||||||
|
getStrength(): number;
|
||||||
|
setStrength(value: number): void;
|
||||||
|
|
||||||
|
getDexterity(): number;
|
||||||
|
setDexterity(value: number): void;
|
||||||
|
|
||||||
|
getStamina(): number;
|
||||||
|
setStamina(value: number): void;
|
||||||
|
|
||||||
|
getIntelligence(): number;
|
||||||
|
setIntelligence(value: number): void;
|
||||||
|
|
||||||
|
getWits(): number;
|
||||||
|
setWits(value: number): void;
|
||||||
|
|
||||||
|
getResolve(): number;
|
||||||
|
setResolve(value: number): void;
|
||||||
|
|
||||||
|
getPresence(): number;
|
||||||
|
setPresence(value: number): void;
|
||||||
|
|
||||||
|
getManipulation(): number;
|
||||||
|
setManipulation(value: number): void;
|
||||||
|
|
||||||
|
getComposure(): number;
|
||||||
|
setComposure(value: number): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): Attributes.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: Attributes): Attributes.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: Attributes, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Attributes;
|
||||||
|
static deserializeBinaryFromReader(message: Attributes, reader: jspb.BinaryReader): Attributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace Attributes {
|
||||||
|
export type AsObject = {
|
||||||
|
strength: number,
|
||||||
|
dexterity: number,
|
||||||
|
stamina: number,
|
||||||
|
intelligence: number,
|
||||||
|
wits: number,
|
||||||
|
resolve: number,
|
||||||
|
presence: number,
|
||||||
|
manipulation: number,
|
||||||
|
composure: number,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class UpdateAttributeRequest extends jspb.Message {
|
||||||
|
getCharacterUsername(): string;
|
||||||
|
setCharacterUsername(value: string): void;
|
||||||
|
|
||||||
|
getCharacterId(): number;
|
||||||
|
setCharacterId(value: number): void;
|
||||||
|
|
||||||
|
getAttributeName(): string;
|
||||||
|
setAttributeName(value: string): void;
|
||||||
|
|
||||||
|
getAttributeValue(): number;
|
||||||
|
setAttributeValue(value: number): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): UpdateAttributeRequest.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: UpdateAttributeRequest): UpdateAttributeRequest.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: UpdateAttributeRequest, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): UpdateAttributeRequest;
|
||||||
|
static deserializeBinaryFromReader(message: UpdateAttributeRequest, reader: jspb.BinaryReader): UpdateAttributeRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace UpdateAttributeRequest {
|
||||||
|
export type AsObject = {
|
||||||
|
characterUsername: string,
|
||||||
|
characterId: number,
|
||||||
|
attributeName: string,
|
||||||
|
attributeValue: number,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Skills extends jspb.Message {
|
||||||
|
clearPhysicalSkillsList(): void;
|
||||||
|
getPhysicalSkillsList(): Array<cofd_pb.CofdSheet.Skill>;
|
||||||
|
setPhysicalSkillsList(value: Array<cofd_pb.CofdSheet.Skill>): void;
|
||||||
|
addPhysicalSkills(value?: cofd_pb.CofdSheet.Skill, index?: number): cofd_pb.CofdSheet.Skill;
|
||||||
|
|
||||||
|
clearMentalSkillsList(): void;
|
||||||
|
getMentalSkillsList(): Array<cofd_pb.CofdSheet.Skill>;
|
||||||
|
setMentalSkillsList(value: Array<cofd_pb.CofdSheet.Skill>): void;
|
||||||
|
addMentalSkills(value?: cofd_pb.CofdSheet.Skill, index?: number): cofd_pb.CofdSheet.Skill;
|
||||||
|
|
||||||
|
clearSocialSkillsList(): void;
|
||||||
|
getSocialSkillsList(): Array<cofd_pb.CofdSheet.Skill>;
|
||||||
|
setSocialSkillsList(value: Array<cofd_pb.CofdSheet.Skill>): void;
|
||||||
|
addSocialSkills(value?: cofd_pb.CofdSheet.Skill, index?: number): cofd_pb.CofdSheet.Skill;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): Skills.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: Skills): Skills.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: Skills, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Skills;
|
||||||
|
static deserializeBinaryFromReader(message: Skills, reader: jspb.BinaryReader): Skills;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace Skills {
|
||||||
|
export type AsObject = {
|
||||||
|
physicalSkillsList: Array<cofd_pb.CofdSheet.Skill.AsObject>,
|
||||||
|
mentalSkillsList: Array<cofd_pb.CofdSheet.Skill.AsObject>,
|
||||||
|
socialSkillsList: Array<cofd_pb.CofdSheet.Skill.AsObject>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SkillUpdate extends jspb.Message {
|
||||||
|
getName(): string;
|
||||||
|
setName(value: string): void;
|
||||||
|
|
||||||
|
hasSkill(): boolean;
|
||||||
|
clearSkill(): void;
|
||||||
|
getSkill(): cofd_pb.CofdSheet.Skill | undefined;
|
||||||
|
setSkill(value?: cofd_pb.CofdSheet.Skill): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): SkillUpdate.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: SkillUpdate): SkillUpdate.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: SkillUpdate, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): SkillUpdate;
|
||||||
|
static deserializeBinaryFromReader(message: SkillUpdate, reader: jspb.BinaryReader): SkillUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace SkillUpdate {
|
||||||
|
export type AsObject = {
|
||||||
|
name: string,
|
||||||
|
skill?: cofd_pb.CofdSheet.Skill.AsObject,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class UpdateSkillValueRequest extends jspb.Message {
|
||||||
|
getCharacterUsername(): string;
|
||||||
|
setCharacterUsername(value: string): void;
|
||||||
|
|
||||||
|
getCharacterId(): number;
|
||||||
|
setCharacterId(value: number): void;
|
||||||
|
|
||||||
|
getSkillName(): string;
|
||||||
|
setSkillName(value: string): void;
|
||||||
|
|
||||||
|
getSkillValue(): number;
|
||||||
|
setSkillValue(value: number): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): UpdateSkillValueRequest.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: UpdateSkillValueRequest): UpdateSkillValueRequest.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: UpdateSkillValueRequest, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): UpdateSkillValueRequest;
|
||||||
|
static deserializeBinaryFromReader(message: UpdateSkillValueRequest, reader: jspb.BinaryReader): UpdateSkillValueRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace UpdateSkillValueRequest {
|
||||||
|
export type AsObject = {
|
||||||
|
characterUsername: string,
|
||||||
|
characterId: number,
|
||||||
|
skillName: string,
|
||||||
|
skillValue: number,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SkillSpecializationsUpdate extends jspb.Message {
|
||||||
|
getName(): string;
|
||||||
|
setName(value: string): void;
|
||||||
|
|
||||||
|
clearSpecializationsList(): void;
|
||||||
|
getSpecializationsList(): Array<string>;
|
||||||
|
setSpecializationsList(value: Array<string>): void;
|
||||||
|
addSpecializations(value: string, index?: number): string;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): SkillSpecializationsUpdate.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: SkillSpecializationsUpdate): SkillSpecializationsUpdate.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: SkillSpecializationsUpdate, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): SkillSpecializationsUpdate;
|
||||||
|
static deserializeBinaryFromReader(message: SkillSpecializationsUpdate, reader: jspb.BinaryReader): SkillSpecializationsUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace SkillSpecializationsUpdate {
|
||||||
|
export type AsObject = {
|
||||||
|
name: string,
|
||||||
|
specializationsList: Array<string>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Condition extends jspb.Message {
|
||||||
|
getName(): string;
|
||||||
|
setName(value: string): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): Condition.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: Condition): Condition.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: Condition, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Condition;
|
||||||
|
static deserializeBinaryFromReader(message: Condition, reader: jspb.BinaryReader): Condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace Condition {
|
||||||
|
export type AsObject = {
|
||||||
|
name: string,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,64 @@
|
||||||
|
// package: models.proto.cofd.api
|
||||||
|
// file: cofd_api.proto
|
||||||
|
|
||||||
|
import * as cofd_api_pb from "./cofd_api_pb";
|
||||||
|
import * as cofd_pb from "./cofd_pb";
|
||||||
|
import {grpc} from "@improbable-eng/grpc-web";
|
||||||
|
|
||||||
|
type CofdApiUpdateSkillValue = {
|
||||||
|
readonly methodName: string;
|
||||||
|
readonly service: typeof CofdApi;
|
||||||
|
readonly requestStream: false;
|
||||||
|
readonly responseStream: false;
|
||||||
|
readonly requestType: typeof cofd_api_pb.UpdateSkillValueRequest;
|
||||||
|
readonly responseType: typeof cofd_pb.CofdSheet.Skill;
|
||||||
|
};
|
||||||
|
|
||||||
|
export class CofdApi {
|
||||||
|
static readonly serviceName: string;
|
||||||
|
static readonly UpdateSkillValue: CofdApiUpdateSkillValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
|
||||||
|
export type Status = { details: string, code: number; metadata: grpc.Metadata }
|
||||||
|
|
||||||
|
interface UnaryResponse {
|
||||||
|
cancel(): void;
|
||||||
|
}
|
||||||
|
interface ResponseStream<T> {
|
||||||
|
cancel(): void;
|
||||||
|
on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
|
||||||
|
on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
|
||||||
|
on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
|
||||||
|
}
|
||||||
|
interface RequestStream<T> {
|
||||||
|
write(message: T): RequestStream<T>;
|
||||||
|
end(): void;
|
||||||
|
cancel(): void;
|
||||||
|
on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
|
||||||
|
on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
|
||||||
|
}
|
||||||
|
interface BidirectionalStream<ReqT, ResT> {
|
||||||
|
write(message: ReqT): BidirectionalStream<ReqT, ResT>;
|
||||||
|
end(): void;
|
||||||
|
cancel(): void;
|
||||||
|
on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
|
||||||
|
on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
|
||||||
|
on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class CofdApiClient {
|
||||||
|
readonly serviceHost: string;
|
||||||
|
|
||||||
|
constructor(serviceHost: string, options?: grpc.RpcOptions);
|
||||||
|
updateSkillValue(
|
||||||
|
requestMessage: cofd_api_pb.UpdateSkillValueRequest,
|
||||||
|
metadata: grpc.Metadata,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: cofd_pb.CofdSheet.Skill|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
updateSkillValue(
|
||||||
|
requestMessage: cofd_api_pb.UpdateSkillValueRequest,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: cofd_pb.CofdSheet.Skill|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
// package: models.proto.cofd.api
|
||||||
|
// file: cofd_api.proto
|
||||||
|
|
||||||
|
var cofd_api_pb = require("./cofd_api_pb");
|
||||||
|
var cofd_pb = require("./cofd_pb");
|
||||||
|
var grpc = require("@improbable-eng/grpc-web").grpc;
|
||||||
|
|
||||||
|
var CofdApi = (function () {
|
||||||
|
function CofdApi() {}
|
||||||
|
CofdApi.serviceName = "models.proto.cofd.api.CofdApi";
|
||||||
|
return CofdApi;
|
||||||
|
}());
|
||||||
|
|
||||||
|
CofdApi.UpdateSkillValue = {
|
||||||
|
methodName: "UpdateSkillValue",
|
||||||
|
service: CofdApi,
|
||||||
|
requestStream: false,
|
||||||
|
responseStream: false,
|
||||||
|
requestType: cofd_api_pb.UpdateSkillValueRequest,
|
||||||
|
responseType: cofd_pb.CofdSheet.Skill
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.CofdApi = CofdApi;
|
||||||
|
|
||||||
|
function CofdApiClient(serviceHost, options) {
|
||||||
|
this.serviceHost = serviceHost;
|
||||||
|
this.options = options || {};
|
||||||
|
}
|
||||||
|
|
||||||
|
CofdApiClient.prototype.updateSkillValue = function updateSkillValue(requestMessage, metadata, callback) {
|
||||||
|
if (arguments.length === 2) {
|
||||||
|
callback = arguments[1];
|
||||||
|
}
|
||||||
|
var client = grpc.unary(CofdApi.UpdateSkillValue, {
|
||||||
|
request: requestMessage,
|
||||||
|
host: this.serviceHost,
|
||||||
|
metadata: metadata,
|
||||||
|
transport: this.options.transport,
|
||||||
|
debug: this.options.debug,
|
||||||
|
onEnd: function (response) {
|
||||||
|
if (callback) {
|
||||||
|
if (response.status !== grpc.Code.OK) {
|
||||||
|
var err = new Error(response.statusMessage);
|
||||||
|
err.code = response.status;
|
||||||
|
err.metadata = response.trailers;
|
||||||
|
callback(err, null);
|
||||||
|
} else {
|
||||||
|
callback(null, response.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
cancel: function () {
|
||||||
|
callback = null;
|
||||||
|
client.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.CofdApiClient = CofdApiClient;
|
||||||
|
|
|
@ -0,0 +1,361 @@
|
||||||
|
// package: models.proto.cofd
|
||||||
|
// file: cofd.proto
|
||||||
|
|
||||||
|
import * as jspb from "google-protobuf";
|
||||||
|
|
||||||
|
export class CoreFields extends jspb.Message {
|
||||||
|
getIntegrity(): number;
|
||||||
|
setIntegrity(value: number): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): CoreFields.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: CoreFields): CoreFields.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: CoreFields, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): CoreFields;
|
||||||
|
static deserializeBinaryFromReader(message: CoreFields, reader: jspb.BinaryReader): CoreFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace CoreFields {
|
||||||
|
export type AsObject = {
|
||||||
|
integrity: number,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class MageFields extends jspb.Message {
|
||||||
|
getWidsom(): number;
|
||||||
|
setWidsom(value: number): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): MageFields.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: MageFields): MageFields.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: MageFields, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): MageFields;
|
||||||
|
static deserializeBinaryFromReader(message: MageFields, reader: jspb.BinaryReader): MageFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace MageFields {
|
||||||
|
export type AsObject = {
|
||||||
|
widsom: number,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ChangelingFields extends jspb.Message {
|
||||||
|
getClarity(): number;
|
||||||
|
setClarity(value: number): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): ChangelingFields.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: ChangelingFields): ChangelingFields.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: ChangelingFields, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): ChangelingFields;
|
||||||
|
static deserializeBinaryFromReader(message: ChangelingFields, reader: jspb.BinaryReader): ChangelingFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace ChangelingFields {
|
||||||
|
export type AsObject = {
|
||||||
|
clarity: number,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class CofdSheet extends jspb.Message {
|
||||||
|
getName(): string;
|
||||||
|
setName(value: string): void;
|
||||||
|
|
||||||
|
getPlayer(): string;
|
||||||
|
setPlayer(value: string): void;
|
||||||
|
|
||||||
|
getCampaign(): string;
|
||||||
|
setCampaign(value: string): void;
|
||||||
|
|
||||||
|
getDescription(): string;
|
||||||
|
setDescription(value: string): void;
|
||||||
|
|
||||||
|
getStrength(): number;
|
||||||
|
setStrength(value: number): void;
|
||||||
|
|
||||||
|
getDexterity(): number;
|
||||||
|
setDexterity(value: number): void;
|
||||||
|
|
||||||
|
getStamina(): number;
|
||||||
|
setStamina(value: number): void;
|
||||||
|
|
||||||
|
getIntelligence(): number;
|
||||||
|
setIntelligence(value: number): void;
|
||||||
|
|
||||||
|
getWits(): number;
|
||||||
|
setWits(value: number): void;
|
||||||
|
|
||||||
|
getResolve(): number;
|
||||||
|
setResolve(value: number): void;
|
||||||
|
|
||||||
|
getPresence(): number;
|
||||||
|
setPresence(value: number): void;
|
||||||
|
|
||||||
|
getManipulation(): number;
|
||||||
|
setManipulation(value: number): void;
|
||||||
|
|
||||||
|
getComposure(): number;
|
||||||
|
setComposure(value: number): void;
|
||||||
|
|
||||||
|
getPhysicalSkillsMap(): jspb.Map<string, CofdSheet.Skill>;
|
||||||
|
clearPhysicalSkillsMap(): void;
|
||||||
|
getMentalSkillsMap(): jspb.Map<string, CofdSheet.Skill>;
|
||||||
|
clearMentalSkillsMap(): void;
|
||||||
|
getSocialSkillsMap(): jspb.Map<string, CofdSheet.Skill>;
|
||||||
|
clearSocialSkillsMap(): void;
|
||||||
|
clearMeritsList(): void;
|
||||||
|
getMeritsList(): Array<CofdSheet.Merit>;
|
||||||
|
setMeritsList(value: Array<CofdSheet.Merit>): void;
|
||||||
|
addMerits(value?: CofdSheet.Merit, index?: number): CofdSheet.Merit;
|
||||||
|
|
||||||
|
clearConditionsList(): void;
|
||||||
|
getConditionsList(): Array<CofdSheet.Condition>;
|
||||||
|
setConditionsList(value: Array<CofdSheet.Condition>): void;
|
||||||
|
addConditions(value?: CofdSheet.Condition, index?: number): CofdSheet.Condition;
|
||||||
|
|
||||||
|
getSize(): number;
|
||||||
|
setSize(value: number): void;
|
||||||
|
|
||||||
|
getHealth(): number;
|
||||||
|
setHealth(value: number): void;
|
||||||
|
|
||||||
|
getWillpower(): number;
|
||||||
|
setWillpower(value: number): void;
|
||||||
|
|
||||||
|
getExperiencePoints(): number;
|
||||||
|
setExperiencePoints(value: number): void;
|
||||||
|
|
||||||
|
getBeats(): number;
|
||||||
|
setBeats(value: number): void;
|
||||||
|
|
||||||
|
clearItemsList(): void;
|
||||||
|
getItemsList(): Array<CofdSheet.Item>;
|
||||||
|
setItemsList(value: Array<CofdSheet.Item>): void;
|
||||||
|
addItems(value?: CofdSheet.Item, index?: number): CofdSheet.Item;
|
||||||
|
|
||||||
|
clearAttacksList(): void;
|
||||||
|
getAttacksList(): Array<CofdSheet.Attack>;
|
||||||
|
setAttacksList(value: Array<CofdSheet.Attack>): void;
|
||||||
|
addAttacks(value?: CofdSheet.Attack, index?: number): CofdSheet.Attack;
|
||||||
|
|
||||||
|
getOtherDataMap(): jspb.Map<string, string>;
|
||||||
|
clearOtherDataMap(): void;
|
||||||
|
hasCore(): boolean;
|
||||||
|
clearCore(): void;
|
||||||
|
getCore(): CoreFields | undefined;
|
||||||
|
setCore(value?: CoreFields): void;
|
||||||
|
|
||||||
|
hasMage(): boolean;
|
||||||
|
clearMage(): void;
|
||||||
|
getMage(): MageFields | undefined;
|
||||||
|
setMage(value?: MageFields): void;
|
||||||
|
|
||||||
|
hasChangeling(): boolean;
|
||||||
|
clearChangeling(): void;
|
||||||
|
getChangeling(): ChangelingFields | undefined;
|
||||||
|
setChangeling(value?: ChangelingFields): void;
|
||||||
|
|
||||||
|
getSystemFieldsCase(): CofdSheet.SystemFieldsCase;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): CofdSheet.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: CofdSheet): CofdSheet.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: CofdSheet, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): CofdSheet;
|
||||||
|
static deserializeBinaryFromReader(message: CofdSheet, reader: jspb.BinaryReader): CofdSheet;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace CofdSheet {
|
||||||
|
export type AsObject = {
|
||||||
|
name: string,
|
||||||
|
player: string,
|
||||||
|
campaign: string,
|
||||||
|
description: string,
|
||||||
|
strength: number,
|
||||||
|
dexterity: number,
|
||||||
|
stamina: number,
|
||||||
|
intelligence: number,
|
||||||
|
wits: number,
|
||||||
|
resolve: number,
|
||||||
|
presence: number,
|
||||||
|
manipulation: number,
|
||||||
|
composure: number,
|
||||||
|
physicalSkillsMap: Array<[string, CofdSheet.Skill.AsObject]>,
|
||||||
|
mentalSkillsMap: Array<[string, CofdSheet.Skill.AsObject]>,
|
||||||
|
socialSkillsMap: Array<[string, CofdSheet.Skill.AsObject]>,
|
||||||
|
meritsList: Array<CofdSheet.Merit.AsObject>,
|
||||||
|
conditionsList: Array<CofdSheet.Condition.AsObject>,
|
||||||
|
size: number,
|
||||||
|
health: number,
|
||||||
|
willpower: number,
|
||||||
|
experiencePoints: number,
|
||||||
|
beats: number,
|
||||||
|
itemsList: Array<CofdSheet.Item.AsObject>,
|
||||||
|
attacksList: Array<CofdSheet.Attack.AsObject>,
|
||||||
|
otherDataMap: Array<[string, string]>,
|
||||||
|
core?: CoreFields.AsObject,
|
||||||
|
mage?: MageFields.AsObject,
|
||||||
|
changeling?: ChangelingFields.AsObject,
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Merit extends jspb.Message {
|
||||||
|
getDots(): number;
|
||||||
|
setDots(value: number): void;
|
||||||
|
|
||||||
|
getName(): string;
|
||||||
|
setName(value: string): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): Merit.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: Merit): Merit.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: Merit, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Merit;
|
||||||
|
static deserializeBinaryFromReader(message: Merit, reader: jspb.BinaryReader): Merit;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace Merit {
|
||||||
|
export type AsObject = {
|
||||||
|
dots: number,
|
||||||
|
name: string,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Condition extends jspb.Message {
|
||||||
|
getName(): string;
|
||||||
|
setName(value: string): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): Condition.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: Condition): Condition.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: Condition, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Condition;
|
||||||
|
static deserializeBinaryFromReader(message: Condition, reader: jspb.BinaryReader): Condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace Condition {
|
||||||
|
export type AsObject = {
|
||||||
|
name: string,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Skill extends jspb.Message {
|
||||||
|
getDots(): number;
|
||||||
|
setDots(value: number): void;
|
||||||
|
|
||||||
|
getName(): string;
|
||||||
|
setName(value: string): void;
|
||||||
|
|
||||||
|
getUntrainedPenalty(): number;
|
||||||
|
setUntrainedPenalty(value: number): void;
|
||||||
|
|
||||||
|
clearSpecializationsList(): void;
|
||||||
|
getSpecializationsList(): Array<string>;
|
||||||
|
setSpecializationsList(value: Array<string>): void;
|
||||||
|
addSpecializations(value: string, index?: number): string;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): Skill.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: Skill): Skill.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: Skill, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Skill;
|
||||||
|
static deserializeBinaryFromReader(message: Skill, reader: jspb.BinaryReader): Skill;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace Skill {
|
||||||
|
export type AsObject = {
|
||||||
|
dots: number,
|
||||||
|
name: string,
|
||||||
|
untrainedPenalty: number,
|
||||||
|
specializationsList: Array<string>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Item extends jspb.Message {
|
||||||
|
getName(): string;
|
||||||
|
setName(value: string): void;
|
||||||
|
|
||||||
|
getDescription(): string;
|
||||||
|
setDescription(value: string): void;
|
||||||
|
|
||||||
|
getRules(): string;
|
||||||
|
setRules(value: string): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): Item.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: Item): Item.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: Item, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Item;
|
||||||
|
static deserializeBinaryFromReader(message: Item, reader: jspb.BinaryReader): Item;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace Item {
|
||||||
|
export type AsObject = {
|
||||||
|
name: string,
|
||||||
|
description: string,
|
||||||
|
rules: string,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Attack extends jspb.Message {
|
||||||
|
getName(): string;
|
||||||
|
setName(value: string): void;
|
||||||
|
|
||||||
|
getDicePool(): number;
|
||||||
|
setDicePool(value: number): void;
|
||||||
|
|
||||||
|
getDamage(): number;
|
||||||
|
setDamage(value: number): void;
|
||||||
|
|
||||||
|
getRange(): number;
|
||||||
|
setRange(value: number): void;
|
||||||
|
|
||||||
|
getInitiativeModifier(): number;
|
||||||
|
setInitiativeModifier(value: number): void;
|
||||||
|
|
||||||
|
getSize(): number;
|
||||||
|
setSize(value: number): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): Attack.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: Attack): Attack.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: Attack, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Attack;
|
||||||
|
static deserializeBinaryFromReader(message: Attack, reader: jspb.BinaryReader): Attack;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace Attack {
|
||||||
|
export type AsObject = {
|
||||||
|
name: string,
|
||||||
|
dicePool: number,
|
||||||
|
damage: number,
|
||||||
|
range: number,
|
||||||
|
initiativeModifier: number,
|
||||||
|
size: number,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum SystemFieldsCase {
|
||||||
|
SYSTEM_FIELDS_NOT_SET = 0,
|
||||||
|
CORE = 28,
|
||||||
|
MAGE = 29,
|
||||||
|
CHANGELING = 30,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,3 @@
|
||||||
|
// package: models.proto.cofd
|
||||||
|
// file: cofd.proto
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
// package: models.proto.cofd
|
||||||
|
// file: cofd.proto
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
import { grpc } from "@improbable-eng/grpc-web";
|
||||||
|
import { CofdApi } from "../_proto/cofd_api_pb_service";
|
||||||
|
import { UpdateSkillValueRequest } from "../_proto/cofd_api_pb";
|
||||||
|
|
||||||
|
let x = new UpdateSkillValueRequest();
|
||||||
|
x.setCharacterId(1);
|
||||||
|
x.setCharacterUsername("guy");
|
||||||
|
console.log("hello", x);
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"alwaysStrict": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"target": "es5",
|
||||||
|
"removeComments": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"strictNullChecks": true,
|
||||||
|
"stripInternal": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noEmitOnError": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
const webpack = require('webpack');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: "./src/index.ts",
|
||||||
|
mode: "development",
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__dirname, 'build'),
|
||||||
|
filename: 'bundle.js'
|
||||||
|
},
|
||||||
|
devtool: 'inline-source-map',
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.ts$/,
|
||||||
|
include: /src|_proto/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
loader: "ts-loader"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: [".ts", ".js"]
|
||||||
|
},
|
||||||
|
// plugins: [
|
||||||
|
// new webpack.DefinePlugin({
|
||||||
|
// 'USE_TLS': process.env.USE_TLS !== undefined
|
||||||
|
// })
|
||||||
|
// ]
|
||||||
|
};
|
|
@ -1,6 +1,7 @@
|
||||||
{% extends "base" %}
|
{% extends "base" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<script type="text/javascript" src="/scripts/ts/build/bundle.js"></script>
|
||||||
<div>
|
<div>
|
||||||
<h1>Tenebrous: Login</h1>
|
<h1>Tenebrous: Login</h1>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue