@aceplus/smartace-api 3.7.0-alpha.11 → 3.7.0-alpha.13
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/platform.client_pb.d.ts +22 -0
- package/platform.client_pb.js +182 -0
- package/platform.client_pb_service.d.ts +19 -0
- package/platform.client_pb_service.js +40 -0
- package/platform.group_pb.d.ts +57 -0
- package/platform.group_pb.js +447 -0
- package/platform.group_pb_service.d.ts +19 -0
- package/platform.group_pb_service.js +40 -0
- package/spic.asset_pb.d.ts +38 -0
- package/spic.asset_pb.js +303 -0
- package/spic.asset_pb_service.d.ts +19 -0
- package/spic.asset_pb_service.js +40 -0
package/spic.asset_pb.js
CHANGED
|
@@ -35,6 +35,8 @@ var google_api_annotations_pb = require('./google/api/annotations_pb.js');
|
|
|
35
35
|
goog.object.extend(proto, google_api_annotations_pb);
|
|
36
36
|
goog.exportSymbol('proto.Spic.AssetProto', null, global);
|
|
37
37
|
goog.exportSymbol('proto.Spic.AssetProto.AssetType', null, global);
|
|
38
|
+
goog.exportSymbol('proto.Spic.AssetProto.AssetTypeRequest', null, global);
|
|
39
|
+
goog.exportSymbol('proto.Spic.AssetProto.AssetTypeResponse', null, global);
|
|
38
40
|
goog.exportSymbol('proto.Spic.AssetProto.BatteryStatus', null, global);
|
|
39
41
|
goog.exportSymbol('proto.Spic.AssetProto.CreateRequest', null, global);
|
|
40
42
|
goog.exportSymbol('proto.Spic.AssetProto.DeleteRequest', null, global);
|
|
@@ -350,6 +352,48 @@ if (goog.DEBUG && !COMPILED) {
|
|
|
350
352
|
*/
|
|
351
353
|
proto.Spic.AssetProto.StateChangedEvent.displayName = 'proto.Spic.AssetProto.StateChangedEvent';
|
|
352
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* Generated by JsPbCodeGenerator.
|
|
357
|
+
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
358
|
+
* server response, or constructed directly in Javascript. The array is used
|
|
359
|
+
* in place and becomes part of the constructed object. It is not cloned.
|
|
360
|
+
* If no data is provided, the constructed object will be empty, but still
|
|
361
|
+
* valid.
|
|
362
|
+
* @extends {jspb.Message}
|
|
363
|
+
* @constructor
|
|
364
|
+
*/
|
|
365
|
+
proto.Spic.AssetProto.AssetTypeRequest = function(opt_data) {
|
|
366
|
+
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
367
|
+
};
|
|
368
|
+
goog.inherits(proto.Spic.AssetProto.AssetTypeRequest, jspb.Message);
|
|
369
|
+
if (goog.DEBUG && !COMPILED) {
|
|
370
|
+
/**
|
|
371
|
+
* @public
|
|
372
|
+
* @override
|
|
373
|
+
*/
|
|
374
|
+
proto.Spic.AssetProto.AssetTypeRequest.displayName = 'proto.Spic.AssetProto.AssetTypeRequest';
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Generated by JsPbCodeGenerator.
|
|
378
|
+
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
379
|
+
* server response, or constructed directly in Javascript. The array is used
|
|
380
|
+
* in place and becomes part of the constructed object. It is not cloned.
|
|
381
|
+
* If no data is provided, the constructed object will be empty, but still
|
|
382
|
+
* valid.
|
|
383
|
+
* @extends {jspb.Message}
|
|
384
|
+
* @constructor
|
|
385
|
+
*/
|
|
386
|
+
proto.Spic.AssetProto.AssetTypeResponse = function(opt_data) {
|
|
387
|
+
jspb.Message.initialize(this, opt_data, 0, -1, proto.Spic.AssetProto.AssetTypeResponse.repeatedFields_, null);
|
|
388
|
+
};
|
|
389
|
+
goog.inherits(proto.Spic.AssetProto.AssetTypeResponse, jspb.Message);
|
|
390
|
+
if (goog.DEBUG && !COMPILED) {
|
|
391
|
+
/**
|
|
392
|
+
* @public
|
|
393
|
+
* @override
|
|
394
|
+
*/
|
|
395
|
+
proto.Spic.AssetProto.AssetTypeResponse.displayName = 'proto.Spic.AssetProto.AssetTypeResponse';
|
|
396
|
+
}
|
|
353
397
|
/**
|
|
354
398
|
* Generated by JsPbCodeGenerator.
|
|
355
399
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
@@ -3547,6 +3591,265 @@ proto.Spic.AssetProto.StateChangedEvent.prototype.setOnlyAttributesUpdated = fun
|
|
|
3547
3591
|
};
|
|
3548
3592
|
|
|
3549
3593
|
|
|
3594
|
+
|
|
3595
|
+
|
|
3596
|
+
|
|
3597
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
3598
|
+
/**
|
|
3599
|
+
* Creates an object representation of this proto.
|
|
3600
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
3601
|
+
* Optional fields that are not set will be set to undefined.
|
|
3602
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
3603
|
+
* For the list of reserved names please see:
|
|
3604
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
3605
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
3606
|
+
* JSPB instance for transitional soy proto support:
|
|
3607
|
+
* http://goto/soy-param-migration
|
|
3608
|
+
* @return {!Object}
|
|
3609
|
+
*/
|
|
3610
|
+
proto.Spic.AssetProto.AssetTypeRequest.prototype.toObject = function(opt_includeInstance) {
|
|
3611
|
+
return proto.Spic.AssetProto.AssetTypeRequest.toObject(opt_includeInstance, this);
|
|
3612
|
+
};
|
|
3613
|
+
|
|
3614
|
+
|
|
3615
|
+
/**
|
|
3616
|
+
* Static version of the {@see toObject} method.
|
|
3617
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
3618
|
+
* the JSPB instance for transitional soy proto support:
|
|
3619
|
+
* http://goto/soy-param-migration
|
|
3620
|
+
* @param {!proto.Spic.AssetProto.AssetTypeRequest} msg The msg instance to transform.
|
|
3621
|
+
* @return {!Object}
|
|
3622
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
3623
|
+
*/
|
|
3624
|
+
proto.Spic.AssetProto.AssetTypeRequest.toObject = function(includeInstance, msg) {
|
|
3625
|
+
var f, obj = {
|
|
3626
|
+
|
|
3627
|
+
};
|
|
3628
|
+
|
|
3629
|
+
if (includeInstance) {
|
|
3630
|
+
obj.$jspbMessageInstance = msg;
|
|
3631
|
+
}
|
|
3632
|
+
return obj;
|
|
3633
|
+
};
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3636
|
+
|
|
3637
|
+
/**
|
|
3638
|
+
* Deserializes binary data (in protobuf wire format).
|
|
3639
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
3640
|
+
* @return {!proto.Spic.AssetProto.AssetTypeRequest}
|
|
3641
|
+
*/
|
|
3642
|
+
proto.Spic.AssetProto.AssetTypeRequest.deserializeBinary = function(bytes) {
|
|
3643
|
+
var reader = new jspb.BinaryReader(bytes);
|
|
3644
|
+
var msg = new proto.Spic.AssetProto.AssetTypeRequest;
|
|
3645
|
+
return proto.Spic.AssetProto.AssetTypeRequest.deserializeBinaryFromReader(msg, reader);
|
|
3646
|
+
};
|
|
3647
|
+
|
|
3648
|
+
|
|
3649
|
+
/**
|
|
3650
|
+
* Deserializes binary data (in protobuf wire format) from the
|
|
3651
|
+
* given reader into the given message object.
|
|
3652
|
+
* @param {!proto.Spic.AssetProto.AssetTypeRequest} msg The message object to deserialize into.
|
|
3653
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
3654
|
+
* @return {!proto.Spic.AssetProto.AssetTypeRequest}
|
|
3655
|
+
*/
|
|
3656
|
+
proto.Spic.AssetProto.AssetTypeRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
3657
|
+
while (reader.nextField()) {
|
|
3658
|
+
if (reader.isEndGroup()) {
|
|
3659
|
+
break;
|
|
3660
|
+
}
|
|
3661
|
+
var field = reader.getFieldNumber();
|
|
3662
|
+
switch (field) {
|
|
3663
|
+
default:
|
|
3664
|
+
reader.skipField();
|
|
3665
|
+
break;
|
|
3666
|
+
}
|
|
3667
|
+
}
|
|
3668
|
+
return msg;
|
|
3669
|
+
};
|
|
3670
|
+
|
|
3671
|
+
|
|
3672
|
+
/**
|
|
3673
|
+
* Serializes the message to binary data (in protobuf wire format).
|
|
3674
|
+
* @return {!Uint8Array}
|
|
3675
|
+
*/
|
|
3676
|
+
proto.Spic.AssetProto.AssetTypeRequest.prototype.serializeBinary = function() {
|
|
3677
|
+
var writer = new jspb.BinaryWriter();
|
|
3678
|
+
proto.Spic.AssetProto.AssetTypeRequest.serializeBinaryToWriter(this, writer);
|
|
3679
|
+
return writer.getResultBuffer();
|
|
3680
|
+
};
|
|
3681
|
+
|
|
3682
|
+
|
|
3683
|
+
/**
|
|
3684
|
+
* Serializes the given message to binary data (in protobuf wire
|
|
3685
|
+
* format), writing to the given BinaryWriter.
|
|
3686
|
+
* @param {!proto.Spic.AssetProto.AssetTypeRequest} message
|
|
3687
|
+
* @param {!jspb.BinaryWriter} writer
|
|
3688
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
3689
|
+
*/
|
|
3690
|
+
proto.Spic.AssetProto.AssetTypeRequest.serializeBinaryToWriter = function(message, writer) {
|
|
3691
|
+
var f = undefined;
|
|
3692
|
+
};
|
|
3693
|
+
|
|
3694
|
+
|
|
3695
|
+
|
|
3696
|
+
/**
|
|
3697
|
+
* List of repeated fields within this message type.
|
|
3698
|
+
* @private {!Array<number>}
|
|
3699
|
+
* @const
|
|
3700
|
+
*/
|
|
3701
|
+
proto.Spic.AssetProto.AssetTypeResponse.repeatedFields_ = [1];
|
|
3702
|
+
|
|
3703
|
+
|
|
3704
|
+
|
|
3705
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
3706
|
+
/**
|
|
3707
|
+
* Creates an object representation of this proto.
|
|
3708
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
3709
|
+
* Optional fields that are not set will be set to undefined.
|
|
3710
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
3711
|
+
* For the list of reserved names please see:
|
|
3712
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
3713
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
3714
|
+
* JSPB instance for transitional soy proto support:
|
|
3715
|
+
* http://goto/soy-param-migration
|
|
3716
|
+
* @return {!Object}
|
|
3717
|
+
*/
|
|
3718
|
+
proto.Spic.AssetProto.AssetTypeResponse.prototype.toObject = function(opt_includeInstance) {
|
|
3719
|
+
return proto.Spic.AssetProto.AssetTypeResponse.toObject(opt_includeInstance, this);
|
|
3720
|
+
};
|
|
3721
|
+
|
|
3722
|
+
|
|
3723
|
+
/**
|
|
3724
|
+
* Static version of the {@see toObject} method.
|
|
3725
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
3726
|
+
* the JSPB instance for transitional soy proto support:
|
|
3727
|
+
* http://goto/soy-param-migration
|
|
3728
|
+
* @param {!proto.Spic.AssetProto.AssetTypeResponse} msg The msg instance to transform.
|
|
3729
|
+
* @return {!Object}
|
|
3730
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
3731
|
+
*/
|
|
3732
|
+
proto.Spic.AssetProto.AssetTypeResponse.toObject = function(includeInstance, msg) {
|
|
3733
|
+
var f, obj = {
|
|
3734
|
+
typesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f
|
|
3735
|
+
};
|
|
3736
|
+
|
|
3737
|
+
if (includeInstance) {
|
|
3738
|
+
obj.$jspbMessageInstance = msg;
|
|
3739
|
+
}
|
|
3740
|
+
return obj;
|
|
3741
|
+
};
|
|
3742
|
+
}
|
|
3743
|
+
|
|
3744
|
+
|
|
3745
|
+
/**
|
|
3746
|
+
* Deserializes binary data (in protobuf wire format).
|
|
3747
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
3748
|
+
* @return {!proto.Spic.AssetProto.AssetTypeResponse}
|
|
3749
|
+
*/
|
|
3750
|
+
proto.Spic.AssetProto.AssetTypeResponse.deserializeBinary = function(bytes) {
|
|
3751
|
+
var reader = new jspb.BinaryReader(bytes);
|
|
3752
|
+
var msg = new proto.Spic.AssetProto.AssetTypeResponse;
|
|
3753
|
+
return proto.Spic.AssetProto.AssetTypeResponse.deserializeBinaryFromReader(msg, reader);
|
|
3754
|
+
};
|
|
3755
|
+
|
|
3756
|
+
|
|
3757
|
+
/**
|
|
3758
|
+
* Deserializes binary data (in protobuf wire format) from the
|
|
3759
|
+
* given reader into the given message object.
|
|
3760
|
+
* @param {!proto.Spic.AssetProto.AssetTypeResponse} msg The message object to deserialize into.
|
|
3761
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
3762
|
+
* @return {!proto.Spic.AssetProto.AssetTypeResponse}
|
|
3763
|
+
*/
|
|
3764
|
+
proto.Spic.AssetProto.AssetTypeResponse.deserializeBinaryFromReader = function(msg, reader) {
|
|
3765
|
+
while (reader.nextField()) {
|
|
3766
|
+
if (reader.isEndGroup()) {
|
|
3767
|
+
break;
|
|
3768
|
+
}
|
|
3769
|
+
var field = reader.getFieldNumber();
|
|
3770
|
+
switch (field) {
|
|
3771
|
+
case 1:
|
|
3772
|
+
var values = /** @type {!Array<!proto.Spic.AssetProto.AssetType>} */ (reader.isDelimited() ? reader.readPackedEnum() : [reader.readEnum()]);
|
|
3773
|
+
for (var i = 0; i < values.length; i++) {
|
|
3774
|
+
msg.addTypes(values[i]);
|
|
3775
|
+
}
|
|
3776
|
+
break;
|
|
3777
|
+
default:
|
|
3778
|
+
reader.skipField();
|
|
3779
|
+
break;
|
|
3780
|
+
}
|
|
3781
|
+
}
|
|
3782
|
+
return msg;
|
|
3783
|
+
};
|
|
3784
|
+
|
|
3785
|
+
|
|
3786
|
+
/**
|
|
3787
|
+
* Serializes the message to binary data (in protobuf wire format).
|
|
3788
|
+
* @return {!Uint8Array}
|
|
3789
|
+
*/
|
|
3790
|
+
proto.Spic.AssetProto.AssetTypeResponse.prototype.serializeBinary = function() {
|
|
3791
|
+
var writer = new jspb.BinaryWriter();
|
|
3792
|
+
proto.Spic.AssetProto.AssetTypeResponse.serializeBinaryToWriter(this, writer);
|
|
3793
|
+
return writer.getResultBuffer();
|
|
3794
|
+
};
|
|
3795
|
+
|
|
3796
|
+
|
|
3797
|
+
/**
|
|
3798
|
+
* Serializes the given message to binary data (in protobuf wire
|
|
3799
|
+
* format), writing to the given BinaryWriter.
|
|
3800
|
+
* @param {!proto.Spic.AssetProto.AssetTypeResponse} message
|
|
3801
|
+
* @param {!jspb.BinaryWriter} writer
|
|
3802
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
3803
|
+
*/
|
|
3804
|
+
proto.Spic.AssetProto.AssetTypeResponse.serializeBinaryToWriter = function(message, writer) {
|
|
3805
|
+
var f = undefined;
|
|
3806
|
+
f = message.getTypesList();
|
|
3807
|
+
if (f.length > 0) {
|
|
3808
|
+
writer.writePackedEnum(
|
|
3809
|
+
1,
|
|
3810
|
+
f
|
|
3811
|
+
);
|
|
3812
|
+
}
|
|
3813
|
+
};
|
|
3814
|
+
|
|
3815
|
+
|
|
3816
|
+
/**
|
|
3817
|
+
* repeated AssetType types = 1;
|
|
3818
|
+
* @return {!Array<!proto.Spic.AssetProto.AssetType>}
|
|
3819
|
+
*/
|
|
3820
|
+
proto.Spic.AssetProto.AssetTypeResponse.prototype.getTypesList = function() {
|
|
3821
|
+
return /** @type {!Array<!proto.Spic.AssetProto.AssetType>} */ (jspb.Message.getRepeatedField(this, 1));
|
|
3822
|
+
};
|
|
3823
|
+
|
|
3824
|
+
|
|
3825
|
+
/**
|
|
3826
|
+
* @param {!Array<!proto.Spic.AssetProto.AssetType>} value
|
|
3827
|
+
* @return {!proto.Spic.AssetProto.AssetTypeResponse} returns this
|
|
3828
|
+
*/
|
|
3829
|
+
proto.Spic.AssetProto.AssetTypeResponse.prototype.setTypesList = function(value) {
|
|
3830
|
+
return jspb.Message.setField(this, 1, value || []);
|
|
3831
|
+
};
|
|
3832
|
+
|
|
3833
|
+
|
|
3834
|
+
/**
|
|
3835
|
+
* @param {!proto.Spic.AssetProto.AssetType} value
|
|
3836
|
+
* @param {number=} opt_index
|
|
3837
|
+
* @return {!proto.Spic.AssetProto.AssetTypeResponse} returns this
|
|
3838
|
+
*/
|
|
3839
|
+
proto.Spic.AssetProto.AssetTypeResponse.prototype.addTypes = function(value, opt_index) {
|
|
3840
|
+
return jspb.Message.addToRepeatedField(this, 1, value, opt_index);
|
|
3841
|
+
};
|
|
3842
|
+
|
|
3843
|
+
|
|
3844
|
+
/**
|
|
3845
|
+
* Clears the list making it empty but non-null.
|
|
3846
|
+
* @return {!proto.Spic.AssetProto.AssetTypeResponse} returns this
|
|
3847
|
+
*/
|
|
3848
|
+
proto.Spic.AssetProto.AssetTypeResponse.prototype.clearTypesList = function() {
|
|
3849
|
+
return this.setTypesList([]);
|
|
3850
|
+
};
|
|
3851
|
+
|
|
3852
|
+
|
|
3550
3853
|
/**
|
|
3551
3854
|
* optional int64 id = 1;
|
|
3552
3855
|
* @return {number}
|
|
@@ -77,6 +77,15 @@ type AssetGRPCReplaceBattery = {
|
|
|
77
77
|
readonly responseType: typeof spic_asset_pb.AssetProto;
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
+
type AssetGRPCGetAssetTypes = {
|
|
81
|
+
readonly methodName: string;
|
|
82
|
+
readonly service: typeof AssetGRPC;
|
|
83
|
+
readonly requestStream: false;
|
|
84
|
+
readonly responseStream: false;
|
|
85
|
+
readonly requestType: typeof spic_asset_pb.AssetProto.AssetTypeRequest;
|
|
86
|
+
readonly responseType: typeof spic_asset_pb.AssetProto.AssetTypeResponse;
|
|
87
|
+
};
|
|
88
|
+
|
|
80
89
|
export class AssetGRPC {
|
|
81
90
|
static readonly serviceName: string;
|
|
82
91
|
static readonly Create: AssetGRPCCreate;
|
|
@@ -87,6 +96,7 @@ export class AssetGRPC {
|
|
|
87
96
|
static readonly Search: AssetGRPCSearch;
|
|
88
97
|
static readonly LocationSearch: AssetGRPCLocationSearch;
|
|
89
98
|
static readonly ReplaceBattery: AssetGRPCReplaceBattery;
|
|
99
|
+
static readonly GetAssetTypes: AssetGRPCGetAssetTypes;
|
|
90
100
|
}
|
|
91
101
|
|
|
92
102
|
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
|
|
@@ -193,5 +203,14 @@ export class AssetGRPCClient {
|
|
|
193
203
|
requestMessage: spic_asset_pb.AssetProto.ReplaceBatteryRequest,
|
|
194
204
|
callback: (error: ServiceError|null, responseMessage: spic_asset_pb.AssetProto|null) => void
|
|
195
205
|
): UnaryResponse;
|
|
206
|
+
getAssetTypes(
|
|
207
|
+
requestMessage: spic_asset_pb.AssetProto.AssetTypeRequest,
|
|
208
|
+
metadata: grpc.Metadata,
|
|
209
|
+
callback: (error: ServiceError|null, responseMessage: spic_asset_pb.AssetProto.AssetTypeResponse|null) => void
|
|
210
|
+
): UnaryResponse;
|
|
211
|
+
getAssetTypes(
|
|
212
|
+
requestMessage: spic_asset_pb.AssetProto.AssetTypeRequest,
|
|
213
|
+
callback: (error: ServiceError|null, responseMessage: spic_asset_pb.AssetProto.AssetTypeResponse|null) => void
|
|
214
|
+
): UnaryResponse;
|
|
196
215
|
}
|
|
197
216
|
|
package/spic.asset_pb_service.js
CHANGED
|
@@ -83,6 +83,15 @@ AssetGRPC.ReplaceBattery = {
|
|
|
83
83
|
responseType: spic_asset_pb.AssetProto
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
+
AssetGRPC.GetAssetTypes = {
|
|
87
|
+
methodName: "GetAssetTypes",
|
|
88
|
+
service: AssetGRPC,
|
|
89
|
+
requestStream: false,
|
|
90
|
+
responseStream: false,
|
|
91
|
+
requestType: spic_asset_pb.AssetProto.AssetTypeRequest,
|
|
92
|
+
responseType: spic_asset_pb.AssetProto.AssetTypeResponse
|
|
93
|
+
};
|
|
94
|
+
|
|
86
95
|
exports.AssetGRPC = AssetGRPC;
|
|
87
96
|
|
|
88
97
|
function AssetGRPCClient(serviceHost, options) {
|
|
@@ -338,5 +347,36 @@ AssetGRPCClient.prototype.replaceBattery = function replaceBattery(requestMessag
|
|
|
338
347
|
};
|
|
339
348
|
};
|
|
340
349
|
|
|
350
|
+
AssetGRPCClient.prototype.getAssetTypes = function getAssetTypes(requestMessage, metadata, callback) {
|
|
351
|
+
if (arguments.length === 2) {
|
|
352
|
+
callback = arguments[1];
|
|
353
|
+
}
|
|
354
|
+
var client = grpc.unary(AssetGRPC.GetAssetTypes, {
|
|
355
|
+
request: requestMessage,
|
|
356
|
+
host: this.serviceHost,
|
|
357
|
+
metadata: metadata,
|
|
358
|
+
transport: this.options.transport,
|
|
359
|
+
debug: this.options.debug,
|
|
360
|
+
onEnd: function (response) {
|
|
361
|
+
if (callback) {
|
|
362
|
+
if (response.status !== grpc.Code.OK) {
|
|
363
|
+
var err = new Error(response.statusMessage);
|
|
364
|
+
err.code = response.status;
|
|
365
|
+
err.metadata = response.trailers;
|
|
366
|
+
callback(err, null);
|
|
367
|
+
} else {
|
|
368
|
+
callback(null, response.message);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
return {
|
|
374
|
+
cancel: function () {
|
|
375
|
+
callback = null;
|
|
376
|
+
client.close();
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
|
|
341
381
|
exports.AssetGRPCClient = AssetGRPCClient;
|
|
342
382
|
|