@cratis/chronicle.contracts 18.4.0 → 18.5.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.
Files changed (34) hide show
  1. package/dist/cjs/generated/descriptorSet.js +1 -1
  2. package/dist/cjs/generated/descriptorSet.js.map +1 -1
  3. package/dist/cjs/generated/index.d.ts +1 -1
  4. package/dist/cjs/generated/index.d.ts.map +1 -1
  5. package/dist/cjs/generated/sequences.d.ts +1 -46
  6. package/dist/cjs/generated/sequences.d.ts.map +1 -1
  7. package/dist/cjs/generated/sequences.js +214 -943
  8. package/dist/cjs/generated/sequences.js.map +1 -1
  9. package/dist/cjs/index.js +0 -4
  10. package/dist/cjs/index.js.map +1 -1
  11. package/dist/esm/generated/descriptorSet.js +1 -1
  12. package/dist/esm/generated/descriptorSet.js.map +1 -1
  13. package/dist/esm/generated/index.d.ts +1 -1
  14. package/dist/esm/generated/index.d.ts.map +1 -1
  15. package/dist/esm/generated/sequences.d.ts +1 -46
  16. package/dist/esm/generated/sequences.d.ts.map +1 -1
  17. package/dist/esm/generated/sequences.js +215 -940
  18. package/dist/esm/generated/sequences.js.map +1 -1
  19. package/dist/esm/index.js +1 -1
  20. package/dist/generated/descriptorSet.js +1 -1
  21. package/dist/generated/descriptorSet.js.map +1 -1
  22. package/dist/generated/index.d.ts +1 -1
  23. package/dist/generated/index.d.ts.map +1 -1
  24. package/dist/generated/index.js +1 -1
  25. package/dist/generated/index.js.map +1 -1
  26. package/dist/generated/sequences.d.ts +1 -46
  27. package/dist/generated/sequences.d.ts.map +1 -1
  28. package/dist/generated/sequences.js +214 -939
  29. package/dist/generated/sequences.js.map +1 -1
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/generated/descriptorSet.ts +1 -1
  32. package/generated/index.ts +1 -1
  33. package/generated/sequences.ts +298 -1126
  34. package/package.json +1 -1
@@ -241,24 +241,6 @@ export interface AllEventSequencesRequest {
241
241
  Namespace: string;
242
242
  }
243
243
 
