@conduitplatform/grpc-sdk 0.16.5 → 0.16.6

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