@conduitplatform/grpc-sdk 0.16.0-alpha.20 → 0.16.0-alpha.21

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 (96) hide show
  1. package/dist/classes/ConduitAuthorizedResource.js +5 -6
  2. package/dist/classes/ConduitAuthorizedResource.js.map +1 -1
  3. package/dist/classes/ConduitModule.js +59 -169
  4. package/dist/classes/ConduitModule.js.map +1 -1
  5. package/dist/classes/ConduitSchema.js +3 -4
  6. package/dist/classes/ConduitSchema.js.map +1 -1
  7. package/dist/classes/Error.js +17 -40
  8. package/dist/classes/Error.js.map +1 -1
  9. package/dist/classes/HealthCheck.js +28 -96
  10. package/dist/classes/HealthCheck.js.map +1 -1
  11. package/dist/index.js +295 -468
  12. package/dist/index.js.map +1 -1
  13. package/dist/interceptors/grpcSignedToken.js +7 -79
  14. package/dist/interceptors/grpcSignedToken.js.map +1 -1
  15. package/dist/interceptors/moduleName.js +7 -79
  16. package/dist/interceptors/moduleName.js.map +1 -1
  17. package/dist/interfaces/ConduitRouteReturn.js +9 -18
  18. package/dist/interfaces/ConduitRouteReturn.js.map +1 -1
  19. package/dist/modules/admin/index.js +13 -31
  20. package/dist/modules/admin/index.js.map +1 -1
  21. package/dist/modules/authentication/index.js +30 -50
  22. package/dist/modules/authentication/index.js.map +1 -1
  23. package/dist/modules/authorization/index.d.ts +1 -0
  24. package/dist/modules/authorization/index.js +35 -50
  25. package/dist/modules/authorization/index.js.map +1 -1
  26. package/dist/modules/chat/index.js +16 -34
  27. package/dist/modules/chat/index.js.map +1 -1
  28. package/dist/modules/config/index.d.ts +10 -1
  29. package/dist/modules/config/index.js +82 -184
  30. package/dist/modules/config/index.js.map +1 -1
  31. package/dist/modules/core/index.js +8 -26
  32. package/dist/modules/core/index.js.map +1 -1
  33. package/dist/modules/database/index.js +139 -179
  34. package/dist/modules/database/index.js.map +1 -1
  35. package/dist/modules/email/index.js +15 -33
  36. package/dist/modules/email/index.js.map +1 -1
  37. package/dist/modules/pushNotifications/index.js +38 -56
  38. package/dist/modules/pushNotifications/index.js.map +1 -1
  39. package/dist/modules/router/index.js +15 -33
  40. package/dist/modules/router/index.js.map +1 -1
  41. package/dist/modules/sms/index.js +17 -35
  42. package/dist/modules/sms/index.js.map +1 -1
  43. package/dist/modules/storage/index.js +57 -77
  44. package/dist/modules/storage/index.js.map +1 -1
  45. package/dist/protoUtils/authentication.d.ts +1 -1
  46. package/dist/protoUtils/authentication.js +267 -235
  47. package/dist/protoUtils/authentication.js.map +1 -1
  48. package/dist/protoUtils/authorization.d.ts +36 -1
  49. package/dist/protoUtils/authorization.js +494 -448
  50. package/dist/protoUtils/authorization.js.map +1 -1
  51. package/dist/protoUtils/chat.d.ts +1 -1
  52. package/dist/protoUtils/chat.js +128 -165
  53. package/dist/protoUtils/chat.js.map +1 -1
  54. package/dist/protoUtils/core.d.ts +4 -1
  55. package/dist/protoUtils/core.js +641 -573
  56. package/dist/protoUtils/core.js.map +1 -1
  57. package/dist/protoUtils/database.d.ts +1 -1
  58. package/dist/protoUtils/database.js +766 -766
  59. package/dist/protoUtils/database.js.map +1 -1
  60. package/dist/protoUtils/email.d.ts +1 -1
  61. package/dist/protoUtils/email.js +144 -174
  62. package/dist/protoUtils/email.js.map +1 -1
  63. package/dist/protoUtils/google/protobuf/empty.d.ts +1 -1
  64. package/dist/protoUtils/google/protobuf/empty.js +14 -15
  65. package/dist/protoUtils/google/protobuf/empty.js.map +1 -1
  66. package/dist/protoUtils/grpc_health_check.d.ts +1 -1
  67. package/dist/protoUtils/grpc_health_check.js +36 -34
  68. package/dist/protoUtils/grpc_health_check.js.map +1 -1
  69. package/dist/protoUtils/module.d.ts +1 -1
  70. package/dist/protoUtils/module.js +285 -293
  71. package/dist/protoUtils/module.js.map +1 -1
  72. package/dist/protoUtils/push-notifications.d.ts +1 -1
  73. package/dist/protoUtils/push-notifications.js +226 -244
  74. package/dist/protoUtils/push-notifications.js.map +1 -1
  75. package/dist/protoUtils/router.d.ts +1 -1
  76. package/dist/protoUtils/router.js +312 -320
  77. package/dist/protoUtils/router.js.map +1 -1
  78. package/dist/protoUtils/sms.d.ts +1 -1
  79. package/dist/protoUtils/sms.js +119 -109
  80. package/dist/protoUtils/sms.js.map +1 -1
  81. package/dist/protoUtils/storage.d.ts +1 -1
  82. package/dist/protoUtils/storage.js +338 -259
  83. package/dist/protoUtils/storage.js.map +1 -1
  84. package/dist/types/index.js +6 -24
  85. package/dist/types/index.js.map +1 -1
  86. package/dist/utilities/EventBus.js +20 -37
  87. package/dist/utilities/EventBus.js.map +1 -1
  88. package/dist/utilities/RedisManager.js +11 -21
  89. package/dist/utilities/RedisManager.js.map +1 -1
  90. package/dist/utilities/StateManager.js +13 -14
  91. package/dist/utilities/StateManager.js.map +1 -1
  92. package/dist/utilities/env.js +4 -4
  93. package/dist/utilities/env.js.map +1 -1
  94. package/dist/utilities/sleep.js +1 -1
  95. package/dist/utilities/sleep.js.map +1 -1
  96. package/package.json +2 -2
