diff --git a/package.json b/package.json index 43ea9a47..3a3d98c0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nitric/sdk", "description": "Nitric NodeJS client sdk", - "nitric": "v0.27.0", + "nitric": "v0.30.0", "author": "Nitric ", "repository": "https://github.com/nitrictech/node-sdk", "main": "lib/index.js", @@ -40,6 +40,7 @@ "@opentelemetry/sdk-trace-node": "^1.10.1", "@opentelemetry/semantic-conventions": "^1.10.1", "google-protobuf": "3.14.0", + "portfinder": "^1.0.32", "tslib": "^2.1.0" }, "license": "Apache-2.0", diff --git a/src/faas/v0/start.ts b/src/faas/v0/start.ts index d9ed1957..cc51d423 100644 --- a/src/faas/v0/start.ts +++ b/src/faas/v0/start.ts @@ -32,6 +32,7 @@ import { NotificationResponseContext, BucketNotificationWorker, BucketNotificationConfig, + HttpWorker, } from '@nitric/api/proto/faas/v1/faas_pb'; import { @@ -57,6 +58,7 @@ import { } from '../../resources'; import * as grpc from '@grpc/grpc-js'; +import { HttpWorkerOptions } from '@nitric/sdk/resources/http'; export class FaasWorkerOptions {} @@ -65,6 +67,7 @@ type FaasClientOptions = | RateWorkerOptions | CronWorkerOptions | FaasWorkerOptions + | HttpWorkerOptions | BucketNotificationWorkerOptions; /** @@ -160,6 +163,7 @@ export class Faas { this.anyHandler = handlers.length && createHandler(...handlers); if ( + !(this.options instanceof HttpWorkerOptions) && !this.httpHandler && !this.eventHandler && !this.bucketNotificationHandler && @@ -177,6 +181,14 @@ export class Faas { // Begin Bi-Di streaming const faasStream = faasClient.triggerStream(); + // Start Node application that HTTP proxy sits on + if ( + this.options instanceof HttpWorkerOptions && + process.env.NITRIC_ENVIRONMENT !== 'build' + ) { + this.options.app.listen(this.options.port, this.options.callback); + } + faasStream.on('data', async (message: ServerMessage) => { // We have an init response from the membrane if (message.hasInitResponse()) { @@ -314,6 +326,10 @@ export class Faas { config.setNotificationType(this.options.notificationType); notificationWorker.setConfig(config); initRequest.setBucketNotification(notificationWorker); + } else if (this.options instanceof HttpWorkerOptions) { + const httpWorker = new HttpWorker(); + httpWorker.setPort(this.options.port); + initRequest.setHttpWorker(httpWorker); } // Original faas workers should return a blank InitRequest for compatibility. diff --git a/src/gen/proto/deploy/v1/deploy_pb.d.ts b/src/gen/proto/deploy/v1/deploy_pb.d.ts index d489d207..61b2cb6b 100644 --- a/src/gen/proto/deploy/v1/deploy_pb.d.ts +++ b/src/gen/proto/deploy/v1/deploy_pb.d.ts @@ -459,6 +459,56 @@ export namespace TopicSubscription { } } +export class HttpTarget extends jspb.Message { + hasExecutionUnit(): boolean; + clearExecutionUnit(): void; + getExecutionUnit(): string; + setExecutionUnit(value: string): void; + + getTargetCase(): HttpTarget.TargetCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HttpTarget.AsObject; + static toObject(includeInstance: boolean, msg: HttpTarget): HttpTarget.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: HttpTarget, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HttpTarget; + static deserializeBinaryFromReader(message: HttpTarget, reader: jspb.BinaryReader): HttpTarget; +} + +export namespace HttpTarget { + export type AsObject = { + executionUnit: string, + } + + export enum TargetCase { + TARGET_NOT_SET = 0, + EXECUTION_UNIT = 1, + } +} + +export class Http extends jspb.Message { + hasTarget(): boolean; + clearTarget(): void; + getTarget(): HttpTarget | undefined; + setTarget(value?: HttpTarget): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Http.AsObject; + static toObject(includeInstance: boolean, msg: Http): Http.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Http, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Http; + static deserializeBinaryFromReader(message: Http, reader: jspb.BinaryReader): Http; +} + +export namespace Http { + export type AsObject = { + target?: HttpTarget.AsObject, + } +} + export class Api extends jspb.Message { hasOpenapi(): boolean; clearOpenapi(): void; @@ -487,6 +537,68 @@ export namespace Api { } } +export class Websocket extends jspb.Message { + hasConnectTarget(): boolean; + clearConnectTarget(): void; + getConnectTarget(): WebsocketTarget | undefined; + setConnectTarget(value?: WebsocketTarget): void; + + hasDisconnectTarget(): boolean; + clearDisconnectTarget(): void; + getDisconnectTarget(): WebsocketTarget | undefined; + setDisconnectTarget(value?: WebsocketTarget): void; + + hasMessageTarget(): boolean; + clearMessageTarget(): void; + getMessageTarget(): WebsocketTarget | undefined; + setMessageTarget(value?: WebsocketTarget): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Websocket.AsObject; + static toObject(includeInstance: boolean, msg: Websocket): Websocket.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Websocket, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Websocket; + static deserializeBinaryFromReader(message: Websocket, reader: jspb.BinaryReader): Websocket; +} + +export namespace Websocket { + export type AsObject = { + connectTarget?: WebsocketTarget.AsObject, + disconnectTarget?: WebsocketTarget.AsObject, + messageTarget?: WebsocketTarget.AsObject, + } +} + +export class WebsocketTarget extends jspb.Message { + hasExecutionUnit(): boolean; + clearExecutionUnit(): void; + getExecutionUnit(): string; + setExecutionUnit(value: string): void; + + getTargetCase(): WebsocketTarget.TargetCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketTarget.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketTarget): WebsocketTarget.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketTarget, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketTarget; + static deserializeBinaryFromReader(message: WebsocketTarget, reader: jspb.BinaryReader): WebsocketTarget; +} + +export namespace WebsocketTarget { + export type AsObject = { + executionUnit: string, + } + + export enum TargetCase { + TARGET_NOT_SET = 0, + EXECUTION_UNIT = 1, + } +} + export class ScheduleTarget extends jspb.Message { hasExecutionUnit(): boolean; clearExecutionUnit(): void; @@ -593,6 +705,16 @@ export class Resource extends jspb.Message { getSecret(): Secret | undefined; setSecret(value?: Secret): void; + hasWebsocket(): boolean; + clearWebsocket(): void; + getWebsocket(): Websocket | undefined; + setWebsocket(value?: Websocket): void; + + hasHttp(): boolean; + clearHttp(): void; + getHttp(): Http | undefined; + setHttp(value?: Http): void; + getConfigCase(): Resource.ConfigCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Resource.AsObject; @@ -617,6 +739,8 @@ export namespace Resource { schedule?: Schedule.AsObject, collection?: Collection.AsObject, secret?: Secret.AsObject, + websocket?: Websocket.AsObject, + http?: Http.AsObject, } export enum ConfigCase { @@ -630,6 +754,8 @@ export namespace Resource { SCHEDULE = 16, COLLECTION = 17, SECRET = 18, + WEBSOCKET = 19, + HTTP = 20, } } diff --git a/src/gen/proto/deploy/v1/deploy_pb.js b/src/gen/proto/deploy/v1/deploy_pb.js index 6054f280..acda8668 100644 --- a/src/gen/proto/deploy/v1/deploy_pb.js +++ b/src/gen/proto/deploy/v1/deploy_pb.js @@ -44,6 +44,9 @@ goog.exportSymbol('proto.nitric.deploy.v1.DeployUpEventResult', null, global); goog.exportSymbol('proto.nitric.deploy.v1.DeployUpRequest', null, global); goog.exportSymbol('proto.nitric.deploy.v1.ExecutionUnit', null, global); goog.exportSymbol('proto.nitric.deploy.v1.ExecutionUnit.SourceCase', null, global); +goog.exportSymbol('proto.nitric.deploy.v1.Http', null, global); +goog.exportSymbol('proto.nitric.deploy.v1.HttpTarget', null, global); +goog.exportSymbol('proto.nitric.deploy.v1.HttpTarget.TargetCase', null, global); goog.exportSymbol('proto.nitric.deploy.v1.ImageSource', null, global); goog.exportSymbol('proto.nitric.deploy.v1.Policy', null, global); goog.exportSymbol('proto.nitric.deploy.v1.Queue', null, global); @@ -60,6 +63,9 @@ goog.exportSymbol('proto.nitric.deploy.v1.Topic', null, global); goog.exportSymbol('proto.nitric.deploy.v1.TopicSubscription', null, global); goog.exportSymbol('proto.nitric.deploy.v1.UpResult', null, global); goog.exportSymbol('proto.nitric.deploy.v1.UpResult.ContentCase', null, global); +goog.exportSymbol('proto.nitric.deploy.v1.Websocket', null, global); +goog.exportSymbol('proto.nitric.deploy.v1.WebsocketTarget', null, global); +goog.exportSymbol('proto.nitric.deploy.v1.WebsocketTarget.TargetCase', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -438,6 +444,48 @@ if (goog.DEBUG && !COMPILED) { */ proto.nitric.deploy.v1.TopicSubscription.displayName = 'proto.nitric.deploy.v1.TopicSubscription'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.deploy.v1.HttpTarget = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.HttpTarget.oneofGroups_); +}; +goog.inherits(proto.nitric.deploy.v1.HttpTarget, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.deploy.v1.HttpTarget.displayName = 'proto.nitric.deploy.v1.HttpTarget'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.deploy.v1.Http = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.deploy.v1.Http, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.deploy.v1.Http.displayName = 'proto.nitric.deploy.v1.Http'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -459,6 +507,48 @@ if (goog.DEBUG && !COMPILED) { */ proto.nitric.deploy.v1.Api.displayName = 'proto.nitric.deploy.v1.Api'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.deploy.v1.Websocket = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.deploy.v1.Websocket, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.deploy.v1.Websocket.displayName = 'proto.nitric.deploy.v1.Websocket'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.deploy.v1.WebsocketTarget = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.nitric.deploy.v1.WebsocketTarget.oneofGroups_); +}; +goog.inherits(proto.nitric.deploy.v1.WebsocketTarget, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.deploy.v1.WebsocketTarget.displayName = 'proto.nitric.deploy.v1.WebsocketTarget'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -3597,21 +3687,21 @@ proto.nitric.deploy.v1.TopicSubscription.prototype.hasTarget = function() { * @private {!Array>} * @const */ -proto.nitric.deploy.v1.Api.oneofGroups_ = [[1]]; +proto.nitric.deploy.v1.HttpTarget.oneofGroups_ = [[1]]; /** * @enum {number} */ -proto.nitric.deploy.v1.Api.DocumentCase = { - DOCUMENT_NOT_SET: 0, - OPENAPI: 1 +proto.nitric.deploy.v1.HttpTarget.TargetCase = { + TARGET_NOT_SET: 0, + EXECUTION_UNIT: 1 }; /** - * @return {proto.nitric.deploy.v1.Api.DocumentCase} + * @return {proto.nitric.deploy.v1.HttpTarget.TargetCase} */ -proto.nitric.deploy.v1.Api.prototype.getDocumentCase = function() { - return /** @type {proto.nitric.deploy.v1.Api.DocumentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.Api.oneofGroups_[0])); +proto.nitric.deploy.v1.HttpTarget.prototype.getTargetCase = function() { + return /** @type {proto.nitric.deploy.v1.HttpTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.HttpTarget.oneofGroups_[0])); }; @@ -3629,8 +3719,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.deploy.v1.Api.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Api.toObject(opt_includeInstance, this); +proto.nitric.deploy.v1.HttpTarget.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.deploy.v1.HttpTarget.toObject(opt_includeInstance, this); }; @@ -3639,13 +3729,13 @@ proto.nitric.deploy.v1.Api.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.deploy.v1.Api} msg The msg instance to transform. + * @param {!proto.nitric.deploy.v1.HttpTarget} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.deploy.v1.Api.toObject = function(includeInstance, msg) { +proto.nitric.deploy.v1.HttpTarget.toObject = function(includeInstance, msg) { var f, obj = { - openapi: jspb.Message.getFieldWithDefault(msg, 1, "") + executionUnit: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { @@ -3659,23 +3749,23 @@ proto.nitric.deploy.v1.Api.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.deploy.v1.Api} + * @return {!proto.nitric.deploy.v1.HttpTarget} */ -proto.nitric.deploy.v1.Api.deserializeBinary = function(bytes) { +proto.nitric.deploy.v1.HttpTarget.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Api; - return proto.nitric.deploy.v1.Api.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.deploy.v1.HttpTarget; + return proto.nitric.deploy.v1.HttpTarget.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Api} msg The message object to deserialize into. + * @param {!proto.nitric.deploy.v1.HttpTarget} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Api} + * @return {!proto.nitric.deploy.v1.HttpTarget} */ -proto.nitric.deploy.v1.Api.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.deploy.v1.HttpTarget.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3684,7 +3774,7 @@ proto.nitric.deploy.v1.Api.deserializeBinaryFromReader = function(msg, reader) { switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setOpenapi(value); + msg.setExecutionUnit(value); break; default: reader.skipField(); @@ -3699,9 +3789,9 @@ proto.nitric.deploy.v1.Api.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.deploy.v1.Api.prototype.serializeBinary = function() { +proto.nitric.deploy.v1.HttpTarget.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Api.serializeBinaryToWriter(this, writer); + proto.nitric.deploy.v1.HttpTarget.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3709,11 +3799,11 @@ proto.nitric.deploy.v1.Api.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Api} message + * @param {!proto.nitric.deploy.v1.HttpTarget} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.deploy.v1.Api.serializeBinaryToWriter = function(message, writer) { +proto.nitric.deploy.v1.HttpTarget.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {string} */ (jspb.Message.getField(message, 1)); if (f != null) { @@ -3726,29 +3816,29 @@ proto.nitric.deploy.v1.Api.serializeBinaryToWriter = function(message, writer) { /** - * optional string openapi = 1; + * optional string execution_unit = 1; * @return {string} */ -proto.nitric.deploy.v1.Api.prototype.getOpenapi = function() { +proto.nitric.deploy.v1.HttpTarget.prototype.getExecutionUnit = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.nitric.deploy.v1.Api} returns this + * @return {!proto.nitric.deploy.v1.HttpTarget} returns this */ -proto.nitric.deploy.v1.Api.prototype.setOpenapi = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.Api.oneofGroups_[0], value); +proto.nitric.deploy.v1.HttpTarget.prototype.setExecutionUnit = function(value) { + return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.HttpTarget.oneofGroups_[0], value); }; /** * Clears the field making it undefined. - * @return {!proto.nitric.deploy.v1.Api} returns this + * @return {!proto.nitric.deploy.v1.HttpTarget} returns this */ -proto.nitric.deploy.v1.Api.prototype.clearOpenapi = function() { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.Api.oneofGroups_[0], undefined); +proto.nitric.deploy.v1.HttpTarget.prototype.clearExecutionUnit = function() { + return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.HttpTarget.oneofGroups_[0], undefined); }; @@ -3756,37 +3846,12 @@ proto.nitric.deploy.v1.Api.prototype.clearOpenapi = function() { * Returns whether this field is set. * @return {boolean} */ -proto.nitric.deploy.v1.Api.prototype.hasOpenapi = function() { +proto.nitric.deploy.v1.HttpTarget.prototype.hasExecutionUnit = function() { return jspb.Message.getField(this, 1) != null; }; -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_ = [[1]]; - -/** - * @enum {number} - */ -proto.nitric.deploy.v1.ScheduleTarget.TargetCase = { - TARGET_NOT_SET: 0, - EXECUTION_UNIT: 1 -}; - -/** - * @return {proto.nitric.deploy.v1.ScheduleTarget.TargetCase} - */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.getTargetCase = function() { - return /** @type {proto.nitric.deploy.v1.ScheduleTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_[0])); -}; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -3802,8 +3867,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.ScheduleTarget.toObject(opt_includeInstance, this); +proto.nitric.deploy.v1.Http.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.deploy.v1.Http.toObject(opt_includeInstance, this); }; @@ -3812,13 +3877,13 @@ proto.nitric.deploy.v1.ScheduleTarget.prototype.toObject = function(opt_includeI * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.deploy.v1.ScheduleTarget} msg The msg instance to transform. + * @param {!proto.nitric.deploy.v1.Http} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.deploy.v1.ScheduleTarget.toObject = function(includeInstance, msg) { +proto.nitric.deploy.v1.Http.toObject = function(includeInstance, msg) { var f, obj = { - executionUnit: jspb.Message.getFieldWithDefault(msg, 1, "") + target: (f = msg.getTarget()) && proto.nitric.deploy.v1.HttpTarget.toObject(includeInstance, f) }; if (includeInstance) { @@ -3832,23 +3897,23 @@ proto.nitric.deploy.v1.ScheduleTarget.toObject = function(includeInstance, msg) /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.deploy.v1.ScheduleTarget} + * @return {!proto.nitric.deploy.v1.Http} */ -proto.nitric.deploy.v1.ScheduleTarget.deserializeBinary = function(bytes) { +proto.nitric.deploy.v1.Http.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.ScheduleTarget; - return proto.nitric.deploy.v1.ScheduleTarget.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.deploy.v1.Http; + return proto.nitric.deploy.v1.Http.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.ScheduleTarget} msg The message object to deserialize into. + * @param {!proto.nitric.deploy.v1.Http} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.ScheduleTarget} + * @return {!proto.nitric.deploy.v1.Http} */ -proto.nitric.deploy.v1.ScheduleTarget.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.deploy.v1.Http.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3856,8 +3921,9 @@ proto.nitric.deploy.v1.ScheduleTarget.deserializeBinaryFromReader = function(msg var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setExecutionUnit(value); + var value = new proto.nitric.deploy.v1.HttpTarget; + reader.readMessage(value,proto.nitric.deploy.v1.HttpTarget.deserializeBinaryFromReader); + msg.setTarget(value); break; default: reader.skipField(); @@ -3872,9 +3938,9 @@ proto.nitric.deploy.v1.ScheduleTarget.deserializeBinaryFromReader = function(msg * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.serializeBinary = function() { +proto.nitric.deploy.v1.Http.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.ScheduleTarget.serializeBinaryToWriter(this, writer); + proto.nitric.deploy.v1.Http.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3882,46 +3948,48 @@ proto.nitric.deploy.v1.ScheduleTarget.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.ScheduleTarget} message + * @param {!proto.nitric.deploy.v1.Http} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.deploy.v1.ScheduleTarget.serializeBinaryToWriter = function(message, writer) { +proto.nitric.deploy.v1.Http.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); + f = message.getTarget(); if (f != null) { - writer.writeString( + writer.writeMessage( 1, - f + f, + proto.nitric.deploy.v1.HttpTarget.serializeBinaryToWriter ); } }; /** - * optional string execution_unit = 1; - * @return {string} + * optional HttpTarget target = 1; + * @return {?proto.nitric.deploy.v1.HttpTarget} */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.getExecutionUnit = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.nitric.deploy.v1.Http.prototype.getTarget = function() { + return /** @type{?proto.nitric.deploy.v1.HttpTarget} */ ( + jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.HttpTarget, 1)); }; /** - * @param {string} value - * @return {!proto.nitric.deploy.v1.ScheduleTarget} returns this - */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.setExecutionUnit = function(value) { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_[0], value); + * @param {?proto.nitric.deploy.v1.HttpTarget|undefined} value + * @return {!proto.nitric.deploy.v1.Http} returns this +*/ +proto.nitric.deploy.v1.Http.prototype.setTarget = function(value) { + return jspb.Message.setWrapperField(this, 1, value); }; /** - * Clears the field making it undefined. - * @return {!proto.nitric.deploy.v1.ScheduleTarget} returns this + * Clears the message field making it undefined. + * @return {!proto.nitric.deploy.v1.Http} returns this */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.clearExecutionUnit = function() { - return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_[0], undefined); +proto.nitric.deploy.v1.Http.prototype.clearTarget = function() { + return this.setTarget(undefined); }; @@ -3929,12 +3997,37 @@ proto.nitric.deploy.v1.ScheduleTarget.prototype.clearExecutionUnit = function() * Returns whether this field is set. * @return {boolean} */ -proto.nitric.deploy.v1.ScheduleTarget.prototype.hasExecutionUnit = function() { +proto.nitric.deploy.v1.Http.prototype.hasTarget = function() { return jspb.Message.getField(this, 1) != null; }; +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.deploy.v1.Api.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.nitric.deploy.v1.Api.DocumentCase = { + DOCUMENT_NOT_SET: 0, + OPENAPI: 1 +}; + +/** + * @return {proto.nitric.deploy.v1.Api.DocumentCase} + */ +proto.nitric.deploy.v1.Api.prototype.getDocumentCase = function() { + return /** @type {proto.nitric.deploy.v1.Api.DocumentCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.Api.oneofGroups_[0])); +}; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -3950,8 +4043,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.deploy.v1.Schedule.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.deploy.v1.Schedule.toObject(opt_includeInstance, this); +proto.nitric.deploy.v1.Api.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.deploy.v1.Api.toObject(opt_includeInstance, this); }; @@ -3960,14 +4053,13 @@ proto.nitric.deploy.v1.Schedule.prototype.toObject = function(opt_includeInstanc * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.deploy.v1.Schedule} msg The msg instance to transform. + * @param {!proto.nitric.deploy.v1.Api} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.deploy.v1.Schedule.toObject = function(includeInstance, msg) { +proto.nitric.deploy.v1.Api.toObject = function(includeInstance, msg) { var f, obj = { - cron: jspb.Message.getFieldWithDefault(msg, 1, ""), - target: (f = msg.getTarget()) && proto.nitric.deploy.v1.ScheduleTarget.toObject(includeInstance, f) + openapi: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { @@ -3981,23 +4073,23 @@ proto.nitric.deploy.v1.Schedule.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.deploy.v1.Schedule} + * @return {!proto.nitric.deploy.v1.Api} */ -proto.nitric.deploy.v1.Schedule.deserializeBinary = function(bytes) { +proto.nitric.deploy.v1.Api.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.deploy.v1.Schedule; - return proto.nitric.deploy.v1.Schedule.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.deploy.v1.Api; + return proto.nitric.deploy.v1.Api.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.deploy.v1.Schedule} msg The message object to deserialize into. + * @param {!proto.nitric.deploy.v1.Api} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.deploy.v1.Schedule} + * @return {!proto.nitric.deploy.v1.Api} */ -proto.nitric.deploy.v1.Schedule.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.deploy.v1.Api.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -4006,12 +4098,7 @@ proto.nitric.deploy.v1.Schedule.deserializeBinaryFromReader = function(msg, read switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setCron(value); - break; - case 2: - var value = new proto.nitric.deploy.v1.ScheduleTarget; - reader.readMessage(value,proto.nitric.deploy.v1.ScheduleTarget.deserializeBinaryFromReader); - msg.setTarget(value); + msg.setOpenapi(value); break; default: reader.skipField(); @@ -4026,9 +4113,9 @@ proto.nitric.deploy.v1.Schedule.deserializeBinaryFromReader = function(msg, read * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.deploy.v1.Schedule.prototype.serializeBinary = function() { +proto.nitric.deploy.v1.Api.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.deploy.v1.Schedule.serializeBinaryToWriter(this, writer); + proto.nitric.deploy.v1.Api.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -4036,35 +4123,788 @@ proto.nitric.deploy.v1.Schedule.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.deploy.v1.Schedule} message + * @param {!proto.nitric.deploy.v1.Api} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.deploy.v1.Schedule.serializeBinaryToWriter = function(message, writer) { +proto.nitric.deploy.v1.Api.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getCron(); - if (f.length > 0) { + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { writer.writeString( 1, f ); } - f = message.getTarget(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.nitric.deploy.v1.ScheduleTarget.serializeBinaryToWriter - ); - } }; /** - * optional string cron = 1; + * optional string openapi = 1; * @return {string} */ -proto.nitric.deploy.v1.Schedule.prototype.getCron = function() { +proto.nitric.deploy.v1.Api.prototype.getOpenapi = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.deploy.v1.Api} returns this + */ +proto.nitric.deploy.v1.Api.prototype.setOpenapi = function(value) { + return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.Api.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.deploy.v1.Api} returns this + */ +proto.nitric.deploy.v1.Api.prototype.clearOpenapi = function() { + return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.Api.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.deploy.v1.Api.prototype.hasOpenapi = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.deploy.v1.Websocket.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.deploy.v1.Websocket.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.deploy.v1.Websocket} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.deploy.v1.Websocket.toObject = function(includeInstance, msg) { + var f, obj = { + connectTarget: (f = msg.getConnectTarget()) && proto.nitric.deploy.v1.WebsocketTarget.toObject(includeInstance, f), + disconnectTarget: (f = msg.getDisconnectTarget()) && proto.nitric.deploy.v1.WebsocketTarget.toObject(includeInstance, f), + messageTarget: (f = msg.getMessageTarget()) && proto.nitric.deploy.v1.WebsocketTarget.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.deploy.v1.Websocket} + */ +proto.nitric.deploy.v1.Websocket.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.deploy.v1.Websocket; + return proto.nitric.deploy.v1.Websocket.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.deploy.v1.Websocket} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.deploy.v1.Websocket} + */ +proto.nitric.deploy.v1.Websocket.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.deploy.v1.WebsocketTarget; + reader.readMessage(value,proto.nitric.deploy.v1.WebsocketTarget.deserializeBinaryFromReader); + msg.setConnectTarget(value); + break; + case 2: + var value = new proto.nitric.deploy.v1.WebsocketTarget; + reader.readMessage(value,proto.nitric.deploy.v1.WebsocketTarget.deserializeBinaryFromReader); + msg.setDisconnectTarget(value); + break; + case 3: + var value = new proto.nitric.deploy.v1.WebsocketTarget; + reader.readMessage(value,proto.nitric.deploy.v1.WebsocketTarget.deserializeBinaryFromReader); + msg.setMessageTarget(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.deploy.v1.Websocket.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.deploy.v1.Websocket.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.deploy.v1.Websocket} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.deploy.v1.Websocket.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getConnectTarget(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.deploy.v1.WebsocketTarget.serializeBinaryToWriter + ); + } + f = message.getDisconnectTarget(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.deploy.v1.WebsocketTarget.serializeBinaryToWriter + ); + } + f = message.getMessageTarget(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.nitric.deploy.v1.WebsocketTarget.serializeBinaryToWriter + ); + } +}; + + +/** + * optional WebsocketTarget connect_target = 1; + * @return {?proto.nitric.deploy.v1.WebsocketTarget} + */ +proto.nitric.deploy.v1.Websocket.prototype.getConnectTarget = function() { + return /** @type{?proto.nitric.deploy.v1.WebsocketTarget} */ ( + jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.WebsocketTarget, 1)); +}; + + +/** + * @param {?proto.nitric.deploy.v1.WebsocketTarget|undefined} value + * @return {!proto.nitric.deploy.v1.Websocket} returns this +*/ +proto.nitric.deploy.v1.Websocket.prototype.setConnectTarget = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.deploy.v1.Websocket} returns this + */ +proto.nitric.deploy.v1.Websocket.prototype.clearConnectTarget = function() { + return this.setConnectTarget(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.deploy.v1.Websocket.prototype.hasConnectTarget = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional WebsocketTarget disconnect_target = 2; + * @return {?proto.nitric.deploy.v1.WebsocketTarget} + */ +proto.nitric.deploy.v1.Websocket.prototype.getDisconnectTarget = function() { + return /** @type{?proto.nitric.deploy.v1.WebsocketTarget} */ ( + jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.WebsocketTarget, 2)); +}; + + +/** + * @param {?proto.nitric.deploy.v1.WebsocketTarget|undefined} value + * @return {!proto.nitric.deploy.v1.Websocket} returns this +*/ +proto.nitric.deploy.v1.Websocket.prototype.setDisconnectTarget = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.deploy.v1.Websocket} returns this + */ +proto.nitric.deploy.v1.Websocket.prototype.clearDisconnectTarget = function() { + return this.setDisconnectTarget(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.deploy.v1.Websocket.prototype.hasDisconnectTarget = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional WebsocketTarget message_target = 3; + * @return {?proto.nitric.deploy.v1.WebsocketTarget} + */ +proto.nitric.deploy.v1.Websocket.prototype.getMessageTarget = function() { + return /** @type{?proto.nitric.deploy.v1.WebsocketTarget} */ ( + jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.WebsocketTarget, 3)); +}; + + +/** + * @param {?proto.nitric.deploy.v1.WebsocketTarget|undefined} value + * @return {!proto.nitric.deploy.v1.Websocket} returns this +*/ +proto.nitric.deploy.v1.Websocket.prototype.setMessageTarget = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.deploy.v1.Websocket} returns this + */ +proto.nitric.deploy.v1.Websocket.prototype.clearMessageTarget = function() { + return this.setMessageTarget(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.deploy.v1.Websocket.prototype.hasMessageTarget = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.deploy.v1.WebsocketTarget.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.nitric.deploy.v1.WebsocketTarget.TargetCase = { + TARGET_NOT_SET: 0, + EXECUTION_UNIT: 1 +}; + +/** + * @return {proto.nitric.deploy.v1.WebsocketTarget.TargetCase} + */ +proto.nitric.deploy.v1.WebsocketTarget.prototype.getTargetCase = function() { + return /** @type {proto.nitric.deploy.v1.WebsocketTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.WebsocketTarget.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.deploy.v1.WebsocketTarget.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.deploy.v1.WebsocketTarget.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.deploy.v1.WebsocketTarget} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.deploy.v1.WebsocketTarget.toObject = function(includeInstance, msg) { + var f, obj = { + executionUnit: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.deploy.v1.WebsocketTarget} + */ +proto.nitric.deploy.v1.WebsocketTarget.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.deploy.v1.WebsocketTarget; + return proto.nitric.deploy.v1.WebsocketTarget.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.deploy.v1.WebsocketTarget} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.deploy.v1.WebsocketTarget} + */ +proto.nitric.deploy.v1.WebsocketTarget.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setExecutionUnit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.deploy.v1.WebsocketTarget.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.deploy.v1.WebsocketTarget.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.deploy.v1.WebsocketTarget} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.deploy.v1.WebsocketTarget.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string execution_unit = 1; + * @return {string} + */ +proto.nitric.deploy.v1.WebsocketTarget.prototype.getExecutionUnit = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.deploy.v1.WebsocketTarget} returns this + */ +proto.nitric.deploy.v1.WebsocketTarget.prototype.setExecutionUnit = function(value) { + return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.WebsocketTarget.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.deploy.v1.WebsocketTarget} returns this + */ +proto.nitric.deploy.v1.WebsocketTarget.prototype.clearExecutionUnit = function() { + return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.WebsocketTarget.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.deploy.v1.WebsocketTarget.prototype.hasExecutionUnit = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_ = [[1]]; + +/** + * @enum {number} + */ +proto.nitric.deploy.v1.ScheduleTarget.TargetCase = { + TARGET_NOT_SET: 0, + EXECUTION_UNIT: 1 +}; + +/** + * @return {proto.nitric.deploy.v1.ScheduleTarget.TargetCase} + */ +proto.nitric.deploy.v1.ScheduleTarget.prototype.getTargetCase = function() { + return /** @type {proto.nitric.deploy.v1.ScheduleTarget.TargetCase} */(jspb.Message.computeOneofCase(this, proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.deploy.v1.ScheduleTarget.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.deploy.v1.ScheduleTarget.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.deploy.v1.ScheduleTarget} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.deploy.v1.ScheduleTarget.toObject = function(includeInstance, msg) { + var f, obj = { + executionUnit: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.deploy.v1.ScheduleTarget} + */ +proto.nitric.deploy.v1.ScheduleTarget.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.deploy.v1.ScheduleTarget; + return proto.nitric.deploy.v1.ScheduleTarget.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.deploy.v1.ScheduleTarget} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.deploy.v1.ScheduleTarget} + */ +proto.nitric.deploy.v1.ScheduleTarget.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setExecutionUnit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.deploy.v1.ScheduleTarget.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.deploy.v1.ScheduleTarget.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.deploy.v1.ScheduleTarget} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.deploy.v1.ScheduleTarget.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string execution_unit = 1; + * @return {string} + */ +proto.nitric.deploy.v1.ScheduleTarget.prototype.getExecutionUnit = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.deploy.v1.ScheduleTarget} returns this + */ +proto.nitric.deploy.v1.ScheduleTarget.prototype.setExecutionUnit = function(value) { + return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.nitric.deploy.v1.ScheduleTarget} returns this + */ +proto.nitric.deploy.v1.ScheduleTarget.prototype.clearExecutionUnit = function() { + return jspb.Message.setOneofField(this, 1, proto.nitric.deploy.v1.ScheduleTarget.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.deploy.v1.ScheduleTarget.prototype.hasExecutionUnit = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.deploy.v1.Schedule.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.deploy.v1.Schedule.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.deploy.v1.Schedule} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.deploy.v1.Schedule.toObject = function(includeInstance, msg) { + var f, obj = { + cron: jspb.Message.getFieldWithDefault(msg, 1, ""), + target: (f = msg.getTarget()) && proto.nitric.deploy.v1.ScheduleTarget.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.deploy.v1.Schedule} + */ +proto.nitric.deploy.v1.Schedule.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.deploy.v1.Schedule; + return proto.nitric.deploy.v1.Schedule.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.deploy.v1.Schedule} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.deploy.v1.Schedule} + */ +proto.nitric.deploy.v1.Schedule.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setCron(value); + break; + case 2: + var value = new proto.nitric.deploy.v1.ScheduleTarget; + reader.readMessage(value,proto.nitric.deploy.v1.ScheduleTarget.deserializeBinaryFromReader); + msg.setTarget(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.deploy.v1.Schedule.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.deploy.v1.Schedule.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.deploy.v1.Schedule} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.deploy.v1.Schedule.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCron(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getTarget(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nitric.deploy.v1.ScheduleTarget.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string cron = 1; + * @return {string} + */ +proto.nitric.deploy.v1.Schedule.prototype.getCron = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; @@ -4124,7 +4964,7 @@ proto.nitric.deploy.v1.Schedule.prototype.hasTarget = function() { * @private {!Array>} * @const */ -proto.nitric.deploy.v1.Resource.oneofGroups_ = [[10,11,12,13,14,15,16,17,18]]; +proto.nitric.deploy.v1.Resource.oneofGroups_ = [[10,11,12,13,14,15,16,17,18,19,20]]; /** * @enum {number} @@ -4139,7 +4979,9 @@ proto.nitric.deploy.v1.Resource.ConfigCase = { POLICY: 15, SCHEDULE: 16, COLLECTION: 17, - SECRET: 18 + SECRET: 18, + WEBSOCKET: 19, + HTTP: 20 }; /** @@ -4190,7 +5032,9 @@ proto.nitric.deploy.v1.Resource.toObject = function(includeInstance, msg) { policy: (f = msg.getPolicy()) && proto.nitric.deploy.v1.Policy.toObject(includeInstance, f), schedule: (f = msg.getSchedule()) && proto.nitric.deploy.v1.Schedule.toObject(includeInstance, f), collection: (f = msg.getCollection()) && proto.nitric.deploy.v1.Collection.toObject(includeInstance, f), - secret: (f = msg.getSecret()) && proto.nitric.deploy.v1.Secret.toObject(includeInstance, f) + secret: (f = msg.getSecret()) && proto.nitric.deploy.v1.Secret.toObject(includeInstance, f), + websocket: (f = msg.getWebsocket()) && proto.nitric.deploy.v1.Websocket.toObject(includeInstance, f), + http: (f = msg.getHttp()) && proto.nitric.deploy.v1.Http.toObject(includeInstance, f) }; if (includeInstance) { @@ -4280,6 +5124,16 @@ proto.nitric.deploy.v1.Resource.deserializeBinaryFromReader = function(msg, read reader.readMessage(value,proto.nitric.deploy.v1.Secret.deserializeBinaryFromReader); msg.setSecret(value); break; + case 19: + var value = new proto.nitric.deploy.v1.Websocket; + reader.readMessage(value,proto.nitric.deploy.v1.Websocket.deserializeBinaryFromReader); + msg.setWebsocket(value); + break; + case 20: + var value = new proto.nitric.deploy.v1.Http; + reader.readMessage(value,proto.nitric.deploy.v1.Http.deserializeBinaryFromReader); + msg.setHttp(value); + break; default: reader.skipField(); break; @@ -4395,6 +5249,22 @@ proto.nitric.deploy.v1.Resource.serializeBinaryToWriter = function(message, writ proto.nitric.deploy.v1.Secret.serializeBinaryToWriter ); } + f = message.getWebsocket(); + if (f != null) { + writer.writeMessage( + 19, + f, + proto.nitric.deploy.v1.Websocket.serializeBinaryToWriter + ); + } + f = message.getHttp(); + if (f != null) { + writer.writeMessage( + 20, + f, + proto.nitric.deploy.v1.Http.serializeBinaryToWriter + ); + } }; @@ -4767,6 +5637,80 @@ proto.nitric.deploy.v1.Resource.prototype.hasSecret = function() { }; +/** + * optional Websocket websocket = 19; + * @return {?proto.nitric.deploy.v1.Websocket} + */ +proto.nitric.deploy.v1.Resource.prototype.getWebsocket = function() { + return /** @type{?proto.nitric.deploy.v1.Websocket} */ ( + jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Websocket, 19)); +}; + + +/** + * @param {?proto.nitric.deploy.v1.Websocket|undefined} value + * @return {!proto.nitric.deploy.v1.Resource} returns this +*/ +proto.nitric.deploy.v1.Resource.prototype.setWebsocket = function(value) { + return jspb.Message.setOneofWrapperField(this, 19, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.deploy.v1.Resource} returns this + */ +proto.nitric.deploy.v1.Resource.prototype.clearWebsocket = function() { + return this.setWebsocket(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.deploy.v1.Resource.prototype.hasWebsocket = function() { + return jspb.Message.getField(this, 19) != null; +}; + + +/** + * optional Http http = 20; + * @return {?proto.nitric.deploy.v1.Http} + */ +proto.nitric.deploy.v1.Resource.prototype.getHttp = function() { + return /** @type{?proto.nitric.deploy.v1.Http} */ ( + jspb.Message.getWrapperField(this, proto.nitric.deploy.v1.Http, 20)); +}; + + +/** + * @param {?proto.nitric.deploy.v1.Http|undefined} value + * @return {!proto.nitric.deploy.v1.Resource} returns this +*/ +proto.nitric.deploy.v1.Resource.prototype.setHttp = function(value) { + return jspb.Message.setOneofWrapperField(this, 20, proto.nitric.deploy.v1.Resource.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.deploy.v1.Resource} returns this + */ +proto.nitric.deploy.v1.Resource.prototype.clearHttp = function() { + return this.setHttp(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.deploy.v1.Resource.prototype.hasHttp = function() { + return jspb.Message.getField(this, 20) != null; +}; + + /** * List of repeated fields within this message type. diff --git a/src/gen/proto/faas/v1/faas_pb.d.ts b/src/gen/proto/faas/v1/faas_pb.d.ts index 509de0cf..34f0a246 100644 --- a/src/gen/proto/faas/v1/faas_pb.d.ts +++ b/src/gen/proto/faas/v1/faas_pb.d.ts @@ -261,6 +261,26 @@ export namespace ScheduleCron { } } +export class HttpWorker extends jspb.Message { + getPort(): number; + setPort(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HttpWorker.AsObject; + static toObject(includeInstance: boolean, msg: HttpWorker): HttpWorker.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: HttpWorker, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HttpWorker; + static deserializeBinaryFromReader(message: HttpWorker, reader: jspb.BinaryReader): HttpWorker; +} + +export namespace HttpWorker { + export type AsObject = { + port: number, + } +} + export class BucketNotificationWorker extends jspb.Message { getBucket(): string; setBucket(value: string): void; @@ -311,6 +331,30 @@ export namespace BucketNotificationConfig { } } +export class WebsocketWorker extends jspb.Message { + getSocket(): string; + setSocket(value: string): void; + + getEvent(): WebsocketEventMap[keyof WebsocketEventMap]; + setEvent(value: WebsocketEventMap[keyof WebsocketEventMap]): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketWorker.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketWorker): WebsocketWorker.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketWorker, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketWorker; + static deserializeBinaryFromReader(message: WebsocketWorker, reader: jspb.BinaryReader): WebsocketWorker; +} + +export namespace WebsocketWorker { + export type AsObject = { + socket: string, + event: WebsocketEventMap[keyof WebsocketEventMap], + } +} + export class InitRequest extends jspb.Message { hasApi(): boolean; clearApi(): void; @@ -332,6 +376,16 @@ export class InitRequest extends jspb.Message { getBucketNotification(): BucketNotificationWorker | undefined; setBucketNotification(value?: BucketNotificationWorker): void; + hasWebsocket(): boolean; + clearWebsocket(): void; + getWebsocket(): WebsocketWorker | undefined; + setWebsocket(value?: WebsocketWorker): void; + + hasHttpWorker(): boolean; + clearHttpWorker(): void; + getHttpWorker(): HttpWorker | undefined; + setHttpWorker(value?: HttpWorker): void; + getWorkerCase(): InitRequest.WorkerCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): InitRequest.AsObject; @@ -349,6 +403,8 @@ export namespace InitRequest { subscription?: SubscriptionWorker.AsObject, schedule?: ScheduleWorker.AsObject, bucketNotification?: BucketNotificationWorker.AsObject, + websocket?: WebsocketWorker.AsObject, + httpWorker?: HttpWorker.AsObject, } export enum WorkerCase { @@ -357,6 +413,8 @@ export namespace InitRequest { SUBSCRIPTION = 11, SCHEDULE = 12, BUCKET_NOTIFICATION = 13, + WEBSOCKET = 14, + HTTP_WORKER = 15, } } @@ -424,6 +482,11 @@ export class TriggerRequest extends jspb.Message { getNotification(): NotificationTriggerContext | undefined; setNotification(value?: NotificationTriggerContext): void; + hasWebsocket(): boolean; + clearWebsocket(): void; + getWebsocket(): WebsocketTriggerContext | undefined; + setWebsocket(value?: WebsocketTriggerContext): void; + getContextCase(): TriggerRequest.ContextCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TriggerRequest.AsObject; @@ -443,6 +506,7 @@ export namespace TriggerRequest { http?: HttpTriggerContext.AsObject, topic?: TopicTriggerContext.AsObject, notification?: NotificationTriggerContext.AsObject, + websocket?: WebsocketTriggerContext.AsObject, } export enum ContextCase { @@ -450,6 +514,7 @@ export namespace TriggerRequest { HTTP = 3, TOPIC = 4, NOTIFICATION = 5, + WEBSOCKET = 6, } } @@ -612,6 +677,34 @@ export namespace NotificationTriggerContext { } } +export class WebsocketTriggerContext extends jspb.Message { + getSocket(): string; + setSocket(value: string): void; + + getEvent(): WebsocketEventMap[keyof WebsocketEventMap]; + setEvent(value: WebsocketEventMap[keyof WebsocketEventMap]): void; + + getConnectionid(): string; + setConnectionid(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketTriggerContext.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketTriggerContext): WebsocketTriggerContext.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketTriggerContext, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketTriggerContext; + static deserializeBinaryFromReader(message: WebsocketTriggerContext, reader: jspb.BinaryReader): WebsocketTriggerContext; +} + +export namespace WebsocketTriggerContext { + export type AsObject = { + socket: string, + event: WebsocketEventMap[keyof WebsocketEventMap], + connectionid: string, + } +} + export class TriggerResponse extends jspb.Message { getData(): Uint8Array | string; getData_asU8(): Uint8Array; @@ -633,6 +726,11 @@ export class TriggerResponse extends jspb.Message { getNotification(): NotificationResponseContext | undefined; setNotification(value?: NotificationResponseContext): void; + hasWebsocket(): boolean; + clearWebsocket(): void; + getWebsocket(): WebsocketResponseContext | undefined; + setWebsocket(value?: WebsocketResponseContext): void; + getContextCase(): TriggerResponse.ContextCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TriggerResponse.AsObject; @@ -650,6 +748,7 @@ export namespace TriggerResponse { http?: HttpResponseContext.AsObject, topic?: TopicResponseContext.AsObject, notification?: NotificationResponseContext.AsObject, + websocket?: WebsocketResponseContext.AsObject, } export enum ContextCase { @@ -657,6 +756,7 @@ export namespace TriggerResponse { HTTP = 10, TOPIC = 11, NOTIFICATION = 12, + WEBSOCKET = 13, } } @@ -726,6 +826,26 @@ export namespace NotificationResponseContext { } } +export class WebsocketResponseContext extends jspb.Message { + getSuccess(): boolean; + setSuccess(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketResponseContext.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketResponseContext): WebsocketResponseContext.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketResponseContext, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketResponseContext; + static deserializeBinaryFromReader(message: WebsocketResponseContext, reader: jspb.BinaryReader): WebsocketResponseContext; +} + +export namespace WebsocketResponseContext { + export type AsObject = { + success: boolean, + } +} + export interface BucketNotificationTypeMap { ALL: 0; CREATED: 1; @@ -734,3 +854,11 @@ export interface BucketNotificationTypeMap { export const BucketNotificationType: BucketNotificationTypeMap; +export interface WebsocketEventMap { + CONNECT: 0; + DISCONNECT: 1; + MESSAGE: 2; +} + +export const WebsocketEvent: WebsocketEventMap; + diff --git a/src/gen/proto/faas/v1/faas_pb.js b/src/gen/proto/faas/v1/faas_pb.js index 38d391a0..586137e3 100644 --- a/src/gen/proto/faas/v1/faas_pb.js +++ b/src/gen/proto/faas/v1/faas_pb.js @@ -33,6 +33,7 @@ goog.exportSymbol('proto.nitric.faas.v1.ClientMessage.ContentCase', null, global goog.exportSymbol('proto.nitric.faas.v1.HeaderValue', null, global); goog.exportSymbol('proto.nitric.faas.v1.HttpResponseContext', null, global); goog.exportSymbol('proto.nitric.faas.v1.HttpTriggerContext', null, global); +goog.exportSymbol('proto.nitric.faas.v1.HttpWorker', null, global); goog.exportSymbol('proto.nitric.faas.v1.InitRequest', null, global); goog.exportSymbol('proto.nitric.faas.v1.InitRequest.WorkerCase', null, global); goog.exportSymbol('proto.nitric.faas.v1.InitResponse', null, global); @@ -54,6 +55,10 @@ goog.exportSymbol('proto.nitric.faas.v1.TriggerRequest', null, global); goog.exportSymbol('proto.nitric.faas.v1.TriggerRequest.ContextCase', null, global); goog.exportSymbol('proto.nitric.faas.v1.TriggerResponse', null, global); goog.exportSymbol('proto.nitric.faas.v1.TriggerResponse.ContextCase', null, global); +goog.exportSymbol('proto.nitric.faas.v1.WebsocketEvent', null, global); +goog.exportSymbol('proto.nitric.faas.v1.WebsocketResponseContext', null, global); +goog.exportSymbol('proto.nitric.faas.v1.WebsocketTriggerContext', null, global); +goog.exportSymbol('proto.nitric.faas.v1.WebsocketWorker', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -243,6 +248,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.nitric.faas.v1.ScheduleCron.displayName = 'proto.nitric.faas.v1.ScheduleCron'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.faas.v1.HttpWorker = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.faas.v1.HttpWorker, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.faas.v1.HttpWorker.displayName = 'proto.nitric.faas.v1.HttpWorker'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -285,6 +311,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.nitric.faas.v1.BucketNotificationConfig.displayName = 'proto.nitric.faas.v1.BucketNotificationConfig'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.faas.v1.WebsocketWorker = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.faas.v1.WebsocketWorker, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.faas.v1.WebsocketWorker.displayName = 'proto.nitric.faas.v1.WebsocketWorker'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -495,6 +542,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.nitric.faas.v1.NotificationTriggerContext.displayName = 'proto.nitric.faas.v1.NotificationTriggerContext'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.faas.v1.WebsocketTriggerContext = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.faas.v1.WebsocketTriggerContext, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.faas.v1.WebsocketTriggerContext.displayName = 'proto.nitric.faas.v1.WebsocketTriggerContext'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -579,6 +647,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.nitric.faas.v1.NotificationResponseContext.displayName = 'proto.nitric.faas.v1.NotificationResponseContext'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.faas.v1.WebsocketResponseContext = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.faas.v1.WebsocketResponseContext, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.faas.v1.WebsocketResponseContext.displayName = 'proto.nitric.faas.v1.WebsocketResponseContext'; +} /** * Oneof group definitions for this message. Each group defines the field @@ -2332,6 +2421,136 @@ proto.nitric.faas.v1.ScheduleCron.prototype.setCron = function(value) { +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.faas.v1.HttpWorker.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.HttpWorker.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.faas.v1.HttpWorker} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.faas.v1.HttpWorker.toObject = function(includeInstance, msg) { + var f, obj = { + port: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.faas.v1.HttpWorker} + */ +proto.nitric.faas.v1.HttpWorker.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.faas.v1.HttpWorker; + return proto.nitric.faas.v1.HttpWorker.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.faas.v1.HttpWorker} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.faas.v1.HttpWorker} + */ +proto.nitric.faas.v1.HttpWorker.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setPort(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.faas.v1.HttpWorker.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.faas.v1.HttpWorker.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.faas.v1.HttpWorker} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.faas.v1.HttpWorker.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPort(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } +}; + + +/** + * optional int32 port = 1; + * @return {number} + */ +proto.nitric.faas.v1.HttpWorker.prototype.getPort = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.nitric.faas.v1.HttpWorker} returns this + */ +proto.nitric.faas.v1.HttpWorker.prototype.setPort = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -2671,34 +2890,6 @@ proto.nitric.faas.v1.BucketNotificationConfig.prototype.setNotificationPrefixFil -/** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.faas.v1.InitRequest.oneofGroups_ = [[10,11,12,13]]; - -/** - * @enum {number} - */ -proto.nitric.faas.v1.InitRequest.WorkerCase = { - WORKER_NOT_SET: 0, - API: 10, - SUBSCRIPTION: 11, - SCHEDULE: 12, - BUCKET_NOTIFICATION: 13 -}; - -/** - * @return {proto.nitric.faas.v1.InitRequest.WorkerCase} - */ -proto.nitric.faas.v1.InitRequest.prototype.getWorkerCase = function() { - return /** @type {proto.nitric.faas.v1.InitRequest.WorkerCase} */(jspb.Message.computeOneofCase(this, proto.nitric.faas.v1.InitRequest.oneofGroups_[0])); -}; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -2714,8 +2905,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.faas.v1.InitRequest.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.InitRequest.toObject(opt_includeInstance, this); +proto.nitric.faas.v1.WebsocketWorker.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.WebsocketWorker.toObject(opt_includeInstance, this); }; @@ -2724,16 +2915,14 @@ proto.nitric.faas.v1.InitRequest.prototype.toObject = function(opt_includeInstan * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.faas.v1.InitRequest} msg The msg instance to transform. + * @param {!proto.nitric.faas.v1.WebsocketWorker} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.faas.v1.InitRequest.toObject = function(includeInstance, msg) { +proto.nitric.faas.v1.WebsocketWorker.toObject = function(includeInstance, msg) { var f, obj = { - api: (f = msg.getApi()) && proto.nitric.faas.v1.ApiWorker.toObject(includeInstance, f), - subscription: (f = msg.getSubscription()) && proto.nitric.faas.v1.SubscriptionWorker.toObject(includeInstance, f), - schedule: (f = msg.getSchedule()) && proto.nitric.faas.v1.ScheduleWorker.toObject(includeInstance, f), - bucketNotification: (f = msg.getBucketNotification()) && proto.nitric.faas.v1.BucketNotificationWorker.toObject(includeInstance, f) + socket: jspb.Message.getFieldWithDefault(msg, 1, ""), + event: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { @@ -2747,48 +2936,36 @@ proto.nitric.faas.v1.InitRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.InitRequest} + * @return {!proto.nitric.faas.v1.WebsocketWorker} */ -proto.nitric.faas.v1.InitRequest.deserializeBinary = function(bytes) { +proto.nitric.faas.v1.WebsocketWorker.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.InitRequest; - return proto.nitric.faas.v1.InitRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.faas.v1.WebsocketWorker; + return proto.nitric.faas.v1.WebsocketWorker.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.faas.v1.InitRequest} msg The message object to deserialize into. + * @param {!proto.nitric.faas.v1.WebsocketWorker} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.InitRequest} + * @return {!proto.nitric.faas.v1.WebsocketWorker} */ -proto.nitric.faas.v1.InitRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.faas.v1.WebsocketWorker.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { - case 10: - var value = new proto.nitric.faas.v1.ApiWorker; - reader.readMessage(value,proto.nitric.faas.v1.ApiWorker.deserializeBinaryFromReader); - msg.setApi(value); - break; - case 11: - var value = new proto.nitric.faas.v1.SubscriptionWorker; - reader.readMessage(value,proto.nitric.faas.v1.SubscriptionWorker.deserializeBinaryFromReader); - msg.setSubscription(value); - break; - case 12: - var value = new proto.nitric.faas.v1.ScheduleWorker; - reader.readMessage(value,proto.nitric.faas.v1.ScheduleWorker.deserializeBinaryFromReader); - msg.setSchedule(value); + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSocket(value); break; - case 13: - var value = new proto.nitric.faas.v1.BucketNotificationWorker; - reader.readMessage(value,proto.nitric.faas.v1.BucketNotificationWorker.deserializeBinaryFromReader); - msg.setBucketNotification(value); + case 2: + var value = /** @type {!proto.nitric.faas.v1.WebsocketEvent} */ (reader.readEnum()); + msg.setEvent(value); break; default: reader.skipField(); @@ -2803,9 +2980,9 @@ proto.nitric.faas.v1.InitRequest.deserializeBinaryFromReader = function(msg, rea * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.faas.v1.InitRequest.prototype.serializeBinary = function() { +proto.nitric.faas.v1.WebsocketWorker.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.InitRequest.serializeBinaryToWriter(this, writer); + proto.nitric.faas.v1.WebsocketWorker.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2813,23 +2990,239 @@ proto.nitric.faas.v1.InitRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.InitRequest} message + * @param {!proto.nitric.faas.v1.WebsocketWorker} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.faas.v1.InitRequest.serializeBinaryToWriter = function(message, writer) { +proto.nitric.faas.v1.WebsocketWorker.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getApi(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.nitric.faas.v1.ApiWorker.serializeBinaryToWriter + f = message.getSocket(); + if (f.length > 0) { + writer.writeString( + 1, + f ); } - f = message.getSubscription(); - if (f != null) { - writer.writeMessage( + f = message.getEvent(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } +}; + + +/** + * optional string socket = 1; + * @return {string} + */ +proto.nitric.faas.v1.WebsocketWorker.prototype.getSocket = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.faas.v1.WebsocketWorker} returns this + */ +proto.nitric.faas.v1.WebsocketWorker.prototype.setSocket = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional WebsocketEvent event = 2; + * @return {!proto.nitric.faas.v1.WebsocketEvent} + */ +proto.nitric.faas.v1.WebsocketWorker.prototype.getEvent = function() { + return /** @type {!proto.nitric.faas.v1.WebsocketEvent} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {!proto.nitric.faas.v1.WebsocketEvent} value + * @return {!proto.nitric.faas.v1.WebsocketWorker} returns this + */ +proto.nitric.faas.v1.WebsocketWorker.prototype.setEvent = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.faas.v1.InitRequest.oneofGroups_ = [[10,11,12,13,14,15]]; + +/** + * @enum {number} + */ +proto.nitric.faas.v1.InitRequest.WorkerCase = { + WORKER_NOT_SET: 0, + API: 10, + SUBSCRIPTION: 11, + SCHEDULE: 12, + BUCKET_NOTIFICATION: 13, + WEBSOCKET: 14, + HTTP_WORKER: 15 +}; + +/** + * @return {proto.nitric.faas.v1.InitRequest.WorkerCase} + */ +proto.nitric.faas.v1.InitRequest.prototype.getWorkerCase = function() { + return /** @type {proto.nitric.faas.v1.InitRequest.WorkerCase} */(jspb.Message.computeOneofCase(this, proto.nitric.faas.v1.InitRequest.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.faas.v1.InitRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.InitRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.faas.v1.InitRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.faas.v1.InitRequest.toObject = function(includeInstance, msg) { + var f, obj = { + api: (f = msg.getApi()) && proto.nitric.faas.v1.ApiWorker.toObject(includeInstance, f), + subscription: (f = msg.getSubscription()) && proto.nitric.faas.v1.SubscriptionWorker.toObject(includeInstance, f), + schedule: (f = msg.getSchedule()) && proto.nitric.faas.v1.ScheduleWorker.toObject(includeInstance, f), + bucketNotification: (f = msg.getBucketNotification()) && proto.nitric.faas.v1.BucketNotificationWorker.toObject(includeInstance, f), + websocket: (f = msg.getWebsocket()) && proto.nitric.faas.v1.WebsocketWorker.toObject(includeInstance, f), + httpWorker: (f = msg.getHttpWorker()) && proto.nitric.faas.v1.HttpWorker.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.faas.v1.InitRequest} + */ +proto.nitric.faas.v1.InitRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.faas.v1.InitRequest; + return proto.nitric.faas.v1.InitRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.faas.v1.InitRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.faas.v1.InitRequest} + */ +proto.nitric.faas.v1.InitRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 10: + var value = new proto.nitric.faas.v1.ApiWorker; + reader.readMessage(value,proto.nitric.faas.v1.ApiWorker.deserializeBinaryFromReader); + msg.setApi(value); + break; + case 11: + var value = new proto.nitric.faas.v1.SubscriptionWorker; + reader.readMessage(value,proto.nitric.faas.v1.SubscriptionWorker.deserializeBinaryFromReader); + msg.setSubscription(value); + break; + case 12: + var value = new proto.nitric.faas.v1.ScheduleWorker; + reader.readMessage(value,proto.nitric.faas.v1.ScheduleWorker.deserializeBinaryFromReader); + msg.setSchedule(value); + break; + case 13: + var value = new proto.nitric.faas.v1.BucketNotificationWorker; + reader.readMessage(value,proto.nitric.faas.v1.BucketNotificationWorker.deserializeBinaryFromReader); + msg.setBucketNotification(value); + break; + case 14: + var value = new proto.nitric.faas.v1.WebsocketWorker; + reader.readMessage(value,proto.nitric.faas.v1.WebsocketWorker.deserializeBinaryFromReader); + msg.setWebsocket(value); + break; + case 15: + var value = new proto.nitric.faas.v1.HttpWorker; + reader.readMessage(value,proto.nitric.faas.v1.HttpWorker.deserializeBinaryFromReader); + msg.setHttpWorker(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.faas.v1.InitRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.faas.v1.InitRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.faas.v1.InitRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.faas.v1.InitRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getApi(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.nitric.faas.v1.ApiWorker.serializeBinaryToWriter + ); + } + f = message.getSubscription(); + if (f != null) { + writer.writeMessage( 11, f, proto.nitric.faas.v1.SubscriptionWorker.serializeBinaryToWriter @@ -2851,6 +3244,22 @@ proto.nitric.faas.v1.InitRequest.serializeBinaryToWriter = function(message, wri proto.nitric.faas.v1.BucketNotificationWorker.serializeBinaryToWriter ); } + f = message.getWebsocket(); + if (f != null) { + writer.writeMessage( + 14, + f, + proto.nitric.faas.v1.WebsocketWorker.serializeBinaryToWriter + ); + } + f = message.getHttpWorker(); + if (f != null) { + writer.writeMessage( + 15, + f, + proto.nitric.faas.v1.HttpWorker.serializeBinaryToWriter + ); + } }; @@ -3002,6 +3411,80 @@ proto.nitric.faas.v1.InitRequest.prototype.hasBucketNotification = function() { }; +/** + * optional WebsocketWorker websocket = 14; + * @return {?proto.nitric.faas.v1.WebsocketWorker} + */ +proto.nitric.faas.v1.InitRequest.prototype.getWebsocket = function() { + return /** @type{?proto.nitric.faas.v1.WebsocketWorker} */ ( + jspb.Message.getWrapperField(this, proto.nitric.faas.v1.WebsocketWorker, 14)); +}; + + +/** + * @param {?proto.nitric.faas.v1.WebsocketWorker|undefined} value + * @return {!proto.nitric.faas.v1.InitRequest} returns this +*/ +proto.nitric.faas.v1.InitRequest.prototype.setWebsocket = function(value) { + return jspb.Message.setOneofWrapperField(this, 14, proto.nitric.faas.v1.InitRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.faas.v1.InitRequest} returns this + */ +proto.nitric.faas.v1.InitRequest.prototype.clearWebsocket = function() { + return this.setWebsocket(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.faas.v1.InitRequest.prototype.hasWebsocket = function() { + return jspb.Message.getField(this, 14) != null; +}; + + +/** + * optional HttpWorker http_worker = 15; + * @return {?proto.nitric.faas.v1.HttpWorker} + */ +proto.nitric.faas.v1.InitRequest.prototype.getHttpWorker = function() { + return /** @type{?proto.nitric.faas.v1.HttpWorker} */ ( + jspb.Message.getWrapperField(this, proto.nitric.faas.v1.HttpWorker, 15)); +}; + + +/** + * @param {?proto.nitric.faas.v1.HttpWorker|undefined} value + * @return {!proto.nitric.faas.v1.InitRequest} returns this +*/ +proto.nitric.faas.v1.InitRequest.prototype.setHttpWorker = function(value) { + return jspb.Message.setOneofWrapperField(this, 15, proto.nitric.faas.v1.InitRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.faas.v1.InitRequest} returns this + */ +proto.nitric.faas.v1.InitRequest.prototype.clearHttpWorker = function() { + return this.setHttpWorker(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.faas.v1.InitRequest.prototype.hasHttpWorker = function() { + return jspb.Message.getField(this, 15) != null; +}; + + @@ -3245,7 +3728,7 @@ proto.nitric.faas.v1.TraceContext.prototype.clearValuesMap = function() { * @private {!Array>} * @const */ -proto.nitric.faas.v1.TriggerRequest.oneofGroups_ = [[3,4,5]]; +proto.nitric.faas.v1.TriggerRequest.oneofGroups_ = [[3,4,5,6]]; /** * @enum {number} @@ -3254,7 +3737,8 @@ proto.nitric.faas.v1.TriggerRequest.ContextCase = { CONTEXT_NOT_SET: 0, HTTP: 3, TOPIC: 4, - NOTIFICATION: 5 + NOTIFICATION: 5, + WEBSOCKET: 6 }; /** @@ -3300,7 +3784,8 @@ proto.nitric.faas.v1.TriggerRequest.toObject = function(includeInstance, msg) { traceContext: (f = msg.getTraceContext()) && proto.nitric.faas.v1.TraceContext.toObject(includeInstance, f), http: (f = msg.getHttp()) && proto.nitric.faas.v1.HttpTriggerContext.toObject(includeInstance, f), topic: (f = msg.getTopic()) && proto.nitric.faas.v1.TopicTriggerContext.toObject(includeInstance, f), - notification: (f = msg.getNotification()) && proto.nitric.faas.v1.NotificationTriggerContext.toObject(includeInstance, f) + notification: (f = msg.getNotification()) && proto.nitric.faas.v1.NotificationTriggerContext.toObject(includeInstance, f), + websocket: (f = msg.getWebsocket()) && proto.nitric.faas.v1.WebsocketTriggerContext.toObject(includeInstance, f) }; if (includeInstance) { @@ -3365,6 +3850,11 @@ proto.nitric.faas.v1.TriggerRequest.deserializeBinaryFromReader = function(msg, reader.readMessage(value,proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinaryFromReader); msg.setNotification(value); break; + case 6: + var value = new proto.nitric.faas.v1.WebsocketTriggerContext; + reader.readMessage(value,proto.nitric.faas.v1.WebsocketTriggerContext.deserializeBinaryFromReader); + msg.setWebsocket(value); + break; default: reader.skipField(); break; @@ -3440,6 +3930,14 @@ proto.nitric.faas.v1.TriggerRequest.serializeBinaryToWriter = function(message, proto.nitric.faas.v1.NotificationTriggerContext.serializeBinaryToWriter ); } + f = message.getWebsocket(); + if (f != null) { + writer.writeMessage( + 6, + f, + proto.nitric.faas.v1.WebsocketTriggerContext.serializeBinaryToWriter + ); + } }; @@ -3651,6 +4149,43 @@ proto.nitric.faas.v1.TriggerRequest.prototype.hasNotification = function() { }; +/** + * optional WebsocketTriggerContext websocket = 6; + * @return {?proto.nitric.faas.v1.WebsocketTriggerContext} + */ +proto.nitric.faas.v1.TriggerRequest.prototype.getWebsocket = function() { + return /** @type{?proto.nitric.faas.v1.WebsocketTriggerContext} */ ( + jspb.Message.getWrapperField(this, proto.nitric.faas.v1.WebsocketTriggerContext, 6)); +}; + + +/** + * @param {?proto.nitric.faas.v1.WebsocketTriggerContext|undefined} value + * @return {!proto.nitric.faas.v1.TriggerRequest} returns this +*/ +proto.nitric.faas.v1.TriggerRequest.prototype.setWebsocket = function(value) { + return jspb.Message.setOneofWrapperField(this, 6, proto.nitric.faas.v1.TriggerRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.faas.v1.TriggerRequest} returns this + */ +proto.nitric.faas.v1.TriggerRequest.prototype.clearWebsocket = function() { + return this.setWebsocket(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.faas.v1.TriggerRequest.prototype.hasWebsocket = function() { + return jspb.Message.getField(this, 6) != null; +}; + + /** * List of repeated fields within this message type. @@ -4578,34 +5113,215 @@ proto.nitric.faas.v1.BucketNotification.prototype.setType = function(value) { }; - + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.nitric.faas.v1.NotificationTriggerContext.oneofGroups_ = [[10]]; + +/** + * @enum {number} + */ +proto.nitric.faas.v1.NotificationTriggerContext.NotificationCase = { + NOTIFICATION_NOT_SET: 0, + BUCKET: 10 +}; + +/** + * @return {proto.nitric.faas.v1.NotificationTriggerContext.NotificationCase} + */ +proto.nitric.faas.v1.NotificationTriggerContext.prototype.getNotificationCase = function() { + return /** @type {proto.nitric.faas.v1.NotificationTriggerContext.NotificationCase} */(jspb.Message.computeOneofCase(this, proto.nitric.faas.v1.NotificationTriggerContext.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.faas.v1.NotificationTriggerContext.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.NotificationTriggerContext.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.faas.v1.NotificationTriggerContext} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.faas.v1.NotificationTriggerContext.toObject = function(includeInstance, msg) { + var f, obj = { + source: jspb.Message.getFieldWithDefault(msg, 1, ""), + bucket: (f = msg.getBucket()) && proto.nitric.faas.v1.BucketNotification.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.faas.v1.NotificationTriggerContext} + */ +proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.faas.v1.NotificationTriggerContext; + return proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.faas.v1.NotificationTriggerContext} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.faas.v1.NotificationTriggerContext} + */ +proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSource(value); + break; + case 10: + var value = new proto.nitric.faas.v1.BucketNotification; + reader.readMessage(value,proto.nitric.faas.v1.BucketNotification.deserializeBinaryFromReader); + msg.setBucket(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.faas.v1.NotificationTriggerContext.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.faas.v1.NotificationTriggerContext.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.faas.v1.NotificationTriggerContext} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.faas.v1.NotificationTriggerContext.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSource(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getBucket(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.nitric.faas.v1.BucketNotification.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string source = 1; + * @return {string} + */ +proto.nitric.faas.v1.NotificationTriggerContext.prototype.getSource = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.faas.v1.NotificationTriggerContext} returns this + */ +proto.nitric.faas.v1.NotificationTriggerContext.prototype.setSource = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional BucketNotification bucket = 10; + * @return {?proto.nitric.faas.v1.BucketNotification} + */ +proto.nitric.faas.v1.NotificationTriggerContext.prototype.getBucket = function() { + return /** @type{?proto.nitric.faas.v1.BucketNotification} */ ( + jspb.Message.getWrapperField(this, proto.nitric.faas.v1.BucketNotification, 10)); +}; + + /** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const - */ -proto.nitric.faas.v1.NotificationTriggerContext.oneofGroups_ = [[10]]; + * @param {?proto.nitric.faas.v1.BucketNotification|undefined} value + * @return {!proto.nitric.faas.v1.NotificationTriggerContext} returns this +*/ +proto.nitric.faas.v1.NotificationTriggerContext.prototype.setBucket = function(value) { + return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.faas.v1.NotificationTriggerContext.oneofGroups_[0], value); +}; + /** - * @enum {number} + * Clears the message field making it undefined. + * @return {!proto.nitric.faas.v1.NotificationTriggerContext} returns this */ -proto.nitric.faas.v1.NotificationTriggerContext.NotificationCase = { - NOTIFICATION_NOT_SET: 0, - BUCKET: 10 +proto.nitric.faas.v1.NotificationTriggerContext.prototype.clearBucket = function() { + return this.setBucket(undefined); }; + /** - * @return {proto.nitric.faas.v1.NotificationTriggerContext.NotificationCase} + * Returns whether this field is set. + * @return {boolean} */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.getNotificationCase = function() { - return /** @type {proto.nitric.faas.v1.NotificationTriggerContext.NotificationCase} */(jspb.Message.computeOneofCase(this, proto.nitric.faas.v1.NotificationTriggerContext.oneofGroups_[0])); +proto.nitric.faas.v1.NotificationTriggerContext.prototype.hasBucket = function() { + return jspb.Message.getField(this, 10) != null; }; + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -4619,8 +5335,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.toObject = function(opt_includeInstance) { - return proto.nitric.faas.v1.NotificationTriggerContext.toObject(opt_includeInstance, this); +proto.nitric.faas.v1.WebsocketTriggerContext.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.WebsocketTriggerContext.toObject(opt_includeInstance, this); }; @@ -4629,14 +5345,15 @@ proto.nitric.faas.v1.NotificationTriggerContext.prototype.toObject = function(op * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.nitric.faas.v1.NotificationTriggerContext} msg The msg instance to transform. + * @param {!proto.nitric.faas.v1.WebsocketTriggerContext} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.faas.v1.NotificationTriggerContext.toObject = function(includeInstance, msg) { +proto.nitric.faas.v1.WebsocketTriggerContext.toObject = function(includeInstance, msg) { var f, obj = { - source: jspb.Message.getFieldWithDefault(msg, 1, ""), - bucket: (f = msg.getBucket()) && proto.nitric.faas.v1.BucketNotification.toObject(includeInstance, f) + socket: jspb.Message.getFieldWithDefault(msg, 1, ""), + event: jspb.Message.getFieldWithDefault(msg, 2, 0), + connectionid: jspb.Message.getFieldWithDefault(msg, 3, "") }; if (includeInstance) { @@ -4650,23 +5367,23 @@ proto.nitric.faas.v1.NotificationTriggerContext.toObject = function(includeInsta /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.nitric.faas.v1.NotificationTriggerContext} + * @return {!proto.nitric.faas.v1.WebsocketTriggerContext} */ -proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinary = function(bytes) { +proto.nitric.faas.v1.WebsocketTriggerContext.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.nitric.faas.v1.NotificationTriggerContext; - return proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinaryFromReader(msg, reader); + var msg = new proto.nitric.faas.v1.WebsocketTriggerContext; + return proto.nitric.faas.v1.WebsocketTriggerContext.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.nitric.faas.v1.NotificationTriggerContext} msg The message object to deserialize into. + * @param {!proto.nitric.faas.v1.WebsocketTriggerContext} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.nitric.faas.v1.NotificationTriggerContext} + * @return {!proto.nitric.faas.v1.WebsocketTriggerContext} */ -proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinaryFromReader = function(msg, reader) { +proto.nitric.faas.v1.WebsocketTriggerContext.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -4675,12 +5392,15 @@ proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinaryFromReader = fu switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); - msg.setSource(value); + msg.setSocket(value); break; - case 10: - var value = new proto.nitric.faas.v1.BucketNotification; - reader.readMessage(value,proto.nitric.faas.v1.BucketNotification.deserializeBinaryFromReader); - msg.setBucket(value); + case 2: + var value = /** @type {!proto.nitric.faas.v1.WebsocketEvent} */ (reader.readEnum()); + msg.setEvent(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setConnectionid(value); break; default: reader.skipField(); @@ -4695,9 +5415,9 @@ proto.nitric.faas.v1.NotificationTriggerContext.deserializeBinaryFromReader = fu * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.serializeBinary = function() { +proto.nitric.faas.v1.WebsocketTriggerContext.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.nitric.faas.v1.NotificationTriggerContext.serializeBinaryToWriter(this, writer); + proto.nitric.faas.v1.WebsocketTriggerContext.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -4705,82 +5425,87 @@ proto.nitric.faas.v1.NotificationTriggerContext.prototype.serializeBinary = func /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.nitric.faas.v1.NotificationTriggerContext} message + * @param {!proto.nitric.faas.v1.WebsocketTriggerContext} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.nitric.faas.v1.NotificationTriggerContext.serializeBinaryToWriter = function(message, writer) { +proto.nitric.faas.v1.WebsocketTriggerContext.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getSource(); + f = message.getSocket(); if (f.length > 0) { writer.writeString( 1, f ); } - f = message.getBucket(); - if (f != null) { - writer.writeMessage( - 10, - f, - proto.nitric.faas.v1.BucketNotification.serializeBinaryToWriter + f = message.getEvent(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } + f = message.getConnectionid(); + if (f.length > 0) { + writer.writeString( + 3, + f ); } }; /** - * optional string source = 1; + * optional string socket = 1; * @return {string} */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.getSource = function() { +proto.nitric.faas.v1.WebsocketTriggerContext.prototype.getSocket = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.nitric.faas.v1.NotificationTriggerContext} returns this + * @return {!proto.nitric.faas.v1.WebsocketTriggerContext} returns this */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.setSource = function(value) { +proto.nitric.faas.v1.WebsocketTriggerContext.prototype.setSocket = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional BucketNotification bucket = 10; - * @return {?proto.nitric.faas.v1.BucketNotification} + * optional WebsocketEvent event = 2; + * @return {!proto.nitric.faas.v1.WebsocketEvent} */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.getBucket = function() { - return /** @type{?proto.nitric.faas.v1.BucketNotification} */ ( - jspb.Message.getWrapperField(this, proto.nitric.faas.v1.BucketNotification, 10)); +proto.nitric.faas.v1.WebsocketTriggerContext.prototype.getEvent = function() { + return /** @type {!proto.nitric.faas.v1.WebsocketEvent} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** - * @param {?proto.nitric.faas.v1.BucketNotification|undefined} value - * @return {!proto.nitric.faas.v1.NotificationTriggerContext} returns this -*/ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.setBucket = function(value) { - return jspb.Message.setOneofWrapperField(this, 10, proto.nitric.faas.v1.NotificationTriggerContext.oneofGroups_[0], value); + * @param {!proto.nitric.faas.v1.WebsocketEvent} value + * @return {!proto.nitric.faas.v1.WebsocketTriggerContext} returns this + */ +proto.nitric.faas.v1.WebsocketTriggerContext.prototype.setEvent = function(value) { + return jspb.Message.setProto3EnumField(this, 2, value); }; /** - * Clears the message field making it undefined. - * @return {!proto.nitric.faas.v1.NotificationTriggerContext} returns this + * optional string connectionId = 3; + * @return {string} */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.clearBucket = function() { - return this.setBucket(undefined); +proto.nitric.faas.v1.WebsocketTriggerContext.prototype.getConnectionid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** - * Returns whether this field is set. - * @return {boolean} + * @param {string} value + * @return {!proto.nitric.faas.v1.WebsocketTriggerContext} returns this */ -proto.nitric.faas.v1.NotificationTriggerContext.prototype.hasBucket = function() { - return jspb.Message.getField(this, 10) != null; +proto.nitric.faas.v1.WebsocketTriggerContext.prototype.setConnectionid = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); }; @@ -4793,7 +5518,7 @@ proto.nitric.faas.v1.NotificationTriggerContext.prototype.hasBucket = function() * @private {!Array>} * @const */ -proto.nitric.faas.v1.TriggerResponse.oneofGroups_ = [[10,11,12]]; +proto.nitric.faas.v1.TriggerResponse.oneofGroups_ = [[10,11,12,13]]; /** * @enum {number} @@ -4802,7 +5527,8 @@ proto.nitric.faas.v1.TriggerResponse.ContextCase = { CONTEXT_NOT_SET: 0, HTTP: 10, TOPIC: 11, - NOTIFICATION: 12 + NOTIFICATION: 12, + WEBSOCKET: 13 }; /** @@ -4846,7 +5572,8 @@ proto.nitric.faas.v1.TriggerResponse.toObject = function(includeInstance, msg) { data: msg.getData_asB64(), http: (f = msg.getHttp()) && proto.nitric.faas.v1.HttpResponseContext.toObject(includeInstance, f), topic: (f = msg.getTopic()) && proto.nitric.faas.v1.TopicResponseContext.toObject(includeInstance, f), - notification: (f = msg.getNotification()) && proto.nitric.faas.v1.NotificationResponseContext.toObject(includeInstance, f) + notification: (f = msg.getNotification()) && proto.nitric.faas.v1.NotificationResponseContext.toObject(includeInstance, f), + websocket: (f = msg.getWebsocket()) && proto.nitric.faas.v1.WebsocketResponseContext.toObject(includeInstance, f) }; if (includeInstance) { @@ -4902,6 +5629,11 @@ proto.nitric.faas.v1.TriggerResponse.deserializeBinaryFromReader = function(msg, reader.readMessage(value,proto.nitric.faas.v1.NotificationResponseContext.deserializeBinaryFromReader); msg.setNotification(value); break; + case 13: + var value = new proto.nitric.faas.v1.WebsocketResponseContext; + reader.readMessage(value,proto.nitric.faas.v1.WebsocketResponseContext.deserializeBinaryFromReader); + msg.setWebsocket(value); + break; default: reader.skipField(); break; @@ -4962,6 +5694,14 @@ proto.nitric.faas.v1.TriggerResponse.serializeBinaryToWriter = function(message, proto.nitric.faas.v1.NotificationResponseContext.serializeBinaryToWriter ); } + f = message.getWebsocket(); + if (f != null) { + writer.writeMessage( + 13, + f, + proto.nitric.faas.v1.WebsocketResponseContext.serializeBinaryToWriter + ); + } }; @@ -5118,6 +5858,43 @@ proto.nitric.faas.v1.TriggerResponse.prototype.hasNotification = function() { }; +/** + * optional WebsocketResponseContext websocket = 13; + * @return {?proto.nitric.faas.v1.WebsocketResponseContext} + */ +proto.nitric.faas.v1.TriggerResponse.prototype.getWebsocket = function() { + return /** @type{?proto.nitric.faas.v1.WebsocketResponseContext} */ ( + jspb.Message.getWrapperField(this, proto.nitric.faas.v1.WebsocketResponseContext, 13)); +}; + + +/** + * @param {?proto.nitric.faas.v1.WebsocketResponseContext|undefined} value + * @return {!proto.nitric.faas.v1.TriggerResponse} returns this +*/ +proto.nitric.faas.v1.TriggerResponse.prototype.setWebsocket = function(value) { + return jspb.Message.setOneofWrapperField(this, 13, proto.nitric.faas.v1.TriggerResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.faas.v1.TriggerResponse} returns this + */ +proto.nitric.faas.v1.TriggerResponse.prototype.clearWebsocket = function() { + return this.setWebsocket(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.faas.v1.TriggerResponse.prototype.hasWebsocket = function() { + return jspb.Message.getField(this, 13) != null; +}; + + @@ -5574,6 +6351,136 @@ proto.nitric.faas.v1.NotificationResponseContext.prototype.setSuccess = function }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.faas.v1.WebsocketResponseContext.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.faas.v1.WebsocketResponseContext.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.faas.v1.WebsocketResponseContext} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.faas.v1.WebsocketResponseContext.toObject = function(includeInstance, msg) { + var f, obj = { + success: jspb.Message.getBooleanFieldWithDefault(msg, 1, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.faas.v1.WebsocketResponseContext} + */ +proto.nitric.faas.v1.WebsocketResponseContext.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.faas.v1.WebsocketResponseContext; + return proto.nitric.faas.v1.WebsocketResponseContext.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.faas.v1.WebsocketResponseContext} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.faas.v1.WebsocketResponseContext} + */ +proto.nitric.faas.v1.WebsocketResponseContext.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSuccess(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.faas.v1.WebsocketResponseContext.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.faas.v1.WebsocketResponseContext.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.faas.v1.WebsocketResponseContext} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.faas.v1.WebsocketResponseContext.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSuccess(); + if (f) { + writer.writeBool( + 1, + f + ); + } +}; + + +/** + * optional bool success = 1; + * @return {boolean} + */ +proto.nitric.faas.v1.WebsocketResponseContext.prototype.getSuccess = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.nitric.faas.v1.WebsocketResponseContext} returns this + */ +proto.nitric.faas.v1.WebsocketResponseContext.prototype.setSuccess = function(value) { + return jspb.Message.setProto3BooleanField(this, 1, value); +}; + + /** * @enum {number} */ @@ -5583,4 +6490,13 @@ proto.nitric.faas.v1.BucketNotificationType = { DELETED: 2 }; +/** + * @enum {number} + */ +proto.nitric.faas.v1.WebsocketEvent = { + CONNECT: 0, + DISCONNECT: 1, + MESSAGE: 2 +}; + goog.object.extend(exports, proto.nitric.faas.v1); diff --git a/src/gen/proto/resource/v1/resource_pb.d.ts b/src/gen/proto/resource/v1/resource_pb.d.ts index a6e8510f..8632bdb6 100644 --- a/src/gen/proto/resource/v1/resource_pb.d.ts +++ b/src/gen/proto/resource/v1/resource_pb.d.ts @@ -351,6 +351,26 @@ export namespace ApiResourceDetails { } } +export class WebsocketResourceDetails extends jspb.Message { + getUrl(): string; + setUrl(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketResourceDetails.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketResourceDetails): WebsocketResourceDetails.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketResourceDetails, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketResourceDetails; + static deserializeBinaryFromReader(message: WebsocketResourceDetails, reader: jspb.BinaryReader): WebsocketResourceDetails; +} + +export namespace WebsocketResourceDetails { + export type AsObject = { + url: string, + } +} + export class ResourceDetailsRequest extends jspb.Message { hasResource(): boolean; clearResource(): void; @@ -388,6 +408,11 @@ export class ResourceDetailsResponse extends jspb.Message { getApi(): ApiResourceDetails | undefined; setApi(value?: ApiResourceDetails): void; + hasWebsocket(): boolean; + clearWebsocket(): void; + getWebsocket(): WebsocketResourceDetails | undefined; + setWebsocket(value?: WebsocketResourceDetails): void; + getDetailsCase(): ResourceDetailsResponse.DetailsCase; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): ResourceDetailsResponse.AsObject; @@ -405,11 +430,13 @@ export namespace ResourceDetailsResponse { provider: string, service: string, api?: ApiResourceDetails.AsObject, + websocket?: WebsocketResourceDetails.AsObject, } export enum DetailsCase { DETAILS_NOT_SET = 0, API = 10, + WEBSOCKET = 11, } } @@ -425,6 +452,8 @@ export interface ResourceTypeMap { POLICY: 8; SECRET: 9; NOTIFICATION: 10; + WEBSOCKET: 11; + HTTP: 12; } export const ResourceType: ResourceTypeMap; @@ -448,6 +477,7 @@ export interface ActionMap { COLLECTIONLIST: 404; SECRETPUT: 500; SECRETACCESS: 501; + WEBSOCKETMANAGE: 600; } export const Action: ActionMap; diff --git a/src/gen/proto/resource/v1/resource_pb.js b/src/gen/proto/resource/v1/resource_pb.js index 826f0c0b..d22d7ca5 100644 --- a/src/gen/proto/resource/v1/resource_pb.js +++ b/src/gen/proto/resource/v1/resource_pb.js @@ -42,6 +42,7 @@ goog.exportSymbol('proto.nitric.resource.v1.ResourceDetailsResponse.DetailsCase' goog.exportSymbol('proto.nitric.resource.v1.ResourceType', null, global); goog.exportSymbol('proto.nitric.resource.v1.SecretResource', null, global); goog.exportSymbol('proto.nitric.resource.v1.TopicResource', null, global); +goog.exportSymbol('proto.nitric.resource.v1.WebsocketResourceDetails', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -336,6 +337,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.nitric.resource.v1.ApiResourceDetails.displayName = 'proto.nitric.resource.v1.ApiResourceDetails'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.resource.v1.WebsocketResourceDetails = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.resource.v1.WebsocketResourceDetails, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.resource.v1.WebsocketResourceDetails.displayName = 'proto.nitric.resource.v1.WebsocketResourceDetails'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -2764,6 +2786,136 @@ proto.nitric.resource.v1.ApiResourceDetails.prototype.setUrl = function(value) { +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.resource.v1.WebsocketResourceDetails.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.resource.v1.WebsocketResourceDetails.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.resource.v1.WebsocketResourceDetails} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.resource.v1.WebsocketResourceDetails.toObject = function(includeInstance, msg) { + var f, obj = { + url: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.resource.v1.WebsocketResourceDetails} + */ +proto.nitric.resource.v1.WebsocketResourceDetails.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.resource.v1.WebsocketResourceDetails; + return proto.nitric.resource.v1.WebsocketResourceDetails.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.resource.v1.WebsocketResourceDetails} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.resource.v1.WebsocketResourceDetails} + */ +proto.nitric.resource.v1.WebsocketResourceDetails.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.resource.v1.WebsocketResourceDetails.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.resource.v1.WebsocketResourceDetails.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.resource.v1.WebsocketResourceDetails} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.resource.v1.WebsocketResourceDetails.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUrl(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string url = 1; + * @return {string} + */ +proto.nitric.resource.v1.WebsocketResourceDetails.prototype.getUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.resource.v1.WebsocketResourceDetails} returns this + */ +proto.nitric.resource.v1.WebsocketResourceDetails.prototype.setUrl = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -2921,14 +3073,15 @@ proto.nitric.resource.v1.ResourceDetailsRequest.prototype.hasResource = function * @private {!Array>} * @const */ -proto.nitric.resource.v1.ResourceDetailsResponse.oneofGroups_ = [[10]]; +proto.nitric.resource.v1.ResourceDetailsResponse.oneofGroups_ = [[10,11]]; /** * @enum {number} */ proto.nitric.resource.v1.ResourceDetailsResponse.DetailsCase = { DETAILS_NOT_SET: 0, - API: 10 + API: 10, + WEBSOCKET: 11 }; /** @@ -2972,7 +3125,8 @@ proto.nitric.resource.v1.ResourceDetailsResponse.toObject = function(includeInst id: jspb.Message.getFieldWithDefault(msg, 1, ""), provider: jspb.Message.getFieldWithDefault(msg, 2, ""), service: jspb.Message.getFieldWithDefault(msg, 3, ""), - api: (f = msg.getApi()) && proto.nitric.resource.v1.ApiResourceDetails.toObject(includeInstance, f) + api: (f = msg.getApi()) && proto.nitric.resource.v1.ApiResourceDetails.toObject(includeInstance, f), + websocket: (f = msg.getWebsocket()) && proto.nitric.resource.v1.WebsocketResourceDetails.toObject(includeInstance, f) }; if (includeInstance) { @@ -3026,6 +3180,11 @@ proto.nitric.resource.v1.ResourceDetailsResponse.deserializeBinaryFromReader = f reader.readMessage(value,proto.nitric.resource.v1.ApiResourceDetails.deserializeBinaryFromReader); msg.setApi(value); break; + case 11: + var value = new proto.nitric.resource.v1.WebsocketResourceDetails; + reader.readMessage(value,proto.nitric.resource.v1.WebsocketResourceDetails.deserializeBinaryFromReader); + msg.setWebsocket(value); + break; default: reader.skipField(); break; @@ -3084,6 +3243,14 @@ proto.nitric.resource.v1.ResourceDetailsResponse.serializeBinaryToWriter = funct proto.nitric.resource.v1.ApiResourceDetails.serializeBinaryToWriter ); } + f = message.getWebsocket(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.nitric.resource.v1.WebsocketResourceDetails.serializeBinaryToWriter + ); + } }; @@ -3178,6 +3345,43 @@ proto.nitric.resource.v1.ResourceDetailsResponse.prototype.hasApi = function() { }; +/** + * optional WebsocketResourceDetails websocket = 11; + * @return {?proto.nitric.resource.v1.WebsocketResourceDetails} + */ +proto.nitric.resource.v1.ResourceDetailsResponse.prototype.getWebsocket = function() { + return /** @type{?proto.nitric.resource.v1.WebsocketResourceDetails} */ ( + jspb.Message.getWrapperField(this, proto.nitric.resource.v1.WebsocketResourceDetails, 11)); +}; + + +/** + * @param {?proto.nitric.resource.v1.WebsocketResourceDetails|undefined} value + * @return {!proto.nitric.resource.v1.ResourceDetailsResponse} returns this +*/ +proto.nitric.resource.v1.ResourceDetailsResponse.prototype.setWebsocket = function(value) { + return jspb.Message.setOneofWrapperField(this, 11, proto.nitric.resource.v1.ResourceDetailsResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.resource.v1.ResourceDetailsResponse} returns this + */ +proto.nitric.resource.v1.ResourceDetailsResponse.prototype.clearWebsocket = function() { + return this.setWebsocket(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.resource.v1.ResourceDetailsResponse.prototype.hasWebsocket = function() { + return jspb.Message.getField(this, 11) != null; +}; + + /** * @enum {number} */ @@ -3192,7 +3396,9 @@ proto.nitric.resource.v1.ResourceType = { COLLECTION: 7, POLICY: 8, SECRET: 9, - NOTIFICATION: 10 + NOTIFICATION: 10, + WEBSOCKET: 11, + HTTP: 12 }; /** @@ -3216,7 +3422,8 @@ proto.nitric.resource.v1.Action = { COLLECTIONQUERY: 403, COLLECTIONLIST: 404, SECRETPUT: 500, - SECRETACCESS: 501 + SECRETACCESS: 501, + WEBSOCKETMANAGE: 600 }; goog.object.extend(exports, proto.nitric.resource.v1); diff --git a/src/gen/proto/storage/v1/storage_pb.d.ts b/src/gen/proto/storage/v1/storage_pb.d.ts index 3c07c761..ddec520a 100644 --- a/src/gen/proto/storage/v1/storage_pb.d.ts +++ b/src/gen/proto/storage/v1/storage_pb.d.ts @@ -199,6 +199,9 @@ export class StorageListFilesRequest extends jspb.Message { getBucketName(): string; setBucketName(value: string): void; + getPrefix(): string; + setPrefix(value: string): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): StorageListFilesRequest.AsObject; static toObject(includeInstance: boolean, msg: StorageListFilesRequest): StorageListFilesRequest.AsObject; @@ -212,6 +215,7 @@ export class StorageListFilesRequest extends jspb.Message { export namespace StorageListFilesRequest { export type AsObject = { bucketName: string, + prefix: string, } } diff --git a/src/gen/proto/storage/v1/storage_pb.js b/src/gen/proto/storage/v1/storage_pb.js index e00efa97..28458dbd 100644 --- a/src/gen/proto/storage/v1/storage_pb.js +++ b/src/gen/proto/storage/v1/storage_pb.js @@ -1546,7 +1546,8 @@ proto.nitric.storage.v1.StorageListFilesRequest.prototype.toObject = function(op */ proto.nitric.storage.v1.StorageListFilesRequest.toObject = function(includeInstance, msg) { var f, obj = { - bucketName: jspb.Message.getFieldWithDefault(msg, 1, "") + bucketName: jspb.Message.getFieldWithDefault(msg, 1, ""), + prefix: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { @@ -1587,6 +1588,10 @@ proto.nitric.storage.v1.StorageListFilesRequest.deserializeBinaryFromReader = fu var value = /** @type {string} */ (reader.readString()); msg.setBucketName(value); break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setPrefix(value); + break; default: reader.skipField(); break; @@ -1623,6 +1628,13 @@ proto.nitric.storage.v1.StorageListFilesRequest.serializeBinaryToWriter = functi f ); } + f = message.getPrefix(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } }; @@ -1644,6 +1656,24 @@ proto.nitric.storage.v1.StorageListFilesRequest.prototype.setBucketName = functi }; +/** + * optional string prefix = 2; + * @return {string} + */ +proto.nitric.storage.v1.StorageListFilesRequest.prototype.getPrefix = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.storage.v1.StorageListFilesRequest} returns this + */ +proto.nitric.storage.v1.StorageListFilesRequest.prototype.setPrefix = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + diff --git a/src/gen/proto/websocket/v1/websocket_grpc_pb.d.ts b/src/gen/proto/websocket/v1/websocket_grpc_pb.d.ts new file mode 100644 index 00000000..bc1ca7cf --- /dev/null +++ b/src/gen/proto/websocket/v1/websocket_grpc_pb.d.ts @@ -0,0 +1,29 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.websocket.v1 +// file: proto/websocket/v1/websocket.proto + +import * as proto_websocket_v1_websocket_pb from "../../../proto/websocket/v1/websocket_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface IWebsocketServiceService extends grpc.ServiceDefinition { + send: grpc.MethodDefinition; + close: grpc.MethodDefinition; +} + +export const WebsocketServiceService: IWebsocketServiceService; + +export interface IWebsocketServiceServer extends grpc.UntypedServiceImplementation { + send: grpc.handleUnaryCall; + close: grpc.handleUnaryCall; +} + +export class WebsocketServiceClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + send(argument: proto_websocket_v1_websocket_pb.WebsocketSendRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + send(argument: proto_websocket_v1_websocket_pb.WebsocketSendRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + send(argument: proto_websocket_v1_websocket_pb.WebsocketSendRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + close(argument: proto_websocket_v1_websocket_pb.WebsocketCloseRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + close(argument: proto_websocket_v1_websocket_pb.WebsocketCloseRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + close(argument: proto_websocket_v1_websocket_pb.WebsocketCloseRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; +} diff --git a/src/gen/proto/websocket/v1/websocket_grpc_pb.js b/src/gen/proto/websocket/v1/websocket_grpc_pb.js new file mode 100644 index 00000000..d0cd6611 --- /dev/null +++ b/src/gen/proto/websocket/v1/websocket_grpc_pb.js @@ -0,0 +1,81 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var proto_websocket_v1_websocket_pb = require('../../../proto/websocket/v1/websocket_pb.js'); +var validate_validate_pb = require('../../../validate/validate_pb.js'); + +function serialize_nitric_websocket_v1_WebsocketCloseRequest(arg) { + if (!(arg instanceof proto_websocket_v1_websocket_pb.WebsocketCloseRequest)) { + throw new Error('Expected argument of type nitric.websocket.v1.WebsocketCloseRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_websocket_v1_WebsocketCloseRequest(buffer_arg) { + return proto_websocket_v1_websocket_pb.WebsocketCloseRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_websocket_v1_WebsocketCloseResponse(arg) { + if (!(arg instanceof proto_websocket_v1_websocket_pb.WebsocketCloseResponse)) { + throw new Error('Expected argument of type nitric.websocket.v1.WebsocketCloseResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_websocket_v1_WebsocketCloseResponse(buffer_arg) { + return proto_websocket_v1_websocket_pb.WebsocketCloseResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_websocket_v1_WebsocketSendRequest(arg) { + if (!(arg instanceof proto_websocket_v1_websocket_pb.WebsocketSendRequest)) { + throw new Error('Expected argument of type nitric.websocket.v1.WebsocketSendRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_websocket_v1_WebsocketSendRequest(buffer_arg) { + return proto_websocket_v1_websocket_pb.WebsocketSendRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_websocket_v1_WebsocketSendResponse(arg) { + if (!(arg instanceof proto_websocket_v1_websocket_pb.WebsocketSendResponse)) { + throw new Error('Expected argument of type nitric.websocket.v1.WebsocketSendResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_websocket_v1_WebsocketSendResponse(buffer_arg) { + return proto_websocket_v1_websocket_pb.WebsocketSendResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +var WebsocketServiceService = exports.WebsocketServiceService = { + // Send a messages to a websocket +send: { + path: '/nitric.websocket.v1.WebsocketService/Send', + requestStream: false, + responseStream: false, + requestType: proto_websocket_v1_websocket_pb.WebsocketSendRequest, + responseType: proto_websocket_v1_websocket_pb.WebsocketSendResponse, + requestSerialize: serialize_nitric_websocket_v1_WebsocketSendRequest, + requestDeserialize: deserialize_nitric_websocket_v1_WebsocketSendRequest, + responseSerialize: serialize_nitric_websocket_v1_WebsocketSendResponse, + responseDeserialize: deserialize_nitric_websocket_v1_WebsocketSendResponse, + }, + // Close a websocket connection +// This can be used to force a client to disconnect +close: { + path: '/nitric.websocket.v1.WebsocketService/Close', + requestStream: false, + responseStream: false, + requestType: proto_websocket_v1_websocket_pb.WebsocketCloseRequest, + responseType: proto_websocket_v1_websocket_pb.WebsocketCloseResponse, + requestSerialize: serialize_nitric_websocket_v1_WebsocketCloseRequest, + requestDeserialize: deserialize_nitric_websocket_v1_WebsocketCloseRequest, + responseSerialize: serialize_nitric_websocket_v1_WebsocketCloseResponse, + responseDeserialize: deserialize_nitric_websocket_v1_WebsocketCloseResponse, + }, +}; + +exports.WebsocketServiceClient = grpc.makeGenericClientConstructor(WebsocketServiceService); diff --git a/src/gen/proto/websocket/v1/websocket_pb.d.ts b/src/gen/proto/websocket/v1/websocket_pb.d.ts new file mode 100644 index 00000000..113af5ed --- /dev/null +++ b/src/gen/proto/websocket/v1/websocket_pb.d.ts @@ -0,0 +1,92 @@ +// package: nitric.websocket.v1 +// file: proto/websocket/v1/websocket.proto + +import * as jspb from "google-protobuf"; +import * as validate_validate_pb from "../../../validate/validate_pb"; + +export class WebsocketSendRequest extends jspb.Message { + getSocket(): string; + setSocket(value: string): void; + + getConnectionId(): string; + setConnectionId(value: string): void; + + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketSendRequest.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketSendRequest): WebsocketSendRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketSendRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketSendRequest; + static deserializeBinaryFromReader(message: WebsocketSendRequest, reader: jspb.BinaryReader): WebsocketSendRequest; +} + +export namespace WebsocketSendRequest { + export type AsObject = { + socket: string, + connectionId: string, + data: Uint8Array | string, + } +} + +export class WebsocketSendResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketSendResponse.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketSendResponse): WebsocketSendResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketSendResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketSendResponse; + static deserializeBinaryFromReader(message: WebsocketSendResponse, reader: jspb.BinaryReader): WebsocketSendResponse; +} + +export namespace WebsocketSendResponse { + export type AsObject = { + } +} + +export class WebsocketCloseRequest extends jspb.Message { + getSocket(): string; + setSocket(value: string): void; + + getConnectionId(): string; + setConnectionId(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketCloseRequest.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketCloseRequest): WebsocketCloseRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketCloseRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketCloseRequest; + static deserializeBinaryFromReader(message: WebsocketCloseRequest, reader: jspb.BinaryReader): WebsocketCloseRequest; +} + +export namespace WebsocketCloseRequest { + export type AsObject = { + socket: string, + connectionId: string, + } +} + +export class WebsocketCloseResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): WebsocketCloseResponse.AsObject; + static toObject(includeInstance: boolean, msg: WebsocketCloseResponse): WebsocketCloseResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: WebsocketCloseResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): WebsocketCloseResponse; + static deserializeBinaryFromReader(message: WebsocketCloseResponse, reader: jspb.BinaryReader): WebsocketCloseResponse; +} + +export namespace WebsocketCloseResponse { + export type AsObject = { + } +} + diff --git a/src/gen/proto/websocket/v1/websocket_pb.js b/src/gen/proto/websocket/v1/websocket_pb.js new file mode 100644 index 00000000..526cbfaf --- /dev/null +++ b/src/gen/proto/websocket/v1/websocket_pb.js @@ -0,0 +1,690 @@ +// source: proto/websocket/v1/websocket.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +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 validate_validate_pb = require('../../../validate/validate_pb.js'); +goog.object.extend(proto, validate_validate_pb); +goog.exportSymbol('proto.nitric.websocket.v1.WebsocketCloseRequest', null, global); +goog.exportSymbol('proto.nitric.websocket.v1.WebsocketCloseResponse', null, global); +goog.exportSymbol('proto.nitric.websocket.v1.WebsocketSendRequest', null, global); +goog.exportSymbol('proto.nitric.websocket.v1.WebsocketSendResponse', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.websocket.v1.WebsocketSendRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.websocket.v1.WebsocketSendRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.websocket.v1.WebsocketSendRequest.displayName = 'proto.nitric.websocket.v1.WebsocketSendRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.websocket.v1.WebsocketSendResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.websocket.v1.WebsocketSendResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.websocket.v1.WebsocketSendResponse.displayName = 'proto.nitric.websocket.v1.WebsocketSendResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.websocket.v1.WebsocketCloseRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.websocket.v1.WebsocketCloseRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.websocket.v1.WebsocketCloseRequest.displayName = 'proto.nitric.websocket.v1.WebsocketCloseRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nitric.websocket.v1.WebsocketCloseResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.websocket.v1.WebsocketCloseResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.websocket.v1.WebsocketCloseResponse.displayName = 'proto.nitric.websocket.v1.WebsocketCloseResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.websocket.v1.WebsocketSendRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.websocket.v1.WebsocketSendRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.websocket.v1.WebsocketSendRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.websocket.v1.WebsocketSendRequest.toObject = function(includeInstance, msg) { + var f, obj = { + socket: jspb.Message.getFieldWithDefault(msg, 1, ""), + connectionId: jspb.Message.getFieldWithDefault(msg, 2, ""), + data: msg.getData_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.websocket.v1.WebsocketSendRequest} + */ +proto.nitric.websocket.v1.WebsocketSendRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.websocket.v1.WebsocketSendRequest; + return proto.nitric.websocket.v1.WebsocketSendRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.websocket.v1.WebsocketSendRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.websocket.v1.WebsocketSendRequest} + */ +proto.nitric.websocket.v1.WebsocketSendRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSocket(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setConnectionId(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.websocket.v1.WebsocketSendRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.websocket.v1.WebsocketSendRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.websocket.v1.WebsocketSendRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.websocket.v1.WebsocketSendRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSocket(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getConnectionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional string socket = 1; + * @return {string} + */ +proto.nitric.websocket.v1.WebsocketSendRequest.prototype.getSocket = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.websocket.v1.WebsocketSendRequest} returns this + */ +proto.nitric.websocket.v1.WebsocketSendRequest.prototype.setSocket = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string connection_id = 2; + * @return {string} + */ +proto.nitric.websocket.v1.WebsocketSendRequest.prototype.getConnectionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.websocket.v1.WebsocketSendRequest} returns this + */ +proto.nitric.websocket.v1.WebsocketSendRequest.prototype.setConnectionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bytes data = 3; + * @return {!(string|Uint8Array)} + */ +proto.nitric.websocket.v1.WebsocketSendRequest.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes data = 3; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.nitric.websocket.v1.WebsocketSendRequest.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.nitric.websocket.v1.WebsocketSendRequest.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.nitric.websocket.v1.WebsocketSendRequest} returns this + */ +proto.nitric.websocket.v1.WebsocketSendRequest.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.websocket.v1.WebsocketSendResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.websocket.v1.WebsocketSendResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.websocket.v1.WebsocketSendResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.websocket.v1.WebsocketSendResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.websocket.v1.WebsocketSendResponse} + */ +proto.nitric.websocket.v1.WebsocketSendResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.websocket.v1.WebsocketSendResponse; + return proto.nitric.websocket.v1.WebsocketSendResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.websocket.v1.WebsocketSendResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.websocket.v1.WebsocketSendResponse} + */ +proto.nitric.websocket.v1.WebsocketSendResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.websocket.v1.WebsocketSendResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.websocket.v1.WebsocketSendResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.websocket.v1.WebsocketSendResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.websocket.v1.WebsocketSendResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.websocket.v1.WebsocketCloseRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.websocket.v1.WebsocketCloseRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.websocket.v1.WebsocketCloseRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.websocket.v1.WebsocketCloseRequest.toObject = function(includeInstance, msg) { + var f, obj = { + socket: jspb.Message.getFieldWithDefault(msg, 1, ""), + connectionId: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.websocket.v1.WebsocketCloseRequest} + */ +proto.nitric.websocket.v1.WebsocketCloseRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.websocket.v1.WebsocketCloseRequest; + return proto.nitric.websocket.v1.WebsocketCloseRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.websocket.v1.WebsocketCloseRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.websocket.v1.WebsocketCloseRequest} + */ +proto.nitric.websocket.v1.WebsocketCloseRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setSocket(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setConnectionId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.websocket.v1.WebsocketCloseRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.websocket.v1.WebsocketCloseRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.websocket.v1.WebsocketCloseRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.websocket.v1.WebsocketCloseRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSocket(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getConnectionId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string socket = 1; + * @return {string} + */ +proto.nitric.websocket.v1.WebsocketCloseRequest.prototype.getSocket = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.websocket.v1.WebsocketCloseRequest} returns this + */ +proto.nitric.websocket.v1.WebsocketCloseRequest.prototype.setSocket = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string connection_id = 2; + * @return {string} + */ +proto.nitric.websocket.v1.WebsocketCloseRequest.prototype.getConnectionId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.websocket.v1.WebsocketCloseRequest} returns this + */ +proto.nitric.websocket.v1.WebsocketCloseRequest.prototype.setConnectionId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nitric.websocket.v1.WebsocketCloseResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.websocket.v1.WebsocketCloseResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nitric.websocket.v1.WebsocketCloseResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.websocket.v1.WebsocketCloseResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nitric.websocket.v1.WebsocketCloseResponse} + */ +proto.nitric.websocket.v1.WebsocketCloseResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.websocket.v1.WebsocketCloseResponse; + return proto.nitric.websocket.v1.WebsocketCloseResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.websocket.v1.WebsocketCloseResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.websocket.v1.WebsocketCloseResponse} + */ +proto.nitric.websocket.v1.WebsocketCloseResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.websocket.v1.WebsocketCloseResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.websocket.v1.WebsocketCloseResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.websocket.v1.WebsocketCloseResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.websocket.v1.WebsocketCloseResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +goog.object.extend(exports, proto.nitric.websocket.v1); diff --git a/src/resources/http.test.ts b/src/resources/http.test.ts new file mode 100644 index 00000000..31ec549c --- /dev/null +++ b/src/resources/http.test.ts @@ -0,0 +1,117 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import * as faas from '../faas/index'; +import { HttpWorkerOptions, http } from '.'; + +jest.mock('portfinder', () => { + const originalModule = jest.requireActual('portfinder'); + + return { + __esmodule: true, + ...originalModule, + getPort: (callback: (err, port) => void) => { + callback('', 1234); + }, + }; +}); + +jest.mock('../faas/index'); + +describe('HTTP Proxy', () => { + const startSpy = jest + .spyOn(faas.Faas.prototype, 'start') + .mockReturnValue(Promise.resolve()); + + const mockApp = { + listen: () => {}, + }; + + afterAll(() => { + jest.clearAllMocks(); + }); + + describe('when creating a new http proxy with an app', () => { + let error = undefined; + afterAll(() => { + jest.resetAllMocks(); + }); + + beforeAll(() => { + try { + http(mockApp); + } catch (err) { + error = err; + } + }); + + it('should not return an error', () => { + expect(error).toBe(undefined); + }); + }); + + describe(`when creating a new http proxy with an app and callback`, () => { + const fakeCallback = () => {}; + + afterAll(() => { + jest.resetAllMocks(); + }); + + beforeAll(async () => { + http(mockApp, fakeCallback); + }); + + it('should create a new FaasClient', () => { + expect(faas.Faas).toBeCalledTimes(1); + }); + + it('should provide Faas with HttpWorkerOptions', () => { + const expectedOpts = new HttpWorkerOptions(mockApp, 1234, fakeCallback); + expect(faas.Faas).toBeCalledWith(expectedOpts); + }); + + it('should call FaasClient::start()', () => { + expect(startSpy).toBeCalledTimes(1); + }); + }); + + describe(`when creating a new http proxy with a bootstrap function`, () => { + const fakeFunc = () => {}; + const fakeCallback = () => {}; + + afterAll(() => { + jest.resetAllMocks(); + }); + + beforeAll(async () => { + http(fakeFunc, fakeCallback); + }); + + it('should create a new FaasClient', () => { + expect(faas.Faas).toBeCalledTimes(1); + }); + + it('should provide Faas with HttpWorkerOptions', () => { + const expectedOpts = new HttpWorkerOptions( + { listen: fakeFunc }, + 1234, + fakeCallback + ); + expect(faas.Faas).toBeCalledWith(expectedOpts); + }); + + it('should call FaasClient::start()', () => { + expect(startSpy).toBeCalledTimes(1); + }); + }); +}); diff --git a/src/resources/http.ts b/src/resources/http.ts new file mode 100644 index 00000000..3bd90e9c --- /dev/null +++ b/src/resources/http.ts @@ -0,0 +1,80 @@ +// Copyright 2021, Nitric Technologies Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import portfinder from 'portfinder'; +import { Faas } from '../faas'; + +type ListenerFunction = + | ((port: number, callback?: () => void) => void) + | ((port: number) => void); + +interface NodeApplication { + listen: ListenerFunction; +} + +export class HttpWorkerOptions { + public readonly app: NodeApplication; + public readonly port: number; + public readonly callback: () => void; + + constructor(app: NodeApplication, port: number, callback?: () => void) { + this.app = app; + this.port = port; + this.callback = callback || (() => {}); + } +} + +/** + * Creates a http worker + */ +class HttpWorker { + private readonly faas: Faas; + + constructor(app: NodeApplication, port: number, callback?: () => void) { + this.faas = new Faas(new HttpWorkerOptions(app, port, callback)); + this.faas.start(); + } +} + +export const http = ( + app: NodeApplication | ListenerFunction, + callback?: () => void +) => { + const unknownApp = app as any; + + const nodeApp = + !!unknownApp.listen && typeof unknownApp.listen === 'function' + ? (app as NodeApplication) + : { listen: app as ListenerFunction }; + + const port = Number.parseInt(process.env.NITRIC_HTTP_PROXY_PORT); + + if (Number.isNaN(port)) { + // If port isn't set and the nitric environment is not run or cloud + console.log('NITRIC_HTTP_PROXY_PORT not set. Finding open port...'); + portfinder.getPort((err, port) => { + if (err) { + throw new Error( + 'Unable to find open port. Try setting the env var `NITRIC_HTTP_PROXY_PORT`' + ); + } + + new HttpWorker(nodeApp, port, callback); + }); + + return; + } + + new HttpWorker(nodeApp, port, callback); +}; diff --git a/src/resources/index.ts b/src/resources/index.ts index bddf9328..e46e8d0f 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -18,3 +18,4 @@ export * from './collection'; export * from './bucket'; export * from './schedule'; export * from './secret'; +export * from './http'; diff --git a/src/resources/schedule.test.ts b/src/resources/schedule.test.ts index 92a62f1a..59839da1 100644 --- a/src/resources/schedule.test.ts +++ b/src/resources/schedule.test.ts @@ -96,7 +96,7 @@ describe('Schedule', () => { expect(faas.Faas).toBeCalledTimes(1); }); - it('should provide Faas with ApiWorkerOptions', () => { + it('should provide Faas with RateWorkerOptions', () => { const expectedOpts = new RateWorkerOptions( 'main', 1, @@ -125,7 +125,7 @@ describe('Schedule', () => { expect(faas.Faas).toBeCalledTimes(1); }); - it('should provide Faas with ApiWorkerOptions', () => { + it('should provide Faas with RateWorkerOptions', () => { const expectedOpts = new RateWorkerOptions('main', 7, rate); expect(faas.Faas).toBeCalledWith(expectedOpts); }); diff --git a/yarn.lock b/yarn.lock index b41bbd1d..3358cf90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1435,6 +1435,13 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +async@^2.6.4: + version "2.6.4" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" + integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== + dependencies: + lodash "^4.17.14" + async@^3.1.0: version "3.2.4" resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" @@ -2173,6 +2180,13 @@ debug@^2.2.0, debug@^2.3.3: dependencies: ms "2.0.0" +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -4473,7 +4487,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== -lodash@4.x, lodash@^4.17.15, lodash@^4.7.0: +lodash@4.x, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -4653,7 +4667,7 @@ minimist-options@4.1.0: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5: +minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -4691,6 +4705,13 @@ mkdirp@1.x, mkdirp@^1.0.3: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +mkdirp@^0.5.6: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + modify-values@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" @@ -4711,6 +4732,11 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + mz@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" @@ -5152,6 +5178,15 @@ please-upgrade-node@^3.2.0: dependencies: semver-compare "^1.0.0" +portfinder@^1.0.32: + version "1.0.32" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.32.tgz#2fe1b9e58389712429dc2bea5beb2146146c7f81" + integrity sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg== + dependencies: + async "^2.6.4" + debug "^3.2.7" + mkdirp "^0.5.6" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"