@@ -10,12 +10,11 @@ import {
1010 Deployment ,
1111 ImageFormat ,
1212 ClassificationOutput ,
13- } from './generated/athena/models' ;
13+ } from './generated/athena/models.js ' ;
1414import * as grpc from '@grpc/grpc-js' ;
1515import {
16- type IClassifierServiceClient ,
1716 ClassifierServiceClient ,
18- } from './generated/athena/athena.grpc-client ' ;
17+ } from './generated/athena/athena.js ' ;
1918import { EventEmitter } from 'events' ;
2019import { Empty } from './generated/google/protobuf/empty' ;
2120import {
@@ -93,7 +92,7 @@ export const defaultGrpcAddress = 'trust.messages.crispthinking.com:443';
9392 */
9493export class ClassifierSdk extends ( EventEmitter as new ( ) => TypedEventEmitter < ClassifierEvents > ) {
9594 private grpcAddress : string ;
96- private client : IClassifierServiceClient ;
95+ private client : ClassifierServiceClient ;
9796 private classifierGrpcCall : grpc . ClientDuplexStream <
9897 ClassifyRequest ,
9998 ClassifyResponse
@@ -253,11 +252,11 @@ export class ClassifierSdk extends (EventEmitter as new () => TypedEventEmitter<
253252 affiliate = this . options . affiliate ,
254253 correlationId = randomUUID ( ) . toString ( ) ,
255254 data : inputData ,
256- includeHashes = [ HashType . MD5 , HashType . SHA1 ] ,
257- encoding = RequestEncoding . UNCOMPRESSED ,
255+ includeHashes = [ HashType . HASH_TYPE_MD5 , HashType . HASH_TYPE_SHA1 ] ,
256+ encoding = RequestEncoding . REQUEST_ENCODING_UNCOMPRESSED ,
258257 } = options ;
259258
260- let inputFormat : ImageFormat = ImageFormat . UNSPECIFIED ;
259+ let inputFormat : ImageFormat = ImageFormat . IMAGE_FORMAT_UNSPECIFIED ;
261260
262261 if ( 'resize' in options === false ) {
263262 inputFormat = options . format ;
@@ -274,11 +273,11 @@ export class ClassifierSdk extends (EventEmitter as new () => TypedEventEmitter<
274273 const hashes : ImageHash [ ] = [ ] ;
275274
276275 if ( md5 && md5 . trim ( ) != '' ) {
277- hashes . push ( { value : md5 , type : HashType . MD5 } ) ;
276+ hashes . push ( { value : md5 , type : HashType . HASH_TYPE_MD5 } ) ;
278277 }
279278
280279 if ( sha1 && sha1 . trim ( ) != '' ) {
281- hashes . push ( { value : sha1 , type : HashType . SHA1 } ) ;
280+ hashes . push ( { value : sha1 , type : HashType . HASH_TYPE_SHA1 } ) ;
282281 }
283282
284283 processedInputs . push ( {
@@ -314,11 +313,11 @@ export class ClassifierSdk extends (EventEmitter as new () => TypedEventEmitter<
314313 const options = {
315314 affiliate : this . options . affiliate ,
316315 correlationId : randomUUID ( ) . toString ( ) ,
317- includeHashes : [ HashType . MD5 , HashType . SHA1 ] ,
316+ includeHashes : [ HashType . HASH_TYPE_MD5 , HashType . HASH_TYPE_SHA1 ] ,
318317 encoding : request . encoding ,
319318 } ;
320319
321- let inputFormat : ImageFormat = ImageFormat . UNSPECIFIED ;
320+ let inputFormat : ImageFormat = ImageFormat . IMAGE_FORMAT_UNSPECIFIED ;
322321
323322 if ( 'resize' in request === false ) {
324323 inputFormat = request . format ;
@@ -335,11 +334,11 @@ export class ClassifierSdk extends (EventEmitter as new () => TypedEventEmitter<
335334 const hashes : ImageHash [ ] = [ ] ;
336335
337336 if ( md5 && md5 . trim ( ) != '' ) {
338- hashes . push ( { value : md5 , type : HashType . MD5 } ) ;
337+ hashes . push ( { value : md5 , type : HashType . HASH_TYPE_MD5 } ) ;
339338 }
340339
341340 if ( sha1 && sha1 . trim ( ) != '' ) {
342- hashes . push ( { value : sha1 , type : HashType . SHA1 } ) ;
341+ hashes . push ( { value : sha1 , type : HashType . HASH_TYPE_SHA1 } ) ;
343342 }
344343
345344 const input : ClassificationInput = {
@@ -399,7 +398,6 @@ export class ClassifierSdk extends (EventEmitter as new () => TypedEventEmitter<
399398 }
400399}
401400
402- export * from './generated/athena/models' ;
403- export * from './generated/athena/athena' ;
404- export * from './generated/athena/athena.grpc-client' ;
405- export * from './hashing' ;
401+ export * from './generated/athena/models.js' ;
402+ export { ClassifierServiceClient } from './generated/athena/athena.js' ;
403+ export * from './hashing.js' ;
0 commit comments