@farcaster/hub-web 0.2.4 → 0.3.0
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/dist/index.d.ts +2281 -559
- package/dist/index.js +254 -69
- package/dist/index.mjs +252 -67
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
@@ -2637,7 +2637,7 @@ export * from "@farcaster/core";
|
|
2637
2637
|
// src/generated/rpc.ts
|
2638
2638
|
init_esm_shims();
|
2639
2639
|
var import_browser_headers = __toESM(require_browser_headers());
|
2640
|
-
import
|
2640
|
+
import grpcWeb from "@improbable-eng/grpc-web";
|
2641
2641
|
import { Observable } from "rxjs";
|
2642
2642
|
import { share } from "rxjs/operators";
|
2643
2643
|
|
@@ -3580,12 +3580,83 @@ var UserDataBody = {
|
|
3580
3580
|
return message;
|
3581
3581
|
}
|
3582
3582
|
};
|
3583
|
+
function createBaseEmbed() {
|
3584
|
+
return { url: void 0, castId: void 0 };
|
3585
|
+
}
|
3586
|
+
var Embed = {
|
3587
|
+
encode(message, writer = import_minimal2.default.Writer.create()) {
|
3588
|
+
if (message.url !== void 0) {
|
3589
|
+
writer.uint32(10).string(message.url);
|
3590
|
+
}
|
3591
|
+
if (message.castId !== void 0) {
|
3592
|
+
CastId.encode(message.castId, writer.uint32(18).fork()).ldelim();
|
3593
|
+
}
|
3594
|
+
return writer;
|
3595
|
+
},
|
3596
|
+
decode(input, length) {
|
3597
|
+
const reader = input instanceof import_minimal2.default.Reader ? input : import_minimal2.default.Reader.create(input);
|
3598
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
3599
|
+
const message = createBaseEmbed();
|
3600
|
+
while (reader.pos < end) {
|
3601
|
+
const tag = reader.uint32();
|
3602
|
+
switch (tag >>> 3) {
|
3603
|
+
case 1:
|
3604
|
+
if (tag != 10) {
|
3605
|
+
break;
|
3606
|
+
}
|
3607
|
+
message.url = reader.string();
|
3608
|
+
continue;
|
3609
|
+
case 2:
|
3610
|
+
if (tag != 18) {
|
3611
|
+
break;
|
3612
|
+
}
|
3613
|
+
message.castId = CastId.decode(reader, reader.uint32());
|
3614
|
+
continue;
|
3615
|
+
}
|
3616
|
+
if ((tag & 7) == 4 || tag == 0) {
|
3617
|
+
break;
|
3618
|
+
}
|
3619
|
+
reader.skipType(tag & 7);
|
3620
|
+
}
|
3621
|
+
return message;
|
3622
|
+
},
|
3623
|
+
fromJSON(object) {
|
3624
|
+
return {
|
3625
|
+
url: isSet2(object.url) ? String(object.url) : void 0,
|
3626
|
+
castId: isSet2(object.castId) ? CastId.fromJSON(object.castId) : void 0
|
3627
|
+
};
|
3628
|
+
},
|
3629
|
+
toJSON(message) {
|
3630
|
+
const obj = {};
|
3631
|
+
message.url !== void 0 && (obj.url = message.url);
|
3632
|
+
message.castId !== void 0 && (obj.castId = message.castId ? CastId.toJSON(message.castId) : void 0);
|
3633
|
+
return obj;
|
3634
|
+
},
|
3635
|
+
create(base) {
|
3636
|
+
return Embed.fromPartial(base != null ? base : {});
|
3637
|
+
},
|
3638
|
+
fromPartial(object) {
|
3639
|
+
var _a;
|
3640
|
+
const message = createBaseEmbed();
|
3641
|
+
message.url = (_a = object.url) != null ? _a : void 0;
|
3642
|
+
message.castId = object.castId !== void 0 && object.castId !== null ? CastId.fromPartial(object.castId) : void 0;
|
3643
|
+
return message;
|
3644
|
+
}
|
3645
|
+
};
|
3583
3646
|
function createBaseCastAddBody() {
|
3584
|
-
return {
|
3647
|
+
return {
|
3648
|
+
embedsDeprecated: [],
|
3649
|
+
mentions: [],
|
3650
|
+
parentCastId: void 0,
|
3651
|
+
parentUrl: void 0,
|
3652
|
+
text: "",
|
3653
|
+
mentionsPositions: [],
|
3654
|
+
embeds: []
|
3655
|
+
};
|
3585
3656
|
}
|
3586
3657
|
var CastAddBody = {
|
3587
3658
|
encode(message, writer = import_minimal2.default.Writer.create()) {
|
3588
|
-
for (const v of message.
|
3659
|
+
for (const v of message.embedsDeprecated) {
|
3589
3660
|
writer.uint32(10).string(v);
|
3590
3661
|
}
|
3591
3662
|
writer.uint32(18).fork();
|
@@ -3596,6 +3667,9 @@ var CastAddBody = {
|
|
3596
3667
|
if (message.parentCastId !== void 0) {
|
3597
3668
|
CastId.encode(message.parentCastId, writer.uint32(26).fork()).ldelim();
|
3598
3669
|
}
|
3670
|
+
if (message.parentUrl !== void 0) {
|
3671
|
+
writer.uint32(58).string(message.parentUrl);
|
3672
|
+
}
|
3599
3673
|
if (message.text !== "") {
|
3600
3674
|
writer.uint32(34).string(message.text);
|
3601
3675
|
}
|
@@ -3604,6 +3678,9 @@ var CastAddBody = {
|
|
3604
3678
|
writer.uint32(v);
|
3605
3679
|
}
|
3606
3680
|
writer.ldelim();
|
3681
|
+
for (const v of message.embeds) {
|
3682
|
+
Embed.encode(v, writer.uint32(50).fork()).ldelim();
|
3683
|
+
}
|
3607
3684
|
return writer;
|
3608
3685
|
},
|
3609
3686
|
decode(input, length) {
|
@@ -3617,7 +3694,7 @@ var CastAddBody = {
|
|
3617
3694
|
if (tag != 10) {
|
3618
3695
|
break;
|
3619
3696
|
}
|
3620
|
-
message.
|
3697
|
+
message.embedsDeprecated.push(reader.string());
|
3621
3698
|
continue;
|
3622
3699
|
case 2:
|
3623
3700
|
if (tag == 16) {
|
@@ -3638,6 +3715,12 @@ var CastAddBody = {
|
|
3638
3715
|
}
|
3639
3716
|
message.parentCastId = CastId.decode(reader, reader.uint32());
|
3640
3717
|
continue;
|
3718
|
+
case 7:
|
3719
|
+
if (tag != 58) {
|
3720
|
+
break;
|
3721
|
+
}
|
3722
|
+
message.parentUrl = reader.string();
|
3723
|
+
continue;
|
3641
3724
|
case 4:
|
3642
3725
|
if (tag != 34) {
|
3643
3726
|
break;
|
@@ -3657,6 +3740,12 @@ var CastAddBody = {
|
|
3657
3740
|
continue;
|
3658
3741
|
}
|
3659
3742
|
break;
|
3743
|
+
case 6:
|
3744
|
+
if (tag != 50) {
|
3745
|
+
break;
|
3746
|
+
}
|
3747
|
+
message.embeds.push(Embed.decode(reader, reader.uint32()));
|
3748
|
+
continue;
|
3660
3749
|
}
|
3661
3750
|
if ((tag & 7) == 4 || tag == 0) {
|
3662
3751
|
break;
|
@@ -3667,19 +3756,21 @@ var CastAddBody = {
|
|
3667
3756
|
},
|
3668
3757
|
fromJSON(object) {
|
3669
3758
|
return {
|
3670
|
-
|
3759
|
+
embedsDeprecated: Array.isArray(object == null ? void 0 : object.embedsDeprecated) ? object.embedsDeprecated.map((e) => String(e)) : [],
|
3671
3760
|
mentions: Array.isArray(object == null ? void 0 : object.mentions) ? object.mentions.map((e) => Number(e)) : [],
|
3672
3761
|
parentCastId: isSet2(object.parentCastId) ? CastId.fromJSON(object.parentCastId) : void 0,
|
3762
|
+
parentUrl: isSet2(object.parentUrl) ? String(object.parentUrl) : void 0,
|
3673
3763
|
text: isSet2(object.text) ? String(object.text) : "",
|
3674
|
-
mentionsPositions: Array.isArray(object == null ? void 0 : object.mentionsPositions) ? object.mentionsPositions.map((e) => Number(e)) : []
|
3764
|
+
mentionsPositions: Array.isArray(object == null ? void 0 : object.mentionsPositions) ? object.mentionsPositions.map((e) => Number(e)) : [],
|
3765
|
+
embeds: Array.isArray(object == null ? void 0 : object.embeds) ? object.embeds.map((e) => Embed.fromJSON(e)) : []
|
3675
3766
|
};
|
3676
3767
|
},
|
3677
3768
|
toJSON(message) {
|
3678
3769
|
const obj = {};
|
3679
|
-
if (message.
|
3680
|
-
obj.
|
3770
|
+
if (message.embedsDeprecated) {
|
3771
|
+
obj.embedsDeprecated = message.embedsDeprecated.map((e) => e);
|
3681
3772
|
} else {
|
3682
|
-
obj.
|
3773
|
+
obj.embedsDeprecated = [];
|
3683
3774
|
}
|
3684
3775
|
if (message.mentions) {
|
3685
3776
|
obj.mentions = message.mentions.map((e) => Math.round(e));
|
@@ -3687,25 +3778,33 @@ var CastAddBody = {
|
|
3687
3778
|
obj.mentions = [];
|
3688
3779
|
}
|
3689
3780
|
message.parentCastId !== void 0 && (obj.parentCastId = message.parentCastId ? CastId.toJSON(message.parentCastId) : void 0);
|
3781
|
+
message.parentUrl !== void 0 && (obj.parentUrl = message.parentUrl);
|
3690
3782
|
message.text !== void 0 && (obj.text = message.text);
|
3691
3783
|
if (message.mentionsPositions) {
|
3692
3784
|
obj.mentionsPositions = message.mentionsPositions.map((e) => Math.round(e));
|
3693
3785
|
} else {
|
3694
3786
|
obj.mentionsPositions = [];
|
3695
3787
|
}
|
3788
|
+
if (message.embeds) {
|
3789
|
+
obj.embeds = message.embeds.map((e) => e ? Embed.toJSON(e) : void 0);
|
3790
|
+
} else {
|
3791
|
+
obj.embeds = [];
|
3792
|
+
}
|
3696
3793
|
return obj;
|
3697
3794
|
},
|
3698
3795
|
create(base) {
|
3699
3796
|
return CastAddBody.fromPartial(base != null ? base : {});
|
3700
3797
|
},
|
3701
3798
|
fromPartial(object) {
|
3702
|
-
var _a, _b, _c, _d;
|
3799
|
+
var _a, _b, _c, _d, _e, _f;
|
3703
3800
|
const message = createBaseCastAddBody();
|
3704
|
-
message.
|
3801
|
+
message.embedsDeprecated = ((_a = object.embedsDeprecated) == null ? void 0 : _a.map((e) => e)) || [];
|
3705
3802
|
message.mentions = ((_b = object.mentions) == null ? void 0 : _b.map((e) => e)) || [];
|
3706
3803
|
message.parentCastId = object.parentCastId !== void 0 && object.parentCastId !== null ? CastId.fromPartial(object.parentCastId) : void 0;
|
3707
|
-
message.
|
3708
|
-
message.
|
3804
|
+
message.parentUrl = (_c = object.parentUrl) != null ? _c : void 0;
|
3805
|
+
message.text = (_d = object.text) != null ? _d : "";
|
3806
|
+
message.mentionsPositions = ((_e = object.mentionsPositions) == null ? void 0 : _e.map((e) => e)) || [];
|
3807
|
+
message.embeds = ((_f = object.embeds) == null ? void 0 : _f.map((e) => Embed.fromPartial(e))) || [];
|
3709
3808
|
return message;
|
3710
3809
|
}
|
3711
3810
|
};
|
@@ -3822,7 +3921,7 @@ var CastId = {
|
|
3822
3921
|
}
|
3823
3922
|
};
|
3824
3923
|
function createBaseReactionBody() {
|
3825
|
-
return { type: 0, targetCastId: void 0 };
|
3924
|
+
return { type: 0, targetCastId: void 0, targetUrl: void 0 };
|
3826
3925
|
}
|
3827
3926
|
var ReactionBody = {
|
3828
3927
|
encode(message, writer = import_minimal2.default.Writer.create()) {
|
@@ -3832,6 +3931,9 @@ var ReactionBody = {
|
|
3832
3931
|
if (message.targetCastId !== void 0) {
|
3833
3932
|
CastId.encode(message.targetCastId, writer.uint32(18).fork()).ldelim();
|
3834
3933
|
}
|
3934
|
+
if (message.targetUrl !== void 0) {
|
3935
|
+
writer.uint32(26).string(message.targetUrl);
|
3936
|
+
}
|
3835
3937
|
return writer;
|
3836
3938
|
},
|
3837
3939
|
decode(input, length) {
|
@@ -3853,6 +3955,12 @@ var ReactionBody = {
|
|
3853
3955
|
}
|
3854
3956
|
message.targetCastId = CastId.decode(reader, reader.uint32());
|
3855
3957
|
continue;
|
3958
|
+
case 3:
|
3959
|
+
if (tag != 26) {
|
3960
|
+
break;
|
3961
|
+
}
|
3962
|
+
message.targetUrl = reader.string();
|
3963
|
+
continue;
|
3856
3964
|
}
|
3857
3965
|
if ((tag & 7) == 4 || tag == 0) {
|
3858
3966
|
break;
|
@@ -3864,23 +3972,26 @@ var ReactionBody = {
|
|
3864
3972
|
fromJSON(object) {
|
3865
3973
|
return {
|
3866
3974
|
type: isSet2(object.type) ? reactionTypeFromJSON(object.type) : 0,
|
3867
|
-
targetCastId: isSet2(object.targetCastId) ? CastId.fromJSON(object.targetCastId) : void 0
|
3975
|
+
targetCastId: isSet2(object.targetCastId) ? CastId.fromJSON(object.targetCastId) : void 0,
|
3976
|
+
targetUrl: isSet2(object.targetUrl) ? String(object.targetUrl) : void 0
|
3868
3977
|
};
|
3869
3978
|
},
|
3870
3979
|
toJSON(message) {
|
3871
3980
|
const obj = {};
|
3872
3981
|
message.type !== void 0 && (obj.type = reactionTypeToJSON(message.type));
|
3873
3982
|
message.targetCastId !== void 0 && (obj.targetCastId = message.targetCastId ? CastId.toJSON(message.targetCastId) : void 0);
|
3983
|
+
message.targetUrl !== void 0 && (obj.targetUrl = message.targetUrl);
|
3874
3984
|
return obj;
|
3875
3985
|
},
|
3876
3986
|
create(base) {
|
3877
3987
|
return ReactionBody.fromPartial(base != null ? base : {});
|
3878
3988
|
},
|
3879
3989
|
fromPartial(object) {
|
3880
|
-
var _a;
|
3990
|
+
var _a, _b;
|
3881
3991
|
const message = createBaseReactionBody();
|
3882
3992
|
message.type = (_a = object.type) != null ? _a : 0;
|
3883
3993
|
message.targetCastId = object.targetCastId !== void 0 && object.targetCastId !== null ? CastId.fromPartial(object.targetCastId) : void 0;
|
3994
|
+
message.targetUrl = (_b = object.targetUrl) != null ? _b : void 0;
|
3884
3995
|
return message;
|
3885
3996
|
}
|
3886
3997
|
};
|
@@ -5602,12 +5713,21 @@ var MessagesResponse = {
|
|
5602
5713
|
}
|
5603
5714
|
};
|
5604
5715
|
function createBaseCastsByParentRequest() {
|
5605
|
-
return {
|
5716
|
+
return {
|
5717
|
+
parentCastId: void 0,
|
5718
|
+
parentUrl: void 0,
|
5719
|
+
pageSize: void 0,
|
5720
|
+
pageToken: void 0,
|
5721
|
+
reverse: void 0
|
5722
|
+
};
|
5606
5723
|
}
|
5607
5724
|
var CastsByParentRequest = {
|
5608
5725
|
encode(message, writer = import_minimal5.default.Writer.create()) {
|
5609
|
-
if (message.
|
5610
|
-
CastId.encode(message.
|
5726
|
+
if (message.parentCastId !== void 0) {
|
5727
|
+
CastId.encode(message.parentCastId, writer.uint32(10).fork()).ldelim();
|
5728
|
+
}
|
5729
|
+
if (message.parentUrl !== void 0) {
|
5730
|
+
writer.uint32(42).string(message.parentUrl);
|
5611
5731
|
}
|
5612
5732
|
if (message.pageSize !== void 0) {
|
5613
5733
|
writer.uint32(16).uint32(message.pageSize);
|
@@ -5631,7 +5751,13 @@ var CastsByParentRequest = {
|
|
5631
5751
|
if (tag != 10) {
|
5632
5752
|
break;
|
5633
5753
|
}
|
5634
|
-
message.
|
5754
|
+
message.parentCastId = CastId.decode(reader, reader.uint32());
|
5755
|
+
continue;
|
5756
|
+
case 5:
|
5757
|
+
if (tag != 42) {
|
5758
|
+
break;
|
5759
|
+
}
|
5760
|
+
message.parentUrl = reader.string();
|
5635
5761
|
continue;
|
5636
5762
|
case 2:
|
5637
5763
|
if (tag != 16) {
|
@@ -5661,7 +5787,8 @@ var CastsByParentRequest = {
|
|
5661
5787
|
},
|
5662
5788
|
fromJSON(object) {
|
5663
5789
|
return {
|
5664
|
-
|
5790
|
+
parentCastId: isSet5(object.parentCastId) ? CastId.fromJSON(object.parentCastId) : void 0,
|
5791
|
+
parentUrl: isSet5(object.parentUrl) ? String(object.parentUrl) : void 0,
|
5665
5792
|
pageSize: isSet5(object.pageSize) ? Number(object.pageSize) : void 0,
|
5666
5793
|
pageToken: isSet5(object.pageToken) ? bytesFromBase644(object.pageToken) : void 0,
|
5667
5794
|
reverse: isSet5(object.reverse) ? Boolean(object.reverse) : void 0
|
@@ -5669,7 +5796,8 @@ var CastsByParentRequest = {
|
|
5669
5796
|
},
|
5670
5797
|
toJSON(message) {
|
5671
5798
|
const obj = {};
|
5672
|
-
message.
|
5799
|
+
message.parentCastId !== void 0 && (obj.parentCastId = message.parentCastId ? CastId.toJSON(message.parentCastId) : void 0);
|
5800
|
+
message.parentUrl !== void 0 && (obj.parentUrl = message.parentUrl);
|
5673
5801
|
message.pageSize !== void 0 && (obj.pageSize = Math.round(message.pageSize));
|
5674
5802
|
message.pageToken !== void 0 && (obj.pageToken = message.pageToken !== void 0 ? base64FromBytes4(message.pageToken) : void 0);
|
5675
5803
|
message.reverse !== void 0 && (obj.reverse = message.reverse);
|
@@ -5679,17 +5807,18 @@ var CastsByParentRequest = {
|
|
5679
5807
|
return CastsByParentRequest.fromPartial(base != null ? base : {});
|
5680
5808
|
},
|
5681
5809
|
fromPartial(object) {
|
5682
|
-
var _a, _b, _c;
|
5810
|
+
var _a, _b, _c, _d;
|
5683
5811
|
const message = createBaseCastsByParentRequest();
|
5684
|
-
message.
|
5685
|
-
message.
|
5686
|
-
message.
|
5687
|
-
message.
|
5812
|
+
message.parentCastId = object.parentCastId !== void 0 && object.parentCastId !== null ? CastId.fromPartial(object.parentCastId) : void 0;
|
5813
|
+
message.parentUrl = (_a = object.parentUrl) != null ? _a : void 0;
|
5814
|
+
message.pageSize = (_b = object.pageSize) != null ? _b : void 0;
|
5815
|
+
message.pageToken = (_c = object.pageToken) != null ? _c : void 0;
|
5816
|
+
message.reverse = (_d = object.reverse) != null ? _d : void 0;
|
5688
5817
|
return message;
|
5689
5818
|
}
|
5690
5819
|
};
|
5691
5820
|
function createBaseReactionRequest() {
|
5692
|
-
return { fid: 0, reactionType: 0,
|
5821
|
+
return { fid: 0, reactionType: 0, targetCastId: void 0, targetUrl: void 0 };
|
5693
5822
|
}
|
5694
5823
|
var ReactionRequest = {
|
5695
5824
|
encode(message, writer = import_minimal5.default.Writer.create()) {
|
@@ -5699,8 +5828,11 @@ var ReactionRequest = {
|
|
5699
5828
|
if (message.reactionType !== 0) {
|
5700
5829
|
writer.uint32(16).int32(message.reactionType);
|
5701
5830
|
}
|
5702
|
-
if (message.
|
5703
|
-
CastId.encode(message.
|
5831
|
+
if (message.targetCastId !== void 0) {
|
5832
|
+
CastId.encode(message.targetCastId, writer.uint32(26).fork()).ldelim();
|
5833
|
+
}
|
5834
|
+
if (message.targetUrl !== void 0) {
|
5835
|
+
writer.uint32(34).string(message.targetUrl);
|
5704
5836
|
}
|
5705
5837
|
return writer;
|
5706
5838
|
},
|
@@ -5727,7 +5859,13 @@ var ReactionRequest = {
|
|
5727
5859
|
if (tag != 26) {
|
5728
5860
|
break;
|
5729
5861
|
}
|
5730
|
-
message.
|
5862
|
+
message.targetCastId = CastId.decode(reader, reader.uint32());
|
5863
|
+
continue;
|
5864
|
+
case 4:
|
5865
|
+
if (tag != 34) {
|
5866
|
+
break;
|
5867
|
+
}
|
5868
|
+
message.targetUrl = reader.string();
|
5731
5869
|
continue;
|
5732
5870
|
}
|
5733
5871
|
if ((tag & 7) == 4 || tag == 0) {
|
@@ -5741,25 +5879,28 @@ var ReactionRequest = {
|
|
5741
5879
|
return {
|
5742
5880
|
fid: isSet5(object.fid) ? Number(object.fid) : 0,
|
5743
5881
|
reactionType: isSet5(object.reactionType) ? reactionTypeFromJSON(object.reactionType) : 0,
|
5744
|
-
|
5882
|
+
targetCastId: isSet5(object.targetCastId) ? CastId.fromJSON(object.targetCastId) : void 0,
|
5883
|
+
targetUrl: isSet5(object.targetUrl) ? String(object.targetUrl) : void 0
|
5745
5884
|
};
|
5746
5885
|
},
|
5747
5886
|
toJSON(message) {
|
5748
5887
|
const obj = {};
|
5749
5888
|
message.fid !== void 0 && (obj.fid = Math.round(message.fid));
|
5750
5889
|
message.reactionType !== void 0 && (obj.reactionType = reactionTypeToJSON(message.reactionType));
|
5751
|
-
message.
|
5890
|
+
message.targetCastId !== void 0 && (obj.targetCastId = message.targetCastId ? CastId.toJSON(message.targetCastId) : void 0);
|
5891
|
+
message.targetUrl !== void 0 && (obj.targetUrl = message.targetUrl);
|
5752
5892
|
return obj;
|
5753
5893
|
},
|
5754
5894
|
create(base) {
|
5755
5895
|
return ReactionRequest.fromPartial(base != null ? base : {});
|
5756
5896
|
},
|
5757
5897
|
fromPartial(object) {
|
5758
|
-
var _a, _b;
|
5898
|
+
var _a, _b, _c;
|
5759
5899
|
const message = createBaseReactionRequest();
|
5760
5900
|
message.fid = (_a = object.fid) != null ? _a : 0;
|
5761
5901
|
message.reactionType = (_b = object.reactionType) != null ? _b : 0;
|
5762
|
-
message.
|
5902
|
+
message.targetCastId = object.targetCastId !== void 0 && object.targetCastId !== null ? CastId.fromPartial(object.targetCastId) : void 0;
|
5903
|
+
message.targetUrl = (_c = object.targetUrl) != null ? _c : void 0;
|
5763
5904
|
return message;
|
5764
5905
|
}
|
5765
5906
|
};
|
@@ -5862,13 +6003,23 @@ var ReactionsByFidRequest = {
|
|
5862
6003
|
return message;
|
5863
6004
|
}
|
5864
6005
|
};
|
5865
|
-
function
|
5866
|
-
return {
|
6006
|
+
function createBaseReactionsByTargetRequest() {
|
6007
|
+
return {
|
6008
|
+
targetCastId: void 0,
|
6009
|
+
targetUrl: void 0,
|
6010
|
+
reactionType: void 0,
|
6011
|
+
pageSize: void 0,
|
6012
|
+
pageToken: void 0,
|
6013
|
+
reverse: void 0
|
6014
|
+
};
|
5867
6015
|
}
|
5868
|
-
var
|
6016
|
+
var ReactionsByTargetRequest = {
|
5869
6017
|
encode(message, writer = import_minimal5.default.Writer.create()) {
|
5870
|
-
if (message.
|
5871
|
-
CastId.encode(message.
|
6018
|
+
if (message.targetCastId !== void 0) {
|
6019
|
+
CastId.encode(message.targetCastId, writer.uint32(10).fork()).ldelim();
|
6020
|
+
}
|
6021
|
+
if (message.targetUrl !== void 0) {
|
6022
|
+
writer.uint32(50).string(message.targetUrl);
|
5872
6023
|
}
|
5873
6024
|
if (message.reactionType !== void 0) {
|
5874
6025
|
writer.uint32(16).int32(message.reactionType);
|
@@ -5887,7 +6038,7 @@ var ReactionsByCastRequest = {
|
|
5887
6038
|
decode(input, length) {
|
5888
6039
|
const reader = input instanceof import_minimal5.default.Reader ? input : import_minimal5.default.Reader.create(input);
|
5889
6040
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
5890
|
-
const message =
|
6041
|
+
const message = createBaseReactionsByTargetRequest();
|
5891
6042
|
while (reader.pos < end) {
|
5892
6043
|
const tag = reader.uint32();
|
5893
6044
|
switch (tag >>> 3) {
|
@@ -5895,7 +6046,13 @@ var ReactionsByCastRequest = {
|
|
5895
6046
|
if (tag != 10) {
|
5896
6047
|
break;
|
5897
6048
|
}
|
5898
|
-
message.
|
6049
|
+
message.targetCastId = CastId.decode(reader, reader.uint32());
|
6050
|
+
continue;
|
6051
|
+
case 6:
|
6052
|
+
if (tag != 50) {
|
6053
|
+
break;
|
6054
|
+
}
|
6055
|
+
message.targetUrl = reader.string();
|
5899
6056
|
continue;
|
5900
6057
|
case 2:
|
5901
6058
|
if (tag != 16) {
|
@@ -5931,7 +6088,8 @@ var ReactionsByCastRequest = {
|
|
5931
6088
|
},
|
5932
6089
|
fromJSON(object) {
|
5933
6090
|
return {
|
5934
|
-
|
6091
|
+
targetCastId: isSet5(object.targetCastId) ? CastId.fromJSON(object.targetCastId) : void 0,
|
6092
|
+
targetUrl: isSet5(object.targetUrl) ? String(object.targetUrl) : void 0,
|
5935
6093
|
reactionType: isSet5(object.reactionType) ? reactionTypeFromJSON(object.reactionType) : void 0,
|
5936
6094
|
pageSize: isSet5(object.pageSize) ? Number(object.pageSize) : void 0,
|
5937
6095
|
pageToken: isSet5(object.pageToken) ? bytesFromBase644(object.pageToken) : void 0,
|
@@ -5940,7 +6098,8 @@ var ReactionsByCastRequest = {
|
|
5940
6098
|
},
|
5941
6099
|
toJSON(message) {
|
5942
6100
|
const obj = {};
|
5943
|
-
message.
|
6101
|
+
message.targetCastId !== void 0 && (obj.targetCastId = message.targetCastId ? CastId.toJSON(message.targetCastId) : void 0);
|
6102
|
+
message.targetUrl !== void 0 && (obj.targetUrl = message.targetUrl);
|
5944
6103
|
message.reactionType !== void 0 && (obj.reactionType = message.reactionType !== void 0 ? reactionTypeToJSON(message.reactionType) : void 0);
|
5945
6104
|
message.pageSize !== void 0 && (obj.pageSize = Math.round(message.pageSize));
|
5946
6105
|
message.pageToken !== void 0 && (obj.pageToken = message.pageToken !== void 0 ? base64FromBytes4(message.pageToken) : void 0);
|
@@ -5948,16 +6107,17 @@ var ReactionsByCastRequest = {
|
|
5948
6107
|
return obj;
|
5949
6108
|
},
|
5950
6109
|
create(base) {
|
5951
|
-
return
|
6110
|
+
return ReactionsByTargetRequest.fromPartial(base != null ? base : {});
|
5952
6111
|
},
|
5953
6112
|
fromPartial(object) {
|
5954
|
-
var _a, _b, _c, _d;
|
5955
|
-
const message =
|
5956
|
-
message.
|
5957
|
-
message.
|
5958
|
-
message.
|
5959
|
-
message.
|
5960
|
-
message.
|
6113
|
+
var _a, _b, _c, _d, _e;
|
6114
|
+
const message = createBaseReactionsByTargetRequest();
|
6115
|
+
message.targetCastId = object.targetCastId !== void 0 && object.targetCastId !== null ? CastId.fromPartial(object.targetCastId) : void 0;
|
6116
|
+
message.targetUrl = (_a = object.targetUrl) != null ? _a : void 0;
|
6117
|
+
message.reactionType = (_b = object.reactionType) != null ? _b : void 0;
|
6118
|
+
message.pageSize = (_c = object.pageSize) != null ? _c : void 0;
|
6119
|
+
message.pageToken = (_d = object.pageToken) != null ? _d : void 0;
|
6120
|
+
message.reverse = (_e = object.reverse) != null ? _e : void 0;
|
5961
6121
|
return message;
|
5962
6122
|
}
|
5963
6123
|
};
|
@@ -6364,6 +6524,7 @@ var HubServiceClientImpl = class {
|
|
6364
6524
|
this.getReaction = this.getReaction.bind(this);
|
6365
6525
|
this.getReactionsByFid = this.getReactionsByFid.bind(this);
|
6366
6526
|
this.getReactionsByCast = this.getReactionsByCast.bind(this);
|
6527
|
+
this.getReactionsByTarget = this.getReactionsByTarget.bind(this);
|
6367
6528
|
this.getUserData = this.getUserData.bind(this);
|
6368
6529
|
this.getUserDataByFid = this.getUserDataByFid.bind(this);
|
6369
6530
|
this.getNameRegistryEvent = this.getNameRegistryEvent.bind(this);
|
@@ -6413,7 +6574,10 @@ var HubServiceClientImpl = class {
|
|
6413
6574
|
return this.rpc.unary(HubServiceGetReactionsByFidDesc, ReactionsByFidRequest.fromPartial(request), metadata);
|
6414
6575
|
}
|
6415
6576
|
getReactionsByCast(request, metadata) {
|
6416
|
-
return this.rpc.unary(HubServiceGetReactionsByCastDesc,
|
6577
|
+
return this.rpc.unary(HubServiceGetReactionsByCastDesc, ReactionsByTargetRequest.fromPartial(request), metadata);
|
6578
|
+
}
|
6579
|
+
getReactionsByTarget(request, metadata) {
|
6580
|
+
return this.rpc.unary(HubServiceGetReactionsByTargetDesc, ReactionsByTargetRequest.fromPartial(request), metadata);
|
6417
6581
|
}
|
6418
6582
|
getUserData(request, metadata) {
|
6419
6583
|
return this.rpc.unary(HubServiceGetUserDataDesc, UserDataRequest.fromPartial(request), metadata);
|
@@ -6686,7 +6850,29 @@ var HubServiceGetReactionsByCastDesc = {
|
|
6686
6850
|
responseStream: false,
|
6687
6851
|
requestType: {
|
6688
6852
|
serializeBinary() {
|
6689
|
-
return
|
6853
|
+
return ReactionsByTargetRequest.encode(this).finish();
|
6854
|
+
}
|
6855
|
+
},
|
6856
|
+
responseType: {
|
6857
|
+
deserializeBinary(data) {
|
6858
|
+
const value = MessagesResponse.decode(data);
|
6859
|
+
return {
|
6860
|
+
...value,
|
6861
|
+
toObject() {
|
6862
|
+
return value;
|
6863
|
+
}
|
6864
|
+
};
|
6865
|
+
}
|
6866
|
+
}
|
6867
|
+
};
|
6868
|
+
var HubServiceGetReactionsByTargetDesc = {
|
6869
|
+
methodName: "GetReactionsByTarget",
|
6870
|
+
service: HubServiceDesc,
|
6871
|
+
requestStream: false,
|
6872
|
+
responseStream: false,
|
6873
|
+
requestType: {
|
6874
|
+
serializeBinary() {
|
6875
|
+
return ReactionsByTargetRequest.encode(this).finish();
|
6690
6876
|
}
|
6691
6877
|
},
|
6692
6878
|
responseType: {
|
@@ -7264,14 +7450,14 @@ var GrpcWebImpl = class {
|
|
7264
7450
|
const request = { ..._request, ...methodDesc.requestType };
|
7265
7451
|
const maybeCombinedMetadata = metadata && this.options.metadata ? new import_browser_headers.BrowserHeaders({ ...(_a = this.options) == null ? void 0 : _a.metadata.headersMap, ...metadata == null ? void 0 : metadata.headersMap }) : metadata || this.options.metadata;
|
7266
7452
|
return new Promise((resolve, reject) => {
|
7267
|
-
grpc.unary(methodDesc, {
|
7453
|
+
grpcWeb.grpc.unary(methodDesc, {
|
7268
7454
|
request,
|
7269
7455
|
host: this.host,
|
7270
7456
|
metadata: maybeCombinedMetadata,
|
7271
7457
|
transport: this.options.transport,
|
7272
7458
|
debug: this.options.debug,
|
7273
7459
|
onEnd: function(response) {
|
7274
|
-
if (response.status === grpc.Code.OK) {
|
7460
|
+
if (response.status === grpcWeb.grpc.Code.OK) {
|
7275
7461
|
resolve(response.message.toObject());
|
7276
7462
|
} else {
|
7277
7463
|
const err2 = new GrpcWebError(response.statusMessage, response.status, response.trailers);
|
@@ -7289,7 +7475,7 @@ var GrpcWebImpl = class {
|
|
7289
7475
|
const maybeCombinedMetadata = metadata && this.options.metadata ? new import_browser_headers.BrowserHeaders({ ...(_a = this.options) == null ? void 0 : _a.metadata.headersMap, ...metadata == null ? void 0 : metadata.headersMap }) : metadata || this.options.metadata;
|
7290
7476
|
return new Observable((observer) => {
|
7291
7477
|
const upStream = () => {
|
7292
|
-
const client = grpc.invoke(methodDesc, {
|
7478
|
+
const client = grpcWeb.grpc.invoke(methodDesc, {
|
7293
7479
|
host: this.host,
|
7294
7480
|
request,
|
7295
7481
|
transport: this.options.streamingTransport || this.options.transport,
|
@@ -7345,7 +7531,7 @@ var GrpcWebError = class extends tsProtoGlobalThis6.Error {
|
|
7345
7531
|
// src/client.ts
|
7346
7532
|
init_esm_shims();
|
7347
7533
|
import { NodeHttpTransport } from "@improbable-eng/grpc-web-node-http-transport";
|
7348
|
-
import
|
7534
|
+
import grpcWeb2 from "@improbable-eng/grpc-web";
|
7349
7535
|
|
7350
7536
|
// ../../node_modules/neverthrow/dist/index.es.js
|
7351
7537
|
init_esm_shims();
|
@@ -7755,19 +7941,18 @@ var fromThrowable = Result.fromThrowable;
|
|
7755
7941
|
|
7756
7942
|
// src/client.ts
|
7757
7943
|
import { HubError } from "@farcaster/core";
|
7758
|
-
import { grpc as grpc3 } from "@improbable-eng/grpc-web";
|
7759
7944
|
import { Observable as Observable2 } from "rxjs";
|
7760
7945
|
var grpcCodeToHubErrorCode = (code) => {
|
7761
7946
|
switch (code) {
|
7762
|
-
case
|
7947
|
+
case grpcWeb2.grpc.Code.Unauthenticated:
|
7763
7948
|
return "unauthenticated";
|
7764
|
-
case
|
7949
|
+
case grpcWeb2.grpc.Code.PermissionDenied:
|
7765
7950
|
return "unauthorized";
|
7766
|
-
case
|
7951
|
+
case grpcWeb2.grpc.Code.InvalidArgument:
|
7767
7952
|
return "bad_request";
|
7768
|
-
case
|
7953
|
+
case grpcWeb2.grpc.Code.NotFound:
|
7769
7954
|
return "not_found";
|
7770
|
-
case
|
7955
|
+
case grpcWeb2.grpc.Code.Unavailable:
|
7771
7956
|
return "unavailable";
|
7772
7957
|
default:
|
7773
7958
|
return "unknown";
|
@@ -7815,7 +8000,7 @@ var getRpcWebClient = (address, isBrowser = true) => {
|
|
7815
8000
|
return new GrpcWebImpl(address, isBrowser ? {} : { transport: NodeHttpTransport() });
|
7816
8001
|
};
|
7817
8002
|
var getAuthMetadata = (username, password) => {
|
7818
|
-
const metadata = new
|
8003
|
+
const metadata = new grpcWeb2.grpc.Metadata();
|
7819
8004
|
if (typeof btoa === "undefined") {
|
7820
8005
|
metadata.set("authorization", `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}`);
|
7821
8006
|
} else {
|
@@ -7854,6 +8039,7 @@ export {
|
|
7854
8039
|
HubServiceGetReactionDesc,
|
7855
8040
|
HubServiceGetReactionsByCastDesc,
|
7856
8041
|
HubServiceGetReactionsByFidDesc,
|
8042
|
+
HubServiceGetReactionsByTargetDesc,
|
7857
8043
|
HubServiceGetSignerDesc,
|
7858
8044
|
HubServiceGetSignersByFidDesc,
|
7859
8045
|
HubServiceGetSyncMetadataByPrefixDesc,
|
@@ -7867,6 +8053,5 @@ export {
|
|
7867
8053
|
Observable2 as Observable,
|
7868
8054
|
getAdminRpcClient,
|
7869
8055
|
getAuthMetadata,
|
7870
|
-
getHubRpcClient
|
7871
|
-
grpc3 as grpc
|
8056
|
+
getHubRpcClient
|
7872
8057
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@farcaster/hub-web",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.3.0",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"ts-proto": "^1.146.0"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@farcaster/core": "^0.
|
32
|
+
"@farcaster/core": "^0.7.0",
|
33
33
|
"@improbable-eng/grpc-web": "^0.15.0",
|
34
34
|
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
35
35
|
"rxjs": "^7.8.0"
|