File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11import crypto from 'crypto' ;
22import EventEmitter from 'events' ;
33import fs from 'fs' ;
4+ import path from 'path' ;
5+ import { fileURLToPath } from 'url' ;
6+
47import avro from 'avro-js' ;
58import certifi from 'certifi' ;
69import grpc from '@grpc/grpc-js' ;
@@ -74,7 +77,12 @@ export default class PubSubApiClient {
7477 const rootCert = fs . readFileSync ( certifi ) ;
7578
7679 // Load proto definition
77- const packageDef = protoLoader . loadSync ( 'pubsub_api.proto' , { } ) ;
80+ const curDirName = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
81+ const protoFilePath = path . resolve (
82+ curDirName ,
83+ '../pubsub_api.proto'
84+ ) ;
85+ const packageDef = protoLoader . loadSync ( protoFilePath , { } ) ;
7886 const grpcObj = grpc . loadPackageDefinition ( packageDef ) ;
7987 const sfdcPackage = grpcObj . eventbus . v1 ;
8088
You can’t perform that action at this time.
0 commit comments