@@ -1,28 +1,16 @@
1
1
  "use strict";
2
- var __values = (this && this.__values) || function(o) {
3
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
- if (m) return m.call(o);
5
- if (o && typeof o.length === "number") return {
6
- next: function () {
7
- if (o && i >= o.length) o = void 0;
8
- return { value: o && o[i++], done: !o };
9
- }
10
- };
11
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
16
5
  Object.defineProperty(exports, "__esModule", { value: true });
17
6
  exports.PushNotificationsDefinition = exports.SendNotificationResponse = exports.SendManyNotificationsRequest = exports.SendNotificationToManyDevicesRequest = exports.SendNotificationRequest = exports.GetNotificationTokensResponse = exports.GetNotificationTokensRequest = exports.SetNotificationTokenResponse = exports.SetNotificationTokenRequest = void 0;
18
7
  /* eslint-disable */
19
- var minimal_1 = __importDefault(require("protobufjs/minimal"));
8
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
20
9
  function createBaseSetNotificationTokenRequest() {
21
10
  return { token: "", platform: "", userId: "" };
22
11
  }
23
12
  exports.SetNotificationTokenRequest = {
24
- encode: function (message, writer) {
25
- if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
13
+ encode(message, writer = minimal_1.default.Writer.create()) {
26
14
  if (message.token !== "") {
27
15
  writer.uint32(10).string(message.token);
28
16
  }
@@ -34,59 +22,65 @@ exports.SetNotificationTokenRequest = {
34
22
  }
35
23
  return writer;
36
24
  },
37
- decode: function (input, length) {
38
- var reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
39
- var end = length === undefined ? reader.len : reader.pos + length;
40
- var message = createBaseSetNotificationTokenRequest();
25
+ decode(input, length) {
26
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
27
+ let end = length === undefined ? reader.len : reader.pos + length;
28
+ const message = createBaseSetNotificationTokenRequest();
41
29
  while (reader.pos < end) {
42
- var tag = reader.uint32();
30
+ const tag = reader.uint32();
43
31
  switch (tag >>> 3) {
44
32
  case 1:
45
- if (tag != 10) {
33
+ if (tag !== 10) {
46
34
  break;
47
35
  }
48
36
  message.token = reader.string();
49
37
  continue;
50
38
  case 2:
51
- if (tag != 18) {
39
+ if (tag !== 18) {
52
40
  break;
53
41
  }
54
42
  message.platform = reader.string();
55
43
  continue;
56
44
  case 3:
57
- if (tag != 26) {
45
+ if (tag !== 26) {
58
46
  break;
59
47
  }
60
48
  message.userId = reader.string();
61
49
  continue;
62
50
  }
63
- if ((tag & 7) == 4 || tag == 0) {
51
+ if ((tag & 7) === 4 || tag === 0) {
64
52
  break;
65
53
  }
66
54
  reader.skipType(tag & 7);
67
55
  }
68
56
  return message;
69
57
  },
70
- fromJSON: function (object) {
58
+ fromJSON(object) {
71
59
  return {
72
- token: isSet(object.token) ? String(object.token) : "",
73
- platform: isSet(object.platform) ? String(object.platform) : "",
74
- userId: isSet(object.userId) ? String(object.userId) : "",
60
+ token: isSet(object.token) ? globalThis.String(object.token) : "",
61
+ platform: isSet(object.platform) ? globalThis.String(object.platform) : "",
62
+ userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
75
63
  };
76
64
  },
77
- toJSON: function (message) {
78
- var obj = {};
79
- message.token !== undefined && (obj.token = message.token);
80
- message.platform !== undefined && (obj.platform = message.platform);
81
- message.userId !== undefined && (obj.userId = message.userId);
65
+ toJSON(message) {
66
+ const obj = {};
67
+ if (message.token !== "") {
68
+ obj.token = message.token;
69
+ }
70
+ if (message.platform !== "") {
71
+ obj.platform = message.platform;
72
+ }
73
+ if (message.userId !== "") {
74
+ obj.userId = message.userId;
75
+ }
82
76
  return obj;
83
77
  },
84
- create: function (base) {
78
+ create(base) {
85
79
  return exports.SetNotificationTokenRequest.fromPartial(base !== null && base !== void 0 ? base : {});
86
80
  },
87
- fromPartial: function (object) {
81
+ fromPartial(object) {
88
82
  var _a, _b, _c;
89
- var message = createBaseSetNotificationTokenRequest();
83
+ const message = createBaseSetNotificationTokenRequest();
90
84
  message.token = (_a = object.token) !== null && _a !== void 0 ? _a : "";
91
85
  message.platform = (_b = object.platform) !== null && _b !== void 0 ? _b : "";
92
86
  message.userId = (_c = object.userId) !== null && _c !== void 0 ? _c : "";
@@ -97,48 +91,49 @@ function createBaseSetNotificationTokenResponse() {
97
91
  return { newTokenDocument: "" };
98
92
  }
99
93
  exports.SetNotificationTokenResponse = {
100
- encode: function (message, writer) {
101
- if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
94
+ encode(message, writer = minimal_1.default.Writer.create()) {
102
95
  if (message.newTokenDocument !== "") {
103
96
  writer.uint32(10).string(message.newTokenDocument);
104
97
  }
105
98
  return writer;
106
99
  },
107
- decode: function (input, length) {
108
- var reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
109
- var end = length === undefined ? reader.len : reader.pos + length;
110
- var message = createBaseSetNotificationTokenResponse();
100
+ decode(input, length) {
101
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
102
+ let end = length === undefined ? reader.len : reader.pos + length;
103
+ const message = createBaseSetNotificationTokenResponse();
111
104
  while (reader.pos < end) {
112
- var tag = reader.uint32();
105
+ const tag = reader.uint32();
113
106
  switch (tag >>> 3) {
114
107
  case 1:
115
- if (tag != 10) {
108
+ if (tag !== 10) {
116
109
  break;
117
110
  }
118
111
  message.newTokenDocument = reader.string();
119
112
  continue;
120
113
  }
121
- if ((tag & 7) == 4 || tag == 0) {
114
+ if ((tag & 7) === 4 || tag === 0) {
122
115
  break;
123
116
  }
124
117
  reader.skipType(tag & 7);
125
118
  }
126
119
  return message;
127
120
  },
128
- fromJSON: function (object) {
129
- return { newTokenDocument: isSet(object.newTokenDocument) ? String(object.newTokenDocument) : "" };
121
+ fromJSON(object) {
122
+ return { newTokenDocument: isSet(object.newTokenDocument) ? globalThis.String(object.newTokenDocument) : "" };
130
123
  },
131
- toJSON: function (message) {
132
- var obj = {};
133
- message.newTokenDocument !== undefined && (obj.newTokenDocument = message.newTokenDocument);
124
+ toJSON(message) {
125
+ const obj = {};
126
+ if (message.newTokenDocument !== "") {
127
+ obj.newTokenDocument = message.newTokenDocument;
128
+ }
134
129
  return obj;
135
130
  },
136
- create: function (base) {
131
+ create(base) {
137
132
  return exports.SetNotificationTokenResponse.fromPartial(base !== null && base !== void 0 ? base : {});
138
133
  },
139
- fromPartial: function (object) {
134
+ fromPartial(object) {
140
135
  var _a;
141
- var message = createBaseSetNotificationTokenResponse();
136
+ const message = createBaseSetNotificationTokenResponse();
142
137
  message.newTokenDocument = (_a = object.newTokenDocument) !== null && _a !== void 0 ? _a : "";
143
138
  return message;
144
139
  },
@@ -147,48 +142,49 @@ function createBaseGetNotificationTokensRequest() {
147
142
  return { userId: "" };
148
143
  }
149
144
  exports.GetNotificationTokensRequest = {
150
- encode: function (message, writer) {
151
- if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
145
+ encode(message, writer = minimal_1.default.Writer.create()) {
152
146
  if (message.userId !== "") {
153
147
  writer.uint32(10).string(message.userId);
154
148
  }
155
149
  return writer;
156
150
  },
157
- decode: function (input, length) {
158
- var reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
159
- var end = length === undefined ? reader.len : reader.pos + length;
160
- var message = createBaseGetNotificationTokensRequest();
151
+ decode(input, length) {
152
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
153
+ let end = length === undefined ? reader.len : reader.pos + length;
154
+ const message = createBaseGetNotificationTokensRequest();
161
155
  while (reader.pos < end) {
162
- var tag = reader.uint32();
156
+ const tag = reader.uint32();
163
157
  switch (tag >>> 3) {
164
158
  case 1:
165
- if (tag != 10) {
159
+ if (tag !== 10) {
166
160
  break;
167
161
  }
168
162
  message.userId = reader.string();
169
163
  continue;
170
164
  }
171
- if ((tag & 7) == 4 || tag == 0) {
165
+ if ((tag & 7) === 4 || tag === 0) {
172
166
  break;
173
167
  }
174
168
  reader.skipType(tag & 7);
175
169
  }
176
170
  return message;
177
171
  },
178
- fromJSON: function (object) {
179
- return { userId: isSet(object.userId) ? String(object.userId) : "" };
172
+ fromJSON(object) {
173
+ return { userId: isSet(object.userId) ? globalThis.String(object.userId) : "" };
180
174
  },
181
- toJSON: function (message) {
182
- var obj = {};
183
- message.userId !== undefined && (obj.userId = message.userId);
175
+ toJSON(message) {
176
+ const obj = {};
177
+ if (message.userId !== "") {
178
+ obj.userId = message.userId;
179
+ }
184
180
  return obj;
185
181
  },
186
- create: function (base) {
182
+ create(base) {
187
183
  return exports.GetNotificationTokensRequest.fromPartial(base !== null && base !== void 0 ? base : {});
188
184
  },
189
- fromPartial: function (object) {
185
+ fromPartial(object) {
190
186
  var _a;
191
- var message = createBaseGetNotificationTokensRequest();
187
+ const message = createBaseGetNotificationTokensRequest();
192
188
  message.userId = (_a = object.userId) !== null && _a !== void 0 ? _a : "";
193
189
  return message;
194
190
  },
@@ -197,67 +193,55 @@ function createBaseGetNotificationTokensResponse() {
197
193
  return { tokenDocuments: [] };
198
194
  }
199
195
  exports.GetNotificationTokensResponse = {
200
- encode: function (message, writer) {
201
- var e_1, _a;
202
- if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
203
- try {
204
- for (var _b = __values(message.tokenDocuments), _c = _b.next(); !_c.done; _c = _b.next()) {
205
- var v = _c.value;
206
- writer.uint32(10).string(v);
207
- }
208
- }
209
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
210
- finally {
211
- try {
212
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
213
- }
214
- finally { if (e_1) throw e_1.error; }
196
+ encode(message, writer = minimal_1.default.Writer.create()) {
197
+ for (const v of message.tokenDocuments) {
198
+ writer.uint32(10).string(v);
215
199
  }
216
200
  return writer;
217
201
  },
218
- decode: function (input, length) {
219
- var reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
220
- var end = length === undefined ? reader.len : reader.pos + length;
221
- var message = createBaseGetNotificationTokensResponse();
202
+ decode(input, length) {
203
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
204
+ let end = length === undefined ? reader.len : reader.pos + length;
205
+ const message = createBaseGetNotificationTokensResponse();
222
206
  while (reader.pos < end) {
223
- var tag = reader.uint32();
207
+ const tag = reader.uint32();
224
208
  switch (tag >>> 3) {
225
209
  case 1:
226
- if (tag != 10) {
210
+ if (tag !== 10) {
227
211
  break;
228
212
  }
229
213
  message.tokenDocuments.push(reader.string());
230
214
  continue;
231
215
  }
232
- if ((tag & 7) == 4 || tag == 0) {
216
+ if ((tag & 7) === 4 || tag === 0) {
233
217
  break;
234
218
  }
235
219
  reader.skipType(tag & 7);
236
220
  }
237
221
  return message;
238
222
  },
239
- fromJSON: function (object) {
223
+ fromJSON(object) {
240
224
  return {
241
- tokenDocuments: Array.isArray(object === null || object === void 0 ? void 0 : object.tokenDocuments) ? object.tokenDocuments.map(function (e) { return String(e); }) : [],
225
+ tokenDocuments: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.tokenDocuments)
226
+ ? object.tokenDocuments.map((e) => globalThis.String(e))
227
+ : [],
242
228
  };
243
229
  },
244
- toJSON: function (message) {
245
- var obj = {};
246
- if (message.tokenDocuments) {
247
- obj.tokenDocuments = message.tokenDocuments.map(function (e) { return e; });
248
- }
249
- else {
250
- obj.tokenDocuments = [];
230
+ toJSON(message) {
231
+ var _a;
232
+ const obj = {};
233
+ if ((_a = message.tokenDocuments) === null || _a === void 0 ? void 0 : _a.length) {
234
+ obj.tokenDocuments = message.tokenDocuments;
251
235
  }
252
236
  return obj;
253
237
  },
254
- create: function (base) {
238
+ create(base) {
255
239
  return exports.GetNotificationTokensResponse.fromPartial(base !== null && base !== void 0 ? base : {});
256
240
  },
257
- fromPartial: function (object) {
241
+ fromPartial(object) {
258
242
  var _a;
259
- var message = createBaseGetNotificationTokensResponse();
260
- message.tokenDocuments = ((_a = object.tokenDocuments) === null || _a === void 0 ? void 0 : _a.map(function (e) { return e; })) || [];
243
+ const message = createBaseGetNotificationTokensResponse();
244
+ message.tokenDocuments = ((_a = object.tokenDocuments) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
261
245
  return message;
262
246
  },
263
247
  };
@@ -273,8 +257,7 @@ function createBaseSendNotificationRequest() {
273
257
  };
274
258
  }
275
259
  exports.SendNotificationRequest = {
276
- encode: function (message, writer) {
277
- if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
260
+ encode(message, writer = minimal_1.default.Writer.create()) {
278
261
  if (message.sendTo !== "") {
279
262
  writer.uint32(10).string(message.sendTo);
280
263
  }
@@ -298,91 +281,105 @@ exports.SendNotificationRequest = {
298
281
  }
299
282
  return writer;
300
283
  },
301
- decode: function (input, length) {
302
- var reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
303
- var end = length === undefined ? reader.len : reader.pos + length;
304
- var message = createBaseSendNotificationRequest();
284
+ decode(input, length) {
285
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
286
+ let end = length === undefined ? reader.len : reader.pos + length;
287
+ const message = createBaseSendNotificationRequest();
305
288
  while (reader.pos < end) {
306
- var tag = reader.uint32();
289
+ const tag = reader.uint32();
307
290
  switch (tag >>> 3) {
308
291
  case 1:
309
- if (tag != 10) {
292
+ if (tag !== 10) {
310
293
  break;
311
294
  }
312
295
  message.sendTo = reader.string();
313
296
  continue;
314
297
  case 2:
315
- if (tag != 18) {
298
+ if (tag !== 18) {
316
299
  break;
317
300
  }
318
301
  message.title = reader.string();
319
302
  continue;
320
303
  case 3:
321
- if (tag != 26) {
304
+ if (tag !== 26) {
322
305
  break;
323
306
  }
324
307
  message.platform = reader.string();
325
308
  continue;
326
309
  case 4:
327
- if (tag != 34) {
310
+ if (tag !== 34) {
328
311
  break;
329
312
  }
330
313
  message.body = reader.string();
331
314
  continue;
332
315
  case 5:
333
- if (tag != 42) {
316
+ if (tag !== 42) {
334
317
  break;
335
318
  }
336
319
  message.data = reader.string();
337
320
  continue;
338
321
  case 6:
339
- if (tag != 48) {
322
+ if (tag !== 48) {
340
323
  break;
341
324
  }
342
325
  message.doNotStore = reader.bool();
343
326
  continue;
344
327
  case 7:
345
- if (tag != 56) {
328
+ if (tag !== 56) {
346
329
  break;
347
330
  }
348
331
  message.isSilent = reader.bool();
349
332
  continue;
350
333
  }
351
- if ((tag & 7) == 4 || tag == 0) {
334
+ if ((tag & 7) === 4 || tag === 0) {
352
335
  break;
353
336
  }
354
337
  reader.skipType(tag & 7);
355
338
  }
356
339
  return message;
357
340
  },
358
- fromJSON: function (object) {
341
+ fromJSON(object) {
359
342
  return {
360
- sendTo: isSet(object.sendTo) ? String(object.sendTo) : "",
361
- title: isSet(object.title) ? String(object.title) : undefined,
362
- platform: isSet(object.platform) ? String(object.platform) : undefined,
363
- body: isSet(object.body) ? String(object.body) : undefined,
364
- data: isSet(object.data) ? String(object.data) : undefined,
365
- doNotStore: isSet(object.doNotStore) ? Boolean(object.doNotStore) : undefined,
366
- isSilent: isSet(object.isSilent) ? Boolean(object.isSilent) : undefined,
343
+ sendTo: isSet(object.sendTo) ? globalThis.String(object.sendTo) : "",
344
+ title: isSet(object.title) ? globalThis.String(object.title) : undefined,
345
+ platform: isSet(object.platform) ? globalThis.String(object.platform) : undefined,
346
+ body: isSet(object.body) ? globalThis.String(object.body) : undefined,
347
+ data: isSet(object.data) ? globalThis.String(object.data) : undefined,
348
+ doNotStore: isSet(object.doNotStore) ? globalThis.Boolean(object.doNotStore) : undefined,
349
+ isSilent: isSet(object.isSilent) ? globalThis.Boolean(object.isSilent) : undefined,
367
350
  };
368
351
  },
369
- toJSON: function (message) {
370
- var obj = {};
371
- message.sendTo !== undefined && (obj.sendTo = message.sendTo);
372
- message.title !== undefined && (obj.title = message.title);
373
- message.platform !== undefined && (obj.platform = message.platform);
374
- message.body !== undefined && (obj.body = message.body);
375
- message.data !== undefined && (obj.data = message.data);
376
- message.doNotStore !== undefined && (obj.doNotStore = message.doNotStore);
377
- message.isSilent !== undefined && (obj.isSilent = message.isSilent);
352
+ toJSON(message) {
353
+ const obj = {};
354
+ if (message.sendTo !== "") {
355
+ obj.sendTo = message.sendTo;
356
+ }
357
+ if (message.title !== undefined) {
358
+ obj.title = message.title;
359
+ }
360
+ if (message.platform !== undefined) {
361
+ obj.platform = message.platform;
362
+ }
363
+ if (message.body !== undefined) {
364
+ obj.body = message.body;
365
+ }
366
+ if (message.data !== undefined) {
367
+ obj.data = message.data;
368
+ }
369
+ if (message.doNotStore !== undefined) {
370
+ obj.doNotStore = message.doNotStore;
371
+ }
372
+ if (message.isSilent !== undefined) {
373
+ obj.isSilent = message.isSilent;
374
+ }
378
375
  return obj;
379
376
  },
380
- create: function (base) {
377
+ create(base) {
381
378
  return exports.SendNotificationRequest.fromPartial(base !== null && base !== void 0 ? base : {});
382
379
  },
383
- fromPartial: function (object) {
380
+ fromPartial(object) {
384
381
  var _a, _b, _c, _d, _e, _f, _g;
385
- var message = createBaseSendNotificationRequest();
382
+ const message = createBaseSendNotificationRequest();
386
383
  message.sendTo = (_a = object.sendTo) !== null && _a !== void 0 ? _a : "";
387
384
  message.title = (_b = object.title) !== null && _b !== void 0 ? _b : undefined;
388
385
  message.platform = (_c = object.platform) !== null && _c !== void 0 ? _c : undefined;
@@ -405,21 +402,9 @@ function createBaseSendNotificationToManyDevicesRequest() {
405
402
  };
406
403
  }
407
404
  exports.SendNotificationToManyDevicesRequest = {
408
- encode: function (message, writer) {
409
- var e_2, _a;
410
- if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
411
- try {
412
- for (var _b = __values(message.sendTo), _c = _b.next(); !_c.done; _c = _b.next()) {
413
- var v = _c.value;
414
- writer.uint32(10).string(v);
415
- }
416
- }
417
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
418
- finally {
419
- try {
420
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
421
- }
422
- finally { if (e_2) throw e_2.error; }
405
+ encode(message, writer = minimal_1.default.Writer.create()) {
406
+ for (const v of message.sendTo) {
407
+ writer.uint32(10).string(v);
423
408
  }
424
409
  if (message.title !== undefined) {
425
410
  writer.uint32(18).string(message.title);
@@ -441,97 +426,107 @@ exports.SendNotificationToManyDevicesRequest = {
441
426
  }
442
427
  return writer;
443
428
  },
444
- decode: function (input, length) {
445
- var reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
446
- var end = length === undefined ? reader.len : reader.pos + length;
447
- var message = createBaseSendNotificationToManyDevicesRequest();
429
+ decode(input, length) {
430
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
431
+ let end = length === undefined ? reader.len : reader.pos + length;
432
+ const message = createBaseSendNotificationToManyDevicesRequest();
448
433
  while (reader.pos < end) {
449
- var tag = reader.uint32();
434
+ const tag = reader.uint32();
450
435
  switch (tag >>> 3) {
451
436
  case 1:
452
- if (tag != 10) {
437
+ if (tag !== 10) {
453
438
  break;
454
439
  }
455
440
  message.sendTo.push(reader.string());
456
441
  continue;
457
442
  case 2:
458
- if (tag != 18) {
443
+ if (tag !== 18) {
459
444
  break;
460
445
  }
461
446
  message.title = reader.string();
462
447
  continue;
463
448
  case 3:
464
- if (tag != 26) {
449
+ if (tag !== 26) {
465
450
  break;
466
451
  }
467
452
  message.body = reader.string();
468
453
  continue;
469
454
  case 4:
470
- if (tag != 34) {
455
+ if (tag !== 34) {
471
456
  break;
472
457
  }
473
458
  message.data = reader.string();
474
459
  continue;
475
460
  case 5:
476
- if (tag != 42) {
461
+ if (tag !== 42) {
477
462
  break;
478
463
  }
479
464
  message.platform = reader.string();
480
465
  continue;
481
466
  case 6:
482
- if (tag != 48) {
467
+ if (tag !== 48) {
483
468
  break;
484
469
  }
485
470
  message.doNotStore = reader.bool();
486
471
  continue;
487
472
  case 7:
488
- if (tag != 56) {
473
+ if (tag !== 56) {
489
474
  break;
490
475
  }
491
476
  message.isSilent = reader.bool();
492
477
  continue;
493
478
  }
494
- if ((tag & 7) == 4 || tag == 0) {
479
+ if ((tag & 7) === 4 || tag === 0) {
495
480
  break;
496
481
  }
497
482
  reader.skipType(tag & 7);
498
483
  }
499
484
  return message;
500
485
  },
501
- fromJSON: function (object) {
486
+ fromJSON(object) {
502
487
  return {
503
- sendTo: Array.isArray(object === null || object === void 0 ? void 0 : object.sendTo) ? object.sendTo.map(function (e) { return String(e); }) : [],
504
- title: isSet(object.title) ? String(object.title) : undefined,
505
- body: isSet(object.body) ? String(object.body) : undefined,
506
- data: isSet(object.data) ? String(object.data) : undefined,
507
- platform: isSet(object.platform) ? String(object.platform) : undefined,
508
- doNotStore: isSet(object.doNotStore) ? Boolean(object.doNotStore) : undefined,
509
- isSilent: isSet(object.isSilent) ? Boolean(object.isSilent) : undefined,
488
+ sendTo: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.sendTo) ? object.sendTo.map((e) => globalThis.String(e)) : [],
489
+ title: isSet(object.title) ? globalThis.String(object.title) : undefined,
490
+ body: isSet(object.body) ? globalThis.String(object.body) : undefined,
491
+ data: isSet(object.data) ? globalThis.String(object.data) : undefined,
492
+ platform: isSet(object.platform) ? globalThis.String(object.platform) : undefined,
493
+ doNotStore: isSet(object.doNotStore) ? globalThis.Boolean(object.doNotStore) : undefined,
494
+ isSilent: isSet(object.isSilent) ? globalThis.Boolean(object.isSilent) : undefined,
510
495
  };
511
496
  },
512
- toJSON: function (message) {
513
- var obj = {};
514
- if (message.sendTo) {
515
- obj.sendTo = message.sendTo.map(function (e) { return e; });
497
+ toJSON(message) {
498
+ var _a;
499
+ const obj = {};
500
+ if ((_a = message.sendTo) === null || _a === void 0 ? void 0 : _a.length) {
501
+ obj.sendTo = message.sendTo;
502
+ }
503
+ if (message.title !== undefined) {
504
+ obj.title = message.title;
516
505
  }
517
- else {
518
- obj.sendTo = [];
506
+ if (message.body !== undefined) {
507
+ obj.body = message.body;
508
+ }
509
+ if (message.data !== undefined) {
510
+ obj.data = message.data;
511
+ }
512
+ if (message.platform !== undefined) {
513
+ obj.platform = message.platform;
514
+ }
515
+ if (message.doNotStore !== undefined) {
516
+ obj.doNotStore = message.doNotStore;
517
+ }
518
+ if (message.isSilent !== undefined) {
519
+ obj.isSilent = message.isSilent;
519
520
  }
520
- message.title !== undefined && (obj.title = message.title);
521
- message.body !== undefined && (obj.body = message.body);
522
- message.data !== undefined && (obj.data = message.data);
523
- message.platform !== undefined && (obj.platform = message.platform);
524
- message.doNotStore !== undefined && (obj.doNotStore = message.doNotStore);
525
- message.isSilent !== undefined && (obj.isSilent = message.isSilent);
526
521
  return obj;
527
522
  },
528
- create: function (base) {
523
+ create(base) {
529
524
  return exports.SendNotificationToManyDevicesRequest.fromPartial(base !== null && base !== void 0 ? base : {});
530
525
  },
531
- fromPartial: function (object) {
526
+ fromPartial(object) {
532
527
  var _a, _b, _c, _d, _e, _f, _g;
533
- var message = createBaseSendNotificationToManyDevicesRequest();
534
- message.sendTo = ((_a = object.sendTo) === null || _a === void 0 ? void 0 : _a.map(function (e) { return e; })) || [];
528
+ const message = createBaseSendNotificationToManyDevicesRequest();
529
+ message.sendTo = ((_a = object.sendTo) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
535
530
  message.title = (_b = object.title) !== null && _b !== void 0 ? _b : undefined;
536
531
  message.body = (_c = object.body) !== null && _c !== void 0 ? _c : undefined;
537
532
  message.data = (_d = object.data) !== null && _d !== void 0 ? _d : undefined;
@@ -545,69 +540,55 @@ function createBaseSendManyNotificationsRequest() {
545
540
  return { notifications: [] };
546
541
  }
547
542
  exports.SendManyNotificationsRequest = {
548
- encode: function (message, writer) {
549
- var e_3, _a;
550
- if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
551
- try {
552
- for (var _b = __values(message.notifications), _c = _b.next(); !_c.done; _c = _b.next()) {
553
- var v = _c.value;
554
- exports.SendNotificationRequest.encode(v, writer.uint32(10).fork()).ldelim();
555
- }
556
- }
557
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
558
- finally {
559
- try {
560
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
561
- }
562
- finally { if (e_3) throw e_3.error; }
543
+ encode(message, writer = minimal_1.default.Writer.create()) {
544
+ for (const v of message.notifications) {
545
+ exports.SendNotificationRequest.encode(v, writer.uint32(10).fork()).ldelim();
563
546
  }
564
547
  return writer;
565
548
  },
566
- decode: function (input, length) {
567
- var reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
568
- var end = length === undefined ? reader.len : reader.pos + length;
569
- var message = createBaseSendManyNotificationsRequest();
549
+ decode(input, length) {
550
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
551
+ let end = length === undefined ? reader.len : reader.pos + length;
552
+ const message = createBaseSendManyNotificationsRequest();
570
553
  while (reader.pos < end) {
571
- var tag = reader.uint32();
554
+ const tag = reader.uint32();
572
555
  switch (tag >>> 3) {
573
556
  case 1:
574
- if (tag != 10) {
557
+ if (tag !== 10) {
575
558
  break;
576
559
  }
577
560
  message.notifications.push(exports.SendNotificationRequest.decode(reader, reader.uint32()));
578
561
  continue;
579
562
  }
580
- if ((tag & 7) == 4 || tag == 0) {
563
+ if ((tag & 7) === 4 || tag === 0) {
581
564
  break;
582
565
  }
583
566
  reader.skipType(tag & 7);
584
567
  }
585
568
  return message;
586
569
  },
587
- fromJSON: function (object) {
570
+ fromJSON(object) {
588
571
  return {
589
- notifications: Array.isArray(object === null || object === void 0 ? void 0 : object.notifications)
590
- ? object.notifications.map(function (e) { return exports.SendNotificationRequest.fromJSON(e); })
572
+ notifications: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.notifications)
573
+ ? object.notifications.map((e) => exports.SendNotificationRequest.fromJSON(e))
591
574
  : [],
592
575
  };
593
576
  },
594
- toJSON: function (message) {
595
- var obj = {};
596
- if (message.notifications) {
597
- obj.notifications = message.notifications.map(function (e) { return e ? exports.SendNotificationRequest.toJSON(e) : undefined; });
598
- }
599
- else {
600
- obj.notifications = [];
577
+ toJSON(message) {
578
+ var _a;
579
+ const obj = {};
580
+ if ((_a = message.notifications) === null || _a === void 0 ? void 0 : _a.length) {
581
+ obj.notifications = message.notifications.map((e) => exports.SendNotificationRequest.toJSON(e));
601
582
  }
602
583
  return obj;
603
584
  },
604
- create: function (base) {
585
+ create(base) {
605
586
  return exports.SendManyNotificationsRequest.fromPartial(base !== null && base !== void 0 ? base : {});
606
587
  },
607
- fromPartial: function (object) {
588
+ fromPartial(object) {
608
589
  var _a;
609
- var message = createBaseSendManyNotificationsRequest();
610
- message.notifications = ((_a = object.notifications) === null || _a === void 0 ? void 0 : _a.map(function (e) { return exports.SendNotificationRequest.fromPartial(e); })) || [];
590
+ const message = createBaseSendManyNotificationsRequest();
591
+ message.notifications = ((_a = object.notifications) === null || _a === void 0 ? void 0 : _a.map((e) => exports.SendNotificationRequest.fromPartial(e))) || [];
611
592
  return message;
612
593
  },
613
594
  };
@@ -615,48 +596,49 @@ function createBaseSendNotificationResponse() {
615
596
  return { message: "" };
616
597
  }
617
598
  exports.SendNotificationResponse = {
618
- encode: function (message, writer) {
619
- if (writer === void 0) { writer = minimal_1.default.Writer.create(); }
599
+ encode(message, writer = minimal_1.default.Writer.create()) {
620
600
  if (message.message !== "") {
621
601
  writer.uint32(10).string(message.message);
622
602
  }
623
603
  return writer;
624
604
  },
625
- decode: function (input, length) {
626
- var reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
627
- var end = length === undefined ? reader.len : reader.pos + length;
628
- var message = createBaseSendNotificationResponse();
605
+ decode(input, length) {
606
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
607
+ let end = length === undefined ? reader.len : reader.pos + length;
608
+ const message = createBaseSendNotificationResponse();
629
609
  while (reader.pos < end) {
630
- var tag = reader.uint32();
610
+ const tag = reader.uint32();
631
611
  switch (tag >>> 3) {
632
612
  case 1:
633
- if (tag != 10) {
613
+ if (tag !== 10) {
634
614
  break;
635
615
  }
636
616
  message.message = reader.string();
637
617
  continue;
638
618
  }
639
- if ((tag & 7) == 4 || tag == 0) {
619
+ if ((tag & 7) === 4 || tag === 0) {
640
620
  break;
641
621
  }
642
622
  reader.skipType(tag & 7);
643
623
  }
644
624
  return message;
645
625
  },
646
- fromJSON: function (object) {
647
- return { message: isSet(object.message) ? String(object.message) : "" };
626
+ fromJSON(object) {
627
+ return { message: isSet(object.message) ? globalThis.String(object.message) : "" };
648
628
  },
649
- toJSON: function (message) {
650
- var obj = {};
651
- message.message !== undefined && (obj.message = message.message);
629
+ toJSON(message) {
630
+ const obj = {};
631
+ if (message.message !== "") {
632
+ obj.message = message.message;
633
+ }
652
634
  return obj;
653
635
  },
654
- create: function (base) {
636
+ create(base) {
655
637
  return exports.SendNotificationResponse.fromPartial(base !== null && base !== void 0 ? base : {});
656
638
  },
657
- fromPartial: function (object) {
639
+ fromPartial(object) {
658
640
  var _a;
659
- var message = createBaseSendNotificationResponse();
641
+ const message = createBaseSendNotificationResponse();
660
642
  message.message = (_a = object.message) !== null && _a !== void 0 ? _a : "";
661
643
  return message;
662
644
  },