Skip to content

Commit

Permalink
GRPC clients version 9.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
clarifai-prod committed Dec 13, 2023
1 parent eeccda4 commit 841f0da
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 80 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.11.1
9.11.2
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clarifai-nodejs-grpc",
"version": "9.11.1",
"version": "9.11.2",
"description": "The official Clarifai Node.js gRPC client",
"main": "src/index.js",
"repository": "https://github.com/Clarifai/clarifai-javascript-grpc",
Expand Down
62 changes: 43 additions & 19 deletions proto/clarifai/api/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2826,43 +2826,66 @@ message WorkflowState {

// AppDuplication
message AppDuplication {
// the id of app duplication
// The unique identifier of an app duplication job.
string id = 1;

// The destination application where resources are written.
//
// If the destination does not exist, then the fields from the request are
// used to create the application. If a field is not set or not supported,
// then it will be copied from the source app, unless otherwise noted.
//
// Note: this field can be empty when reading app duplication jobs in cases
// where the app has been deleted or is just not visible to the caller.
//
// ########## Supported fields ##########
// - description
// - id - if not set, then generated automatically
// - user_id - if not set, then the calling user is used as the app owner
App destination_app = 10;

// The ID of an existing app you want to copy data into.
//
// If not provided, then we will create a new application as the destination instead.
// The various new_app_* fields can be used to set fields of this new application.
string existing_app_id = 8;
//
// Deprecated: Use destination_app.id with an existing ID instead.
string existing_app_id = 8 [deprecated = true];

// The ID to use when creating a new application.
// You cannot set this field when copying into an existing app, i.e., when existing_app_is is set.
//
// If not provided, then it will be generated automatically.
string new_app_id = 2;
//
// Deprecated: Use destination_app.id with a new ID instead.
string new_app_id = 2 [deprecated = true];

// The name to use when creating a new application.
// You cannot set this field when copying into an existing app, i.e., when existing_app_is is set.
//
// If not provided, then the ID of the new application is also used as the name.
string new_app_name = 3;

// The description to use when creating a new application.
// You cannot set this field when copying into an existing app, i.e., when existing_app_is is set.
//
// If not provided, then the description of the source application is copied.
string new_app_description = 10;
// Deprecated: Application names are deprecated, use application IDs instead.
string new_app_name = 3 [deprecated = true];

// the status of app duplication
// The status of the app duplication job.
clarifai.api.status.Status status = 4;
// when is the app duplication triggered

// The time when the app duplication job was created.
google.protobuf.Timestamp created_at = 5;
// The last time when is the status got updated

// The last time when the app duplication job status was updated.
google.protobuf.Timestamp last_modified_at = 6;
// Only copy resources depending on the filters

// The filter specifies which resources are copied by the app duplication job.
AppDuplicationFilters filter = 7;

// contains progress for each requested filter
// Copy progress for each resource type requested by the filter. Possible fields:
// - inputs
// - concepts
// - annotations
// - models
// - workflows
repeated AppCopyProgress progress = 9;
}

Expand All @@ -2873,15 +2896,16 @@ message AppCopyProgress {

// AppDuplicationFilters
message AppDuplicationFilters {
// Copy inputs what what it depends on: input level annotation and concepts
// Copy inputs. Requires that copy_concepts is also set.
// Note that this will still copy input-level annotations even if copy_annotations is not set.
bool copy_inputs = 1;
// Copy only concepts
// Copy concepts.
bool copy_concepts = 2;
// Copy annotations and what it depends on: inputs and concepts
// Copy annotations. Requires that copy_inputs and copy_concepts are also set.
bool copy_annotations = 3;
// Copy models and what it depends on: concepts
// Copy models. Requires that copy_concepts is also set.
bool copy_models = 4;
// Copy workflows and what it depends on: models and concepts
// Copy workflows. Requires that copy_models and copy_concepts are also set.
bool copy_workflows = 5;
}

Expand Down
9 changes: 6 additions & 3 deletions proto/clarifai/api/resources_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5239,14 +5239,17 @@ export namespace WorkflowState {
export class AppDuplication extends jspb.Message {
getId(): string;
setId(value: string): AppDuplication;

hasDestinationApp(): boolean;
clearDestinationApp(): void;
getDestinationApp(): App | undefined;
setDestinationApp(value?: App): AppDuplication;
getExistingAppId(): string;
setExistingAppId(value: string): AppDuplication;
getNewAppId(): string;
setNewAppId(value: string): AppDuplication;
getNewAppName(): string;
setNewAppName(value: string): AppDuplication;
getNewAppDescription(): string;
setNewAppDescription(value: string): AppDuplication;

hasStatus(): boolean;
clearStatus(): void;
Expand Down Expand Up @@ -5285,10 +5288,10 @@ export class AppDuplication extends jspb.Message {
export namespace AppDuplication {
export type AsObject = {
id: string,
destinationApp?: App.AsObject,
existingAppId: string,
newAppId: string,
newAppName: string,
newAppDescription: string,
status?: proto_clarifai_api_status_status_pb.Status.AsObject,
createdAt?: google_protobuf_timestamp_pb.Timestamp.AsObject,
lastModifiedAt?: google_protobuf_timestamp_pb.Timestamp.AsObject,
Expand Down
81 changes: 51 additions & 30 deletions proto/clarifai/api/resources_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -45390,10 +45390,10 @@ proto.clarifai.api.AppDuplication.prototype.toObject = function(opt_includeInsta
proto.clarifai.api.AppDuplication.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
destinationApp: (f = msg.getDestinationApp()) && proto.clarifai.api.App.toObject(includeInstance, f),
existingAppId: jspb.Message.getFieldWithDefault(msg, 8, ""),
newAppId: jspb.Message.getFieldWithDefault(msg, 2, ""),
newAppName: jspb.Message.getFieldWithDefault(msg, 3, ""),
newAppDescription: jspb.Message.getFieldWithDefault(msg, 10, ""),
status: (f = msg.getStatus()) && proto_clarifai_api_status_status_pb.Status.toObject(includeInstance, f),
createdAt: (f = msg.getCreatedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
lastModifiedAt: (f = msg.getLastModifiedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
Expand Down Expand Up @@ -45440,6 +45440,11 @@ proto.clarifai.api.AppDuplication.deserializeBinaryFromReader = function(msg, re
var value = /** @type {string} */ (reader.readString());
msg.setId(value);
break;
case 10:
var value = new proto.clarifai.api.App;
reader.readMessage(value,proto.clarifai.api.App.deserializeBinaryFromReader);
msg.setDestinationApp(value);
break;
case 8:
var value = /** @type {string} */ (reader.readString());
msg.setExistingAppId(value);
Expand All @@ -45452,10 +45457,6 @@ proto.clarifai.api.AppDuplication.deserializeBinaryFromReader = function(msg, re
var value = /** @type {string} */ (reader.readString());
msg.setNewAppName(value);
break;
case 10:
var value = /** @type {string} */ (reader.readString());
msg.setNewAppDescription(value);
break;
case 4:
var value = new proto_clarifai_api_status_status_pb.Status;
reader.readMessage(value,proto_clarifai_api_status_status_pb.Status.deserializeBinaryFromReader);
Expand Down Expand Up @@ -45517,6 +45518,14 @@ proto.clarifai.api.AppDuplication.serializeBinaryToWriter = function(message, wr
f
);
}
f = message.getDestinationApp();
if (f != null) {
writer.writeMessage(
10,
f,
proto.clarifai.api.App.serializeBinaryToWriter
);
}
f = message.getExistingAppId();
if (f.length > 0) {
writer.writeString(
Expand All @@ -45538,13 +45547,6 @@ proto.clarifai.api.AppDuplication.serializeBinaryToWriter = function(message, wr
f
);
}
f = message.getNewAppDescription();
if (f.length > 0) {
writer.writeString(
10,
f
);
}
f = message.getStatus();
if (f != null) {
writer.writeMessage(
Expand Down Expand Up @@ -45606,6 +45608,43 @@ proto.clarifai.api.AppDuplication.prototype.setId = function(value) {
};


/**
* optional App destination_app = 10;
* @return {?proto.clarifai.api.App}
*/
proto.clarifai.api.AppDuplication.prototype.getDestinationApp = function() {
return /** @type{?proto.clarifai.api.App} */ (
jspb.Message.getWrapperField(this, proto.clarifai.api.App, 10));
};


/**
* @param {?proto.clarifai.api.App|undefined} value
* @return {!proto.clarifai.api.AppDuplication} returns this
*/
proto.clarifai.api.AppDuplication.prototype.setDestinationApp = function(value) {
return jspb.Message.setWrapperField(this, 10, value);
};


/**
* Clears the message field making it undefined.
* @return {!proto.clarifai.api.AppDuplication} returns this
*/
proto.clarifai.api.AppDuplication.prototype.clearDestinationApp = function() {
return this.setDestinationApp(undefined);
};


/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.clarifai.api.AppDuplication.prototype.hasDestinationApp = function() {
return jspb.Message.getField(this, 10) != null;
};


/**
* optional string existing_app_id = 8;
* @return {string}
Expand Down Expand Up @@ -45660,24 +45699,6 @@ proto.clarifai.api.AppDuplication.prototype.setNewAppName = function(value) {
};


/**
* optional string new_app_description = 10;
* @return {string}
*/
proto.clarifai.api.AppDuplication.prototype.getNewAppDescription = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, ""));
};


/**
* @param {string} value
* @return {!proto.clarifai.api.AppDuplication} returns this
*/
proto.clarifai.api.AppDuplication.prototype.setNewAppDescription = function(value) {
return jspb.Message.setProto3StringField(this, 10, value);
};


/**
* optional status.Status status = 4;
* @return {?proto.clarifai.api.status.Status}
Expand Down
33 changes: 22 additions & 11 deletions proto/clarifai/api/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2562,12 +2562,21 @@ service V2 {



// start to duplicate an app which copies all the inputs, annotations, models, concepts etc. to a new app.
// this is an async process, you should use ListAppDuplications or GetAppDuplication to check the status.
// PostAppDuplications starts async app duplication jobs which copy resources
// (inputs, annotations, models etc) from one application to another. It can
// also create the destination application if it does not exist, with fields
// (description, metadata etc) copied from the source application.
//
// A duplication job can be started by any user that can read from the source
// application (the target of this call) and can create and write to the
// destination application. The duplication is associated with the user that
// created it, so in order to read the status and progress of the job, that
// user's ID has to be used in the call to GetAppDuplication, which might be
// different to the source application owner ID in this call.
rpc PostAppDuplications (PostAppDuplicationsRequest) returns (MultiAppDuplicationsResponse) {
option (google.api.http) = {
post: "/v2/users/{user_app_id.user_id}/apps/{user_app_id.app_id}/duplications"
body: "*"
body: "*"
};
option (clarifai.auth.util.cl_auth_type) = PATAuth;
option (clarifai.auth.util.cl_depending_scopes) = Apps_Add;
Expand All @@ -2585,18 +2594,18 @@ service V2 {
option (clarifai.auth.util.cl_depending_scopes) = Workflows_Get;
}

// list all the app duplications user triggers
// ListAppDuplications lists all app duplication jobs created by the user.
rpc ListAppDuplications (ListAppDuplicationsRequest) returns (MultiAppDuplicationsResponse){
option (google.api.http) = {
get : "/v2/users/{user_app_id.user_id}/duplications"
get: "/v2/users/{user_app_id.user_id}/duplications"
};
option (clarifai.auth.util.cl_auth_type) = PATAuth;
}

// get the app duplication status
// GetAppDuplication returns an app duplication job created by the user.
rpc GetAppDuplication (GetAppDuplicationRequest) returns (SingleAppDuplicationResponse) {
option (google.api.http) = {
get : "/v2/users/{user_app_id.user_id}/duplications/{app_duplication_id}"
get: "/v2/users/{user_app_id.user_id}/duplications/{app_duplication_id}"
};
option (clarifai.auth.util.cl_auth_type) = PATAuth;
}
Expand Down Expand Up @@ -6322,21 +6331,23 @@ message SingleWorkflowVersionResponse {



//Request to start a app duplication process
// Request to start app duplication jobs.
message PostAppDuplicationsRequest {
// The user and application ID of the source application to duplicate.
clarifai.api.UserAppIDSet user_app_id = 1;
repeated AppDuplication app_duplications = 2;
}

//Request to check app duplication status
// Request to get an app duplication job.
message GetAppDuplicationRequest {
// The ID of the user that created the app duplication job.
clarifai.api.UserAppIDSet user_app_id = 1;
//The app duplication id
string app_duplication_id = 2;
}

//Request to list all the app duplication that user triggered.
// Request to list all the app duplication jobs that a user created.
message ListAppDuplicationsRequest {
// The ID of the user whose app duplication jobs to list.
clarifai.api.UserAppIDSet user_app_id = 1;
// (optional URL parameter) The page number. Pagination is used to split the results into chunks.
// Defaults to 1.
Expand Down
17 changes: 13 additions & 4 deletions proto/clarifai/api/service_grpc_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -5297,8 +5297,17 @@ listCollaborations: {
responseSerialize: serialize_clarifai_api_MultiCollaborationsResponse,
responseDeserialize: deserialize_clarifai_api_MultiCollaborationsResponse,
},
// start to duplicate an app which copies all the inputs, annotations, models, concepts etc. to a new app.
// this is an async process, you should use ListAppDuplications or GetAppDuplication to check the status.
// PostAppDuplications starts async app duplication jobs which copy resources
// (inputs, annotations, models etc) from one application to another. It can
// also create the destination application if it does not exist, with fields
// (description, metadata etc) copied from the source application.
//
// A duplication job can be started by any user that can read from the source
// application (the target of this call) and can create and write to the
// destination application. The duplication is associated with the user that
// created it, so in order to read the status and progress of the job, that
// user's ID has to be used in the call to GetAppDuplication, which might be
// different to the source application owner ID in this call.
postAppDuplications: {
path: '/clarifai.api.V2/PostAppDuplications',
requestStream: false,
Expand All @@ -5310,7 +5319,7 @@ postAppDuplications: {
responseSerialize: serialize_clarifai_api_MultiAppDuplicationsResponse,
responseDeserialize: deserialize_clarifai_api_MultiAppDuplicationsResponse,
},
// list all the app duplications user triggers
// ListAppDuplications lists all app duplication jobs created by the user.
listAppDuplications: {
path: '/clarifai.api.V2/ListAppDuplications',
requestStream: false,
Expand All @@ -5322,7 +5331,7 @@ listAppDuplications: {
responseSerialize: serialize_clarifai_api_MultiAppDuplicationsResponse,
responseDeserialize: deserialize_clarifai_api_MultiAppDuplicationsResponse,
},
// get the app duplication status
// GetAppDuplication returns an app duplication job created by the user.
getAppDuplication: {
path: '/clarifai.api.V2/GetAppDuplication',
requestStream: false,
Expand Down
Loading

0 comments on commit 841f0da

Please sign in to comment.