Skip to content

Commit

Permalink
added typescript bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Peeeekay committed Jun 8, 2023
1 parent a4cb4e6 commit 081bf56
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 23 deletions.
12 changes: 6 additions & 6 deletions api/scripts/regenerate-protobuf-bindings.sh
Expand Up @@ -32,10 +32,10 @@ for output_dirname in "${OUTPUT_DIRNAMES[@]}"; do
echo "Successfully generated ${output_dirname} Go bindings in directory '${go_output_dirpath}'"

# TypeScript
# typescript_output_dirpath="${api_dirpath}/${TYPESCRIPT_DIRNAME}/src/${output_dirname}/${rpc_bindings_dirname}"
# if ! "${GENERATOR_SCRIPT_FILENAME}" "${input_dirpath}" "${typescript_output_dirpath}" typescript; then
# echo "Error: An error occurred generating ${output_dirname} TypeScript bindings in directory '${typescript_output_dirpath}'" >&2
# exit 1
# fi
# echo "Successfully generated ${output_dirname} TypeScript bindings in directory '${typescript_output_dirpath}'"
typescript_output_dirpath="${api_dirpath}/${TYPESCRIPT_DIRNAME}/src/${output_dirname}/${rpc_bindings_dirname}"
if ! "${GENERATOR_SCRIPT_FILENAME}" "${input_dirpath}" "${typescript_output_dirpath}" typescript; then
echo "Error: An error occurred generating ${output_dirname} TypeScript bindings in directory '${typescript_output_dirpath}'" >&2
exit 1
fi
echo "Successfully generated ${output_dirname} TypeScript bindings in directory '${typescript_output_dirpath}'"
done
Expand Up @@ -7,7 +7,7 @@
// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
// versions:
// protoc-gen-grpc-web v1.4.2
// protoc v3.19.1
// protoc v3.15.6
// source: api_container_service.proto


Expand Down
Expand Up @@ -121,6 +121,12 @@ export class ServiceConfig extends jspb.Message {
hasSubnetwork(): boolean;
clearSubnetwork(): ServiceConfig;

getMinCpuMilliCores(): number;
setMinCpuMilliCores(value: number): ServiceConfig;

getMinMemoryMegabytes(): number;
setMinMemoryMegabytes(value: number): ServiceConfig;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ServiceConfig.AsObject;
static toObject(includeInstance: boolean, msg: ServiceConfig): ServiceConfig.AsObject;
Expand All @@ -142,6 +148,8 @@ export namespace ServiceConfig {
memoryAllocationMegabytes: number,
privateIpAddrPlaceholder: string,
subnetwork?: string,
minCpuMilliCores: number,
minMemoryMegabytes: number,
}

export enum SubnetworkCase {
Expand Down
Expand Up @@ -13,13 +13,7 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var global = Function('return this')();

var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
goog.object.extend(proto, google_protobuf_empty_pb);
Expand Down Expand Up @@ -1743,7 +1737,9 @@ proto.api_container_api.ServiceConfig.toObject = function(includeInstance, msg)
cpuAllocationMillicpus: jspb.Message.getFieldWithDefault(msg, 8, 0),
memoryAllocationMegabytes: jspb.Message.getFieldWithDefault(msg, 9, 0),
privateIpAddrPlaceholder: jspb.Message.getFieldWithDefault(msg, 10, ""),
subnetwork: jspb.Message.getFieldWithDefault(msg, 11, "")
subnetwork: jspb.Message.getFieldWithDefault(msg, 11, ""),
minCpuMilliCores: jspb.Message.getFieldWithDefault(msg, 12, 0),
minMemoryMegabytes: jspb.Message.getFieldWithDefault(msg, 13, 0)
};

if (includeInstance) {
Expand Down Expand Up @@ -1832,6 +1828,14 @@ proto.api_container_api.ServiceConfig.deserializeBinaryFromReader = function(msg
var value = /** @type {string} */ (reader.readString());
msg.setSubnetwork(value);
break;
case 12:
var value = /** @type {number} */ (reader.readUint64());
msg.setMinCpuMilliCores(value);
break;
case 13:
var value = /** @type {number} */ (reader.readUint64());
msg.setMinMemoryMegabytes(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -1926,6 +1930,20 @@ proto.api_container_api.ServiceConfig.serializeBinaryToWriter = function(message
f
);
}
f = message.getMinCpuMilliCores();
if (f !== 0) {
writer.writeUint64(
12,
f
);
}
f = message.getMinMemoryMegabytes();
if (f !== 0) {
writer.writeUint64(
13,
f
);
}
};


Expand Down Expand Up @@ -2199,6 +2217,42 @@ proto.api_container_api.ServiceConfig.prototype.hasSubnetwork = function() {
};


/**
* optional uint64 min_cpu_milli_cores = 12;
* @return {number}
*/
proto.api_container_api.ServiceConfig.prototype.getMinCpuMilliCores = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0));
};


/**
* @param {number} value
* @return {!proto.api_container_api.ServiceConfig} returns this
*/
proto.api_container_api.ServiceConfig.prototype.setMinCpuMilliCores = function(value) {
return jspb.Message.setProto3IntField(this, 12, value);
};


/**
* optional uint64 min_memory_megabytes = 13;
* @return {number}
*/
proto.api_container_api.ServiceConfig.prototype.getMinMemoryMegabytes = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 13, 0));
};


/**
* @param {number} value
* @return {!proto.api_container_api.ServiceConfig} returns this
*/
proto.api_container_api.ServiceConfig.prototype.setMinMemoryMegabytes = function(value) {
return jspb.Message.setProto3IntField(this, 13, value);
};





Expand Down
Expand Up @@ -7,7 +7,7 @@
// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
// versions:
// protoc-gen-grpc-web v1.4.2
// protoc v3.19.1
// protoc v3.15.6
// source: engine_service.proto


Expand Down
Expand Up @@ -13,13 +13,7 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var global = Function('return this')();

var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
goog.object.extend(proto, google_protobuf_empty_pb);
Expand Down

0 comments on commit 081bf56

Please sign in to comment.