@conduitplatform/grpc-sdk 0.17.0-alpha.7 → 0.17.0-alpha.8
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.cjs +472 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +80 -5
- package/dist/index.d.ts +80 -5
- package/dist/index.esm.js +467 -36
- package/dist/index.esm.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -52,6 +52,7 @@ __export(index_exports, {
|
|
|
52
52
|
ColumnExistenceResponse: () => ColumnExistenceResponse,
|
|
53
53
|
Communications: () => Communications,
|
|
54
54
|
CommunicationsDefinition: () => CommunicationsDefinition,
|
|
55
|
+
CompatibleIndexType: () => CompatibleIndexType,
|
|
55
56
|
ConduitAuthorizedResource: () => ConduitAuthorizedResource,
|
|
56
57
|
ConduitError: () => ConduitError,
|
|
57
58
|
ConduitGrpcSdk: () => ConduitGrpcSdk,
|
|
@@ -85,6 +86,7 @@ __export(index_exports, {
|
|
|
85
86
|
DeleteEmbeddingConfigRequest: () => DeleteEmbeddingConfigRequest,
|
|
86
87
|
DeleteEmbeddingConfigResponse: () => DeleteEmbeddingConfigResponse,
|
|
87
88
|
DeleteFileResponse: () => DeleteFileResponse,
|
|
89
|
+
DeleteMessageRequest: () => DeleteMessageRequest,
|
|
88
90
|
DeleteResourceRequest: () => DeleteResourceRequest,
|
|
89
91
|
DeleteRoomRequest: () => DeleteRoomRequest,
|
|
90
92
|
DeleteVectorIndexRequest: () => DeleteVectorIndexRequest,
|
|
@@ -248,6 +250,7 @@ __export(index_exports, {
|
|
|
248
250
|
SetNotificationTokenRequest: () => SetNotificationTokenRequest,
|
|
249
251
|
SetNotificationTokenResponse: () => SetNotificationTokenResponse,
|
|
250
252
|
SocketData: () => SocketData,
|
|
253
|
+
SocketPushRequest: () => SocketPushRequest,
|
|
251
254
|
SocketRequest: () => SocketRequest,
|
|
252
255
|
SocketResponse: () => SocketResponse,
|
|
253
256
|
StartBackfillRequest: () => StartBackfillRequest,
|
|
@@ -269,6 +272,8 @@ __export(index_exports, {
|
|
|
269
272
|
UpdateTemplateRequest: () => UpdateTemplateRequest,
|
|
270
273
|
UpsertConfigRequest: () => UpsertConfigRequest,
|
|
271
274
|
UpsertConfigResponse: () => UpsertConfigResponse,
|
|
275
|
+
UserChangeEmail: () => UserChangeEmail,
|
|
276
|
+
UserChangeEmailResponse: () => UserChangeEmailResponse,
|
|
272
277
|
UserChangePass: () => UserChangePass,
|
|
273
278
|
UserCreateByUsernameRequest: () => UserCreateByUsernameRequest,
|
|
274
279
|
UserCreateRequest: () => UserCreateRequest,
|
|
@@ -826,6 +831,143 @@ var UserChangePass = {
|
|
|
826
831
|
return message;
|
|
827
832
|
}
|
|
828
833
|
};
|
|
834
|
+
function createBaseUserChangeEmail() {
|
|
835
|
+
return { userId: "", newEmail: "" };
|
|
836
|
+
}
|
|
837
|
+
var UserChangeEmail = {
|
|
838
|
+
encode(message, writer = new import_wire2.BinaryWriter()) {
|
|
839
|
+
if (message.userId !== "") {
|
|
840
|
+
writer.uint32(10).string(message.userId);
|
|
841
|
+
}
|
|
842
|
+
if (message.newEmail !== "") {
|
|
843
|
+
writer.uint32(18).string(message.newEmail);
|
|
844
|
+
}
|
|
845
|
+
return writer;
|
|
846
|
+
},
|
|
847
|
+
decode(input, length) {
|
|
848
|
+
const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
|
|
849
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
850
|
+
if (previousRecursionDepth >= 100) {
|
|
851
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
852
|
+
}
|
|
853
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
854
|
+
try {
|
|
855
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
856
|
+
const message = createBaseUserChangeEmail();
|
|
857
|
+
while (reader.pos < end) {
|
|
858
|
+
const tag = reader.uint32();
|
|
859
|
+
switch (tag >>> 3) {
|
|
860
|
+
case 1: {
|
|
861
|
+
if (tag !== 10) {
|
|
862
|
+
break;
|
|
863
|
+
}
|
|
864
|
+
message.userId = reader.string();
|
|
865
|
+
continue;
|
|
866
|
+
}
|
|
867
|
+
case 2: {
|
|
868
|
+
if (tag !== 18) {
|
|
869
|
+
break;
|
|
870
|
+
}
|
|
871
|
+
message.newEmail = reader.string();
|
|
872
|
+
continue;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
876
|
+
break;
|
|
877
|
+
}
|
|
878
|
+
reader.skip(tag & 7);
|
|
879
|
+
}
|
|
880
|
+
return message;
|
|
881
|
+
} finally {
|
|
882
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
fromJSON(object) {
|
|
886
|
+
return {
|
|
887
|
+
userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
|
|
888
|
+
newEmail: isSet(object.newEmail) ? globalThis.String(object.newEmail) : ""
|
|
889
|
+
};
|
|
890
|
+
},
|
|
891
|
+
toJSON(message) {
|
|
892
|
+
const obj = {};
|
|
893
|
+
if (message.userId !== "") {
|
|
894
|
+
obj.userId = message.userId;
|
|
895
|
+
}
|
|
896
|
+
if (message.newEmail !== "") {
|
|
897
|
+
obj.newEmail = message.newEmail;
|
|
898
|
+
}
|
|
899
|
+
return obj;
|
|
900
|
+
},
|
|
901
|
+
create(base) {
|
|
902
|
+
return UserChangeEmail.fromPartial(base ?? {});
|
|
903
|
+
},
|
|
904
|
+
fromPartial(object) {
|
|
905
|
+
const message = createBaseUserChangeEmail();
|
|
906
|
+
message.userId = object.userId ?? "";
|
|
907
|
+
message.newEmail = object.newEmail ?? "";
|
|
908
|
+
return message;
|
|
909
|
+
}
|
|
910
|
+
};
|
|
911
|
+
function createBaseUserChangeEmailResponse() {
|
|
912
|
+
return { message: "" };
|
|
913
|
+
}
|
|
914
|
+
var UserChangeEmailResponse = {
|
|
915
|
+
encode(message, writer = new import_wire2.BinaryWriter()) {
|
|
916
|
+
if (message.message !== "") {
|
|
917
|
+
writer.uint32(10).string(message.message);
|
|
918
|
+
}
|
|
919
|
+
return writer;
|
|
920
|
+
},
|
|
921
|
+
decode(input, length) {
|
|
922
|
+
const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
|
|
923
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
924
|
+
if (previousRecursionDepth >= 100) {
|
|
925
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
926
|
+
}
|
|
927
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
928
|
+
try {
|
|
929
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
930
|
+
const message = createBaseUserChangeEmailResponse();
|
|
931
|
+
while (reader.pos < end) {
|
|
932
|
+
const tag = reader.uint32();
|
|
933
|
+
switch (tag >>> 3) {
|
|
934
|
+
case 1: {
|
|
935
|
+
if (tag !== 10) {
|
|
936
|
+
break;
|
|
937
|
+
}
|
|
938
|
+
message.message = reader.string();
|
|
939
|
+
continue;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
943
|
+
break;
|
|
944
|
+
}
|
|
945
|
+
reader.skip(tag & 7);
|
|
946
|
+
}
|
|
947
|
+
return message;
|
|
948
|
+
} finally {
|
|
949
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
fromJSON(object) {
|
|
953
|
+
return { message: isSet(object.message) ? globalThis.String(object.message) : "" };
|
|
954
|
+
},
|
|
955
|
+
toJSON(message) {
|
|
956
|
+
const obj = {};
|
|
957
|
+
if (message.message !== "") {
|
|
958
|
+
obj.message = message.message;
|
|
959
|
+
}
|
|
960
|
+
return obj;
|
|
961
|
+
},
|
|
962
|
+
create(base) {
|
|
963
|
+
return UserChangeEmailResponse.fromPartial(base ?? {});
|
|
964
|
+
},
|
|
965
|
+
fromPartial(object) {
|
|
966
|
+
const message = createBaseUserChangeEmailResponse();
|
|
967
|
+
message.message = object.message ?? "";
|
|
968
|
+
return message;
|
|
969
|
+
}
|
|
970
|
+
};
|
|
829
971
|
function createBaseUserDeleteRequest() {
|
|
830
972
|
return { userId: "" };
|
|
831
973
|
}
|
|
@@ -2368,6 +2510,14 @@ var AuthenticationDefinition = {
|
|
|
2368
2510
|
responseStream: false,
|
|
2369
2511
|
options: {}
|
|
2370
2512
|
},
|
|
2513
|
+
changeEmail: {
|
|
2514
|
+
name: "ChangeEmail",
|
|
2515
|
+
requestType: UserChangeEmail,
|
|
2516
|
+
requestStream: false,
|
|
2517
|
+
responseType: UserChangeEmailResponse,
|
|
2518
|
+
responseStream: false,
|
|
2519
|
+
options: {}
|
|
2520
|
+
},
|
|
2371
2521
|
userDelete: {
|
|
2372
2522
|
name: "UserDelete",
|
|
2373
2523
|
requestType: UserDeleteRequest,
|
|
@@ -4404,6 +4554,83 @@ var EditMessageRequest = {
|
|
|
4404
4554
|
return message;
|
|
4405
4555
|
}
|
|
4406
4556
|
};
|
|
4557
|
+
function createBaseDeleteMessageRequest() {
|
|
4558
|
+
return { messageId: "", userId: "" };
|
|
4559
|
+
}
|
|
4560
|
+
var DeleteMessageRequest = {
|
|
4561
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
4562
|
+
if (message.messageId !== "") {
|
|
4563
|
+
writer.uint32(10).string(message.messageId);
|
|
4564
|
+
}
|
|
4565
|
+
if (message.userId !== "") {
|
|
4566
|
+
writer.uint32(18).string(message.userId);
|
|
4567
|
+
}
|
|
4568
|
+
return writer;
|
|
4569
|
+
},
|
|
4570
|
+
decode(input, length) {
|
|
4571
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
4572
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
4573
|
+
if (previousRecursionDepth >= 100) {
|
|
4574
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
4575
|
+
}
|
|
4576
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
4577
|
+
try {
|
|
4578
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
4579
|
+
const message = createBaseDeleteMessageRequest();
|
|
4580
|
+
while (reader.pos < end) {
|
|
4581
|
+
const tag = reader.uint32();
|
|
4582
|
+
switch (tag >>> 3) {
|
|
4583
|
+
case 1: {
|
|
4584
|
+
if (tag !== 10) {
|
|
4585
|
+
break;
|
|
4586
|
+
}
|
|
4587
|
+
message.messageId = reader.string();
|
|
4588
|
+
continue;
|
|
4589
|
+
}
|
|
4590
|
+
case 2: {
|
|
4591
|
+
if (tag !== 18) {
|
|
4592
|
+
break;
|
|
4593
|
+
}
|
|
4594
|
+
message.userId = reader.string();
|
|
4595
|
+
continue;
|
|
4596
|
+
}
|
|
4597
|
+
}
|
|
4598
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4599
|
+
break;
|
|
4600
|
+
}
|
|
4601
|
+
reader.skip(tag & 7);
|
|
4602
|
+
}
|
|
4603
|
+
return message;
|
|
4604
|
+
} finally {
|
|
4605
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
4606
|
+
}
|
|
4607
|
+
},
|
|
4608
|
+
fromJSON(object) {
|
|
4609
|
+
return {
|
|
4610
|
+
messageId: isSet3(object.messageId) ? globalThis.String(object.messageId) : "",
|
|
4611
|
+
userId: isSet3(object.userId) ? globalThis.String(object.userId) : ""
|
|
4612
|
+
};
|
|
4613
|
+
},
|
|
4614
|
+
toJSON(message) {
|
|
4615
|
+
const obj = {};
|
|
4616
|
+
if (message.messageId !== "") {
|
|
4617
|
+
obj.messageId = message.messageId;
|
|
4618
|
+
}
|
|
4619
|
+
if (message.userId !== "") {
|
|
4620
|
+
obj.userId = message.userId;
|
|
4621
|
+
}
|
|
4622
|
+
return obj;
|
|
4623
|
+
},
|
|
4624
|
+
create(base) {
|
|
4625
|
+
return DeleteMessageRequest.fromPartial(base ?? {});
|
|
4626
|
+
},
|
|
4627
|
+
fromPartial(object) {
|
|
4628
|
+
const message = createBaseDeleteMessageRequest();
|
|
4629
|
+
message.messageId = object.messageId ?? "";
|
|
4630
|
+
message.userId = object.userId ?? "";
|
|
4631
|
+
return message;
|
|
4632
|
+
}
|
|
4633
|
+
};
|
|
4407
4634
|
function createBaseDeleteRoomRequest() {
|
|
4408
4635
|
return { _id: "" };
|
|
4409
4636
|
}
|
|
@@ -4653,6 +4880,14 @@ var ChatDefinition = {
|
|
|
4653
4880
|
responseType: Empty,
|
|
4654
4881
|
responseStream: false,
|
|
4655
4882
|
options: {}
|
|
4883
|
+
},
|
|
4884
|
+
deleteMessage: {
|
|
4885
|
+
name: "DeleteMessage",
|
|
4886
|
+
requestType: DeleteMessageRequest,
|
|
4887
|
+
requestStream: false,
|
|
4888
|
+
responseType: Empty,
|
|
4889
|
+
responseStream: false,
|
|
4890
|
+
options: {}
|
|
4656
4891
|
}
|
|
4657
4892
|
}
|
|
4658
4893
|
};
|
|
@@ -9803,6 +10038,113 @@ function isSet4(value) {
|
|
|
9803
10038
|
|
|
9804
10039
|
// src/protoUtils/core.ts
|
|
9805
10040
|
var import_wire6 = require("@bufbuild/protobuf/wire");
|
|
10041
|
+
function createBaseSocketPushRequest() {
|
|
10042
|
+
return { event: "", data: void 0, receivers: [], rooms: [] };
|
|
10043
|
+
}
|
|
10044
|
+
var SocketPushRequest = {
|
|
10045
|
+
encode(message, writer = new import_wire6.BinaryWriter()) {
|
|
10046
|
+
if (message.event !== "") {
|
|
10047
|
+
writer.uint32(10).string(message.event);
|
|
10048
|
+
}
|
|
10049
|
+
if (message.data !== void 0) {
|
|
10050
|
+
writer.uint32(18).string(message.data);
|
|
10051
|
+
}
|
|
10052
|
+
for (const v of message.receivers) {
|
|
10053
|
+
writer.uint32(26).string(v);
|
|
10054
|
+
}
|
|
10055
|
+
for (const v of message.rooms) {
|
|
10056
|
+
writer.uint32(34).string(v);
|
|
10057
|
+
}
|
|
10058
|
+
return writer;
|
|
10059
|
+
},
|
|
10060
|
+
decode(input, length) {
|
|
10061
|
+
const reader = input instanceof import_wire6.BinaryReader ? input : new import_wire6.BinaryReader(input);
|
|
10062
|
+
const previousRecursionDepth = reader.__tsProtoDecodeDepth ?? 0;
|
|
10063
|
+
if (previousRecursionDepth >= 100) {
|
|
10064
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
10065
|
+
}
|
|
10066
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
10067
|
+
try {
|
|
10068
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
10069
|
+
const message = createBaseSocketPushRequest();
|
|
10070
|
+
while (reader.pos < end) {
|
|
10071
|
+
const tag = reader.uint32();
|
|
10072
|
+
switch (tag >>> 3) {
|
|
10073
|
+
case 1: {
|
|
10074
|
+
if (tag !== 10) {
|
|
10075
|
+
break;
|
|
10076
|
+
}
|
|
10077
|
+
message.event = reader.string();
|
|
10078
|
+
continue;
|
|
10079
|
+
}
|
|
10080
|
+
case 2: {
|
|
10081
|
+
if (tag !== 18) {
|
|
10082
|
+
break;
|
|
10083
|
+
}
|
|
10084
|
+
message.data = reader.string();
|
|
10085
|
+
continue;
|
|
10086
|
+
}
|
|
10087
|
+
case 3: {
|
|
10088
|
+
if (tag !== 26) {
|
|
10089
|
+
break;
|
|
10090
|
+
}
|
|
10091
|
+
message.receivers.push(reader.string());
|
|
10092
|
+
continue;
|
|
10093
|
+
}
|
|
10094
|
+
case 4: {
|
|
10095
|
+
if (tag !== 34) {
|
|
10096
|
+
break;
|
|
10097
|
+
}
|
|
10098
|
+
message.rooms.push(reader.string());
|
|
10099
|
+
continue;
|
|
10100
|
+
}
|
|
10101
|
+
}
|
|
10102
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
10103
|
+
break;
|
|
10104
|
+
}
|
|
10105
|
+
reader.skip(tag & 7);
|
|
10106
|
+
}
|
|
10107
|
+
return message;
|
|
10108
|
+
} finally {
|
|
10109
|
+
reader.__tsProtoDecodeDepth = previousRecursionDepth;
|
|
10110
|
+
}
|
|
10111
|
+
},
|
|
10112
|
+
fromJSON(object) {
|
|
10113
|
+
return {
|
|
10114
|
+
event: isSet5(object.event) ? globalThis.String(object.event) : "",
|
|
10115
|
+
data: isSet5(object.data) ? globalThis.String(object.data) : void 0,
|
|
10116
|
+
receivers: globalThis.Array.isArray(object?.receivers) ? object.receivers.map((e) => globalThis.String(e)) : [],
|
|
10117
|
+
rooms: globalThis.Array.isArray(object?.rooms) ? object.rooms.map((e) => globalThis.String(e)) : []
|
|
10118
|
+
};
|
|
10119
|
+
},
|
|
10120
|
+
toJSON(message) {
|
|
10121
|
+
const obj = {};
|
|
10122
|
+
if (message.event !== "") {
|
|
10123
|
+
obj.event = message.event;
|
|
10124
|
+
}
|
|
10125
|
+
if (message.data !== void 0) {
|
|
10126
|
+
obj.data = message.data;
|
|
10127
|
+
}
|
|
10128
|
+
if (message.receivers?.length) {
|
|
10129
|
+
obj.receivers = message.receivers;
|
|
10130
|
+
}
|
|
10131
|
+
if (message.rooms?.length) {
|
|
10132
|
+
obj.rooms = message.rooms;
|
|
10133
|
+
}
|
|
10134
|
+
return obj;
|
|
10135
|
+
},
|
|
10136
|
+
create(base) {
|
|
10137
|
+
return SocketPushRequest.fromPartial(base ?? {});
|
|
10138
|
+
},
|
|
10139
|
+
fromPartial(object) {
|
|
10140
|
+
const message = createBaseSocketPushRequest();
|
|
10141
|
+
message.event = object.event ?? "";
|
|
10142
|
+
message.data = object.data ?? void 0;
|
|
10143
|
+
message.receivers = object.receivers?.map((e) => e) || [];
|
|
10144
|
+
message.rooms = object.rooms?.map((e) => e) || [];
|
|
10145
|
+
return message;
|
|
10146
|
+
}
|
|
10147
|
+
};
|
|
9806
10148
|
function createBaseRegisterAdminRouteRequest() {
|
|
9807
10149
|
return { routes: [], routerUrl: void 0 };
|
|
9808
10150
|
}
|
|
@@ -11878,6 +12220,14 @@ var AdminDefinition = {
|
|
|
11878
12220
|
responseType: Empty,
|
|
11879
12221
|
responseStream: false,
|
|
11880
12222
|
options: {}
|
|
12223
|
+
},
|
|
12224
|
+
socketPush: {
|
|
12225
|
+
name: "SocketPush",
|
|
12226
|
+
requestType: SocketPushRequest,
|
|
12227
|
+
requestStream: false,
|
|
12228
|
+
responseType: Empty,
|
|
12229
|
+
responseStream: false,
|
|
12230
|
+
options: {}
|
|
11881
12231
|
}
|
|
11882
12232
|
}
|
|
11883
12233
|
};
|
|
@@ -22893,6 +23243,11 @@ var PostgresIndexType = /* @__PURE__ */ ((PostgresIndexType2) => {
|
|
|
22893
23243
|
PostgresIndexType2["BRIN"] = "BRIN";
|
|
22894
23244
|
return PostgresIndexType2;
|
|
22895
23245
|
})(PostgresIndexType || {});
|
|
23246
|
+
var CompatibleIndexType = /* @__PURE__ */ ((CompatibleIndexType2) => {
|
|
23247
|
+
CompatibleIndexType2["Ascending"] = "Ascending";
|
|
23248
|
+
CompatibleIndexType2["Descending"] = "Descending";
|
|
23249
|
+
return CompatibleIndexType2;
|
|
23250
|
+
})(CompatibleIndexType || {});
|
|
22896
23251
|
var ConduitModelOptionsPermModifyType = [
|
|
22897
23252
|
"Everything",
|
|
22898
23253
|
"Nothing",
|
|
@@ -23521,6 +23876,9 @@ var Admin = class extends ConduitModule {
|
|
|
23521
23876
|
};
|
|
23522
23877
|
return this.client.registerAdminRoute(request);
|
|
23523
23878
|
}
|
|
23879
|
+
socketPush(data) {
|
|
23880
|
+
return this.client.socketPush(data);
|
|
23881
|
+
}
|
|
23524
23882
|
patchRouteMiddlewares(path, action, middlewares) {
|
|
23525
23883
|
return this.client.patchRouteMiddlewares({
|
|
23526
23884
|
path,
|
|
@@ -23623,6 +23981,9 @@ var Chat = class extends ConduitModule {
|
|
|
23623
23981
|
editMessage(messageData) {
|
|
23624
23982
|
return this.client.editMessage(EditMessageRequest.fromPartial(messageData));
|
|
23625
23983
|
}
|
|
23984
|
+
deleteMessage(messageData) {
|
|
23985
|
+
return this.client.deleteMessage(DeleteMessageRequest.fromPartial(messageData));
|
|
23986
|
+
}
|
|
23626
23987
|
createRoom(name, participants) {
|
|
23627
23988
|
return this.client.createRoom({ name, participants });
|
|
23628
23989
|
}
|
|
@@ -23712,6 +24073,9 @@ var Authentication = class extends ConduitModule {
|
|
|
23712
24073
|
changePass(email, password) {
|
|
23713
24074
|
return this.client.changePass({ email, password });
|
|
23714
24075
|
}
|
|
24076
|
+
changeEmail(userId, newEmail) {
|
|
24077
|
+
return this.client.changeEmail({ userId, newEmail });
|
|
24078
|
+
}
|
|
23715
24079
|
getTeam(teamId) {
|
|
23716
24080
|
return this.client.getTeam({ teamId });
|
|
23717
24081
|
}
|
|
@@ -24037,72 +24401,136 @@ var import_crypto = __toESM(require("crypto"), 1);
|
|
|
24037
24401
|
var EventBus = class {
|
|
24038
24402
|
_clientSubscriber;
|
|
24039
24403
|
_clientPublisher;
|
|
24040
|
-
|
|
24041
|
-
|
|
24404
|
+
/** channelName -> subscriberId -> callback */
|
|
24405
|
+
_channelCallbacks;
|
|
24406
|
+
/** subscriberId -> channelName */
|
|
24407
|
+
_subscriberChannels;
|
|
24408
|
+
/** channels with a successful Redis SUBSCRIBE */
|
|
24409
|
+
_redisSubscribedChannels;
|
|
24410
|
+
_subscribeInFlight = /* @__PURE__ */ new Map();
|
|
24042
24411
|
_signature;
|
|
24412
|
+
_anonymousSubscriberSeq = 0;
|
|
24413
|
+
_shuttingDown = false;
|
|
24043
24414
|
constructor(redisManager) {
|
|
24044
|
-
this.
|
|
24045
|
-
this.
|
|
24415
|
+
this._channelCallbacks = /* @__PURE__ */ new Map();
|
|
24416
|
+
this._subscriberChannels = /* @__PURE__ */ new Map();
|
|
24417
|
+
this._redisSubscribedChannels = /* @__PURE__ */ new Set();
|
|
24046
24418
|
this._clientSubscriber = redisManager.getClient({ keyPrefix: "bus_" });
|
|
24047
24419
|
this._clientPublisher = redisManager.getClient({ keyPrefix: "bus_" });
|
|
24048
24420
|
this._signature = import_crypto.default.randomBytes(20).toString("hex");
|
|
24049
24421
|
this._clientSubscriber.on("ready", () => {
|
|
24050
24422
|
getLogger().log("The Bus is in the station...hehe");
|
|
24051
24423
|
});
|
|
24424
|
+
this._clientSubscriber.on("message", (channel, message) => {
|
|
24425
|
+
this.dispatch(channel, message);
|
|
24426
|
+
});
|
|
24052
24427
|
process.on("exit", () => {
|
|
24053
|
-
this.
|
|
24054
|
-
this._clientPublisher.quit();
|
|
24428
|
+
this.quit();
|
|
24055
24429
|
});
|
|
24056
24430
|
}
|
|
24431
|
+
quit() {
|
|
24432
|
+
if (this._shuttingDown) return;
|
|
24433
|
+
this._shuttingDown = true;
|
|
24434
|
+
void this._clientSubscriber.quit();
|
|
24435
|
+
void this._clientPublisher.quit();
|
|
24436
|
+
}
|
|
24057
24437
|
unsubscribe(subscriberId) {
|
|
24058
|
-
|
|
24059
|
-
|
|
24060
|
-
|
|
24061
|
-
|
|
24062
|
-
|
|
24063
|
-
|
|
24438
|
+
const channelName = this._subscriberChannels.get(subscriberId);
|
|
24439
|
+
if (!channelName) {
|
|
24440
|
+
return;
|
|
24441
|
+
}
|
|
24442
|
+
const callbacks = this._channelCallbacks.get(channelName);
|
|
24443
|
+
callbacks?.delete(subscriberId);
|
|
24444
|
+
this._subscriberChannels.delete(subscriberId);
|
|
24445
|
+
if (callbacks && callbacks.size === 0) {
|
|
24446
|
+
this._channelCallbacks.delete(channelName);
|
|
24447
|
+
if (this._redisSubscribedChannels.delete(channelName)) {
|
|
24064
24448
|
this._clientSubscriber.unsubscribe(channelName, () => {
|
|
24065
24449
|
});
|
|
24066
24450
|
}
|
|
24067
24451
|
}
|
|
24068
24452
|
}
|
|
24069
24453
|
subscribe(channelName, callback, subscriberId) {
|
|
24454
|
+
void this.subscribeAck(channelName, callback, subscriberId).catch((err) => {
|
|
24455
|
+
getLogger().error(
|
|
24456
|
+
`EventBus subscribe failed for ${channelName}: ${err instanceof Error ? err.message : String(err)}`
|
|
24457
|
+
);
|
|
24458
|
+
});
|
|
24459
|
+
}
|
|
24460
|
+
async subscribeAck(channelName, callback, subscriberId) {
|
|
24461
|
+
if (this._shuttingDown) {
|
|
24462
|
+
return;
|
|
24463
|
+
}
|
|
24464
|
+
const id = subscriberId ?? `anon:${channelName}:${++this._anonymousSubscriberSeq}:${import_crypto.default.randomBytes(4).toString("hex")}`;
|
|
24070
24465
|
if (subscriberId) {
|
|
24071
24466
|
this.unsubscribe(subscriberId);
|
|
24072
24467
|
}
|
|
24073
|
-
|
|
24074
|
-
|
|
24075
|
-
|
|
24076
|
-
|
|
24077
|
-
|
|
24078
|
-
|
|
24079
|
-
|
|
24080
|
-
|
|
24468
|
+
let callbacks = this._channelCallbacks.get(channelName);
|
|
24469
|
+
if (!callbacks) {
|
|
24470
|
+
callbacks = /* @__PURE__ */ new Map();
|
|
24471
|
+
this._channelCallbacks.set(channelName, callbacks);
|
|
24472
|
+
}
|
|
24473
|
+
callbacks.set(id, callback);
|
|
24474
|
+
this._subscriberChannels.set(id, channelName);
|
|
24475
|
+
if (this._redisSubscribedChannels.has(channelName)) {
|
|
24081
24476
|
return;
|
|
24082
24477
|
}
|
|
24083
|
-
this.
|
|
24084
|
-
|
|
24085
|
-
|
|
24086
|
-
|
|
24087
|
-
|
|
24088
|
-
|
|
24089
|
-
|
|
24090
|
-
|
|
24091
|
-
|
|
24092
|
-
|
|
24093
|
-
});
|
|
24094
|
-
}
|
|
24095
|
-
} else {
|
|
24096
|
-
self._subscribedChannels[channelName].forEach((fn) => {
|
|
24097
|
-
fn(message);
|
|
24478
|
+
let inFlight = this._subscribeInFlight.get(channelName);
|
|
24479
|
+
if (!inFlight) {
|
|
24480
|
+
inFlight = new Promise((resolve, reject) => {
|
|
24481
|
+
this._clientSubscriber.subscribe(channelName, (err) => {
|
|
24482
|
+
if (err) {
|
|
24483
|
+
reject(err);
|
|
24484
|
+
return;
|
|
24485
|
+
}
|
|
24486
|
+
this._redisSubscribedChannels.add(channelName);
|
|
24487
|
+
resolve();
|
|
24098
24488
|
});
|
|
24489
|
+
}).finally(() => {
|
|
24490
|
+
this._subscribeInFlight.delete(channelName);
|
|
24491
|
+
});
|
|
24492
|
+
this._subscribeInFlight.set(channelName, inFlight);
|
|
24493
|
+
}
|
|
24494
|
+
try {
|
|
24495
|
+
await inFlight;
|
|
24496
|
+
} catch (err) {
|
|
24497
|
+
if (!this._redisSubscribedChannels.has(channelName)) {
|
|
24498
|
+
this.removeChannelCallbacks(channelName);
|
|
24099
24499
|
}
|
|
24100
|
-
|
|
24500
|
+
this.unsubscribe(id);
|
|
24501
|
+
throw err;
|
|
24502
|
+
}
|
|
24101
24503
|
}
|
|
24102
24504
|
publish(channelName, message) {
|
|
24103
24505
|
message = message + `CND_Signature:${this._signature}`;
|
|
24104
24506
|
this._clientPublisher.publish(channelName, message);
|
|
24105
24507
|
}
|
|
24508
|
+
removeChannelCallbacks(channelName) {
|
|
24509
|
+
const callbacks = this._channelCallbacks.get(channelName);
|
|
24510
|
+
if (!callbacks) {
|
|
24511
|
+
return;
|
|
24512
|
+
}
|
|
24513
|
+
for (const subId of callbacks.keys()) {
|
|
24514
|
+
this._subscriberChannels.delete(subId);
|
|
24515
|
+
}
|
|
24516
|
+
this._channelCallbacks.delete(channelName);
|
|
24517
|
+
}
|
|
24518
|
+
dispatch(channel, message) {
|
|
24519
|
+
const callbacks = this._channelCallbacks.get(channel);
|
|
24520
|
+
if (!callbacks || callbacks.size === 0) {
|
|
24521
|
+
return;
|
|
24522
|
+
}
|
|
24523
|
+
let payload = message;
|
|
24524
|
+
if (message.indexOf("CND_Signature") !== -1) {
|
|
24525
|
+
if (message.indexOf(this._signature) !== -1) {
|
|
24526
|
+
return;
|
|
24527
|
+
}
|
|
24528
|
+
payload = message.split("CND_Signature:")[0];
|
|
24529
|
+
}
|
|
24530
|
+
for (const fn of callbacks.values()) {
|
|
24531
|
+
fn(payload);
|
|
24532
|
+
}
|
|
24533
|
+
}
|
|
24106
24534
|
};
|
|
24107
24535
|
|
|
24108
24536
|
// src/utilities/RedisManager.ts
|
|
@@ -24235,6 +24663,9 @@ var StateManager = class {
|
|
|
24235
24663
|
getKey(keyName) {
|
|
24236
24664
|
return this.redisClient.get(keyName);
|
|
24237
24665
|
}
|
|
24666
|
+
incr(keyName) {
|
|
24667
|
+
return this.redisClient.incr(keyName);
|
|
24668
|
+
}
|
|
24238
24669
|
};
|
|
24239
24670
|
|
|
24240
24671
|
// src/index.ts
|
|
@@ -24949,6 +25380,7 @@ var ConduitGrpcSdk = class _ConduitGrpcSdk {
|
|
|
24949
25380
|
ColumnExistenceResponse,
|
|
24950
25381
|
Communications,
|
|
24951
25382
|
CommunicationsDefinition,
|
|
25383
|
+
CompatibleIndexType,
|
|
24952
25384
|
ConduitAuthorizedResource,
|
|
24953
25385
|
ConduitError,
|
|
24954
25386
|
ConduitGrpcSdk,
|
|
@@ -24982,6 +25414,7 @@ var ConduitGrpcSdk = class _ConduitGrpcSdk {
|
|
|
24982
25414
|
DeleteEmbeddingConfigRequest,
|
|
24983
25415
|
DeleteEmbeddingConfigResponse,
|
|
24984
25416
|
DeleteFileResponse,
|
|
25417
|
+
DeleteMessageRequest,
|
|
24985
25418
|
DeleteResourceRequest,
|
|
24986
25419
|
DeleteRoomRequest,
|
|
24987
25420
|
DeleteVectorIndexRequest,
|
|
@@ -25145,6 +25578,7 @@ var ConduitGrpcSdk = class _ConduitGrpcSdk {
|
|
|
25145
25578
|
SetNotificationTokenRequest,
|
|
25146
25579
|
SetNotificationTokenResponse,
|
|
25147
25580
|
SocketData,
|
|
25581
|
+
SocketPushRequest,
|
|
25148
25582
|
SocketRequest,
|
|
25149
25583
|
SocketResponse,
|
|
25150
25584
|
StartBackfillRequest,
|
|
@@ -25166,6 +25600,8 @@ var ConduitGrpcSdk = class _ConduitGrpcSdk {
|
|
|
25166
25600
|
UpdateTemplateRequest,
|
|
25167
25601
|
UpsertConfigRequest,
|
|
25168
25602
|
UpsertConfigResponse,
|
|
25603
|
+
UserChangeEmail,
|
|
25604
|
+
UserChangeEmailResponse,
|
|
25169
25605
|
UserChangePass,
|
|
25170
25606
|
UserCreateByUsernameRequest,
|
|
25171
25607
|
UserCreateRequest,
|