@waku/core 0.0.31-1887f4f.0 → 0.0.31-39f8920.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 (47) hide show
  1. package/bundle/{base_protocol-WTp5jKZK.js → base_protocol-Dge5_tvU.js} +3 -7
  2. package/bundle/{index-COT0phC8.js → index-Gts2Ddu_.js} +38 -52
  3. package/bundle/index.js +214 -193
  4. package/bundle/lib/base_protocol.js +2 -2
  5. package/bundle/lib/message/version_0.js +2 -2
  6. package/bundle/{version_0-SMRUXDNR.js → version_0-CNRKFufI.js} +154 -308
  7. package/dist/.tsbuildinfo +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/lib/base_protocol.d.ts +2 -3
  12. package/dist/lib/base_protocol.js +3 -7
  13. package/dist/lib/base_protocol.js.map +1 -1
  14. package/dist/lib/connection_manager.d.ts +1 -1
  15. package/dist/lib/connection_manager.js.map +1 -1
  16. package/dist/lib/filter/index.d.ts +3 -2
  17. package/dist/lib/filter/index.js +4 -2
  18. package/dist/lib/filter/index.js.map +1 -1
  19. package/dist/lib/health_manager.d.ts +14 -0
  20. package/dist/lib/health_manager.js +70 -0
  21. package/dist/lib/health_manager.js.map +1 -0
  22. package/dist/lib/light_push/index.d.ts +3 -2
  23. package/dist/lib/light_push/index.js +4 -2
  24. package/dist/lib/light_push/index.js.map +1 -1
  25. package/dist/lib/metadata/index.d.ts +2 -2
  26. package/dist/lib/metadata/index.js +9 -9
  27. package/dist/lib/metadata/index.js.map +1 -1
  28. package/dist/lib/store/index.d.ts +5 -44
  29. package/dist/lib/store/index.js +39 -45
  30. package/dist/lib/store/index.js.map +1 -1
  31. package/dist/lib/store/rpc.d.ts +22 -0
  32. package/dist/lib/store/rpc.js +74 -0
  33. package/dist/lib/store/rpc.js.map +1 -0
  34. package/package.json +1 -1
  35. package/src/index.ts +2 -2
  36. package/src/lib/base_protocol.ts +3 -7
  37. package/src/lib/connection_manager.ts +1 -1
  38. package/src/lib/filter/index.ts +3 -10
  39. package/src/lib/health_manager.ts +90 -0
  40. package/src/lib/light_push/index.ts +6 -9
  41. package/src/lib/metadata/index.ts +11 -12
  42. package/src/lib/store/index.ts +53 -93
  43. package/src/lib/store/rpc.ts +92 -0
  44. package/dist/lib/store/history_rpc.d.ts +0 -27
  45. package/dist/lib/store/history_rpc.js +0 -72
  46. package/dist/lib/store/history_rpc.js.map +0 -1
  47. package/src/lib/store/history_rpc.ts +0 -93
@@ -1,4 +1,4 @@
1
- import { a as allocUnsafe, f as fromString, b as alloc$1, L as Logger, e as determinePubsubTopic } from './index-COT0phC8.js';
1
+ import { a as allocUnsafe, f as fromString, b as alloc$1, L as Logger, g as determinePubsubTopic } from './index-Gts2Ddu_.js';
2
2
 
3
3
  /* eslint-disable no-fallthrough */
4
4
  const N1 = Math.pow(2, 7);
@@ -920,7 +920,7 @@ function decodeMessage(buf, codec, opts) {
920
920
  * A general purpose buffer pool
921
921
  */
922
922
  function pool(size) {
923
- const SIZE = size ?? 8192;
923
+ const SIZE = 8192;
924
924
  const MAX = SIZE >>> 1;
925
925
  let slab;
926
926
  let offset = SIZE;
@@ -1433,12 +1433,17 @@ function message$1(encode, decode) {
1433
1433
  * npm i protons-runtime
1434
1434
  * ```
1435
1435
  */
1436
- class CodeError extends Error {
1437
- code;
1438
- constructor(message, code, options) {
1439
- super(message, options);
1440
- this.code = code;
1441
- }
1436
+ /**
1437
+ * Thrown when a repeated field has too many elements
1438
+ */
1439
+ class MaxLengthError extends Error {
1440
+ /**
1441
+ * This will be removed in a future release
1442
+ *
1443
+ * @deprecated use the `.name` property instead
1444
+ */
1445
+ code = 'ERR_MAX_LENGTH';
1446
+ name = 'MaxLengthError';
1442
1447
  }
1443
1448
 
1444
1449
  /* eslint-disable import/export */
@@ -1746,7 +1751,7 @@ var FilterRequest;
1746
1751
  }
1747
1752
  case 3: {
1748
1753
  if (opts.limits?.contentFilters != null && obj.contentFilters.length === opts.limits.contentFilters) {
1749
- throw new CodeError('decode error - map field "contentFilters" had too many elements', 'ERR_MAX_LENGTH');
1754
+ throw new MaxLengthError('Decode error - map field "contentFilters" had too many elements');
1750
1755
  }
1751
1756
  obj.contentFilters.push(FilterRequest.ContentFilter.codec().decode(reader, reader.uint32(), {
1752
1757
  limits: opts.limits?.contentFilters$
@@ -1799,7 +1804,7 @@ var MessagePush$1;
1799
1804
  switch (tag >>> 3) {
1800
1805
  case 1: {
1801
1806
  if (opts.limits?.messages != null && obj.messages.length === opts.limits.messages) {
1802
- throw new CodeError('decode error - map field "messages" had too many elements', 'ERR_MAX_LENGTH');
1807
+ throw new MaxLengthError('Decode error - map field "messages" had too many elements');
1803
1808
  }
1804
1809
  obj.messages.push(WakuMessage$3.codec().decode(reader, reader.uint32(), {
1805
1810
  limits: opts.limits?.messages$
@@ -2218,7 +2223,7 @@ var FilterSubscribeRequest;
2218
2223
  }
2219
2224
  case 11: {
2220
2225
  if (opts.limits?.contentTopics != null && obj.contentTopics.length === opts.limits.contentTopics) {
2221
- throw new CodeError('decode error - map field "contentTopics" had too many elements', 'ERR_MAX_LENGTH');
2226
+ throw new MaxLengthError('Decode error - map field "contentTopics" had too many elements');
2222
2227
  }
2223
2228
  obj.contentTopics.push(reader.string());
2224
2229
  break;
@@ -2940,113 +2945,26 @@ var WakuMessage$1;
2940
2945
  /* eslint-disable @typescript-eslint/no-namespace */
2941
2946
  /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
2942
2947
  /* eslint-disable @typescript-eslint/no-empty-interface */
2943
- var Index;
2944
- (function (Index) {
2948
+ var WakuMessageKeyValue;
2949
+ (function (WakuMessageKeyValue) {
2945
2950
  let _codec;
2946
- Index.codec = () => {
2951
+ WakuMessageKeyValue.codec = () => {
2947
2952
  if (_codec == null) {
2948
2953
  _codec = message$1((obj, w, opts = {}) => {
2949
2954
  if (opts.lengthDelimited !== false) {
2950
2955
  w.fork();
2951
2956
  }
2952
- if ((obj.digest != null && obj.digest.byteLength > 0)) {
2957
+ if (obj.messageHash != null) {
2953
2958
  w.uint32(10);
2954
- w.bytes(obj.digest);
2955
- }
2956
- if ((obj.receiverTime != null && obj.receiverTime !== 0n)) {
2957
- w.uint32(16);
2958
- w.sint64(obj.receiverTime);
2959
- }
2960
- if ((obj.senderTime != null && obj.senderTime !== 0n)) {
2961
- w.uint32(24);
2962
- w.sint64(obj.senderTime);
2963
- }
2964
- if ((obj.pubsubTopic != null && obj.pubsubTopic !== '')) {
2965
- w.uint32(34);
2966
- w.string(obj.pubsubTopic);
2967
- }
2968
- if (opts.lengthDelimited !== false) {
2969
- w.ldelim();
2970
- }
2971
- }, (reader, length, opts = {}) => {
2972
- const obj = {
2973
- digest: alloc$1(0),
2974
- receiverTime: 0n,
2975
- senderTime: 0n,
2976
- pubsubTopic: ''
2977
- };
2978
- const end = length == null ? reader.len : reader.pos + length;
2979
- while (reader.pos < end) {
2980
- const tag = reader.uint32();
2981
- switch (tag >>> 3) {
2982
- case 1: {
2983
- obj.digest = reader.bytes();
2984
- break;
2985
- }
2986
- case 2: {
2987
- obj.receiverTime = reader.sint64();
2988
- break;
2989
- }
2990
- case 3: {
2991
- obj.senderTime = reader.sint64();
2992
- break;
2993
- }
2994
- case 4: {
2995
- obj.pubsubTopic = reader.string();
2996
- break;
2997
- }
2998
- default: {
2999
- reader.skipType(tag & 7);
3000
- break;
3001
- }
3002
- }
2959
+ w.bytes(obj.messageHash);
3003
2960
  }
3004
- return obj;
3005
- });
3006
- }
3007
- return _codec;
3008
- };
3009
- Index.encode = (obj) => {
3010
- return encodeMessage(obj, Index.codec());
3011
- };
3012
- Index.decode = (buf, opts) => {
3013
- return decodeMessage(buf, Index.codec(), opts);
3014
- };
3015
- })(Index || (Index = {}));
3016
- var PagingInfo;
3017
- (function (PagingInfo) {
3018
- (function (Direction) {
3019
- Direction["BACKWARD"] = "BACKWARD";
3020
- Direction["FORWARD"] = "FORWARD";
3021
- })(PagingInfo.Direction || (PagingInfo.Direction = {}));
3022
- let __DirectionValues;
3023
- (function (__DirectionValues) {
3024
- __DirectionValues[__DirectionValues["BACKWARD"] = 0] = "BACKWARD";
3025
- __DirectionValues[__DirectionValues["FORWARD"] = 1] = "FORWARD";
3026
- })(__DirectionValues || (__DirectionValues = {}));
3027
- (function (Direction) {
3028
- Direction.codec = () => {
3029
- return enumeration(__DirectionValues);
3030
- };
3031
- })(PagingInfo.Direction || (PagingInfo.Direction = {}));
3032
- let _codec;
3033
- PagingInfo.codec = () => {
3034
- if (_codec == null) {
3035
- _codec = message$1((obj, w, opts = {}) => {
3036
- if (opts.lengthDelimited !== false) {
3037
- w.fork();
3038
- }
3039
- if (obj.pageSize != null) {
3040
- w.uint32(8);
3041
- w.uint64(obj.pageSize);
3042
- }
3043
- if (obj.cursor != null) {
2961
+ if (obj.message != null) {
3044
2962
  w.uint32(18);
3045
- Index.codec().encode(obj.cursor, w);
2963
+ WakuMessage.codec().encode(obj.message, w);
3046
2964
  }
3047
- if (obj.direction != null) {
3048
- w.uint32(24);
3049
- PagingInfo.Direction.codec().encode(obj.direction, w);
2965
+ if (obj.pubsubTopic != null) {
2966
+ w.uint32(26);
2967
+ w.string(obj.pubsubTopic);
3050
2968
  }
3051
2969
  if (opts.lengthDelimited !== false) {
3052
2970
  w.ldelim();
@@ -3058,17 +2976,17 @@ var PagingInfo;
3058
2976
  const tag = reader.uint32();
3059
2977
  switch (tag >>> 3) {
3060
2978
  case 1: {
3061
- obj.pageSize = reader.uint64();
2979
+ obj.messageHash = reader.bytes();
3062
2980
  break;
3063
2981
  }
3064
2982
  case 2: {
3065
- obj.cursor = Index.codec().decode(reader, reader.uint32(), {
3066
- limits: opts.limits?.cursor
2983
+ obj.message = WakuMessage.codec().decode(reader, reader.uint32(), {
2984
+ limits: opts.limits?.message
3067
2985
  });
3068
2986
  break;
3069
2987
  }
3070
2988
  case 3: {
3071
- obj.direction = PagingInfo.Direction.codec().decode(reader);
2989
+ obj.pubsubTopic = reader.string();
3072
2990
  break;
3073
2991
  }
3074
2992
  default: {
@@ -3082,217 +3000,125 @@ var PagingInfo;
3082
3000
  }
3083
3001
  return _codec;
3084
3002
  };
3085
- PagingInfo.encode = (obj) => {
3086
- return encodeMessage(obj, PagingInfo.codec());
3003
+ WakuMessageKeyValue.encode = (obj) => {
3004
+ return encodeMessage(obj, WakuMessageKeyValue.codec());
3087
3005
  };
3088
- PagingInfo.decode = (buf, opts) => {
3089
- return decodeMessage(buf, PagingInfo.codec(), opts);
3006
+ WakuMessageKeyValue.decode = (buf, opts) => {
3007
+ return decodeMessage(buf, WakuMessageKeyValue.codec(), opts);
3090
3008
  };
3091
- })(PagingInfo || (PagingInfo = {}));
3092
- var ContentFilter;
3093
- (function (ContentFilter) {
3009
+ })(WakuMessageKeyValue || (WakuMessageKeyValue = {}));
3010
+ var StoreQueryRequest$1;
3011
+ (function (StoreQueryRequest) {
3094
3012
  let _codec;
3095
- ContentFilter.codec = () => {
3013
+ StoreQueryRequest.codec = () => {
3096
3014
  if (_codec == null) {
3097
3015
  _codec = message$1((obj, w, opts = {}) => {
3098
3016
  if (opts.lengthDelimited !== false) {
3099
3017
  w.fork();
3100
3018
  }
3101
- if ((obj.contentTopic != null && obj.contentTopic !== '')) {
3019
+ if ((obj.requestId != null && obj.requestId !== '')) {
3102
3020
  w.uint32(10);
3103
- w.string(obj.contentTopic);
3021
+ w.string(obj.requestId);
3104
3022
  }
3105
- if (opts.lengthDelimited !== false) {
3106
- w.ldelim();
3023
+ if ((obj.includeData != null && obj.includeData !== false)) {
3024
+ w.uint32(16);
3025
+ w.bool(obj.includeData);
3107
3026
  }
3108
- }, (reader, length, opts = {}) => {
3109
- const obj = {
3110
- contentTopic: ''
3111
- };
3112
- const end = length == null ? reader.len : reader.pos + length;
3113
- while (reader.pos < end) {
3114
- const tag = reader.uint32();
3115
- switch (tag >>> 3) {
3116
- case 1: {
3117
- obj.contentTopic = reader.string();
3118
- break;
3119
- }
3120
- default: {
3121
- reader.skipType(tag & 7);
3122
- break;
3123
- }
3027
+ if (obj.pubsubTopic != null) {
3028
+ w.uint32(82);
3029
+ w.string(obj.pubsubTopic);
3030
+ }
3031
+ if (obj.contentTopics != null) {
3032
+ for (const value of obj.contentTopics) {
3033
+ w.uint32(90);
3034
+ w.string(value);
3124
3035
  }
3125
3036
  }
3126
- return obj;
3127
- });
3128
- }
3129
- return _codec;
3130
- };
3131
- ContentFilter.encode = (obj) => {
3132
- return encodeMessage(obj, ContentFilter.codec());
3133
- };
3134
- ContentFilter.decode = (buf, opts) => {
3135
- return decodeMessage(buf, ContentFilter.codec(), opts);
3136
- };
3137
- })(ContentFilter || (ContentFilter = {}));
3138
- var HistoryQuery;
3139
- (function (HistoryQuery) {
3140
- let _codec;
3141
- HistoryQuery.codec = () => {
3142
- if (_codec == null) {
3143
- _codec = message$1((obj, w, opts = {}) => {
3144
- if (opts.lengthDelimited !== false) {
3145
- w.fork();
3037
+ if (obj.timeStart != null) {
3038
+ w.uint32(96);
3039
+ w.sint64(obj.timeStart);
3146
3040
  }
3147
- if (obj.pubsubTopic != null) {
3148
- w.uint32(18);
3149
- w.string(obj.pubsubTopic);
3041
+ if (obj.timeEnd != null) {
3042
+ w.uint32(104);
3043
+ w.sint64(obj.timeEnd);
3150
3044
  }
3151
- if (obj.contentFilters != null) {
3152
- for (const value of obj.contentFilters) {
3153
- w.uint32(26);
3154
- ContentFilter.codec().encode(value, w);
3045
+ if (obj.messageHashes != null) {
3046
+ for (const value of obj.messageHashes) {
3047
+ w.uint32(162);
3048
+ w.bytes(value);
3155
3049
  }
3156
3050
  }
3157
- if (obj.pagingInfo != null) {
3158
- w.uint32(34);
3159
- PagingInfo.codec().encode(obj.pagingInfo, w);
3051
+ if (obj.paginationCursor != null) {
3052
+ w.uint32(410);
3053
+ w.bytes(obj.paginationCursor);
3160
3054
  }
3161
- if (obj.startTime != null) {
3162
- w.uint32(40);
3163
- w.sint64(obj.startTime);
3055
+ if ((obj.paginationForward != null && obj.paginationForward !== false)) {
3056
+ w.uint32(416);
3057
+ w.bool(obj.paginationForward);
3164
3058
  }
3165
- if (obj.endTime != null) {
3166
- w.uint32(48);
3167
- w.sint64(obj.endTime);
3059
+ if (obj.paginationLimit != null) {
3060
+ w.uint32(424);
3061
+ w.uint64(obj.paginationLimit);
3168
3062
  }
3169
3063
  if (opts.lengthDelimited !== false) {
3170
3064
  w.ldelim();
3171
3065
  }
3172
3066
  }, (reader, length, opts = {}) => {
3173
3067
  const obj = {
3174
- contentFilters: []
3068
+ requestId: '',
3069
+ includeData: false,
3070
+ contentTopics: [],
3071
+ messageHashes: [],
3072
+ paginationForward: false
3175
3073
  };
3176
3074
  const end = length == null ? reader.len : reader.pos + length;
3177
3075
  while (reader.pos < end) {
3178
3076
  const tag = reader.uint32();
3179
3077
  switch (tag >>> 3) {
3180
- case 2: {
3181
- obj.pubsubTopic = reader.string();
3078
+ case 1: {
3079
+ obj.requestId = reader.string();
3182
3080
  break;
3183
3081
  }
3184
- case 3: {
3185
- if (opts.limits?.contentFilters != null && obj.contentFilters.length === opts.limits.contentFilters) {
3186
- throw new CodeError('decode error - map field "contentFilters" had too many elements', 'ERR_MAX_LENGTH');
3187
- }
3188
- obj.contentFilters.push(ContentFilter.codec().decode(reader, reader.uint32(), {
3189
- limits: opts.limits?.contentFilters$
3190
- }));
3082
+ case 2: {
3083
+ obj.includeData = reader.bool();
3191
3084
  break;
3192
3085
  }
3193
- case 4: {
3194
- obj.pagingInfo = PagingInfo.codec().decode(reader, reader.uint32(), {
3195
- limits: opts.limits?.pagingInfo
3196
- });
3086
+ case 10: {
3087
+ obj.pubsubTopic = reader.string();
3197
3088
  break;
3198
3089
  }
3199
- case 5: {
3200
- obj.startTime = reader.sint64();
3090
+ case 11: {
3091
+ if (opts.limits?.contentTopics != null && obj.contentTopics.length === opts.limits.contentTopics) {
3092
+ throw new MaxLengthError('Decode error - map field "contentTopics" had too many elements');
3093
+ }
3094
+ obj.contentTopics.push(reader.string());
3201
3095
  break;
3202
3096
  }
3203
- case 6: {
3204
- obj.endTime = reader.sint64();
3097
+ case 12: {
3098
+ obj.timeStart = reader.sint64();
3205
3099
  break;
3206
3100
  }
3207
- default: {
3208
- reader.skipType(tag & 7);
3101
+ case 13: {
3102
+ obj.timeEnd = reader.sint64();
3209
3103
  break;
3210
3104
  }
3211
- }
3212
- }
3213
- return obj;
3214
- });
3215
- }
3216
- return _codec;
3217
- };
3218
- HistoryQuery.encode = (obj) => {
3219
- return encodeMessage(obj, HistoryQuery.codec());
3220
- };
3221
- HistoryQuery.decode = (buf, opts) => {
3222
- return decodeMessage(buf, HistoryQuery.codec(), opts);
3223
- };
3224
- })(HistoryQuery || (HistoryQuery = {}));
3225
- var HistoryResponse;
3226
- (function (HistoryResponse) {
3227
- let HistoryError;
3228
- (function (HistoryError) {
3229
- HistoryError["NONE"] = "NONE";
3230
- HistoryError["INVALID_CURSOR"] = "INVALID_CURSOR";
3231
- HistoryError["TOO_MANY_REQUESTS"] = "TOO_MANY_REQUESTS";
3232
- HistoryError["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
3233
- })(HistoryError = HistoryResponse.HistoryError || (HistoryResponse.HistoryError = {}));
3234
- let __HistoryErrorValues;
3235
- (function (__HistoryErrorValues) {
3236
- __HistoryErrorValues[__HistoryErrorValues["NONE"] = 0] = "NONE";
3237
- __HistoryErrorValues[__HistoryErrorValues["INVALID_CURSOR"] = 1] = "INVALID_CURSOR";
3238
- __HistoryErrorValues[__HistoryErrorValues["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
3239
- __HistoryErrorValues[__HistoryErrorValues["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
3240
- })(__HistoryErrorValues || (__HistoryErrorValues = {}));
3241
- (function (HistoryError) {
3242
- HistoryError.codec = () => {
3243
- return enumeration(__HistoryErrorValues);
3244
- };
3245
- })(HistoryError = HistoryResponse.HistoryError || (HistoryResponse.HistoryError = {}));
3246
- let _codec;
3247
- HistoryResponse.codec = () => {
3248
- if (_codec == null) {
3249
- _codec = message$1((obj, w, opts = {}) => {
3250
- if (opts.lengthDelimited !== false) {
3251
- w.fork();
3252
- }
3253
- if (obj.messages != null) {
3254
- for (const value of obj.messages) {
3255
- w.uint32(18);
3256
- WakuMessage.codec().encode(value, w);
3257
- }
3258
- }
3259
- if (obj.pagingInfo != null) {
3260
- w.uint32(26);
3261
- PagingInfo.codec().encode(obj.pagingInfo, w);
3262
- }
3263
- if (obj.error != null && __HistoryErrorValues[obj.error] !== 0) {
3264
- w.uint32(32);
3265
- HistoryResponse.HistoryError.codec().encode(obj.error, w);
3266
- }
3267
- if (opts.lengthDelimited !== false) {
3268
- w.ldelim();
3269
- }
3270
- }, (reader, length, opts = {}) => {
3271
- const obj = {
3272
- messages: [],
3273
- error: HistoryError.NONE
3274
- };
3275
- const end = length == null ? reader.len : reader.pos + length;
3276
- while (reader.pos < end) {
3277
- const tag = reader.uint32();
3278
- switch (tag >>> 3) {
3279
- case 2: {
3280
- if (opts.limits?.messages != null && obj.messages.length === opts.limits.messages) {
3281
- throw new CodeError('decode error - map field "messages" had too many elements', 'ERR_MAX_LENGTH');
3105
+ case 20: {
3106
+ if (opts.limits?.messageHashes != null && obj.messageHashes.length === opts.limits.messageHashes) {
3107
+ throw new MaxLengthError('Decode error - map field "messageHashes" had too many elements');
3282
3108
  }
3283
- obj.messages.push(WakuMessage.codec().decode(reader, reader.uint32(), {
3284
- limits: opts.limits?.messages$
3285
- }));
3109
+ obj.messageHashes.push(reader.bytes());
3286
3110
  break;
3287
3111
  }
3288
- case 3: {
3289
- obj.pagingInfo = PagingInfo.codec().decode(reader, reader.uint32(), {
3290
- limits: opts.limits?.pagingInfo
3291
- });
3112
+ case 51: {
3113
+ obj.paginationCursor = reader.bytes();
3292
3114
  break;
3293
3115
  }
3294
- case 4: {
3295
- obj.error = HistoryResponse.HistoryError.codec().decode(reader);
3116
+ case 52: {
3117
+ obj.paginationForward = reader.bool();
3118
+ break;
3119
+ }
3120
+ case 53: {
3121
+ obj.paginationLimit = reader.uint64();
3296
3122
  break;
3297
3123
  }
3298
3124
  default: {
@@ -3306,17 +3132,17 @@ var HistoryResponse;
3306
3132
  }
3307
3133
  return _codec;
3308
3134
  };
3309
- HistoryResponse.encode = (obj) => {
3310
- return encodeMessage(obj, HistoryResponse.codec());
3135
+ StoreQueryRequest.encode = (obj) => {
3136
+ return encodeMessage(obj, StoreQueryRequest.codec());
3311
3137
  };
3312
- HistoryResponse.decode = (buf, opts) => {
3313
- return decodeMessage(buf, HistoryResponse.codec(), opts);
3138
+ StoreQueryRequest.decode = (buf, opts) => {
3139
+ return decodeMessage(buf, StoreQueryRequest.codec(), opts);
3314
3140
  };
3315
- })(HistoryResponse || (HistoryResponse = {}));
3316
- var HistoryRpc$1;
3317
- (function (HistoryRpc) {
3141
+ })(StoreQueryRequest$1 || (StoreQueryRequest$1 = {}));
3142
+ var StoreQueryResponse$1;
3143
+ (function (StoreQueryResponse) {
3318
3144
  let _codec;
3319
- HistoryRpc.codec = () => {
3145
+ StoreQueryResponse.codec = () => {
3320
3146
  if (_codec == null) {
3321
3147
  _codec = message$1((obj, w, opts = {}) => {
3322
3148
  if (opts.lengthDelimited !== false) {
@@ -3326,20 +3152,31 @@ var HistoryRpc$1;
3326
3152
  w.uint32(10);
3327
3153
  w.string(obj.requestId);
3328
3154
  }
3329
- if (obj.query != null) {
3330
- w.uint32(18);
3331
- HistoryQuery.codec().encode(obj.query, w);
3155
+ if (obj.statusCode != null) {
3156
+ w.uint32(80);
3157
+ w.uint32(obj.statusCode);
3332
3158
  }
3333
- if (obj.response != null) {
3334
- w.uint32(26);
3335
- HistoryResponse.codec().encode(obj.response, w);
3159
+ if (obj.statusDesc != null) {
3160
+ w.uint32(90);
3161
+ w.string(obj.statusDesc);
3162
+ }
3163
+ if (obj.messages != null) {
3164
+ for (const value of obj.messages) {
3165
+ w.uint32(162);
3166
+ WakuMessageKeyValue.codec().encode(value, w);
3167
+ }
3168
+ }
3169
+ if (obj.paginationCursor != null) {
3170
+ w.uint32(410);
3171
+ w.bytes(obj.paginationCursor);
3336
3172
  }
3337
3173
  if (opts.lengthDelimited !== false) {
3338
3174
  w.ldelim();
3339
3175
  }
3340
3176
  }, (reader, length, opts = {}) => {
3341
3177
  const obj = {
3342
- requestId: ''
3178
+ requestId: '',
3179
+ messages: []
3343
3180
  };
3344
3181
  const end = length == null ? reader.len : reader.pos + length;
3345
3182
  while (reader.pos < end) {
@@ -3349,16 +3186,25 @@ var HistoryRpc$1;
3349
3186
  obj.requestId = reader.string();
3350
3187
  break;
3351
3188
  }
3352
- case 2: {
3353
- obj.query = HistoryQuery.codec().decode(reader, reader.uint32(), {
3354
- limits: opts.limits?.query
3355
- });
3189
+ case 10: {
3190
+ obj.statusCode = reader.uint32();
3356
3191
  break;
3357
3192
  }
3358
- case 3: {
3359
- obj.response = HistoryResponse.codec().decode(reader, reader.uint32(), {
3360
- limits: opts.limits?.response
3361
- });
3193
+ case 11: {
3194
+ obj.statusDesc = reader.string();
3195
+ break;
3196
+ }
3197
+ case 20: {
3198
+ if (opts.limits?.messages != null && obj.messages.length === opts.limits.messages) {
3199
+ throw new MaxLengthError('Decode error - map field "messages" had too many elements');
3200
+ }
3201
+ obj.messages.push(WakuMessageKeyValue.codec().decode(reader, reader.uint32(), {
3202
+ limits: opts.limits?.messages$
3203
+ }));
3204
+ break;
3205
+ }
3206
+ case 51: {
3207
+ obj.paginationCursor = reader.bytes();
3362
3208
  break;
3363
3209
  }
3364
3210
  default: {
@@ -3372,13 +3218,13 @@ var HistoryRpc$1;
3372
3218
  }
3373
3219
  return _codec;
3374
3220
  };
3375
- HistoryRpc.encode = (obj) => {
3376
- return encodeMessage(obj, HistoryRpc.codec());
3221
+ StoreQueryResponse.encode = (obj) => {
3222
+ return encodeMessage(obj, StoreQueryResponse.codec());
3377
3223
  };
3378
- HistoryRpc.decode = (buf, opts) => {
3379
- return decodeMessage(buf, HistoryRpc.codec(), opts);
3224
+ StoreQueryResponse.decode = (buf, opts) => {
3225
+ return decodeMessage(buf, StoreQueryResponse.codec(), opts);
3380
3226
  };
3381
- })(HistoryRpc$1 || (HistoryRpc$1 = {}));
3227
+ })(StoreQueryResponse$1 || (StoreQueryResponse$1 = {}));
3382
3228
  var RateLimitProof;
3383
3229
  (function (RateLimitProof) {
3384
3230
  let _codec;
@@ -3698,7 +3544,7 @@ var PeerExchangeResponse;
3698
3544
  switch (tag >>> 3) {
3699
3545
  case 1: {
3700
3546
  if (opts.limits?.peerInfos != null && obj.peerInfos.length === opts.limits.peerInfos) {
3701
- throw new CodeError('decode error - map field "peerInfos" had too many elements', 'ERR_MAX_LENGTH');
3547
+ throw new MaxLengthError('Decode error - map field "peerInfos" had too many elements');
3702
3548
  }
3703
3549
  obj.peerInfos.push(PeerInfo.codec().decode(reader, reader.uint32(), {
3704
3550
  limits: opts.limits?.peerInfos$
@@ -3821,7 +3667,7 @@ var WakuMetadataRequest;
3821
3667
  }
3822
3668
  case 2: {
3823
3669
  if (opts.limits?.shards != null && obj.shards.length === opts.limits.shards) {
3824
- throw new CodeError('decode error - map field "shards" had too many elements', 'ERR_MAX_LENGTH');
3670
+ throw new MaxLengthError('Decode error - map field "shards" had too many elements');
3825
3671
  }
3826
3672
  obj.shards.push(reader.uint32());
3827
3673
  break;
@@ -3880,7 +3726,7 @@ var WakuMetadataResponse;
3880
3726
  }
3881
3727
  case 2: {
3882
3728
  if (opts.limits?.shards != null && obj.shards.length === opts.limits.shards) {
3883
- throw new CodeError('decode error - map field "shards" had too many elements', 'ERR_MAX_LENGTH');
3729
+ throw new MaxLengthError('Decode error - map field "shards" had too many elements');
3884
3730
  }
3885
3731
  obj.shards.push(reader.uint32());
3886
3732
  break;
@@ -4056,4 +3902,4 @@ var version_0 = /*#__PURE__*/Object.freeze({
4056
3902
  proto: message
4057
3903
  });
4058
3904
 
4059
- export { DecodedMessage as D, Encoder as E, FilterSubscribeRequest as F, HistoryRpc$1 as H, MessagePush as M, PushRpc$1 as P, Version as V, WakuMetadataRequest as W, encode as a, FilterSubscribeResponse$1 as b, PushResponse as c, decode as d, encodingLength as e, PagingInfo as f, HistoryResponse as g, createEncoder as h, WakuMetadataResponse as i, createDecoder as j, Decoder as k, message as m, version_0 as v };
3905
+ export { DecodedMessage as D, Encoder as E, FilterSubscribeRequest as F, MessagePush as M, PushRpc$1 as P, StoreQueryRequest$1 as S, Version as V, WakuMetadataRequest as W, encode as a, FilterSubscribeResponse$1 as b, PushResponse as c, decode as d, encodingLength as e, StoreQueryResponse$1 as f, createEncoder as g, WakuMetadataResponse as h, createDecoder as i, Decoder as j, message as m, version_0 as v };