244
- export interface AppendCausation {
245
- Occurred: SerializableDateTimeOffset | undefined;
246
- Type: string;
247
- Properties: { [key: string]: string };
248
- }
249
-
250
- export interface AppendCausation_PropertiesEntry {
251
- key: string;
252
- value: string;
253
- }
254
-
255
- export interface AppendIdentity {
256
- Subject: string;
257
- Name: string;
258
- UserName: string;
259
- OnBehalfOf: AppendIdentity | undefined;
260
- }
261
-
262
244
  export interface AppendManyForEventSourcesRequest {
263
245
  EventStore: string;
264
246
  Namespace: string;
@@ -269,7 +251,6 @@ export interface AppendManyForEventSourcesRequest {
269
251
  Causation: Causation[];
270
252
  CausedBy: Identity | undefined;
271
253
  ConcurrencyScopes: EventSourceConcurrencyScope[];
272
- IncludeReceipts: boolean;
273
254
  }
274
255
 
275
256
  export interface AppendManyRequest {
@@ -284,7 +265,6 @@ export interface AppendManyRequest {
284
265
  CausedBy: Identity | undefined;
285
266
  ConcurrencyScope: ConcurrencyScope | undefined;
286
267
  Occurred: SerializableDateTimeOffset | undefined;
287
- IncludeReceipts: boolean;
288
268
  }
289
269
 
290
270
  export interface AppendManyResponse {
@@ -299,31 +279,6 @@ export interface AppendManyResponse {
299
279
  ConstraintViolations: ConstraintViolation[];
300
280
  Errors: string[];
301
281
  ConcurrencyViolations: ConcurrencyViolation[];
302
- Receipts: AppendReceipt[];
303
- }
304
-
305
- export interface AppendReceipt {
306
- EventStore: string;
307
- Namespace: string;
308
- SequenceNumber: bigint;
309
- EventTypeId: string;
310
- Generation: number;
311
- Tombstone: boolean;
312
- EventSourceType: string;
313
- EventSourceId: string;
314
- EventStreamType: string;
315
- EventStreamId: string;
316
- Occurred:
317
- | SerializableDateTimeOffset
318
- | undefined;
319
- /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */
320
- CorrelationId: Guid | undefined;
321
- Subject: string;
322
- Tags: string[];
323
- Hash: string;
324
- Causation: AppendCausation[];
325
- CausedBy: AppendIdentity | undefined;
326
- ObservationState: EventObservationState;
327
282
  }
328
283
 
329
284
  export interface AppendRequest {
@@ -343,7 +298,6 @@ export interface AppendRequest {
343
298
  Causation: Causation[];
344
299
  CausedBy: Identity | undefined;
345
300
  ConcurrencyScope: ConcurrencyScope | undefined;
346
- IncludeReceipt: boolean;
347
301
  }
348
302
 
349
303
  export interface AppendResponse {
@@ -358,7 +312,6 @@ export interface AppendResponse {
358
312
  ConstraintViolations: ConstraintViolation[];
359
313
  Errors: string[];
360
314
  ConcurrencyViolation: ConcurrencyViolation | undefined;
361
- Receipt: AppendReceipt | undefined;
362
315
  }
363
316
 
364
317
  export interface AppendedEventResponse {
@@ -584,6 +537,7 @@ export interface ForEventSourceIdAndEventTypesRequest {
584
537
  EventTypeIds: string;
585
538
  EventStreamType: string;
586
539
  EventStreamId: string;
540
+ EventSourceType: string;
587
541
  }
588
542
 
589
543
  export interface FromSequenceNumberRequest {
@@ -873,25 +827,53 @@ export const AllEventSequencesRequest: MessageFns<AllEventSequencesRequest> = {
873
827
  },
874
828
  };
875
829
 
876
- function createBaseAppendCausation(): AppendCausation {
877
- return { Occurred: undefined, Type: "", Properties: {} };
830
+ function createBaseAppendManyForEventSourcesRequest(): AppendManyForEventSourcesRequest {
831
+ return {
832
+ EventStore: "",
833
+ Namespace: "",
834
+ EventSequenceId: "",
835
+ Events: [],
836
+ CorrelationId: undefined,
837
+ Tags: [],
838
+ Causation: [],
839
+ CausedBy: undefined,
840
+ ConcurrencyScopes: [],
841
+ };
878
842
  }
879
843
 
880
- export const AppendCausation: MessageFns<AppendCausation> = {
881
- encode(message: AppendCausation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
882
- if (message.Occurred !== undefined) {
883
- SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(10).fork()).join();
844
+ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSourcesRequest> = {
845
+ encode(message: AppendManyForEventSourcesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
846
+ if (message.EventStore !== "") {
847
+ writer.uint32(10).string(message.EventStore);
884
848
  }
885
- if (message.Type !== "") {
886
- writer.uint32(18).string(message.Type);
849
+ if (message.Namespace !== "") {
850
+ writer.uint32(18).string(message.Namespace);
851
+ }
852
+ if (message.EventSequenceId !== "") {
853
+ writer.uint32(26).string(message.EventSequenceId);
854
+ }
855
+ for (const v of message.Events) {
856
+ EventForEventSourceId.encode(v!, writer.uint32(34).fork()).join();
857
+ }
858
+ if (message.CorrelationId !== undefined) {
859
+ Guid.encode(message.CorrelationId, writer.uint32(42).fork()).join();
860
+ }
861
+ for (const v of message.Tags) {
862
+ writer.uint32(50).string(v!);
863
+ }
864
+ for (const v of message.Causation) {
865
+ Causation.encode(v!, writer.uint32(58).fork()).join();
866
+ }
867
+ if (message.CausedBy !== undefined) {
868
+ Identity.encode(message.CausedBy, writer.uint32(66).fork()).join();
869
+ }
870
+ for (const v of message.ConcurrencyScopes) {
871
+ EventSourceConcurrencyScope.encode(v!, writer.uint32(74).fork()).join();
887
872
  }
888
- globalThis.Object.entries(message.Properties).forEach(([key, value]: [string, string]) => {
889
- AppendCausation_PropertiesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join();
890
- });
891
873
  return writer;
892
874
  },
893
875
 
894
- decode(input: BinaryReader | Uint8Array, length?: number): AppendCausation {
876
+ decode(input: BinaryReader | Uint8Array, length?: number): AppendManyForEventSourcesRequest {
895
877
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
896
878
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
897
879
  if (previousRecursionDepth >= 100) {
@@ -900,7 +882,7 @@ export const AppendCausation: MessageFns<AppendCausation> = {
900
882
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
901
883
  try {
902
884
  const end = length === undefined ? reader.len : reader.pos + length;
903
- const message = createBaseAppendCausation();
885
+ const message = createBaseAppendManyForEventSourcesRequest();
904
886
  while (reader.pos < end) {
905
887
  const tag = reader.uint32();
906
888
  switch (tag >>> 3) {
@@ -909,7 +891,7 @@ export const AppendCausation: MessageFns<AppendCausation> = {
909
891
  break;
910
892
  }
911
893
 
912
- message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32());
894
+ message.EventStore = reader.string();
913
895
  continue;
914
896
  }
915
897
  case 2: {
@@ -917,7 +899,7 @@ export const AppendCausation: MessageFns<AppendCausation> = {
917
899
  break;
918
900
  }
919
901
 
920
- message.Type = reader.string();
902
+ message.Namespace = reader.string();
921
903
  continue;
922
904
  }
923
905
  case 3: {
@@ -925,129 +907,55 @@ export const AppendCausation: MessageFns<AppendCausation> = {
925
907
  break;
926
908
  }
927
909
 
928
- const entry3 = AppendCausation_PropertiesEntry.decode(reader, reader.uint32());
929
- if (entry3.value !== undefined) {
930
- message.Properties[entry3.key] = entry3.value;
931
- }
910
+ message.EventSequenceId = reader.string();
932
911
  continue;
933
912
  }
934
- }
935
- if ((tag & 7) === 4 || tag === 0) {
936
- break;
937
- }
938
- reader.skip(tag & 7);
939
- }
940
- return message;
941
- } finally {
942
- (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
943
- }
944
- },
945
-
946
- fromJSON(object: any): AppendCausation {
947
- return {
948
- Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined,
949
- Type: isSet(object.Type) ? globalThis.String(object.Type) : "",
950
- Properties: isObject(object.Properties)
951
- ? (globalThis.Object.entries(object.Properties) as [string, any][]).reduce(
952
- (acc: { [key: string]: string }, [key, value]: [string, any]) => {
953
- globalThis.Object.defineProperty(acc, key, {
954
- value: globalThis.String(value),
955
- enumerable: true,
956
- configurable: true,
957
- writable: true,
958
- });
959
- return acc;
960
- },
961
- {},
962
- )
963
- : {},
964
- };
965
- },
966
-
967
- toJSON(message: AppendCausation): unknown {
968
- const obj: any = {};
969
- if (message.Occurred !== undefined) {
970
- obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred);
971
- }
972
- if (message.Type !== "") {
973
- obj.Type = message.Type;
974
- }
975
- if (message.Properties) {
976
- const entries = globalThis.Object.entries(message.Properties) as [string, string][];
977
- if (entries.length > 0) {
978
- obj.Properties = {};
979
- entries.forEach(([k, v]) => {
980
- obj.Properties[k] = v;
981
- });
982
- }
983
- }
984
- return obj;
985
- },
913
+ case 4: {
914
+ if (tag !== 34) {
915
+ break;
916
+ }
986
917
 
987
- create(base?: DeepPartial<AppendCausation>): AppendCausation {
988
- return AppendCausation.fromPartial(base ?? {});
989
- },
990
- fromPartial(object: DeepPartial<AppendCausation>): AppendCausation {
991
- const message = createBaseAppendCausation();
992
- message.Occurred = (object.Occurred !== undefined && object.Occurred !== null)
993
- ? SerializableDateTimeOffset.fromPartial(object.Occurred)
994
- : undefined;
995
- message.Type = object.Type ?? "";
996
- message.Properties = (globalThis.Object.entries(object.Properties ?? {}) as [string, string][]).reduce(
997
- (acc: { [key: string]: string }, [key, value]: [string, string]) => {
998
- if (value !== undefined) {
999
- acc[key] = globalThis.String(value);
1000
- }
1001
- return acc;
1002
- },
1003
- {},
1004
- );
1005
- return message;
1006
- },
1007
- };
918
+ message.Events.push(EventForEventSourceId.decode(reader, reader.uint32()));
919
+ continue;
920
+ }
921
+ case 5: {
922
+ if (tag !== 42) {
923
+ break;
924
+ }
1008
925
 
1009
- function createBaseAppendCausation_PropertiesEntry(): AppendCausation_PropertiesEntry {
1010
- return { key: "", value: "" };
1011
- }
926
+ message.CorrelationId = Guid.decode(reader, reader.uint32());
927
+ continue;
928
+ }
929
+ case 6: {
930
+ if (tag !== 50) {
931
+ break;
932
+ }
1012
933
 
1013
- export const AppendCausation_PropertiesEntry: MessageFns<AppendCausation_PropertiesEntry> = {
1014
- encode(message: AppendCausation_PropertiesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1015
- if (message.key !== "") {
1016
- writer.uint32(10).string(message.key);
1017
- }
1018
- if (message.value !== "") {
1019
- writer.uint32(18).string(message.value);
1020
- }
1021
- return writer;
1022
- },
934
+ message.Tags.push(reader.string());
935
+ continue;
936
+ }
937
+ case 7: {
938
+ if (tag !== 58) {
939
+ break;
940
+ }
1023
941
 
1024
- decode(input: BinaryReader | Uint8Array, length?: number): AppendCausation_PropertiesEntry {
1025
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1026
- const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1027
- if (previousRecursionDepth >= 100) {
1028
- throw new globalThis.Error("protobuf decode recursion limit exceeded");
1029
- }
1030
- (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1031
- try {
1032
- const end = length === undefined ? reader.len : reader.pos + length;
1033
- const message = createBaseAppendCausation_PropertiesEntry();
1034
- while (reader.pos < end) {
1035
- const tag = reader.uint32();
1036
- switch (tag >>> 3) {
1037
- case 1: {
1038
- if (tag !== 10) {
942
+ message.Causation.push(Causation.decode(reader, reader.uint32()));
943
+ continue;
944
+ }
945
+ case 8: {
946
+ if (tag !== 66) {
1039
947
  break;
1040
948
  }
1041
949
 
1042
- message.key = reader.string();
950
+ message.CausedBy = Identity.decode(reader, reader.uint32());
1043
951
  continue;
1044
952
  }
1045
- case 2: {
1046
- if (tag !== 18) {
953
+ case 9: {
954
+ if (tag !== 74) {
1047
955
  break;
1048
956
  }
1049
957
 
1050
- message.value = reader.string();
958
+ message.ConcurrencyScopes.push(EventSourceConcurrencyScope.decode(reader, reader.uint32()));
1051
959
  continue;
1052
960
  }
1053
961
  }
@@ -1062,171 +970,98 @@ export const AppendCausation_PropertiesEntry: MessageFns<AppendCausation_Propert
1062
970
  }
1063
971
  },
1064
972
 
1065
- fromJSON(object: any): AppendCausation_PropertiesEntry {
973
+ fromJSON(object: any): AppendManyForEventSourcesRequest {
1066
974
  return {
1067
- key: isSet(object.key) ? globalThis.String(object.key) : "",
1068
- value: isSet(object.value) ? globalThis.String(object.value) : "",
975
+ EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
976
+ Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
977
+ EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "",
978
+ Events: globalThis.Array.isArray(object?.Events)
979
+ ? object.Events.map((e: any) => EventForEventSourceId.fromJSON(e))
980
+ : [],
981
+ CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
982
+ Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [],
983
+ Causation: globalThis.Array.isArray(object?.Causation)
984
+ ? object.Causation.map((e: any) => Causation.fromJSON(e))
985
+ : [],
986
+ CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined,
987
+ ConcurrencyScopes: globalThis.Array.isArray(object?.ConcurrencyScopes)
988
+ ? object.ConcurrencyScopes.map((e: any) => EventSourceConcurrencyScope.fromJSON(e))
989
+ : [],
1069
990
  };
1070
991
  },
1071
992
 
1072
- toJSON(message: AppendCausation_PropertiesEntry): unknown {
993
+ toJSON(message: AppendManyForEventSourcesRequest): unknown {
1073
994
  const obj: any = {};
1074
- if (message.key !== "") {
1075
- obj.key = message.key;
995
+ if (message.EventStore !== "") {
996
+ obj.EventStore = message.EventStore;
1076
997
  }
1077
- if (message.value !== "") {
1078
- obj.value = message.value;
998
+ if (message.Namespace !== "") {
999
+ obj.Namespace = message.Namespace;
1079
1000
  }
1080
- return obj;
1081
- },
1082
-
1083
- create(base?: DeepPartial<AppendCausation_PropertiesEntry>): AppendCausation_PropertiesEntry {
1084
- return AppendCausation_PropertiesEntry.fromPartial(base ?? {});
1085
- },
1086
- fromPartial(object: DeepPartial<AppendCausation_PropertiesEntry>): AppendCausation_PropertiesEntry {
1087
- const message = createBaseAppendCausation_PropertiesEntry();
1088
- message.key = object.key ?? "";
1089
- message.value = object.value ?? "";
1090
- return message;
1091
- },
1092
- };
1093
-
1094
- function createBaseAppendIdentity(): AppendIdentity {
1095
- return { Subject: "", Name: "", UserName: "", OnBehalfOf: undefined };
1096
- }
1097
-
1098
- export const AppendIdentity: MessageFns<AppendIdentity> = {
1099
- encode(message: AppendIdentity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1100
- if (message.Subject !== "") {
1101
- writer.uint32(10).string(message.Subject);
1102
- }
1103
- if (message.Name !== "") {
1104
- writer.uint32(18).string(message.Name);
1105
- }
1106
- if (message.UserName !== "") {
1107
- writer.uint32(26).string(message.UserName);
1108
- }
1109
- if (message.OnBehalfOf !== undefined) {
1110
- AppendIdentity.encode(message.OnBehalfOf, writer.uint32(34).fork()).join();
1001
+ if (message.EventSequenceId !== "") {
1002
+ obj.EventSequenceId = message.EventSequenceId;
1111
1003
  }
1112
- return writer;
1113
- },
1114
-
1115
- decode(input: BinaryReader | Uint8Array, length?: number): AppendIdentity {
1116
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1117
- const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1118
- if (previousRecursionDepth >= 100) {
1119
- throw new globalThis.Error("protobuf decode recursion limit exceeded");
1004
+ if (message.Events?.length) {
1005
+ obj.Events = message.Events.map((e) => EventForEventSourceId.toJSON(e));
1120
1006
  }
1121
- (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1122
- try {
1123
- const end = length === undefined ? reader.len : reader.pos + length;
1124
- const message = createBaseAppendIdentity();
1125
- while (reader.pos < end) {
1126
- const tag = reader.uint32();
1127
- switch (tag >>> 3) {
1128
- case 1: {
1129
- if (tag !== 10) {
1130
- break;
1131
- }
1132
-
1133
- message.Subject = reader.string();
1134
- continue;
1135
- }
1136
- case 2: {
1137
- if (tag !== 18) {
1138
- break;
1139
- }
1140
-
1141
- message.Name = reader.string();
1142
- continue;
1143
- }
1144
- case 3: {
1145
- if (tag !== 26) {
1146
- break;
1147
- }
1148
-
1149
- message.UserName = reader.string();
1150
- continue;
1151
- }
1152
- case 4: {
1153
- if (tag !== 34) {
1154
- break;
1155
- }
1156
-
1157
- message.OnBehalfOf = AppendIdentity.decode(reader, reader.uint32());
1158
- continue;
1159
- }
1160
- }
1161
- if ((tag & 7) === 4 || tag === 0) {
1162
- break;
1163
- }
1164
- reader.skip(tag & 7);
1165
- }
1166
- return message;
1167
- } finally {
1168
- (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1007
+ if (message.CorrelationId !== undefined) {
1008
+ obj.CorrelationId = Guid.toJSON(message.CorrelationId);
1169
1009
  }
1170
- },
1171
-
1172
- fromJSON(object: any): AppendIdentity {
1173
- return {
1174
- Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "",
1175
- Name: isSet(object.Name) ? globalThis.String(object.Name) : "",
1176
- UserName: isSet(object.UserName) ? globalThis.String(object.UserName) : "",
1177
- OnBehalfOf: isSet(object.OnBehalfOf) ? AppendIdentity.fromJSON(object.OnBehalfOf) : undefined,
1178
- };
1179
- },
1180
-
1181
- toJSON(message: AppendIdentity): unknown {
1182
- const obj: any = {};
1183
- if (message.Subject !== "") {
1184
- obj.Subject = message.Subject;
1010
+ if (message.Tags?.length) {
1011
+ obj.Tags = message.Tags;
1185
1012
  }
1186
- if (message.Name !== "") {
1187
- obj.Name = message.Name;
1013
+ if (message.Causation?.length) {
1014
+ obj.Causation = message.Causation.map((e) => Causation.toJSON(e));
1188
1015
  }
1189
- if (message.UserName !== "") {
1190
- obj.UserName = message.UserName;
1016
+ if (message.CausedBy !== undefined) {
1017
+ obj.CausedBy = Identity.toJSON(message.CausedBy);
1191
1018
  }
1192
- if (message.OnBehalfOf !== undefined) {
1193
- obj.OnBehalfOf = AppendIdentity.toJSON(message.OnBehalfOf);
1019
+ if (message.ConcurrencyScopes?.length) {
1020
+ obj.ConcurrencyScopes = message.ConcurrencyScopes.map((e) => EventSourceConcurrencyScope.toJSON(e));
1194
1021
  }
1195
1022
  return obj;
1196
1023
  },
1197
1024
 
1198
- create(base?: DeepPartial<AppendIdentity>): AppendIdentity {
1199
- return AppendIdentity.fromPartial(base ?? {});
1025
+ create(base?: DeepPartial<AppendManyForEventSourcesRequest>): AppendManyForEventSourcesRequest {
1026
+ return AppendManyForEventSourcesRequest.fromPartial(base ?? {});
1200
1027
  },
1201
- fromPartial(object: DeepPartial<AppendIdentity>): AppendIdentity {
1202
- const message = createBaseAppendIdentity();
1203
- message.Subject = object.Subject ?? "";
1204
- message.Name = object.Name ?? "";
1205
- message.UserName = object.UserName ?? "";
1206
- message.OnBehalfOf = (object.OnBehalfOf !== undefined && object.OnBehalfOf !== null)
1207
- ? AppendIdentity.fromPartial(object.OnBehalfOf)
1028
+ fromPartial(object: DeepPartial<AppendManyForEventSourcesRequest>): AppendManyForEventSourcesRequest {
1029
+ const message = createBaseAppendManyForEventSourcesRequest();
1030
+ message.EventStore = object.EventStore ?? "";
1031
+ message.Namespace = object.Namespace ?? "";
1032
+ message.EventSequenceId = object.EventSequenceId ?? "";
1033
+ message.Events = object.Events?.map((e) => EventForEventSourceId.fromPartial(e)) || [];
1034
+ message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
1035
+ ? Guid.fromPartial(object.CorrelationId)
1208
1036
  : undefined;
1037
+ message.Tags = object.Tags?.map((e) => e) || [];
1038
+ message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || [];
1039
+ message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null)
1040
+ ? Identity.fromPartial(object.CausedBy)
1041
+ : undefined;
1042
+ message.ConcurrencyScopes = object.ConcurrencyScopes?.map((e) => EventSourceConcurrencyScope.fromPartial(e)) || [];
1209
1043
  return message;
1210
1044
  },
1211
1045
  };
1212
1046
 
1213
- function createBaseAppendManyForEventSourcesRequest(): AppendManyForEventSourcesRequest {
1047
+ function createBaseAppendManyRequest(): AppendManyRequest {
1214
1048
  return {
1215
1049
  EventStore: "",
1216
1050
  Namespace: "",
1217
1051
  EventSequenceId: "",
1052
+ EventSourceId: "",
1218
1053
  Events: [],
1219
1054
  CorrelationId: undefined,
1220
1055
  Tags: [],
1221
1056
  Causation: [],
1222
1057
  CausedBy: undefined,
1223
- ConcurrencyScopes: [],
1224
- IncludeReceipts: false,
1058
+ ConcurrencyScope: undefined,
1059
+ Occurred: undefined,
1225
1060
  };
1226
1061
  }
1227
1062
 
1228
- export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSourcesRequest> = {
1229
- encode(message: AppendManyForEventSourcesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1063
+ export const AppendManyRequest: MessageFns<AppendManyRequest> = {
1064
+ encode(message: AppendManyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1230
1065
  if (message.EventStore !== "") {
1231
1066
  writer.uint32(10).string(message.EventStore);
1232
1067
  }
@@ -1236,31 +1071,34 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1236
1071
  if (message.EventSequenceId !== "") {
1237
1072
  writer.uint32(26).string(message.EventSequenceId);
1238
1073
  }
1074
+ if (message.EventSourceId !== "") {
1075
+ writer.uint32(34).string(message.EventSourceId);
1076
+ }
1239
1077
  for (const v of message.Events) {
1240
- EventForEventSourceId.encode(v!, writer.uint32(34).fork()).join();
1078
+ EventToAppend.encode(v!, writer.uint32(42).fork()).join();
1241
1079
  }
1242
1080
  if (message.CorrelationId !== undefined) {
1243
- Guid.encode(message.CorrelationId, writer.uint32(42).fork()).join();
1081
+ Guid.encode(message.CorrelationId, writer.uint32(50).fork()).join();
1244
1082
  }
1245
1083
  for (const v of message.Tags) {
1246
- writer.uint32(50).string(v!);
1084
+ writer.uint32(58).string(v!);
1247
1085
  }
1248
1086
  for (const v of message.Causation) {
1249
- Causation.encode(v!, writer.uint32(58).fork()).join();
1087
+ Causation.encode(v!, writer.uint32(66).fork()).join();
1250
1088
  }
1251
1089
  if (message.CausedBy !== undefined) {
1252
- Identity.encode(message.CausedBy, writer.uint32(66).fork()).join();
1090
+ Identity.encode(message.CausedBy, writer.uint32(74).fork()).join();
1253
1091
  }
1254
- for (const v of message.ConcurrencyScopes) {
1255
- EventSourceConcurrencyScope.encode(v!, writer.uint32(74).fork()).join();
1092
+ if (message.ConcurrencyScope !== undefined) {
1093
+ ConcurrencyScope.encode(message.ConcurrencyScope, writer.uint32(82).fork()).join();
1256
1094
  }
1257
- if (message.IncludeReceipts !== false) {
1258
- writer.uint32(80).bool(message.IncludeReceipts);
1095
+ if (message.Occurred !== undefined) {
1096
+ SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(90).fork()).join();
1259
1097
  }
1260
1098
  return writer;
1261
1099
  },
1262
1100
 
1263
- decode(input: BinaryReader | Uint8Array, length?: number): AppendManyForEventSourcesRequest {
1101
+ decode(input: BinaryReader | Uint8Array, length?: number): AppendManyRequest {
1264
1102
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1265
1103
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1266
1104
  if (previousRecursionDepth >= 100) {
@@ -1269,7 +1107,7 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1269
1107
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1270
1108
  try {
1271
1109
  const end = length === undefined ? reader.len : reader.pos + length;
1272
- const message = createBaseAppendManyForEventSourcesRequest();
1110
+ const message = createBaseAppendManyRequest();
1273
1111
  while (reader.pos < end) {
1274
1112
  const tag = reader.uint32();
1275
1113
  switch (tag >>> 3) {
@@ -1302,7 +1140,7 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1302
1140
  break;
1303
1141
  }
1304
1142
 
1305
- message.Events.push(EventForEventSourceId.decode(reader, reader.uint32()));
1143
+ message.EventSourceId = reader.string();
1306
1144
  continue;
1307
1145
  }
1308
1146
  case 5: {
@@ -1310,7 +1148,7 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1310
1148
  break;
1311
1149
  }
1312
1150
 
1313
- message.CorrelationId = Guid.decode(reader, reader.uint32());
1151
+ message.Events.push(EventToAppend.decode(reader, reader.uint32()));
1314
1152
  continue;
1315
1153
  }
1316
1154
  case 6: {
@@ -1318,7 +1156,7 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1318
1156
  break;
1319
1157
  }
1320
1158
 
1321
- message.Tags.push(reader.string());
1159
+ message.CorrelationId = Guid.decode(reader, reader.uint32());
1322
1160
  continue;
1323
1161
  }
1324
1162
  case 7: {
@@ -1326,7 +1164,7 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1326
1164
  break;
1327
1165
  }
1328
1166
 
1329
- message.Causation.push(Causation.decode(reader, reader.uint32()));
1167
+ message.Tags.push(reader.string());
1330
1168
  continue;
1331
1169
  }
1332
1170
  case 8: {
@@ -1334,7 +1172,7 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1334
1172
  break;
1335
1173
  }
1336
1174
 
1337
- message.CausedBy = Identity.decode(reader, reader.uint32());
1175
+ message.Causation.push(Causation.decode(reader, reader.uint32()));
1338
1176
  continue;
1339
1177
  }
1340
1178
  case 9: {
@@ -1342,15 +1180,23 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1342
1180
  break;
1343
1181
  }
1344
1182
 
1345
- message.ConcurrencyScopes.push(EventSourceConcurrencyScope.decode(reader, reader.uint32()));
1183
+ message.CausedBy = Identity.decode(reader, reader.uint32());
1346
1184
  continue;
1347
1185
  }
1348
1186
  case 10: {
1349
- if (tag !== 80) {
1187
+ if (tag !== 82) {
1188
+ break;
1189
+ }
1190
+
1191
+ message.ConcurrencyScope = ConcurrencyScope.decode(reader, reader.uint32());
1192
+ continue;
1193
+ }
1194
+ case 11: {
1195
+ if (tag !== 90) {
1350
1196
  break;
1351
1197
  }
1352
1198
 
1353
- message.IncludeReceipts = reader.bool();
1199
+ message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32());
1354
1200
  continue;
1355
1201
  }
1356
1202
  }
@@ -1365,28 +1211,25 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1365
1211
  }
1366
1212
  },
1367
1213
 
1368
- fromJSON(object: any): AppendManyForEventSourcesRequest {
1214
+ fromJSON(object: any): AppendManyRequest {
1369
1215
  return {
1370
1216
  EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
1371
1217
  Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
1372
1218
  EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "",
1373
- Events: globalThis.Array.isArray(object?.Events)
1374
- ? object.Events.map((e: any) => EventForEventSourceId.fromJSON(e))
1375
- : [],
1219
+ EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "",
1220
+ Events: globalThis.Array.isArray(object?.Events) ? object.Events.map((e: any) => EventToAppend.fromJSON(e)) : [],
1376
1221
  CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
1377
1222
  Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [],
1378
1223
  Causation: globalThis.Array.isArray(object?.Causation)
1379
1224
  ? object.Causation.map((e: any) => Causation.fromJSON(e))
1380
1225
  : [],
1381
1226
  CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined,
1382
- ConcurrencyScopes: globalThis.Array.isArray(object?.ConcurrencyScopes)
1383
- ? object.ConcurrencyScopes.map((e: any) => EventSourceConcurrencyScope.fromJSON(e))
1384
- : [],
1385
- IncludeReceipts: isSet(object.IncludeReceipts) ? globalThis.Boolean(object.IncludeReceipts) : false,
1227
+ ConcurrencyScope: isSet(object.ConcurrencyScope) ? ConcurrencyScope.fromJSON(object.ConcurrencyScope) : undefined,
1228
+ Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined,
1386
1229
  };
1387
1230
  },
1388
1231
 
1389
- toJSON(message: AppendManyForEventSourcesRequest): unknown {
1232
+ toJSON(message: AppendManyRequest): unknown {
1390
1233
  const obj: any = {};
1391
1234
  if (message.EventStore !== "") {
1392
1235
  obj.EventStore = message.EventStore;
@@ -1397,8 +1240,11 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1397
1240
  if (message.EventSequenceId !== "") {
1398
1241
  obj.EventSequenceId = message.EventSequenceId;
1399
1242
  }
1243
+ if (message.EventSourceId !== "") {
1244
+ obj.EventSourceId = message.EventSourceId;
1245
+ }
1400
1246
  if (message.Events?.length) {
1401
- obj.Events = message.Events.map((e) => EventForEventSourceId.toJSON(e));
1247
+ obj.Events = message.Events.map((e) => EventToAppend.toJSON(e));
1402
1248
  }
1403
1249
  if (message.CorrelationId !== undefined) {
1404
1250
  obj.CorrelationId = Guid.toJSON(message.CorrelationId);
@@ -1412,24 +1258,25 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1412
1258
  if (message.CausedBy !== undefined) {
1413
1259
  obj.CausedBy = Identity.toJSON(message.CausedBy);
1414
1260
  }
1415
- if (message.ConcurrencyScopes?.length) {
1416
- obj.ConcurrencyScopes = message.ConcurrencyScopes.map((e) => EventSourceConcurrencyScope.toJSON(e));
1261
+ if (message.ConcurrencyScope !== undefined) {
1262
+ obj.ConcurrencyScope = ConcurrencyScope.toJSON(message.ConcurrencyScope);
1417
1263
  }
1418
- if (message.IncludeReceipts !== false) {
1419
- obj.IncludeReceipts = message.IncludeReceipts;
1264
+ if (message.Occurred !== undefined) {
1265
+ obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred);
1420
1266
  }
1421
1267
  return obj;
1422
1268
  },
1423
1269
 
1424
- create(base?: DeepPartial<AppendManyForEventSourcesRequest>): AppendManyForEventSourcesRequest {
1425
- return AppendManyForEventSourcesRequest.fromPartial(base ?? {});
1270
+ create(base?: DeepPartial<AppendManyRequest>): AppendManyRequest {
1271
+ return AppendManyRequest.fromPartial(base ?? {});
1426
1272
  },
1427
- fromPartial(object: DeepPartial<AppendManyForEventSourcesRequest>): AppendManyForEventSourcesRequest {
1428
- const message = createBaseAppendManyForEventSourcesRequest();
1273
+ fromPartial(object: DeepPartial<AppendManyRequest>): AppendManyRequest {
1274
+ const message = createBaseAppendManyRequest();
1429
1275
  message.EventStore = object.EventStore ?? "";
1430
1276
  message.Namespace = object.Namespace ?? "";
1431
1277
  message.EventSequenceId = object.EventSequenceId ?? "";
1432
- message.Events = object.Events?.map((e) => EventForEventSourceId.fromPartial(e)) || [];
1278
+ message.EventSourceId = object.EventSourceId ?? "";
1279
+ message.Events = object.Events?.map((e) => EventToAppend.fromPartial(e)) || [];
1433
1280
  message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
1434
1281
  ? Guid.fromPartial(object.CorrelationId)
1435
1282
  : undefined;
@@ -1438,309 +1285,44 @@ export const AppendManyForEventSourcesRequest: MessageFns<AppendManyForEventSour
1438
1285
  message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null)
1439
1286
  ? Identity.fromPartial(object.CausedBy)
1440
1287
  : undefined;
1441
- message.ConcurrencyScopes = object.ConcurrencyScopes?.map((e) => EventSourceConcurrencyScope.fromPartial(e)) || [];
1442
- message.IncludeReceipts = object.IncludeReceipts ?? false;
1288
+ message.ConcurrencyScope = (object.ConcurrencyScope !== undefined && object.ConcurrencyScope !== null)
1289
+ ? ConcurrencyScope.fromPartial(object.ConcurrencyScope)
1290
+ : undefined;
1291
+ message.Occurred = (object.Occurred !== undefined && object.Occurred !== null)
1292
+ ? SerializableDateTimeOffset.fromPartial(object.Occurred)
1293
+ : undefined;
1443
1294
  return message;
1444
1295
  },
1445
1296
  };
1446
1297
 
1447
- function createBaseAppendManyRequest(): AppendManyRequest {
1298
+ function createBaseAppendManyResponse(): AppendManyResponse {
1448
1299
  return {
1449
- EventStore: "",
1450
- Namespace: "",
1451
- EventSequenceId: "",
1452
- EventSourceId: "",
1453
- Events: [],
1454
1300
  CorrelationId: undefined,
1455
- Tags: [],
1456
- Causation: [],
1457
- CausedBy: undefined,
1458
- ConcurrencyScope: undefined,
1459
- Occurred: undefined,
1460
- IncludeReceipts: false,
1301
+ SequenceNumbers: [],
1302
+ IsSuccess: false,
1303
+ HasConstraintViolations: false,
1304
+ HasConcurrencyViolations: false,
1305
+ HasErrors: false,
1306
+ ConcurrencyCheckPerformed: false,
1307
+ ConstraintViolations: [],
1308
+ Errors: [],
1309
+ ConcurrencyViolations: [],
1461
1310
  };
1462
1311
  }
1463
1312
 
1464
- export const AppendManyRequest: MessageFns<AppendManyRequest> = {
1465
- encode(message: AppendManyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1466
- if (message.EventStore !== "") {
1467
- writer.uint32(10).string(message.EventStore);
1313
+ export const AppendManyResponse: MessageFns<AppendManyResponse> = {
1314
+ encode(message: AppendManyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1315
+ if (message.CorrelationId !== undefined) {
1316
+ Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
1468
1317
  }
1469
- if (message.Namespace !== "") {
1470
- writer.uint32(18).string(message.Namespace);
1318
+ for (const v of message.SequenceNumbers) {
1319
+ if (BigInt.asUintN(64, v!) !== v!) {
1320
+ throw new globalThis.Error("value provided for field v! of type uint64 too large");
1321
+ }
1322
+ writer.uint32(16).uint64(v!);
1471
1323
  }
1472
- if (message.EventSequenceId !== "") {
1473
- writer.uint32(26).string(message.EventSequenceId);
1474
- }
1475
- if (message.EventSourceId !== "") {
1476
- writer.uint32(34).string(message.EventSourceId);
1477
- }
1478
- for (const v of message.Events) {
1479
- EventToAppend.encode(v!, writer.uint32(42).fork()).join();
1480
- }
1481
- if (message.CorrelationId !== undefined) {
1482
- Guid.encode(message.CorrelationId, writer.uint32(50).fork()).join();
1483
- }
1484
- for (const v of message.Tags) {
1485
- writer.uint32(58).string(v!);
1486
- }
1487
- for (const v of message.Causation) {
1488
- Causation.encode(v!, writer.uint32(66).fork()).join();
1489
- }
1490
- if (message.CausedBy !== undefined) {
1491
- Identity.encode(message.CausedBy, writer.uint32(74).fork()).join();
1492
- }
1493
- if (message.ConcurrencyScope !== undefined) {
1494
- ConcurrencyScope.encode(message.ConcurrencyScope, writer.uint32(82).fork()).join();
1495
- }
1496
- if (message.Occurred !== undefined) {
1497
- SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(90).fork()).join();
1498
- }
1499
- if (message.IncludeReceipts !== false) {
1500
- writer.uint32(96).bool(message.IncludeReceipts);
1501
- }
1502
- return writer;
1503
- },
1504
-
1505
- decode(input: BinaryReader | Uint8Array, length?: number): AppendManyRequest {
1506
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1507
- const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
1508
- if (previousRecursionDepth >= 100) {
1509
- throw new globalThis.Error("protobuf decode recursion limit exceeded");
1510
- }
1511
- (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
1512
- try {
1513
- const end = length === undefined ? reader.len : reader.pos + length;
1514
- const message = createBaseAppendManyRequest();
1515
- while (reader.pos < end) {
1516
- const tag = reader.uint32();
1517
- switch (tag >>> 3) {
1518
- case 1: {
1519
- if (tag !== 10) {
1520
- break;
1521
- }
1522
-
1523
- message.EventStore = reader.string();
1524
- continue;
1525
- }
1526
- case 2: {
1527
- if (tag !== 18) {
1528
- break;
1529
- }
1530
-
1531
- message.Namespace = reader.string();
1532
- continue;
1533
- }
1534
- case 3: {
1535
- if (tag !== 26) {
1536
- break;
1537
- }
1538
-
1539
- message.EventSequenceId = reader.string();
1540
- continue;
1541
- }
1542
- case 4: {
1543
- if (tag !== 34) {
1544
- break;
1545
- }
1546
-
1547
- message.EventSourceId = reader.string();
1548
- continue;
1549
- }
1550
- case 5: {
1551
- if (tag !== 42) {
1552
- break;
1553
- }
1554
-
1555
- message.Events.push(EventToAppend.decode(reader, reader.uint32()));
1556
- continue;
1557
- }
1558
- case 6: {
1559
- if (tag !== 50) {
1560
- break;
1561
- }
1562
-
1563
- message.CorrelationId = Guid.decode(reader, reader.uint32());
1564
- continue;
1565
- }
1566
- case 7: {
1567
- if (tag !== 58) {
1568
- break;
1569
- }
1570
-
1571
- message.Tags.push(reader.string());
1572
- continue;
1573
- }
1574
- case 8: {
1575
- if (tag !== 66) {
1576
- break;
1577
- }
1578
-
1579
- message.Causation.push(Causation.decode(reader, reader.uint32()));
1580
- continue;
1581
- }
1582
- case 9: {
1583
- if (tag !== 74) {
1584
- break;
1585
- }
1586
-
1587
- message.CausedBy = Identity.decode(reader, reader.uint32());
1588
- continue;
1589
- }
1590
- case 10: {
1591
- if (tag !== 82) {
1592
- break;
1593
- }
1594
-
1595
- message.ConcurrencyScope = ConcurrencyScope.decode(reader, reader.uint32());
1596
- continue;
1597
- }
1598
- case 11: {
1599
- if (tag !== 90) {
1600
- break;
1601
- }
1602
-
1603
- message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32());
1604
- continue;
1605
- }
1606
- case 12: {
1607
- if (tag !== 96) {
1608
- break;
1609
- }
1610
-
1611
- message.IncludeReceipts = reader.bool();
1612
- continue;
1613
- }
1614
- }
1615
- if ((tag & 7) === 4 || tag === 0) {
1616
- break;
1617
- }
1618
- reader.skip(tag & 7);
1619
- }
1620
- return message;
1621
- } finally {
1622
- (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1623
- }
1624
- },
1625
-
1626
- fromJSON(object: any): AppendManyRequest {
1627
- return {
1628
- EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
1629
- Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
1630
- EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "",
1631
- EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "",
1632
- Events: globalThis.Array.isArray(object?.Events) ? object.Events.map((e: any) => EventToAppend.fromJSON(e)) : [],
1633
- CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
1634
- Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [],
1635
- Causation: globalThis.Array.isArray(object?.Causation)
1636
- ? object.Causation.map((e: any) => Causation.fromJSON(e))
1637
- : [],
1638
- CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined,
1639
- ConcurrencyScope: isSet(object.ConcurrencyScope) ? ConcurrencyScope.fromJSON(object.ConcurrencyScope) : undefined,
1640
- Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined,
1641
- IncludeReceipts: isSet(object.IncludeReceipts) ? globalThis.Boolean(object.IncludeReceipts) : false,
1642
- };
1643
- },
1644
-
1645
- toJSON(message: AppendManyRequest): unknown {
1646
- const obj: any = {};
1647
- if (message.EventStore !== "") {
1648
- obj.EventStore = message.EventStore;
1649
- }
1650
- if (message.Namespace !== "") {
1651
- obj.Namespace = message.Namespace;
1652
- }
1653
- if (message.EventSequenceId !== "") {
1654
- obj.EventSequenceId = message.EventSequenceId;
1655
- }
1656
- if (message.EventSourceId !== "") {
1657
- obj.EventSourceId = message.EventSourceId;
1658
- }
1659
- if (message.Events?.length) {
1660
- obj.Events = message.Events.map((e) => EventToAppend.toJSON(e));
1661
- }
1662
- if (message.CorrelationId !== undefined) {
1663
- obj.CorrelationId = Guid.toJSON(message.CorrelationId);
1664
- }
1665
- if (message.Tags?.length) {
1666
- obj.Tags = message.Tags;
1667
- }
1668
- if (message.Causation?.length) {
1669
- obj.Causation = message.Causation.map((e) => Causation.toJSON(e));
1670
- }
1671
- if (message.CausedBy !== undefined) {
1672
- obj.CausedBy = Identity.toJSON(message.CausedBy);
1673
- }
1674
- if (message.ConcurrencyScope !== undefined) {
1675
- obj.ConcurrencyScope = ConcurrencyScope.toJSON(message.ConcurrencyScope);
1676
- }
1677
- if (message.Occurred !== undefined) {
1678
- obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred);
1679
- }
1680
- if (message.IncludeReceipts !== false) {
1681
- obj.IncludeReceipts = message.IncludeReceipts;
1682
- }
1683
- return obj;
1684
- },
1685
-
1686
- create(base?: DeepPartial<AppendManyRequest>): AppendManyRequest {
1687
- return AppendManyRequest.fromPartial(base ?? {});
1688
- },
1689
- fromPartial(object: DeepPartial<AppendManyRequest>): AppendManyRequest {
1690
- const message = createBaseAppendManyRequest();
1691
- message.EventStore = object.EventStore ?? "";
1692
- message.Namespace = object.Namespace ?? "";
1693
- message.EventSequenceId = object.EventSequenceId ?? "";
1694
- message.EventSourceId = object.EventSourceId ?? "";
1695
- message.Events = object.Events?.map((e) => EventToAppend.fromPartial(e)) || [];
1696
- message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
1697
- ? Guid.fromPartial(object.CorrelationId)
1698
- : undefined;
1699
- message.Tags = object.Tags?.map((e) => e) || [];
1700
- message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || [];
1701
- message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null)
1702
- ? Identity.fromPartial(object.CausedBy)
1703
- : undefined;
1704
- message.ConcurrencyScope = (object.ConcurrencyScope !== undefined && object.ConcurrencyScope !== null)
1705
- ? ConcurrencyScope.fromPartial(object.ConcurrencyScope)
1706
- : undefined;
1707
- message.Occurred = (object.Occurred !== undefined && object.Occurred !== null)
1708
- ? SerializableDateTimeOffset.fromPartial(object.Occurred)
1709
- : undefined;
1710
- message.IncludeReceipts = object.IncludeReceipts ?? false;
1711
- return message;
1712
- },
1713
- };
1714
-
1715
- function createBaseAppendManyResponse(): AppendManyResponse {
1716
- return {
1717
- CorrelationId: undefined,
1718
- SequenceNumbers: [],
1719
- IsSuccess: false,
1720
- HasConstraintViolations: false,
1721
- HasConcurrencyViolations: false,
1722
- HasErrors: false,
1723
- ConcurrencyCheckPerformed: false,
1724
- ConstraintViolations: [],
1725
- Errors: [],
1726
- ConcurrencyViolations: [],
1727
- Receipts: [],
1728
- };
1729
- }
1730
-
1731
- export const AppendManyResponse: MessageFns<AppendManyResponse> = {
1732
- encode(message: AppendManyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1733
- if (message.CorrelationId !== undefined) {
1734
- Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join();
1735
- }
1736
- for (const v of message.SequenceNumbers) {
1737
- if (BigInt.asUintN(64, v!) !== v!) {
1738
- throw new globalThis.Error("value provided for field v! of type uint64 too large");
1739
- }
1740
- writer.uint32(16).uint64(v!);
1741
- }
1742
- if (message.IsSuccess !== false) {
1743
- writer.uint32(24).bool(message.IsSuccess);
1324
+ if (message.IsSuccess !== false) {
1325
+ writer.uint32(24).bool(message.IsSuccess);
1744
1326
  }
1745
1327
  if (message.HasConstraintViolations !== false) {
1746
1328
  writer.uint32(32).bool(message.HasConstraintViolations);
@@ -1763,9 +1345,6 @@ export const AppendManyResponse: MessageFns<AppendManyResponse> = {
1763
1345
  for (const v of message.ConcurrencyViolations) {
1764
1346
  ConcurrencyViolation.encode(v!, writer.uint32(82).fork()).join();
1765
1347
  }
1766
- for (const v of message.Receipts) {
1767
- AppendReceipt.encode(v!, writer.uint32(90).fork()).join();
1768
- }
1769
1348
  return writer;
1770
1349
  },
1771
1350
 
@@ -1801,315 +1380,27 @@ export const AppendManyResponse: MessageFns<AppendManyResponse> = {
1801
1380
  const end2 = reader.uint32() + reader.pos;
1802
1381
  while (reader.pos < end2) {
1803
1382
  message.SequenceNumbers.push(reader.uint64() as bigint);
1804
- }
1805
-
1806
- continue;
1807
- }
1808
-
1809
- break;
1810
- }
1811
- case 3: {
1812
- if (tag !== 24) {
1813
- break;
1814
- }
1815
-
1816
- message.IsSuccess = reader.bool();
1817
- continue;
1818
- }
1819
- case 4: {
1820
- if (tag !== 32) {
1821
- break;
1822
- }
1823
-
1824
- message.HasConstraintViolations = reader.bool();
1825
- continue;
1826
- }
1827
- case 5: {
1828
- if (tag !== 40) {
1829
- break;
1830
- }
1831
-
1832
- message.HasConcurrencyViolations = reader.bool();
1833
- continue;
1834
- }
1835
- case 6: {
1836
- if (tag !== 48) {
1837
- break;
1838
- }
1839
-
1840
- message.HasErrors = reader.bool();
1841
- continue;
1842
- }
1843
- case 7: {
1844
- if (tag !== 56) {
1845
- break;
1846
- }
1847
-
1848
- message.ConcurrencyCheckPerformed = reader.bool();
1849
- continue;
1850
- }
1851
- case 8: {
1852
- if (tag !== 66) {
1853
- break;
1854
- }
1855
-
1856
- message.ConstraintViolations.push(ConstraintViolation.decode(reader, reader.uint32()));
1857
- continue;
1858
- }
1859
- case 9: {
1860
- if (tag !== 74) {
1861
- break;
1862
- }
1863
-
1864
- message.Errors.push(reader.string());
1865
- continue;
1866
- }
1867
- case 10: {
1868
- if (tag !== 82) {
1869
- break;
1870
- }
1871
-
1872
- message.ConcurrencyViolations.push(ConcurrencyViolation.decode(reader, reader.uint32()));
1873
- continue;
1874
- }
1875
- case 11: {
1876
- if (tag !== 90) {
1877
- break;
1878
- }
1879
-
1880
- message.Receipts.push(AppendReceipt.decode(reader, reader.uint32()));
1881
- continue;
1882
- }
1883
- }
1884
- if ((tag & 7) === 4 || tag === 0) {
1885
- break;
1886
- }
1887
- reader.skip(tag & 7);
1888
- }
1889
- return message;
1890
- } finally {
1891
- (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
1892
- }
1893
- },
1894
-
1895
- fromJSON(object: any): AppendManyResponse {
1896
- return {
1897
- CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
1898
- SequenceNumbers: globalThis.Array.isArray(object?.SequenceNumbers)
1899
- ? object.SequenceNumbers.map((e: any) => BigInt(e))
1900
- : [],
1901
- IsSuccess: isSet(object.IsSuccess) ? globalThis.Boolean(object.IsSuccess) : false,
1902
- HasConstraintViolations: isSet(object.HasConstraintViolations)
1903
- ? globalThis.Boolean(object.HasConstraintViolations)
1904
- : false,
1905
- HasConcurrencyViolations: isSet(object.HasConcurrencyViolations)
1906
- ? globalThis.Boolean(object.HasConcurrencyViolations)
1907
- : false,
1908
- HasErrors: isSet(object.HasErrors) ? globalThis.Boolean(object.HasErrors) : false,
1909
- ConcurrencyCheckPerformed: isSet(object.ConcurrencyCheckPerformed)
1910
- ? globalThis.Boolean(object.ConcurrencyCheckPerformed)
1911
- : false,
1912
- ConstraintViolations: globalThis.Array.isArray(object?.ConstraintViolations)
1913
- ? object.ConstraintViolations.map((e: any) => ConstraintViolation.fromJSON(e))
1914
- : [],
1915
- Errors: globalThis.Array.isArray(object?.Errors) ? object.Errors.map((e: any) => globalThis.String(e)) : [],
1916
- ConcurrencyViolations: globalThis.Array.isArray(object?.ConcurrencyViolations)
1917
- ? object.ConcurrencyViolations.map((e: any) => ConcurrencyViolation.fromJSON(e))
1918
- : [],
1919
- Receipts: globalThis.Array.isArray(object?.Receipts)
1920
- ? object.Receipts.map((e: any) => AppendReceipt.fromJSON(e))
1921
- : [],
1922
- };
1923
- },
1924
-
1925
- toJSON(message: AppendManyResponse): unknown {
1926
- const obj: any = {};
1927
- if (message.CorrelationId !== undefined) {
1928
- obj.CorrelationId = Guid.toJSON(message.CorrelationId);
1929
- }
1930
- if (message.SequenceNumbers?.length) {
1931
- obj.SequenceNumbers = message.SequenceNumbers.map((e) => e.toString());
1932
- }
1933
- if (message.IsSuccess !== false) {
1934
- obj.IsSuccess = message.IsSuccess;
1935
- }
1936
- if (message.HasConstraintViolations !== false) {
1937
- obj.HasConstraintViolations = message.HasConstraintViolations;
1938
- }
1939
- if (message.HasConcurrencyViolations !== false) {
1940
- obj.HasConcurrencyViolations = message.HasConcurrencyViolations;
1941
- }
1942
- if (message.HasErrors !== false) {
1943
- obj.HasErrors = message.HasErrors;
1944
- }
1945
- if (message.ConcurrencyCheckPerformed !== false) {
1946
- obj.ConcurrencyCheckPerformed = message.ConcurrencyCheckPerformed;
1947
- }
1948
- if (message.ConstraintViolations?.length) {
1949
- obj.ConstraintViolations = message.ConstraintViolations.map((e) => ConstraintViolation.toJSON(e));
1950
- }
1951
- if (message.Errors?.length) {
1952
- obj.Errors = message.Errors;
1953
- }
1954
- if (message.ConcurrencyViolations?.length) {
1955
- obj.ConcurrencyViolations = message.ConcurrencyViolations.map((e) => ConcurrencyViolation.toJSON(e));
1956
- }
1957
- if (message.Receipts?.length) {
1958
- obj.Receipts = message.Receipts.map((e) => AppendReceipt.toJSON(e));
1959
- }
1960
- return obj;
1961
- },
1962
-
1963
- create(base?: DeepPartial<AppendManyResponse>): AppendManyResponse {
1964
- return AppendManyResponse.fromPartial(base ?? {});
1965
- },
1966
- fromPartial(object: DeepPartial<AppendManyResponse>): AppendManyResponse {
1967
- const message = createBaseAppendManyResponse();
1968
- message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
1969
- ? Guid.fromPartial(object.CorrelationId)
1970
- : undefined;
1971
- message.SequenceNumbers = object.SequenceNumbers?.map((e) => BigInt(e)) || [];
1972
- message.IsSuccess = object.IsSuccess ?? false;
1973
- message.HasConstraintViolations = object.HasConstraintViolations ?? false;
1974
- message.HasConcurrencyViolations = object.HasConcurrencyViolations ?? false;
1975
- message.HasErrors = object.HasErrors ?? false;
1976
- message.ConcurrencyCheckPerformed = object.ConcurrencyCheckPerformed ?? false;
1977
- message.ConstraintViolations = object.ConstraintViolations?.map((e) => ConstraintViolation.fromPartial(e)) || [];
1978
- message.Errors = object.Errors?.map((e) => e) || [];
1979
- message.ConcurrencyViolations = object.ConcurrencyViolations?.map((e) => ConcurrencyViolation.fromPartial(e)) || [];
1980
- message.Receipts = object.Receipts?.map((e) => AppendReceipt.fromPartial(e)) || [];
1981
- return message;
1982
- },
1983
- };
1984
-
1985
- function createBaseAppendReceipt(): AppendReceipt {
1986
- return {
1987
- EventStore: "",
1988
- Namespace: "",
1989
- SequenceNumber: 0n,
1990
- EventTypeId: "",
1991
- Generation: 0,
1992
- Tombstone: false,
1993
- EventSourceType: "",
1994
- EventSourceId: "",
1995
- EventStreamType: "",
1996
- EventStreamId: "",
1997
- Occurred: undefined,
1998
- CorrelationId: undefined,
1999
- Subject: "",
2000
- Tags: [],
2001
- Hash: "",
2002
- Causation: [],
2003
- CausedBy: undefined,
2004
- ObservationState: 0,
2005
- };
2006
- }
2007
-
2008
- export const AppendReceipt: MessageFns<AppendReceipt> = {
2009
- encode(message: AppendReceipt, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2010
- if (message.EventStore !== "") {
2011
- writer.uint32(10).string(message.EventStore);
2012
- }
2013
- if (message.Namespace !== "") {
2014
- writer.uint32(18).string(message.Namespace);
2015
- }
2016
- if (message.SequenceNumber !== 0n) {
2017
- if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) {
2018
- throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large");
2019
- }
2020
- writer.uint32(24).uint64(message.SequenceNumber);
2021
- }
2022
- if (message.EventTypeId !== "") {
2023
- writer.uint32(34).string(message.EventTypeId);
2024
- }
2025
- if (message.Generation !== 0) {
2026
- writer.uint32(40).uint32(message.Generation);
2027
- }
2028
- if (message.Tombstone !== false) {
2029
- writer.uint32(48).bool(message.Tombstone);
2030
- }
2031
- if (message.EventSourceType !== "") {
2032
- writer.uint32(58).string(message.EventSourceType);
2033
- }
2034
- if (message.EventSourceId !== "") {
2035
- writer.uint32(66).string(message.EventSourceId);
2036
- }
2037
- if (message.EventStreamType !== "") {
2038
- writer.uint32(74).string(message.EventStreamType);
2039
- }
2040
- if (message.EventStreamId !== "") {
2041
- writer.uint32(82).string(message.EventStreamId);
2042
- }
2043
- if (message.Occurred !== undefined) {
2044
- SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(90).fork()).join();
2045
- }
2046
- if (message.CorrelationId !== undefined) {
2047
- Guid.encode(message.CorrelationId, writer.uint32(98).fork()).join();
2048
- }
2049
- if (message.Subject !== "") {
2050
- writer.uint32(106).string(message.Subject);
2051
- }
2052
- for (const v of message.Tags) {
2053
- writer.uint32(114).string(v!);
2054
- }
2055
- if (message.Hash !== "") {
2056
- writer.uint32(122).string(message.Hash);
2057
- }
2058
- for (const v of message.Causation) {
2059
- AppendCausation.encode(v!, writer.uint32(130).fork()).join();
2060
- }
2061
- if (message.CausedBy !== undefined) {
2062
- AppendIdentity.encode(message.CausedBy, writer.uint32(138).fork()).join();
2063
- }
2064
- if (message.ObservationState !== 0) {
2065
- writer.uint32(144).int32(message.ObservationState);
2066
- }
2067
- return writer;
2068
- },
2069
-
2070
- decode(input: BinaryReader | Uint8Array, length?: number): AppendReceipt {
2071
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2072
- const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
2073
- if (previousRecursionDepth >= 100) {
2074
- throw new globalThis.Error("protobuf decode recursion limit exceeded");
2075
- }
2076
- (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
2077
- try {
2078
- const end = length === undefined ? reader.len : reader.pos + length;
2079
- const message = createBaseAppendReceipt();
2080
- while (reader.pos < end) {
2081
- const tag = reader.uint32();
2082
- switch (tag >>> 3) {
2083
- case 1: {
2084
- if (tag !== 10) {
2085
- break;
2086
- }
1383
+ }
2087
1384
 
2088
- message.EventStore = reader.string();
2089
- continue;
2090
- }
2091
- case 2: {
2092
- if (tag !== 18) {
2093
- break;
1385
+ continue;
2094
1386
  }
2095
1387
 
2096
- message.Namespace = reader.string();
2097
- continue;
1388
+ break;
2098
1389
  }
2099
1390
  case 3: {
2100
1391
  if (tag !== 24) {
2101
1392
  break;
2102
1393
  }
2103
1394
 
2104
- message.SequenceNumber = reader.uint64() as bigint;
1395
+ message.IsSuccess = reader.bool();
2105
1396
  continue;
2106
1397
  }
2107
1398
  case 4: {
2108
- if (tag !== 34) {
1399
+ if (tag !== 32) {
2109
1400
  break;
2110
1401
  }
2111
1402
 
2112
- message.EventTypeId = reader.string();
1403
+ message.HasConstraintViolations = reader.bool();
2113
1404
  continue;
2114
1405
  }
2115
1406
  case 5: {
@@ -2117,7 +1408,7 @@ export const AppendReceipt: MessageFns<AppendReceipt> = {
2117
1408
  break;
2118
1409
  }
2119
1410
 
2120
- message.Generation = reader.uint32();
1411
+ message.HasConcurrencyViolations = reader.bool();
2121
1412
  continue;
2122
1413
  }
2123
1414
  case 6: {
@@ -2125,15 +1416,15 @@ export const AppendReceipt: MessageFns<AppendReceipt> = {
2125
1416
  break;
2126
1417
  }
2127
1418
 
2128
- message.Tombstone = reader.bool();
1419
+ message.HasErrors = reader.bool();
2129
1420
  continue;
2130
1421
  }
2131
1422
  case 7: {
2132
- if (tag !== 58) {
1423
+ if (tag !== 56) {
2133
1424
  break;
2134
1425
  }
2135
1426
 
2136
- message.EventSourceType = reader.string();
1427
+ message.ConcurrencyCheckPerformed = reader.bool();
2137
1428
  continue;
2138
1429
  }
2139
1430
  case 8: {
@@ -2141,7 +1432,7 @@ export const AppendReceipt: MessageFns<AppendReceipt> = {
2141
1432
  break;
2142
1433
  }
2143
1434
 
2144
- message.EventSourceId = reader.string();
1435
+ message.ConstraintViolations.push(ConstraintViolation.decode(reader, reader.uint32()));
2145
1436
  continue;
2146
1437
  }
2147
1438
  case 9: {
@@ -2149,7 +1440,7 @@ export const AppendReceipt: MessageFns<AppendReceipt> = {
2149
1440
  break;
2150
1441
  }
2151
1442
 
2152
- message.EventStreamType = reader.string();
1443
+ message.Errors.push(reader.string());
2153
1444
  continue;
2154
1445
  }
2155
1446
  case 10: {
@@ -2157,71 +1448,7 @@ export const AppendReceipt: MessageFns<AppendReceipt> = {
2157
1448
  break;
2158
1449
  }
2159
1450
 
2160
- message.EventStreamId = reader.string();
2161
- continue;
2162
- }
2163
- case 11: {
2164
- if (tag !== 90) {
2165
- break;
2166
- }
2167
-
2168
- message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32());
2169
- continue;
2170
- }
2171
- case 12: {
2172
- if (tag !== 98) {
2173
- break;
2174
- }
2175
-
2176
- message.CorrelationId = Guid.decode(reader, reader.uint32());
2177
- continue;
2178
- }
2179
- case 13: {
2180
- if (tag !== 106) {
2181
- break;
2182
- }
2183
-
2184
- message.Subject = reader.string();
2185
- continue;
2186
- }
2187
- case 14: {
2188
- if (tag !== 114) {
2189
- break;
2190
- }
2191
-
2192
- message.Tags.push(reader.string());
2193
- continue;
2194
- }
2195
- case 15: {
2196
- if (tag !== 122) {
2197
- break;
2198
- }
2199
-
2200
- message.Hash = reader.string();
2201
- continue;
2202
- }
2203
- case 16: {
2204
- if (tag !== 130) {
2205
- break;
2206
- }
2207
-
2208
- message.Causation.push(AppendCausation.decode(reader, reader.uint32()));
2209
- continue;
2210
- }
2211
- case 17: {
2212
- if (tag !== 138) {
2213
- break;
2214
- }
2215
-
2216
- message.CausedBy = AppendIdentity.decode(reader, reader.uint32());
2217
- continue;
2218
- }
2219
- case 18: {
2220
- if (tag !== 144) {
2221
- break;
2222
- }
2223
-
2224
- message.ObservationState = reader.int32() as any;
1451
+ message.ConcurrencyViolations.push(ConcurrencyViolation.decode(reader, reader.uint32()));
2225
1452
  continue;
2226
1453
  }
2227
1454
  }
@@ -2236,121 +1463,85 @@ export const AppendReceipt: MessageFns<AppendReceipt> = {
2236
1463
  }
2237
1464
  },
2238
1465
 
2239
- fromJSON(object: any): AppendReceipt {
1466
+ fromJSON(object: any): AppendManyResponse {
2240
1467
  return {
2241
- EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "",
2242
- Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "",
2243
- SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n,
2244
- EventTypeId: isSet(object.EventTypeId) ? globalThis.String(object.EventTypeId) : "",
2245
- Generation: isSet(object.Generation) ? globalThis.Number(object.Generation) : 0,
2246
- Tombstone: isSet(object.Tombstone) ? globalThis.Boolean(object.Tombstone) : false,
2247
- EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "",
2248
- EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "",
2249
- EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "",
2250
- EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "",
2251
- Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined,
2252
1468
  CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined,
2253
- Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "",
2254
- Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [],
2255
- Hash: isSet(object.Hash) ? globalThis.String(object.Hash) : "",
2256
- Causation: globalThis.Array.isArray(object?.Causation)
2257
- ? object.Causation.map((e: any) => AppendCausation.fromJSON(e))
1469
+ SequenceNumbers: globalThis.Array.isArray(object?.SequenceNumbers)
1470
+ ? object.SequenceNumbers.map((e: any) => BigInt(e))
1471
+ : [],
1472
+ IsSuccess: isSet(object.IsSuccess) ? globalThis.Boolean(object.IsSuccess) : false,
1473
+ HasConstraintViolations: isSet(object.HasConstraintViolations)
1474
+ ? globalThis.Boolean(object.HasConstraintViolations)
1475
+ : false,
1476
+ HasConcurrencyViolations: isSet(object.HasConcurrencyViolations)
1477
+ ? globalThis.Boolean(object.HasConcurrencyViolations)
1478
+ : false,
1479
+ HasErrors: isSet(object.HasErrors) ? globalThis.Boolean(object.HasErrors) : false,
1480
+ ConcurrencyCheckPerformed: isSet(object.ConcurrencyCheckPerformed)
1481
+ ? globalThis.Boolean(object.ConcurrencyCheckPerformed)
1482
+ : false,
1483
+ ConstraintViolations: globalThis.Array.isArray(object?.ConstraintViolations)
1484
+ ? object.ConstraintViolations.map((e: any) => ConstraintViolation.fromJSON(e))
1485
+ : [],
1486
+ Errors: globalThis.Array.isArray(object?.Errors) ? object.Errors.map((e: any) => globalThis.String(e)) : [],
1487
+ ConcurrencyViolations: globalThis.Array.isArray(object?.ConcurrencyViolations)
1488
+ ? object.ConcurrencyViolations.map((e: any) => ConcurrencyViolation.fromJSON(e))
2258
1489
  : [],
2259
- CausedBy: isSet(object.CausedBy) ? AppendIdentity.fromJSON(object.CausedBy) : undefined,
2260
- ObservationState: isSet(object.ObservationState) ? eventObservationStateFromJSON(object.ObservationState) : 0,
2261
1490
  };
2262
1491
  },
2263
1492
 
2264
- toJSON(message: AppendReceipt): unknown {
1493
+ toJSON(message: AppendManyResponse): unknown {
2265
1494
  const obj: any = {};
2266
- if (message.EventStore !== "") {
2267
- obj.EventStore = message.EventStore;
2268
- }
2269
- if (message.Namespace !== "") {
2270
- obj.Namespace = message.Namespace;
2271
- }
2272
- if (message.SequenceNumber !== 0n) {
2273
- obj.SequenceNumber = message.SequenceNumber.toString();
2274
- }
2275
- if (message.EventTypeId !== "") {
2276
- obj.EventTypeId = message.EventTypeId;
2277
- }
2278
- if (message.Generation !== 0) {
2279
- obj.Generation = Math.round(message.Generation);
2280
- }
2281
- if (message.Tombstone !== false) {
2282
- obj.Tombstone = message.Tombstone;
2283
- }
2284
- if (message.EventSourceType !== "") {
2285
- obj.EventSourceType = message.EventSourceType;
2286
- }
2287
- if (message.EventSourceId !== "") {
2288
- obj.EventSourceId = message.EventSourceId;
2289
- }
2290
- if (message.EventStreamType !== "") {
2291
- obj.EventStreamType = message.EventStreamType;
1495
+ if (message.CorrelationId !== undefined) {
1496
+ obj.CorrelationId = Guid.toJSON(message.CorrelationId);
2292
1497
  }
2293
- if (message.EventStreamId !== "") {
2294
- obj.EventStreamId = message.EventStreamId;
1498
+ if (message.SequenceNumbers?.length) {
1499
+ obj.SequenceNumbers = message.SequenceNumbers.map((e) => e.toString());
2295
1500
  }
2296
- if (message.Occurred !== undefined) {
2297
- obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred);
1501
+ if (message.IsSuccess !== false) {
1502
+ obj.IsSuccess = message.IsSuccess;
2298
1503
  }
2299
- if (message.CorrelationId !== undefined) {
2300
- obj.CorrelationId = Guid.toJSON(message.CorrelationId);
1504
+ if (message.HasConstraintViolations !== false) {
1505
+ obj.HasConstraintViolations = message.HasConstraintViolations;
2301
1506
  }
2302
- if (message.Subject !== "") {
2303
- obj.Subject = message.Subject;
1507
+ if (message.HasConcurrencyViolations !== false) {
1508
+ obj.HasConcurrencyViolations = message.HasConcurrencyViolations;
2304
1509
  }
2305
- if (message.Tags?.length) {
2306
- obj.Tags = message.Tags;
1510
+ if (message.HasErrors !== false) {
1511
+ obj.HasErrors = message.HasErrors;
2307
1512
  }
2308
- if (message.Hash !== "") {
2309
- obj.Hash = message.Hash;
1513
+ if (message.ConcurrencyCheckPerformed !== false) {
1514
+ obj.ConcurrencyCheckPerformed = message.ConcurrencyCheckPerformed;
2310
1515
  }
2311
- if (message.Causation?.length) {
2312
- obj.Causation = message.Causation.map((e) => AppendCausation.toJSON(e));
1516
+ if (message.ConstraintViolations?.length) {
1517
+ obj.ConstraintViolations = message.ConstraintViolations.map((e) => ConstraintViolation.toJSON(e));
2313
1518
  }
2314
- if (message.CausedBy !== undefined) {
2315
- obj.CausedBy = AppendIdentity.toJSON(message.CausedBy);
1519
+ if (message.Errors?.length) {
1520
+ obj.Errors = message.Errors;
2316
1521
  }
2317
- if (message.ObservationState !== 0) {
2318
- obj.ObservationState = eventObservationStateToJSON(message.ObservationState);
1522
+ if (message.ConcurrencyViolations?.length) {
1523
+ obj.ConcurrencyViolations = message.ConcurrencyViolations.map((e) => ConcurrencyViolation.toJSON(e));
2319
1524
  }
2320
1525
  return obj;
2321
1526
  },
2322
1527
 
2323
- create(base?: DeepPartial<AppendReceipt>): AppendReceipt {
2324
- return AppendReceipt.fromPartial(base ?? {});
1528
+ create(base?: DeepPartial<AppendManyResponse>): AppendManyResponse {
1529
+ return AppendManyResponse.fromPartial(base ?? {});
2325
1530
  },
2326
- fromPartial(object: DeepPartial<AppendReceipt>): AppendReceipt {
2327
- const message = createBaseAppendReceipt();
2328
- message.EventStore = object.EventStore ?? "";
2329
- message.Namespace = object.Namespace ?? "";
2330
- message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null)
2331
- ? BigInt(object.SequenceNumber)
2332
- : 0n;
2333
- message.EventTypeId = object.EventTypeId ?? "";
2334
- message.Generation = object.Generation ?? 0;
2335
- message.Tombstone = object.Tombstone ?? false;
2336
- message.EventSourceType = object.EventSourceType ?? "";
2337
- message.EventSourceId = object.EventSourceId ?? "";
2338
- message.EventStreamType = object.EventStreamType ?? "";
2339
- message.EventStreamId = object.EventStreamId ?? "";
2340
- message.Occurred = (object.Occurred !== undefined && object.Occurred !== null)
2341
- ? SerializableDateTimeOffset.fromPartial(object.Occurred)
2342
- : undefined;
1531
+ fromPartial(object: DeepPartial<AppendManyResponse>): AppendManyResponse {
1532
+ const message = createBaseAppendManyResponse();
2343
1533
  message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null)
2344
1534
  ? Guid.fromPartial(object.CorrelationId)
2345
1535
  : undefined;
2346
- message.Subject = object.Subject ?? "";
2347
- message.Tags = object.Tags?.map((e) => e) || [];
2348
- message.Hash = object.Hash ?? "";
2349
- message.Causation = object.Causation?.map((e) => AppendCausation.fromPartial(e)) || [];
2350
- message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null)
2351
- ? AppendIdentity.fromPartial(object.CausedBy)
2352
- : undefined;
2353
- message.ObservationState = object.ObservationState ?? 0;
1536
+ message.SequenceNumbers = object.SequenceNumbers?.map((e) => BigInt(e)) || [];
1537
+ message.IsSuccess = object.IsSuccess ?? false;
1538
+ message.HasConstraintViolations = object.HasConstraintViolations ?? false;
1539
+ message.HasConcurrencyViolations = object.HasConcurrencyViolations ?? false;
1540
+ message.HasErrors = object.HasErrors ?? false;
1541
+ message.ConcurrencyCheckPerformed = object.ConcurrencyCheckPerformed ?? false;
1542
+ message.ConstraintViolations = object.ConstraintViolations?.map((e) => ConstraintViolation.fromPartial(e)) || [];
1543
+ message.Errors = object.Errors?.map((e) => e) || [];
1544
+ message.ConcurrencyViolations = object.ConcurrencyViolations?.map((e) => ConcurrencyViolation.fromPartial(e)) || [];
2354
1545
  return message;
2355
1546
  },
2356
1547
  };
@@ -2373,7 +1564,6 @@ function createBaseAppendRequest(): AppendRequest {
2373
1564
  Causation: [],
2374
1565
  CausedBy: undefined,
2375
1566
  ConcurrencyScope: undefined,
2376
- IncludeReceipt: false,
2377
1567
  };
2378
1568
  }
2379
1569
 
@@ -2427,9 +1617,6 @@ export const AppendRequest: MessageFns<AppendRequest> = {
2427
1617
  if (message.ConcurrencyScope !== undefined) {
2428
1618
  ConcurrencyScope.encode(message.ConcurrencyScope, writer.uint32(130).fork()).join();
2429
1619
  }
2430
- if (message.IncludeReceipt !== false) {
2431
- writer.uint32(136).bool(message.IncludeReceipt);
2432
- }
2433
1620
  return writer;
2434
1621
  },
2435
1622
 
@@ -2574,14 +1761,6 @@ export const AppendRequest: MessageFns<AppendRequest> = {
2574
1761
  message.ConcurrencyScope = ConcurrencyScope.decode(reader, reader.uint32());
2575
1762
  continue;
2576
1763
  }
2577
- case 17: {
2578
- if (tag !== 136) {
2579
- break;
2580
- }
2581
-
2582
- message.IncludeReceipt = reader.bool();
2583
- continue;
2584
- }
2585
1764
  }
2586
1765
  if ((tag & 7) === 4 || tag === 0) {
2587
1766
  break;
@@ -2614,7 +1793,6 @@ export const AppendRequest: MessageFns<AppendRequest> = {
2614
1793
  : [],
2615
1794
  CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined,
2616
1795
  ConcurrencyScope: isSet(object.ConcurrencyScope) ? ConcurrencyScope.fromJSON(object.ConcurrencyScope) : undefined,
2617
- IncludeReceipt: isSet(object.IncludeReceipt) ? globalThis.Boolean(object.IncludeReceipt) : false,
2618
1796
  };
2619
1797
  },
2620
1798
 
@@ -2668,9 +1846,6 @@ export const AppendRequest: MessageFns<AppendRequest> = {
2668
1846
  if (message.ConcurrencyScope !== undefined) {
2669
1847
  obj.ConcurrencyScope = ConcurrencyScope.toJSON(message.ConcurrencyScope);
2670
1848
  }
2671
- if (message.IncludeReceipt !== false) {
2672
- obj.IncludeReceipt = message.IncludeReceipt;
2673
- }
2674
1849
  return obj;
2675
1850
  },
2676
1851
 
@@ -2705,7 +1880,6 @@ export const AppendRequest: MessageFns<AppendRequest> = {
2705
1880
  message.ConcurrencyScope = (object.ConcurrencyScope !== undefined && object.ConcurrencyScope !== null)
2706
1881
  ? ConcurrencyScope.fromPartial(object.ConcurrencyScope)
2707
1882
  : undefined;
2708
- message.IncludeReceipt = object.IncludeReceipt ?? false;
2709
1883
  return message;
2710
1884
  },
2711
1885
  };
@@ -2722,7 +1896,6 @@ function createBaseAppendResponse(): AppendResponse {
2722
1896
  ConstraintViolations: [],
2723
1897
  Errors: [],
2724
1898
  ConcurrencyViolation: undefined,
2725
- Receipt: undefined,
2726
1899
  };
2727
1900
  }
2728
1901
 
@@ -2761,9 +1934,6 @@ export const AppendResponse: MessageFns<AppendResponse> = {
2761
1934
  if (message.ConcurrencyViolation !== undefined) {
2762
1935
  ConcurrencyViolation.encode(message.ConcurrencyViolation, writer.uint32(82).fork()).join();
2763
1936
  }
2764
- if (message.Receipt !== undefined) {
2765
- AppendReceipt.encode(message.Receipt, writer.uint32(90).fork()).join();
2766
- }
2767
1937
  return writer;
2768
1938
  },
2769
1939
 
@@ -2860,14 +2030,6 @@ export const AppendResponse: MessageFns<AppendResponse> = {
2860
2030
  message.ConcurrencyViolation = ConcurrencyViolation.decode(reader, reader.uint32());
2861
2031
  continue;
2862
2032
  }
2863
- case 11: {
2864
- if (tag !== 90) {
2865
- break;
2866
- }
2867
-
2868
- message.Receipt = AppendReceipt.decode(reader, reader.uint32());
2869
- continue;
2870
- }
2871
2033
  }
2872
2034
  if ((tag & 7) === 4 || tag === 0) {
2873
2035
  break;
@@ -2904,7 +2066,6 @@ export const AppendResponse: MessageFns<AppendResponse> = {
2904
2066
  ConcurrencyViolation: isSet(object.ConcurrencyViolation)
2905
2067
  ? ConcurrencyViolation.fromJSON(object.ConcurrencyViolation)
2906
2068
  : undefined,
2907
- Receipt: isSet(object.Receipt) ? AppendReceipt.fromJSON(object.Receipt) : undefined,
2908
2069
  };
2909
2070
  },
2910
2071
 
@@ -2940,9 +2101,6 @@ export const AppendResponse: MessageFns<AppendResponse> = {
2940
2101
  if (message.ConcurrencyViolation !== undefined) {
2941
2102
  obj.ConcurrencyViolation = ConcurrencyViolation.toJSON(message.ConcurrencyViolation);
2942
2103
  }
2943
- if (message.Receipt !== undefined) {
2944
- obj.Receipt = AppendReceipt.toJSON(message.Receipt);
2945
- }
2946
2104
  return obj;
2947
2105
  },
2948
2106
 
@@ -2967,9 +2125,6 @@ export const AppendResponse: MessageFns<AppendResponse> = {
2967
2125
  message.ConcurrencyViolation = (object.ConcurrencyViolation !== undefined && object.ConcurrencyViolation !== null)
2968
2126
  ? ConcurrencyViolation.fromPartial(object.ConcurrencyViolation)
2969
2127
  : undefined;
2970
- message.Receipt = (object.Receipt !== undefined && object.Receipt !== null)
2971
- ? AppendReceipt.fromPartial(object.Receipt)
2972
- : undefined;
2973
2128
  return message;
2974
2129
  },
2975
2130
  };
@@ -6704,6 +5859,7 @@ function createBaseForEventSourceIdAndEventTypesRequest(): ForEventSourceIdAndEv
6704
5859
  EventTypeIds: "",
6705
5860
  EventStreamType: "",
6706
5861
  EventStreamId: "",
5862
+ EventSourceType: "",
6707
5863
  };
6708
5864
  }
6709
5865
 
@@ -6730,6 +5886,9 @@ export const ForEventSourceIdAndEventTypesRequest: MessageFns<ForEventSourceIdAn
6730
5886
  if (message.EventStreamId !== "") {
6731
5887
  writer.uint32(66).string(message.EventStreamId);
6732
5888
  }
5889
+ if (message.EventSourceType !== "") {
5890
+ writer.uint32(74).string(message.EventSourceType);
5891
+ }
6733
5892
  return writer;
6734
5893
  },
6735
5894
 
@@ -6802,6 +5961,14 @@ export const ForEventSourceIdAndEventTypesRequest: MessageFns<ForEventSourceIdAn
6802
5961
  message.EventStreamId = reader.string();
6803
5962
  continue;
6804
5963
  }
5964
+ case 9: {
5965
+ if (tag !== 74) {
5966
+ break;
5967
+ }
5968
+
5969
+ message.EventSourceType = reader.string();
5970
+ continue;
5971
+ }
6805
5972
  }
6806
5973
  if ((tag & 7) === 4 || tag === 0) {
6807
5974
  break;
@@ -6823,6 +5990,7 @@ export const ForEventSourceIdAndEventTypesRequest: MessageFns<ForEventSourceIdAn
6823
5990
  EventTypeIds: isSet(object.EventTypeIds) ? globalThis.String(object.EventTypeIds) : "",
6824
5991
  EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "",
6825
5992
  EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "",
5993
+ EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "",
6826
5994
  };
6827
5995
  },
6828
5996
 
@@ -6849,6 +6017,9 @@ export const ForEventSourceIdAndEventTypesRequest: MessageFns<ForEventSourceIdAn
6849
6017
  if (message.EventStreamId !== "") {
6850
6018
  obj.EventStreamId = message.EventStreamId;
6851
6019
  }
6020
+ if (message.EventSourceType !== "") {
6021
+ obj.EventSourceType = message.EventSourceType;
6022
+ }
6852
6023
  return obj;
6853
6024
  },
6854
6025
 
@@ -6864,6 +6035,7 @@ export const ForEventSourceIdAndEventTypesRequest: MessageFns<ForEventSourceIdAn
6864
6035
  message.EventTypeIds = object.EventTypeIds ?? "";
6865
6036
  message.EventStreamType = object.EventStreamType ?? "";
6866
6037
  message.EventStreamId = object.EventStreamId ?? "";
6038
+ message.EventSourceType = object.EventSourceType ?? "";
6867
6039
  return message;
6868
6040
  },
6869
6041
  };