@jibb-open/jssdk 3.14.0 → 3.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/types/jibb.pb.js +1 -1
- package/ws/connection_base.js +1 -1
package/package.json
CHANGED
package/types/jibb.pb.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var $protobuf=require("protobufjs/light"),$root=($protobuf.roots["default"]||($protobuf.roots["default"]=new $protobuf.Root)).addJSON({types:{options:{go_package:"github.com/Inkerz/jibbapis/sdk/go/types"},nested:{Code:{values:{SUCCESS:0,ERR_IO:4e3,ERR_CLOSED:4001,ERR_TIMEOUT:4002,ERR_BAD_REQUEST:4003,ERR_UNAUTHORIZED:4004,ERR_INTERNAL:4005,ERR_TOO_MANY_CONNECTIONS:4006,ERR_OUT_OF_LICENSE:4008}},ErrorLevel:{values:{DEBUG:0,INFO:1,WARNING:2,ERROR:3,CRITICAL:4}},Error:{fields:{level:{type:"ErrorLevel",id:1},code:{type:"Code",id:2},reason:{type:"string",id:3}}},TriState:{values:{DEFAULT:0,ENABLE:1,DISABLE:2}},SurfaceType:{values:{UNKNOWN:0,PAPER:1,WHITEBOARD:2}},ClientType:{options:{allow_alias:!0},values:{UNKNOWN_CLIENT_TYPE:0,ANY:0,IPSA:1,MOBILE:2,WEBAPP:3,COMPANION:4,ipsa:1,mobile:2,webapp:3,companion:4}},ClientDetails:{fields:{clientType:{type:"ClientType",id:1},id:{type:"string",id:2},name:{type:"string",id:3}}},ContentType:{values:{UNKNOWN_TYPE:0,IMAGE_JPEG:1,IMAGE_WEBP:2}}}},jibb:{nested:{ipsa:{nested:{v1:{options:{java_package:"ai.jibb.ipsa",java_outer_classname:"IPSA",go_package:"github.com/Inkerz/jibbapis/sdk/go/ipsa"},nested:{StatusCode:{values:{SUCCESS:0,INVALID_INPUT:3,SESSION_BUSY:6,SURFACE_DETECTED:110,SURFACE_NOT_DETECTED:100,SURFACE_NOT_STABILIZED:101,SURFACE_CHANGED:103,SURFACE_TOO_LEFT:104,SURFACE_TOO_RIGHT:105,SURFACE_TOO_CLOSE:106,SURFACE_TOO_FAR:109,SURFACE_TOO_DARK:107,SURFACE_TOO_BRIGHT:108,INTERNAL_ERROR:200}},Rotation:{values:{ROTATE_0:0,ROTATE_90_CLOCKWISE:1,ROTATE_180:2,ROTATE_90_COUNTERCLOCKWISE:3}},Encoding:{values:{JPEG:0,VP8:1,VP9:2,H264:3}},Config:{fields:{surfaceType:{type:"types.SurfaceType",id:1},enableStabilization:{type:"types.TriState",id:3},enableTransformation:{type:"types.TriState",id:4},userId:{type:"string",id:5},mbusTopicStatus:{type:"string",id:7},mbusTopicImage:{type:"string",id:8},encoding:{type:"Encoding",id:10}}},RuntimeConfig:{fields:{customCorners:{rule:"repeated",type:"sint32",id:1},fixedCorners:{type:"bool",id:2},enableColor:{type:"bool",id:3},rotation:{type:"Rotation",id:4},flipUpDown:{type:"bool",id:5},flipLeftRight:{type:"bool",id:6},enableEstimation:{type:"bool",id:7},inputRotation:{type:"Rotation",id:8}}},VersionResponse:{fields:{version:{type:"string",id:1}}},SurfaceTransformationRequest:{fields:{surfaceType:{type:"types.SurfaceType",id:1},img:{type:"bytes",id:2}}},SurfaceTransformationResponse:{fields:{img:{type:"bytes",id:1}}},SurfaceSegmentationRequest:{fields:{surfaceType:{type:"types.SurfaceType",id:1},overlay:{type:"bool",id:2},img:{type:"bytes",id:3}}},SurfaceSegmentationResponse:{fields:{img:{type:"bytes",id:1}}},SurfaceDetectionRequest:{fields:{surfaceType:{type:"types.SurfaceType",id:1},img:{type:"bytes",id:2},overlay:{type:"bool",id:3}}},SurfaceDetectionResponse:{fields:{img:{type:"bytes",id:1},corners:{rule:"repeated",type:"sint32",id:2}}},ObjectRemovalRequest:{fields:{surfaceType:{type:"types.SurfaceType",id:1},overlay:{type:"bool",id:2},enableTransformation:{type:"bool",id:3},img:{type:"bytes",id:4}}},ObjectRemovalResponse:{fields:{img:{type:"bytes",id:1}}},ContentExtractionRequest:{fields:{surfaceType:{type:"types.SurfaceType",id:1},enableTransformation:{type:"bool",id:2},enableColor:{type:"bool",id:4},img:{type:"bytes",id:3}}},ContentExtractionResponse:{fields:{img:{type:"bytes",id:1},transformedImg:{type:"bytes",id:2}}},GetSimilarityRequest:{fields:{newImage:{type:"bytes",id:1},prevImage:{type:"bytes",id:2},level:{type:"SensivityLevel",id:3}},nested:{SensivityLevel:{values:{NORMAL:0,LOW:1,HIGH:2}}}},GetSimilarityResponse:{fields:{isSimilar:{type:"bool",id:1},addedContentCount:{type:"int32",id:2}}},Ipsa:{fields:{data:{type:"bytes",id:1}}},Request:{oneofs:{Command:{oneof:["config","ipsa","resetSession","recalibrate","runtimeConfig"]}},fields:{id:{type:"int32",id:1},config:{type:"Config",id:2},ipsa:{type:"Ipsa",id:3},resetSession:{type:"google.protobuf.Empty",id:4},recalibrate:{type:"google.protobuf.Empty",id:5},runtimeConfig:{type:"RuntimeConfig",id:6}}},Status:{fields:{userId:{type:"string",id:1},corners:{rule:"repeated",type:"float",id:2},codes:{rule:"repeated",type:"StatusCode",id:3},processingTime:{type:"int32",id:4},upsampling:{type:"float",id:5},paperDetectionConfidence:{type:"int32",id:6}}},Image:{fields:{userId:{type:"string",id:1},data:{type:"bytes",id:2}}},Response:{fields:{id:{type:"int32",id:1},image:{type:"bytes",id:5},status:{type:"Status",id:8}}},Started:{fields:{}},Stopped:{fields:{}}}}}}}},user:{options:{go_package:"github.com/Inkerz/jibbapis/sdk/go/user"},nested:{Level:{values:{FREE:0,BASIC:1,PRO:3,BUSINESS:4,ENTERPRISE:5}},UserType:{values:{UNKNOWN:0,MEMBER:2,ADMIN:3,OWNER:4}},UserDetails:{fields:{organizationName:{type:"string",id:2},level:{type:"Level",id:3},firstName:{type:"string",id:4},lastName:{type:"string",id:5},organizationId:{type:"int32",id:6},userType:{type:"UserType",id:7},activated:{type:"bool",id:8},userId:{type:"string",id:9},email:{type:"string",id:10},lastLogin:{type:"google.protobuf.Timestamp",id:11}}},UserClaims:{fields:{level:{type:"Level",id:2},organizationId:{type:"int32",id:3},email:{type:"string",id:4},organizationName:{type:"string",id:5}}},OrganizationDetails:{fields:{name:{type:"string",id:1},ownerEmail:{type:"string",id:2},level:{type:"Level",id:3},licenseCount:{type:"int32",id:4},usersCount:{type:"int32",id:5},creationDate:{type:"google.protobuf.Timestamp",id:6},expiryDate:{type:"google.protobuf.Timestamp",id:7},organizationId:{type:"int32",id:8},subdomainName:{type:"string",id:9},deviceLicenseCount:{type:"int32",id:10},devicesCount:{type:"int32",id:11}}}}},google:{nested:{protobuf:{nested:{Empty:{fields:{}},Timestamp:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}}}},meeting:{options:{go_package:"github.com/Inkerz/jibbapis/sdk/go/meeting"},nested:{Participant:{fields:{id:{type:"int32",id:1},userId:{type:"string",id:2},email:{type:"string",id:3},title:{type:"string",id:4}}},Update:{fields:{userId:{type:"string",id:2},image:{type:"bytes",id:5}}},Drawing:{fields:{userId:{type:"string",id:2},data:{type:"string",id:4}}},Pointer:{fields:{userId:{type:"string",id:2},x:{type:"int32",id:4},y:{type:"int32",id:5},email:{type:"string",id:6}}},ImageAck:{fields:{userId:{type:"string",id:2}}},Message:{oneofs:{event:{oneof:["join","leave","update","drawing","pointer","imageAck"]}},fields:{join:{type:"Participant",id:1},leave:{type:"Participant",id:2},update:{type:"Update",id:3},drawing:{type:"Drawing",id:6},pointer:{type:"Pointer",id:7},imageAck:{type:"ImageAck",id:8}}},SharePermission:{values:{UNKNOWN_SHARE_TYPE:0,SHARE_READ:1,SHARE_WRITE:2}},Permission:{values:{UNKNOWN_PERMISSION:0,IMAGE_READ:1,IMAGE_WRITE:2,ANNOTATION_READ:4,ANNOTATION_WRITE:8,MODIFY:16,MASK_READ_ONLY:5,MASK_WRITE_ONLY:10,MASK_READ_WRITE:15,MASK_FULL_ACCESS:31}},Meeting:{fields:{id:{type:"string",id:1},title:{type:"string",id:2},ownerId:{type:"string",id:6},creationTime:{type:"int64",id:7},capacity:{type:"int32",id:8},isTemporary:{type:"bool",id:9}}},MeetingClaims:{fields:{meetingId:{type:"string",id:1},ownerId:{type:"string",id:3},capacity:{type:"int32",id:4},auxilary:{keyType:"string",type:"string",id:5},title:{type:"string",id:6},isTemporary:{type:"bool",id:7},permission:{type:"uint32",id:9}}}}},cilix:{options:{go_package:"github.com/Inkerz/jibbapis/sdk/go/cilix"},nested:{CameraDescription:{fields:{id:{type:"string",id:1},name:{type:"string",id:2}}},StartRequest:{fields:{config:{type:"jibb.ipsa.v1.Config",id:2},runtimeConfig:{type:"jibb.ipsa.v1.RuntimeConfig",id:4},camera:{type:"CameraDescription",id:5},meetingToken:{type:"string",id:6}}},PreviewRequest:{fields:{source:{type:"CameraDescription",id:2}}},PreviewResponse:{fields:{image:{type:"bytes",id:1}}},GetCameraListResponse:{fields:{items:{rule:"repeated",type:"CameraDescription",id:1}}},GetClientStatusListResponse:{fields:{clients:{rule:"repeated",type:"types.ClientDetails",id:1}}},BusMessage:{oneofs:{messageType:{oneof:["clientConnected","clientDisconnected","tooManyPublishers","ipsaResponse","startRequest","stopRequest","newPageRequest","previewRequest","previewResponse","cameraListRequest","cameraListResponse","runtimeConfigRequest","clientStatusRequest","recordingStarted","recordingStopped","error"]}},fields:{clientConnected:{type:"google.protobuf.Empty",id:2},clientDisconnected:{type:"google.protobuf.Empty",id:3},tooManyPublishers:{type:"google.protobuf.Empty",id:4},ipsaResponse:{type:"jibb.ipsa.v1.Response",id:6},startRequest:{type:"StartRequest",id:50},stopRequest:{type:"google.protobuf.Empty",id:51},newPageRequest:{type:"google.protobuf.Empty",id:52},previewRequest:{type:"PreviewRequest",id:53},previewResponse:{type:"PreviewResponse",id:54},cameraListRequest:{type:"google.protobuf.Empty",id:55},cameraListResponse:{type:"GetCameraListResponse",id:56},runtimeConfigRequest:{type:"jibb.ipsa.v1.RuntimeConfig",id:57},clientStatusRequest:{type:"google.protobuf.Empty",id:58},recordingStarted:{type:"google.protobuf.Empty",id:59},recordingStopped:{type:"google.protobuf.Empty",id:60},error:{type:"types.Code",id:100},src:{type:"types.ClientDetails",id:30},dst:{type:"types.ClientDetails",id:31}}}}}});module.exports=$root;
|
|
1
|
+
"use strict";var $protobuf=require("protobufjs/light"),$root=($protobuf.roots["default"]||($protobuf.roots["default"]=new $protobuf.Root)).addJSON({types:{options:{go_package:"github.com/Inkerz/jibbapis/sdk/go/types"},nested:{Code:{values:{SUCCESS:0,ERR_IO:4e3,ERR_CLOSED:4001,ERR_TIMEOUT:4002,ERR_BAD_REQUEST:4003,ERR_UNAUTHORIZED:4004,ERR_INTERNAL:4005,ERR_TOO_MANY_CONNECTIONS:4006,ERR_OUT_OF_LICENSE:4008}},ErrorLevel:{values:{DEBUG:0,INFO:1,WARNING:2,ERROR:3,CRITICAL:4}},Error:{fields:{level:{type:"ErrorLevel",id:1},code:{type:"Code",id:2},reason:{type:"string",id:3}}},TriState:{values:{DEFAULT:0,ENABLE:1,DISABLE:2}},SurfaceType:{values:{UNKNOWN:0,PAPER:1,WHITEBOARD:2}},ClientType:{options:{allow_alias:!0},values:{UNKNOWN_CLIENT_TYPE:0,ANY:0,IPSA:1,MOBILE:2,WEBAPP:3,COMPANION:4,ipsa:1,mobile:2,webapp:3,companion:4}},ClientDetails:{fields:{clientType:{type:"ClientType",id:1},id:{type:"string",id:2},name:{type:"string",id:3}}},ContentType:{values:{UNKNOWN_TYPE:0,IMAGE_JPEG:1,IMAGE_WEBP:2}}}},jibb:{nested:{ipsa:{nested:{v1:{options:{java_package:"ai.jibb.ipsa",java_outer_classname:"IPSA",go_package:"github.com/Inkerz/jibbapis/sdk/go/ipsa"},nested:{StatusCode:{values:{SUCCESS:0,INVALID_INPUT:3,SESSION_BUSY:6,SURFACE_DETECTED:110,SURFACE_NOT_DETECTED:100,SURFACE_NOT_STABILIZED:101,SURFACE_CHANGED:103,SURFACE_TOO_LEFT:104,SURFACE_TOO_RIGHT:105,SURFACE_TOO_CLOSE:106,SURFACE_TOO_FAR:109,SURFACE_TOO_DARK:107,SURFACE_TOO_BRIGHT:108,INTERNAL_ERROR:200}},Rotation:{values:{ROTATE_0:0,ROTATE_90_CLOCKWISE:1,ROTATE_180:2,ROTATE_90_COUNTERCLOCKWISE:3}},Encoding:{values:{JPEG:0,VP8:1,VP9:2,H264:3}},Config:{fields:{surfaceType:{type:"types.SurfaceType",id:1},enableStabilization:{type:"types.TriState",id:3},enableTransformation:{type:"types.TriState",id:4},userId:{type:"string",id:5},mbusTopicStatus:{type:"string",id:7},mbusTopicImage:{type:"string",id:8},encoding:{type:"Encoding",id:10}}},RuntimeConfig:{fields:{customCorners:{rule:"repeated",type:"sint32",id:1},fixedCorners:{type:"bool",id:2},enableColor:{type:"bool",id:3},rotation:{type:"Rotation",id:4},flipUpDown:{type:"bool",id:5},flipLeftRight:{type:"bool",id:6},enableEstimation:{type:"bool",id:7},inputRotation:{type:"Rotation",id:8}}},VersionResponse:{fields:{version:{type:"string",id:1}}},SurfaceTransformationRequest:{fields:{surfaceType:{type:"types.SurfaceType",id:1},img:{type:"bytes",id:2}}},SurfaceTransformationResponse:{fields:{img:{type:"bytes",id:1}}},SurfaceSegmentationRequest:{fields:{surfaceType:{type:"types.SurfaceType",id:1},overlay:{type:"bool",id:2},img:{type:"bytes",id:3}}},SurfaceSegmentationResponse:{fields:{img:{type:"bytes",id:1}}},SurfaceDetectionRequest:{fields:{surfaceType:{type:"types.SurfaceType",id:1},img:{type:"bytes",id:2},overlay:{type:"bool",id:3}}},SurfaceDetectionResponse:{fields:{img:{type:"bytes",id:1},corners:{rule:"repeated",type:"sint32",id:2}}},ObjectRemovalRequest:{fields:{surfaceType:{type:"types.SurfaceType",id:1},overlay:{type:"bool",id:2},enableTransformation:{type:"bool",id:3},img:{type:"bytes",id:4}}},ObjectRemovalResponse:{fields:{img:{type:"bytes",id:1}}},ContentExtractionRequest:{fields:{surfaceType:{type:"types.SurfaceType",id:1},enableTransformation:{type:"bool",id:2},enableColor:{type:"bool",id:4},img:{type:"bytes",id:3}}},ContentExtractionResponse:{fields:{img:{type:"bytes",id:1},transformedImg:{type:"bytes",id:2}}},GetSimilarityRequest:{fields:{newImage:{type:"bytes",id:1},prevImage:{type:"bytes",id:2},level:{type:"SensivityLevel",id:3}},nested:{SensivityLevel:{values:{NORMAL:0,LOW:1,HIGH:2}}}},GetSimilarityResponse:{fields:{isSimilar:{type:"bool",id:1},addedContentCount:{type:"int32",id:2}}},Ipsa:{fields:{data:{type:"bytes",id:1}}},Request:{oneofs:{Command:{oneof:["config","ipsa","resetSession","recalibrate","runtimeConfig"]}},fields:{id:{type:"int32",id:1},config:{type:"Config",id:2},ipsa:{type:"Ipsa",id:3},resetSession:{type:"google.protobuf.Empty",id:4},recalibrate:{type:"google.protobuf.Empty",id:5},runtimeConfig:{type:"RuntimeConfig",id:6}}},Status:{fields:{userId:{type:"string",id:1},corners:{rule:"repeated",type:"float",id:2},codes:{rule:"repeated",type:"StatusCode",id:3},processingTime:{type:"int32",id:4},upsampling:{type:"float",id:5},paperDetectionConfidence:{type:"int32",id:6}}},Image:{fields:{userId:{type:"string",id:1},data:{type:"bytes",id:2}}},Response:{fields:{id:{type:"int32",id:1},image:{type:"bytes",id:5},status:{type:"Status",id:8}}},Started:{fields:{}},Stopped:{fields:{}}}}}}}},user:{options:{go_package:"github.com/Inkerz/jibbapis/sdk/go/user"},nested:{Level:{values:{FREE:0,BASIC:1,PRO:3,BUSINESS:4,ENTERPRISE:5}},UserType:{values:{UNKNOWN:0,MEMBER:2,ADMIN:3,OWNER:4}},UserDetails:{fields:{organizationName:{type:"string",id:2},level:{type:"Level",id:3},firstName:{type:"string",id:4},lastName:{type:"string",id:5},organizationId:{type:"int32",id:6},userType:{type:"UserType",id:7},activated:{type:"bool",id:8},userId:{type:"string",id:9},email:{type:"string",id:10},lastLogin:{type:"google.protobuf.Timestamp",id:11}}},UserClaims:{fields:{level:{type:"Level",id:2},organizationId:{type:"int32",id:3},email:{type:"string",id:4},organizationName:{type:"string",id:5},userId:{type:"string",id:6},isDevice:{type:"bool",id:7}}},OrganizationDetails:{fields:{name:{type:"string",id:1},ownerEmail:{type:"string",id:2},level:{type:"Level",id:3},licenseCount:{type:"int32",id:4},usersCount:{type:"int32",id:5},creationDate:{type:"google.protobuf.Timestamp",id:6},startDate:{type:"google.protobuf.Timestamp",id:12},expiryDate:{type:"google.protobuf.Timestamp",id:7},organizationId:{type:"int32",id:8},subdomainName:{type:"string",id:9},deviceLicenseCount:{type:"int32",id:10},devicesCount:{type:"int32",id:11}}}}},google:{nested:{protobuf:{nested:{Empty:{fields:{}},Timestamp:{fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}}}},meeting:{options:{go_package:"github.com/Inkerz/jibbapis/sdk/go/meeting"},nested:{Participant:{fields:{id:{type:"int32",id:1},userId:{type:"string",id:2},email:{type:"string",id:3},title:{type:"string",id:4}}},Update:{fields:{userId:{type:"string",id:2},image:{type:"bytes",id:5}}},Drawing:{fields:{userId:{type:"string",id:2},data:{type:"string",id:4}}},Pointer:{fields:{userId:{type:"string",id:2},x:{type:"int32",id:4},y:{type:"int32",id:5},email:{type:"string",id:6}}},ImageAck:{fields:{userId:{type:"string",id:2}}},Message:{oneofs:{event:{oneof:["join","leave","update","drawing","pointer","imageAck"]}},fields:{join:{type:"Participant",id:1},leave:{type:"Participant",id:2},update:{type:"Update",id:3},drawing:{type:"Drawing",id:6},pointer:{type:"Pointer",id:7},imageAck:{type:"ImageAck",id:8}}},SharePermission:{values:{UNKNOWN_SHARE_TYPE:0,SHARE_READ:1,SHARE_WRITE:2}},Permission:{values:{UNKNOWN_PERMISSION:0,IMAGE_READ:1,IMAGE_WRITE:2,ANNOTATION_READ:4,ANNOTATION_WRITE:8,MODIFY:16,MASK_READ_ONLY:5,MASK_WRITE_ONLY:10,MASK_READ_WRITE:15,MASK_FULL_ACCESS:31}},Meeting:{fields:{id:{type:"string",id:1},title:{type:"string",id:2},ownerId:{type:"string",id:6},creationTime:{type:"int64",id:7},capacity:{type:"int32",id:8},isTemporary:{type:"bool",id:9}}},SharedMeeting:{fields:{id:{type:"int32",id:1},userId:{type:"string",id:2},meetingId:{type:"int32",id:3},email:{type:"string",id:4},permission:{type:"SharePermission",id:5}}},MeetingClaims:{fields:{meetingId:{type:"string",id:1},ownerId:{type:"string",id:3},capacity:{type:"int32",id:4},auxilary:{keyType:"string",type:"string",id:5},title:{type:"string",id:6},isTemporary:{type:"bool",id:7},permission:{type:"uint32",id:9}}}}},cilix:{options:{go_package:"github.com/Inkerz/jibbapis/sdk/go/cilix"},nested:{CameraDescription:{fields:{id:{type:"string",id:1},name:{type:"string",id:2}}},StartRequest:{fields:{config:{type:"jibb.ipsa.v1.Config",id:2},runtimeConfig:{type:"jibb.ipsa.v1.RuntimeConfig",id:4},camera:{type:"CameraDescription",id:5},meetingToken:{type:"string",id:6}}},PreviewRequest:{fields:{source:{type:"CameraDescription",id:2}}},PreviewResponse:{fields:{image:{type:"bytes",id:1}}},GetCameraListResponse:{fields:{items:{rule:"repeated",type:"CameraDescription",id:1}}},GetClientStatusListResponse:{fields:{clients:{rule:"repeated",type:"types.ClientDetails",id:1}}},BusMessage:{oneofs:{messageType:{oneof:["clientConnected","clientDisconnected","tooManyPublishers","ipsaResponse","startRequest","stopRequest","newPageRequest","previewRequest","previewResponse","cameraListRequest","cameraListResponse","runtimeConfigRequest","clientStatusRequest","recordingStarted","recordingStopped","error"]}},fields:{clientConnected:{type:"google.protobuf.Empty",id:2},clientDisconnected:{type:"google.protobuf.Empty",id:3},tooManyPublishers:{type:"google.protobuf.Empty",id:4},ipsaResponse:{type:"jibb.ipsa.v1.Response",id:6},startRequest:{type:"StartRequest",id:50},stopRequest:{type:"google.protobuf.Empty",id:51},newPageRequest:{type:"google.protobuf.Empty",id:52},previewRequest:{type:"PreviewRequest",id:53},previewResponse:{type:"PreviewResponse",id:54},cameraListRequest:{type:"google.protobuf.Empty",id:55},cameraListResponse:{type:"GetCameraListResponse",id:56},runtimeConfigRequest:{type:"jibb.ipsa.v1.RuntimeConfig",id:57},clientStatusRequest:{type:"google.protobuf.Empty",id:58},recordingStarted:{type:"google.protobuf.Empty",id:59},recordingStopped:{type:"google.protobuf.Empty",id:60},error:{type:"types.Code",id:100},src:{type:"types.ClientDetails",id:30},dst:{type:"types.ClientDetails",id:31}}}}}});module.exports=$root;
|
package/ws/connection_base.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConnectionStatus=exports.ConnectionBase=void 0,require("core-js/modules/es.promise.js"),require("core-js/modules/web.dom-collections.iterator.js");var _index=require("../utils/logger/index.js"),_future=require("../utils/future.js"),_proto=require("../types/proto.js"),_exceptions=require("../types/exceptions.js");function _classPrivateFieldInitSpec(a,b,c){_checkPrivateRedeclaration(a,b),b.set(a,c)}function _checkPrivateRedeclaration(a,b){if(b.has(a))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(a,b){var c=_classExtractFieldDescriptor(a,b,"get");return _classApplyDescriptorGet(a,c)}function _classApplyDescriptorGet(a,b){return b.get?b.get.call(a):b.value}function _classPrivateFieldSet(a,b,c){var d=_classExtractFieldDescriptor(a,b,"set");return _classApplyDescriptorSet(a,d,c),c}function _classExtractFieldDescriptor(a,b,c){if(!b.has(a))throw new TypeError("attempted to "+c+" private field on non-instance");return b.get(a)}function _classApplyDescriptorSet(a,b,c){if(b.set)b.set.call(a,c);else{if(!b.writable)throw new TypeError("attempted to set read only private field");b.value=c}}const ErrorCode=_proto.types.Code,ConnectionStatus={CONNECTED:"CONNECTED",DISCONNECTED:"DISCONNECTED",CONNECTING:"CONNECTING"};exports.ConnectionStatus=ConnectionStatus;var _connectionStatus=/*#__PURE__*/new WeakMap,_connectionFuture=/*#__PURE__*/new WeakMap,_socket=/*#__PURE__*/new WeakMap;class ConnectionBase{constructor(a){_classPrivateFieldInitSpec(this,_connectionStatus,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_connectionFuture,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_socket,{writable:!0,value:void 0}),this.name=a,_classPrivateFieldSet(this,_connectionStatus,ConnectionStatus.DISCONNECTED),_classPrivateFieldSet(this,_connectionFuture,new _future.Future),_classPrivateFieldGet(this,_connectionFuture).reject("disconnected"),_classPrivateFieldSet(this,_socket,null)}async connect(){if(null==_classPrivateFieldGet(this,_socket)){_index.logger.info("".concat(this.name,": connecting ...")),_classPrivateFieldSet(this,_connectionStatus,ConnectionStatus.CONNECTING),_classPrivateFieldSet(this,_connectionFuture,new _future.Future);let a=await this.getURI();_classPrivateFieldSet(this,_socket,new WebSocket(a)),_classPrivateFieldGet(this,_socket).binaryType="arraybuffer",_classPrivateFieldGet(this,_socket).addEventListener("open",()=>{this.onConnected()}),_classPrivateFieldGet(this,_socket).addEventListener("close",()=>{this.onDisconnected()}),_classPrivateFieldGet(this,_socket).addEventListener("message",a=>{this.onData(a.data)}),_classPrivateFieldGet(this,_socket).addEventListener("error",a=>{this.onError(a)})}}async getURI(){throw new Error("connection.getURI is not implemented")}disconnect(){null!=_classPrivateFieldGet(this,_socket)&&(_classPrivateFieldGet(this,_socket).close(),_classPrivateFieldSet(this,_socket,null),_index.logger.info("connection disconnected: ",this.name))}async write(a){var b,c;await this.waitForConnection(),null===(b=_classPrivateFieldGet(this,_socket))||void 0===b||null===(c=b.send)||void 0===c?void 0:c.call(b,a)}parseJSONResponse(a){try{let{code:b,reason:c}=JSON.parse(a);return b===ErrorCode.ERR_TOO_MANY_CONNECTIONS?this.onError(new _exceptions.TooManyConnectionsError(c)):b===ErrorCode.ERR_UNAUTHORIZED?this.onError(new _exceptions.PermissionDeniedError(c)):b===ErrorCode.ERR_BAD_REQUEST?(this.stop(),this.onError(new _exceptions.InvalidArgumentError(c))):b===ErrorCode.ERR_TIMEOUT?this.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConnectionStatus=exports.ConnectionBase=void 0,require("core-js/modules/es.promise.js"),require("core-js/modules/web.dom-collections.iterator.js");var _index=require("../utils/logger/index.js"),_future=require("../utils/future.js"),_proto=require("../types/proto.js"),_exceptions=require("../types/exceptions.js");function _classPrivateFieldInitSpec(a,b,c){_checkPrivateRedeclaration(a,b),b.set(a,c)}function _checkPrivateRedeclaration(a,b){if(b.has(a))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(a,b){var c=_classExtractFieldDescriptor(a,b,"get");return _classApplyDescriptorGet(a,c)}function _classApplyDescriptorGet(a,b){return b.get?b.get.call(a):b.value}function _classPrivateFieldSet(a,b,c){var d=_classExtractFieldDescriptor(a,b,"set");return _classApplyDescriptorSet(a,d,c),c}function _classExtractFieldDescriptor(a,b,c){if(!b.has(a))throw new TypeError("attempted to "+c+" private field on non-instance");return b.get(a)}function _classApplyDescriptorSet(a,b,c){if(b.set)b.set.call(a,c);else{if(!b.writable)throw new TypeError("attempted to set read only private field");b.value=c}}const ErrorCode=_proto.types.Code,ConnectionStatus={CONNECTED:"CONNECTED",DISCONNECTED:"DISCONNECTED",CONNECTING:"CONNECTING"};exports.ConnectionStatus=ConnectionStatus;var _connectionStatus=/*#__PURE__*/new WeakMap,_connectionFuture=/*#__PURE__*/new WeakMap,_socket=/*#__PURE__*/new WeakMap;class ConnectionBase{constructor(a){_classPrivateFieldInitSpec(this,_connectionStatus,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_connectionFuture,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_socket,{writable:!0,value:void 0}),this.name=a,_classPrivateFieldSet(this,_connectionStatus,ConnectionStatus.DISCONNECTED),_classPrivateFieldSet(this,_connectionFuture,new _future.Future),_classPrivateFieldGet(this,_connectionFuture).reject("disconnected"),_classPrivateFieldSet(this,_socket,null)}async connect(){if(null==_classPrivateFieldGet(this,_socket)){_index.logger.info("".concat(this.name,": connecting ...")),_classPrivateFieldSet(this,_connectionStatus,ConnectionStatus.CONNECTING),_classPrivateFieldSet(this,_connectionFuture,new _future.Future);let a=await this.getURI();_classPrivateFieldSet(this,_socket,new WebSocket(a)),_classPrivateFieldGet(this,_socket).binaryType="arraybuffer",_classPrivateFieldGet(this,_socket).addEventListener("open",()=>{this.onConnected()}),_classPrivateFieldGet(this,_socket).addEventListener("close",()=>{this.onDisconnected()}),_classPrivateFieldGet(this,_socket).addEventListener("message",a=>{this.onData(a.data)}),_classPrivateFieldGet(this,_socket).addEventListener("error",a=>{this.onError(a)})}}async getURI(){throw new Error("connection.getURI is not implemented")}disconnect(){null!=_classPrivateFieldGet(this,_socket)&&(_classPrivateFieldGet(this,_socket).close(),_classPrivateFieldSet(this,_socket,null),_index.logger.info("connection disconnected: ",this.name))}async write(a){var b,c;await this.waitForConnection(),null===(b=_classPrivateFieldGet(this,_socket))||void 0===b||null===(c=b.send)||void 0===c?void 0:c.call(b,a)}parseJSONResponse(a){try{let{code:b,reason:c}=JSON.parse(a);return b===ErrorCode.ERR_TOO_MANY_CONNECTIONS?this.onError(new _exceptions.TooManyConnectionsError(c)):b===ErrorCode.ERR_UNAUTHORIZED?this.onError(new _exceptions.PermissionDeniedError(c)):b===ErrorCode.ERR_BAD_REQUEST?(this.stop(),this.onError(new _exceptions.InvalidArgumentError(c))):b===ErrorCode.ERR_TIMEOUT?this.onError(new _exceptions.SessionTimeoutError(c)):this.onError(new _exceptions.GenericError(b,c))}catch(a){this.onError(a)}}getBufferedAmount(){return _classPrivateFieldGet(this,_socket)?_classPrivateFieldGet(this,_socket).bufferedAmount:0}onConnected(){_index.logger.info("".concat(this.name,": connected")),_classPrivateFieldSet(this,_connectionStatus,ConnectionStatus.CONNECTED),_classPrivateFieldGet(this,_connectionFuture).set("connected")}onDisconnected(){null!=_classPrivateFieldGet(this,_socket)&&(_classPrivateFieldGet(this,_socket).close(),_classPrivateFieldSet(this,_socket,null),_index.logger.info("connection disconnected: ",this.name)),_index.logger.warn("".concat(this.name,": disconnected")),_classPrivateFieldSet(this,_connectionStatus,ConnectionStatus.DISCONNECTED),_classPrivateFieldGet(this,_connectionFuture).reject("disconnected")}isConnected(){return _classPrivateFieldGet(this,_connectionStatus)==ConnectionStatus.CONNECTED}waitForConnection(){return _classPrivateFieldGet(this,_connectionFuture).get()}getConnectionStatus(){return _classPrivateFieldGet(this,_connectionStatus)}onData(){}onError(a){_index.logger.warn("".concat(this.name,": onError: ").concat(a))}}exports.ConnectionBase=ConnectionBase;
|