diff --git a/VERSION b/VERSION index 49dc27b..5ffe92d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.8.5 +9.9.0 diff --git a/google/api/field_info_grpc_pb.js b/google/api/field_info_grpc_pb.js new file mode 100644 index 0000000..97b3a24 --- /dev/null +++ b/google/api/field_info_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/google/api/field_info_pb.js b/google/api/field_info_pb.js new file mode 100644 index 0000000..c9b69cd --- /dev/null +++ b/google/api/field_info_pb.js @@ -0,0 +1,216 @@ +// source: google/api/field_info.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 = + (typeof globalThis !== 'undefined' && globalThis) || + (typeof window !== 'undefined' && window) || + (typeof global !== 'undefined' && global) || + (typeof self !== 'undefined' && self) || + (function () { return this; }).call(null) || + Function('return this')(); + +var google_protobuf_descriptor_pb = require('google-protobuf/google/protobuf/descriptor_pb.js'); +goog.object.extend(proto, google_protobuf_descriptor_pb); +goog.exportSymbol('proto.google.api.FieldInfo', null, global); +goog.exportSymbol('proto.google.api.FieldInfo.Format', null, global); +goog.exportSymbol('proto.google.api.fieldInfo', 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.google.api.FieldInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.google.api.FieldInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.google.api.FieldInfo.displayName = 'proto.google.api.FieldInfo'; +} + + + +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.google.api.FieldInfo.prototype.toObject = function(opt_includeInstance) { + return proto.google.api.FieldInfo.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.google.api.FieldInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.api.FieldInfo.toObject = function(includeInstance, msg) { + var f, obj = { + format: 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.google.api.FieldInfo} + */ +proto.google.api.FieldInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.google.api.FieldInfo; + return proto.google.api.FieldInfo.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.google.api.FieldInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.google.api.FieldInfo} + */ +proto.google.api.FieldInfo.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.google.api.FieldInfo.Format} */ (reader.readEnum()); + msg.setFormat(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.google.api.FieldInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.google.api.FieldInfo.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.google.api.FieldInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.api.FieldInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFormat(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.google.api.FieldInfo.Format = { + FORMAT_UNSPECIFIED: 0, + UUID4: 1, + IPV4: 2, + IPV6: 3, + IPV4_OR_IPV6: 4 +}; + +/** + * optional Format format = 1; + * @return {!proto.google.api.FieldInfo.Format} + */ +proto.google.api.FieldInfo.prototype.getFormat = function() { + return /** @type {!proto.google.api.FieldInfo.Format} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {!proto.google.api.FieldInfo.Format} value + * @return {!proto.google.api.FieldInfo} returns this + */ +proto.google.api.FieldInfo.prototype.setFormat = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); +}; + + + +/** + * A tuple of {field number, class constructor} for the extension + * field named `fieldInfo`. + * @type {!jspb.ExtensionFieldInfo} + */ +proto.google.api.fieldInfo = new jspb.ExtensionFieldInfo( + 291403980, + {fieldInfo: 0}, + proto.google.api.FieldInfo, + /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ ( + proto.google.api.FieldInfo.toObject), + 0); + +google_protobuf_descriptor_pb.FieldOptions.extensionsBinary[291403980] = new jspb.ExtensionFieldBinaryInfo( + proto.google.api.fieldInfo, + jspb.BinaryReader.prototype.readMessage, + jspb.BinaryWriter.prototype.writeMessage, + proto.google.api.FieldInfo.serializeBinaryToWriter, + proto.google.api.FieldInfo.deserializeBinaryFromReader, + false); +// This registers the extension field with the extended class, so that +// toObject() will function correctly. +google_protobuf_descriptor_pb.FieldOptions.extensions[291403980] = proto.google.api.fieldInfo; + +goog.object.extend(exports, proto.google.api); diff --git a/package.json b/package.json index 3f78f82..7c9244a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clarifai-nodejs-grpc", - "version": "9.8.5", + "version": "9.9.0", "description": "The official Clarifai Node.js gRPC client", "main": "src/index.js", "repository": "https://github.com/Clarifai/clarifai-javascript-grpc", diff --git a/proto/clarifai/api/resources.proto b/proto/clarifai/api/resources.proto index 1a8e470..d71a8e3 100644 --- a/proto/clarifai/api/resources.proto +++ b/proto/clarifai/api/resources.proto @@ -144,6 +144,19 @@ message App { // Representative image for this app Image image = 22; + + AppExtraInfo extra_info = 24; +} + +message AppExtraInfo { + // Revision marker for this application. + // The value of the revision changes when + // * inputs are added, updated or deleted + // * annotations are added, updated or deleted + // * inputs are added to or removed from datasets + // For example, this value can be used to detect if client side caches related to searching should be invalidated. + // Field not filled in for list endpoints, use GetApp + string search_revision_marker = 1; } // App query diff --git a/proto/clarifai/api/resources_pb.d.ts b/proto/clarifai/api/resources_pb.d.ts index 77835ba..7b0b113 100644 --- a/proto/clarifai/api/resources_pb.d.ts +++ b/proto/clarifai/api/resources_pb.d.ts @@ -195,6 +195,11 @@ export class App extends jspb.Message { getImage(): Image | undefined; setImage(value?: Image): App; + hasExtraInfo(): boolean; + clearExtraInfo(): void; + getExtraInfo(): AppExtraInfo | undefined; + setExtraInfo(value?: AppExtraInfo): App; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): App.AsObject; static toObject(includeInstance: boolean, msg: App): App.AsObject; @@ -225,6 +230,27 @@ export namespace App { starCount: number, notes: string, image?: Image.AsObject, + extraInfo?: AppExtraInfo.AsObject, + } +} + +export class AppExtraInfo extends jspb.Message { + getSearchRevisionMarker(): string; + setSearchRevisionMarker(value: string): AppExtraInfo; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AppExtraInfo.AsObject; + static toObject(includeInstance: boolean, msg: AppExtraInfo): AppExtraInfo.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AppExtraInfo, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AppExtraInfo; + static deserializeBinaryFromReader(message: AppExtraInfo, reader: jspb.BinaryReader): AppExtraInfo; +} + +export namespace AppExtraInfo { + export type AsObject = { + searchRevisionMarker: string, } } diff --git a/proto/clarifai/api/resources_pb.js b/proto/clarifai/api/resources_pb.js index 16b4169..3a0854b 100644 --- a/proto/clarifai/api/resources_pb.js +++ b/proto/clarifai/api/resources_pb.js @@ -54,6 +54,7 @@ goog.exportSymbol('proto.clarifai.api.App', null, global); goog.exportSymbol('proto.clarifai.api.AppCopyProgress', null, global); goog.exportSymbol('proto.clarifai.api.AppDuplication', null, global); goog.exportSymbol('proto.clarifai.api.AppDuplicationFilters', null, global); +goog.exportSymbol('proto.clarifai.api.AppExtraInfo', null, global); goog.exportSymbol('proto.clarifai.api.AppQuery', null, global); goog.exportSymbol('proto.clarifai.api.Audio', null, global); goog.exportSymbol('proto.clarifai.api.AudioInfo', null, global); @@ -328,6 +329,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.clarifai.api.App.displayName = 'proto.clarifai.api.App'; } +/** + * 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.clarifai.api.AppExtraInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.clarifai.api.AppExtraInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.clarifai.api.AppExtraInfo.displayName = 'proto.clarifai.api.AppExtraInfo'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -5344,7 +5366,8 @@ proto.clarifai.api.App.toObject = function(includeInstance, msg) { isStarred: jspb.Message.getBooleanFieldWithDefault(msg, 19, false), starCount: jspb.Message.getFieldWithDefault(msg, 20, 0), notes: jspb.Message.getFieldWithDefault(msg, 21, ""), - image: (f = msg.getImage()) && proto.clarifai.api.Image.toObject(includeInstance, f) + image: (f = msg.getImage()) && proto.clarifai.api.Image.toObject(includeInstance, f), + extraInfo: (f = msg.getExtraInfo()) && proto.clarifai.api.AppExtraInfo.toObject(includeInstance, f) }; if (includeInstance) { @@ -5459,6 +5482,11 @@ proto.clarifai.api.App.deserializeBinaryFromReader = function(msg, reader) { reader.readMessage(value,proto.clarifai.api.Image.deserializeBinaryFromReader); msg.setImage(value); break; + case 24: + var value = new proto.clarifai.api.AppExtraInfo; + reader.readMessage(value,proto.clarifai.api.AppExtraInfo.deserializeBinaryFromReader); + msg.setExtraInfo(value); + break; default: reader.skipField(); break; @@ -5620,6 +5648,14 @@ proto.clarifai.api.App.serializeBinaryToWriter = function(message, writer) { proto.clarifai.api.Image.serializeBinaryToWriter ); } + f = message.getExtraInfo(); + if (f != null) { + writer.writeMessage( + 24, + f, + proto.clarifai.api.AppExtraInfo.serializeBinaryToWriter + ); + } }; @@ -6061,6 +6097,173 @@ proto.clarifai.api.App.prototype.hasImage = function() { }; +/** + * optional AppExtraInfo extra_info = 24; + * @return {?proto.clarifai.api.AppExtraInfo} + */ +proto.clarifai.api.App.prototype.getExtraInfo = function() { + return /** @type{?proto.clarifai.api.AppExtraInfo} */ ( + jspb.Message.getWrapperField(this, proto.clarifai.api.AppExtraInfo, 24)); +}; + + +/** + * @param {?proto.clarifai.api.AppExtraInfo|undefined} value + * @return {!proto.clarifai.api.App} returns this +*/ +proto.clarifai.api.App.prototype.setExtraInfo = function(value) { + return jspb.Message.setWrapperField(this, 24, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.clarifai.api.App} returns this + */ +proto.clarifai.api.App.prototype.clearExtraInfo = function() { + return this.setExtraInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.clarifai.api.App.prototype.hasExtraInfo = function() { + return jspb.Message.getField(this, 24) != 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.clarifai.api.AppExtraInfo.prototype.toObject = function(opt_includeInstance) { + return proto.clarifai.api.AppExtraInfo.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.clarifai.api.AppExtraInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.clarifai.api.AppExtraInfo.toObject = function(includeInstance, msg) { + var f, obj = { + searchRevisionMarker: 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.clarifai.api.AppExtraInfo} + */ +proto.clarifai.api.AppExtraInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.clarifai.api.AppExtraInfo; + return proto.clarifai.api.AppExtraInfo.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.clarifai.api.AppExtraInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.clarifai.api.AppExtraInfo} + */ +proto.clarifai.api.AppExtraInfo.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.setSearchRevisionMarker(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.clarifai.api.AppExtraInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.clarifai.api.AppExtraInfo.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.clarifai.api.AppExtraInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.clarifai.api.AppExtraInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSearchRevisionMarker(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string search_revision_marker = 1; + * @return {string} + */ +proto.clarifai.api.AppExtraInfo.prototype.getSearchRevisionMarker = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.clarifai.api.AppExtraInfo} returns this + */ +proto.clarifai.api.AppExtraInfo.prototype.setSearchRevisionMarker = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + +