@coralogix/rum-cli 1.1.21 → 1.1.22

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 (89) hide show
  1. package/README.md +8 -4
  2. package/api/rum-api.ts +1 -1
  3. package/cli/commands/delete-source-maps-command.ts +1 -1
  4. package/cli/commands/index.ts +5 -4
  5. package/cli/commands/update-source-maps-command.ts +1 -1
  6. package/cli/commands/upload-react-native-source-maps-command.ts +39 -0
  7. package/cli/commands/upload-source-maps-command.ts +1 -1
  8. package/cli/rum-cli.ts +8 -7
  9. package/dist/api/rum-api.js +2 -2
  10. package/dist/cli/commands/delete-source-maps-command.d.ts +1 -1
  11. package/dist/cli/commands/delete-source-maps-command.js +4 -4
  12. package/dist/cli/commands/index.d.ts +4 -3
  13. package/dist/cli/commands/index.js +3 -2
  14. package/dist/cli/commands/update-source-maps-command.d.ts +1 -1
  15. package/dist/cli/commands/update-source-maps-command.js +4 -4
  16. package/dist/cli/commands/upload-react-native-source-maps-command.d.ts +2 -0
  17. package/dist/cli/commands/upload-react-native-source-maps-command.js +47 -0
  18. package/dist/cli/commands/upload-source-maps-command.d.ts +1 -1
  19. package/dist/cli/commands/upload-source-maps-command.js +4 -4
  20. package/dist/cli/rum-cli.js +9 -7
  21. package/dist/proto-models/com/coralogix/rum/v2/analytics.d.ts +1 -1
  22. package/dist/proto-models/com/coralogix/rum/v2/analytics.js +115 -102
  23. package/dist/proto-models/com/coralogix/rum/v2/audit_log.d.ts +1 -1
  24. package/dist/proto-models/com/coralogix/rum/v2/audit_log.js +5 -3
  25. package/dist/proto-models/com/coralogix/rum/v2/chunk.d.ts +1 -1
  26. package/dist/proto-models/com/coralogix/rum/v2/chunk.js +54 -49
  27. package/dist/proto-models/com/coralogix/rum/v2/file.d.ts +1 -1
  28. package/dist/proto-models/com/coralogix/rum/v2/file.js +24 -34
  29. package/dist/proto-models/com/coralogix/rum/v2/rum_react_native_source_map_service.d.ts +69 -0
  30. package/dist/proto-models/com/coralogix/rum/v2/rum_react_native_source_map_service.js +189 -0
  31. package/dist/proto-models/com/coralogix/rum/v2/rum_saved_filters_service.d.ts +526 -0
  32. package/dist/proto-models/com/coralogix/rum/v2/rum_saved_filters_service.js +1560 -0
  33. package/dist/proto-models/com/coralogix/rum/v2/rum_service.d.ts +98 -3
  34. package/dist/proto-models/com/coralogix/rum/v2/rum_service.js +475 -127
  35. package/dist/proto-models/com/coralogix/rum/v2/rum_session_recording_service.d.ts +1 -59
  36. package/dist/proto-models/com/coralogix/rum/v2/rum_session_recording_service.js +4 -175
  37. package/dist/proto-models/com/coralogix/rum/v2/rum_snooze_errors_service.d.ts +261 -0
  38. package/dist/proto-models/com/coralogix/rum/v2/rum_snooze_errors_service.js +698 -0
  39. package/dist/proto-models/com/coralogix/rum/v2/rum_source_map_service.d.ts +1 -1
  40. package/dist/proto-models/com/coralogix/rum/v2/rum_source_map_service.js +65 -41
  41. package/dist/proto-models/com/coralogix/rum/v2/saved_filter.d.ts +55 -0
  42. package/dist/proto-models/com/coralogix/rum/v2/saved_filter.js +267 -0
  43. package/dist/proto-models/com/coralogix/rum/v2/snooze_errors.d.ts +109 -0
  44. package/dist/proto-models/com/coralogix/rum/v2/snooze_errors.js +580 -0
  45. package/dist/proto-models/com/coralogix/rum/v2/source_code_file_mapping.d.ts +1 -1
  46. package/dist/proto-models/com/coralogix/rum/v2/source_code_file_mapping.js +47 -24
  47. package/dist/proto-models/com/coralogix/rum/v2/source_map_release.d.ts +1 -1
  48. package/dist/proto-models/com/coralogix/rum/v2/source_map_release.js +43 -38
  49. package/dist/proto-models/com/coralogix/rum/v2/template.d.ts +14 -1
  50. package/dist/proto-models/com/coralogix/rum/v2/template.js +148 -54
  51. package/dist/proto-models/google/protobuf/descriptor.d.ts +1 -1
  52. package/dist/proto-models/google/protobuf/descriptor.js +537 -427
  53. package/dist/services/react-native-source-maps.service.d.ts +3 -0
  54. package/dist/services/react-native-source-maps.service.js +42 -0
  55. package/dist/services/source-maps.service.js +3 -3
  56. package/dist/utils/index.d.ts +1 -1
  57. package/dist/utils/index.js +4 -4
  58. package/package.json +1 -1
  59. package/proto-models/com/coralogix/rum/v2/analytics.ts +113 -108
  60. package/proto-models/com/coralogix/rum/v2/audit_log.ts +6 -4
  61. package/proto-models/com/coralogix/rum/v2/chunk.ts +55 -56
  62. package/proto-models/com/coralogix/rum/v2/file.ts +25 -39
  63. package/proto-models/com/coralogix/rum/v2/rum_react_native_source_map_service.ts +223 -0
  64. package/proto-models/com/coralogix/rum/v2/rum_saved_filters_service.ts +1837 -0
  65. package/proto-models/com/coralogix/rum/v2/rum_service.ts +533 -146
  66. package/proto-models/com/coralogix/rum/v2/rum_session_recording_service.ts +1 -208
  67. package/proto-models/com/coralogix/rum/v2/rum_snooze_errors_service.ts +818 -0
  68. package/proto-models/com/coralogix/rum/v2/rum_source_map_service.ts +65 -46
  69. package/proto-models/com/coralogix/rum/v2/saved_filter.ts +301 -0
  70. package/proto-models/com/coralogix/rum/v2/snooze_errors.ts +656 -0
  71. package/proto-models/com/coralogix/rum/v2/source_code_file_mapping.ts +48 -27
  72. package/proto-models/com/coralogix/rum/v2/source_map_release.ts +44 -44
  73. package/proto-models/com/coralogix/rum/v2/template.ts +161 -59
  74. package/proto-models/google/protobuf/descriptor.ts +551 -464
  75. package/protofetch.lock +2 -2
  76. package/protofetch.toml +1 -1
  77. package/protos/com/coralogix/rum/v2/rum_react_native_source_map_service.proto +19 -0
  78. package/protos/com/coralogix/rum/v2/rum_saved_filters_service.proto +128 -0
  79. package/protos/com/coralogix/rum/v2/rum_service.proto +26 -0
  80. package/protos/com/coralogix/rum/v2/rum_session_recording_service.proto +1 -12
  81. package/protos/com/coralogix/rum/v2/rum_snooze_errors_service.proto +64 -0
  82. package/protos/com/coralogix/rum/v2/rum_source_map_service.proto +1 -1
  83. package/protos/com/coralogix/rum/v2/saved_filter.proto +28 -0
  84. package/protos/com/coralogix/rum/v2/snooze_errors.proto +55 -0
  85. package/protos/com/coralogix/rum/v2/template.proto +6 -0
  86. package/protoset.bin +0 -0
  87. package/services/react-native-source-maps.service.ts +40 -0
  88. package/services/source-maps.service.ts +2 -2
  89. package/utils/index.ts +3 -3
@@ -0,0 +1,656 @@
1
+ /* eslint-disable */
2
+ import Long from "long";
3
+ import _m0 from "protobufjs/minimal";
4
+
5
+ export const protobufPackage = "com.coralogix.rum.v2";
6
+
7
+ export enum SnoozeType {
8
+ SNOOZE_TYPE_UNSPECIFIED = 0,
9
+ SNOOZE_TYPE_TEMPLATE_ID = 1,
10
+ SNOOZE_TYPE_CATEGORY = 2,
11
+ }
12
+
13
+ export function snoozeTypeFromJSON(object: any): SnoozeType {
14
+ switch (object) {
15
+ case 0:
16
+ case "SNOOZE_TYPE_UNSPECIFIED":
17
+ return SnoozeType.SNOOZE_TYPE_UNSPECIFIED;
18
+ case 1:
19
+ case "SNOOZE_TYPE_TEMPLATE_ID":
20
+ return SnoozeType.SNOOZE_TYPE_TEMPLATE_ID;
21
+ case 2:
22
+ case "SNOOZE_TYPE_CATEGORY":
23
+ return SnoozeType.SNOOZE_TYPE_CATEGORY;
24
+ default:
25
+ throw new globalThis.Error("Unrecognized enum value " + object + " for enum SnoozeType");
26
+ }
27
+ }
28
+
29
+ export function snoozeTypeToJSON(object: SnoozeType): string {
30
+ switch (object) {
31
+ case SnoozeType.SNOOZE_TYPE_UNSPECIFIED:
32
+ return "SNOOZE_TYPE_UNSPECIFIED";
33
+ case SnoozeType.SNOOZE_TYPE_TEMPLATE_ID:
34
+ return "SNOOZE_TYPE_TEMPLATE_ID";
35
+ case SnoozeType.SNOOZE_TYPE_CATEGORY:
36
+ return "SNOOZE_TYPE_CATEGORY";
37
+ default:
38
+ throw new globalThis.Error("Unrecognized enum value " + object + " for enum SnoozeType");
39
+ }
40
+ }
41
+
42
+ export enum SnoozeCondition {
43
+ SNOOZE_CONDITION_UNSPECIFIED = 0,
44
+ SNOOZE_CONDITION_TIME = 1,
45
+ }
46
+
47
+ export function snoozeConditionFromJSON(object: any): SnoozeCondition {
48
+ switch (object) {
49
+ case 0:
50
+ case "SNOOZE_CONDITION_UNSPECIFIED":
51
+ return SnoozeCondition.SNOOZE_CONDITION_UNSPECIFIED;
52
+ case 1:
53
+ case "SNOOZE_CONDITION_TIME":
54
+ return SnoozeCondition.SNOOZE_CONDITION_TIME;
55
+ default:
56
+ throw new globalThis.Error("Unrecognized enum value " + object + " for enum SnoozeCondition");
57
+ }
58
+ }
59
+
60
+ export function snoozeConditionToJSON(object: SnoozeCondition): string {
61
+ switch (object) {
62
+ case SnoozeCondition.SNOOZE_CONDITION_UNSPECIFIED:
63
+ return "SNOOZE_CONDITION_UNSPECIFIED";
64
+ case SnoozeCondition.SNOOZE_CONDITION_TIME:
65
+ return "SNOOZE_CONDITION_TIME";
66
+ default:
67
+ throw new globalThis.Error("Unrecognized enum value " + object + " for enum SnoozeCondition");
68
+ }
69
+ }
70
+
71
+ export enum SnoozeStatus {
72
+ SNOOZE_STATUS_UNSPECIFIED = 0,
73
+ SNOOZE_STATUS_ACTIVE = 1,
74
+ SNOOZE_STATUS_EXPIRING_SOON = 2,
75
+ SNOOZE_STATUS_UPDATED = 3,
76
+ }
77
+
78
+ export function snoozeStatusFromJSON(object: any): SnoozeStatus {
79
+ switch (object) {
80
+ case 0:
81
+ case "SNOOZE_STATUS_UNSPECIFIED":
82
+ return SnoozeStatus.SNOOZE_STATUS_UNSPECIFIED;
83
+ case 1:
84
+ case "SNOOZE_STATUS_ACTIVE":
85
+ return SnoozeStatus.SNOOZE_STATUS_ACTIVE;
86
+ case 2:
87
+ case "SNOOZE_STATUS_EXPIRING_SOON":
88
+ return SnoozeStatus.SNOOZE_STATUS_EXPIRING_SOON;
89
+ case 3:
90
+ case "SNOOZE_STATUS_UPDATED":
91
+ return SnoozeStatus.SNOOZE_STATUS_UPDATED;
92
+ default:
93
+ throw new globalThis.Error("Unrecognized enum value " + object + " for enum SnoozeStatus");
94
+ }
95
+ }
96
+
97
+ export function snoozeStatusToJSON(object: SnoozeStatus): string {
98
+ switch (object) {
99
+ case SnoozeStatus.SNOOZE_STATUS_UNSPECIFIED:
100
+ return "SNOOZE_STATUS_UNSPECIFIED";
101
+ case SnoozeStatus.SNOOZE_STATUS_ACTIVE:
102
+ return "SNOOZE_STATUS_ACTIVE";
103
+ case SnoozeStatus.SNOOZE_STATUS_EXPIRING_SOON:
104
+ return "SNOOZE_STATUS_EXPIRING_SOON";
105
+ case SnoozeStatus.SNOOZE_STATUS_UPDATED:
106
+ return "SNOOZE_STATUS_UPDATED";
107
+ default:
108
+ throw new globalThis.Error("Unrecognized enum value " + object + " for enum SnoozeStatus");
109
+ }
110
+ }
111
+
112
+ export interface Category {
113
+ key: string;
114
+ values: string[];
115
+ }
116
+
117
+ export interface Categories {
118
+ categories: Category[];
119
+ }
120
+
121
+ export interface TimeCondition {
122
+ endTime: number;
123
+ }
124
+
125
+ export interface TimeBasedSnooze {
126
+ snoozeDetails?: { $case: "categories"; categories: Categories } | { $case: "template"; template: string } | undefined;
127
+ endTime: number;
128
+ }
129
+
130
+ export interface Management {
131
+ snoozeType: SnoozeType;
132
+ snoozeCondition: SnoozeCondition;
133
+ snoozeStatus: SnoozeStatus;
134
+ initialTime: number;
135
+ expiresTime: number;
136
+ snoozeDetails?: { $case: "template"; template: string } | { $case: "categories"; categories: Categories } | undefined;
137
+ id: string;
138
+ }
139
+
140
+ function createBaseCategory(): Category {
141
+ return { key: "", values: [] };
142
+ }
143
+
144
+ export const Category = {
145
+ encode(message: Category, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
146
+ if (message.key !== "") {
147
+ writer.uint32(10).string(message.key);
148
+ }
149
+ for (const v of message.values) {
150
+ writer.uint32(18).string(v!);
151
+ }
152
+ return writer;
153
+ },
154
+
155
+ decode(input: _m0.Reader | Uint8Array, length?: number): Category {
156
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
157
+ let end = length === undefined ? reader.len : reader.pos + length;
158
+ const message = createBaseCategory();
159
+ while (reader.pos < end) {
160
+ const tag = reader.uint32();
161
+ switch (tag >>> 3) {
162
+ case 1:
163
+ if (tag !== 10) {
164
+ break;
165
+ }
166
+
167
+ message.key = reader.string();
168
+ continue;
169
+ case 2:
170
+ if (tag !== 18) {
171
+ break;
172
+ }
173
+
174
+ message.values.push(reader.string());
175
+ continue;
176
+ }
177
+ if ((tag & 7) === 4 || tag === 0) {
178
+ break;
179
+ }
180
+ reader.skipType(tag & 7);
181
+ }
182
+ return message;
183
+ },
184
+
185
+ fromJSON(object: any): Category {
186
+ return {
187
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
188
+ values: globalThis.Array.isArray(object?.values) ? object.values.map((e: any) => globalThis.String(e)) : [],
189
+ };
190
+ },
191
+
192
+ toJSON(message: Category): unknown {
193
+ const obj: any = {};
194
+ if (message.key !== "") {
195
+ obj.key = message.key;
196
+ }
197
+ if (message.values?.length) {
198
+ obj.values = message.values;
199
+ }
200
+ return obj;
201
+ },
202
+
203
+ create(base?: DeepPartial<Category>): Category {
204
+ return Category.fromPartial(base ?? {});
205
+ },
206
+ fromPartial(object: DeepPartial<Category>): Category {
207
+ const message = createBaseCategory();
208
+ message.key = object.key ?? "";
209
+ message.values = object.values?.map((e) => e) || [];
210
+ return message;
211
+ },
212
+ };
213
+
214
+ function createBaseCategories(): Categories {
215
+ return { categories: [] };
216
+ }
217
+
218
+ export const Categories = {
219
+ encode(message: Categories, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
220
+ for (const v of message.categories) {
221
+ Category.encode(v!, writer.uint32(10).fork()).ldelim();
222
+ }
223
+ return writer;
224
+ },
225
+
226
+ decode(input: _m0.Reader | Uint8Array, length?: number): Categories {
227
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
228
+ let end = length === undefined ? reader.len : reader.pos + length;
229
+ const message = createBaseCategories();
230
+ while (reader.pos < end) {
231
+ const tag = reader.uint32();
232
+ switch (tag >>> 3) {
233
+ case 1:
234
+ if (tag !== 10) {
235
+ break;
236
+ }
237
+
238
+ message.categories.push(Category.decode(reader, reader.uint32()));
239
+ continue;
240
+ }
241
+ if ((tag & 7) === 4 || tag === 0) {
242
+ break;
243
+ }
244
+ reader.skipType(tag & 7);
245
+ }
246
+ return message;
247
+ },
248
+
249
+ fromJSON(object: any): Categories {
250
+ return {
251
+ categories: globalThis.Array.isArray(object?.categories)
252
+ ? object.categories.map((e: any) => Category.fromJSON(e))
253
+ : [],
254
+ };
255
+ },
256
+
257
+ toJSON(message: Categories): unknown {
258
+ const obj: any = {};
259
+ if (message.categories?.length) {
260
+ obj.categories = message.categories.map((e) => Category.toJSON(e));
261
+ }
262
+ return obj;
263
+ },
264
+
265
+ create(base?: DeepPartial<Categories>): Categories {
266
+ return Categories.fromPartial(base ?? {});
267
+ },
268
+ fromPartial(object: DeepPartial<Categories>): Categories {
269
+ const message = createBaseCategories();
270
+ message.categories = object.categories?.map((e) => Category.fromPartial(e)) || [];
271
+ return message;
272
+ },
273
+ };
274
+
275
+ function createBaseTimeCondition(): TimeCondition {
276
+ return { endTime: 0 };
277
+ }
278
+
279
+ export const TimeCondition = {
280
+ encode(message: TimeCondition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
281
+ if (message.endTime !== 0) {
282
+ writer.uint32(8).int64(message.endTime);
283
+ }
284
+ return writer;
285
+ },
286
+
287
+ decode(input: _m0.Reader | Uint8Array, length?: number): TimeCondition {
288
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
289
+ let end = length === undefined ? reader.len : reader.pos + length;
290
+ const message = createBaseTimeCondition();
291
+ while (reader.pos < end) {
292
+ const tag = reader.uint32();
293
+ switch (tag >>> 3) {
294
+ case 1:
295
+ if (tag !== 8) {
296
+ break;
297
+ }
298
+
299
+ message.endTime = longToNumber(reader.int64() as Long);
300
+ continue;
301
+ }
302
+ if ((tag & 7) === 4 || tag === 0) {
303
+ break;
304
+ }
305
+ reader.skipType(tag & 7);
306
+ }
307
+ return message;
308
+ },
309
+
310
+ fromJSON(object: any): TimeCondition {
311
+ return { endTime: isSet(object.endTime) ? globalThis.Number(object.endTime) : 0 };
312
+ },
313
+
314
+ toJSON(message: TimeCondition): unknown {
315
+ const obj: any = {};
316
+ if (message.endTime !== 0) {
317
+ obj.endTime = Math.round(message.endTime);
318
+ }
319
+ return obj;
320
+ },
321
+
322
+ create(base?: DeepPartial<TimeCondition>): TimeCondition {
323
+ return TimeCondition.fromPartial(base ?? {});
324
+ },
325
+ fromPartial(object: DeepPartial<TimeCondition>): TimeCondition {
326
+ const message = createBaseTimeCondition();
327
+ message.endTime = object.endTime ?? 0;
328
+ return message;
329
+ },
330
+ };
331
+
332
+ function createBaseTimeBasedSnooze(): TimeBasedSnooze {
333
+ return { snoozeDetails: undefined, endTime: 0 };
334
+ }
335
+
336
+ export const TimeBasedSnooze = {
337
+ encode(message: TimeBasedSnooze, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
338
+ switch (message.snoozeDetails?.$case) {
339
+ case "categories":
340
+ Categories.encode(message.snoozeDetails.categories, writer.uint32(10).fork()).ldelim();
341
+ break;
342
+ case "template":
343
+ writer.uint32(18).string(message.snoozeDetails.template);
344
+ break;
345
+ }
346
+ if (message.endTime !== 0) {
347
+ writer.uint32(24).int64(message.endTime);
348
+ }
349
+ return writer;
350
+ },
351
+
352
+ decode(input: _m0.Reader | Uint8Array, length?: number): TimeBasedSnooze {
353
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
354
+ let end = length === undefined ? reader.len : reader.pos + length;
355
+ const message = createBaseTimeBasedSnooze();
356
+ while (reader.pos < end) {
357
+ const tag = reader.uint32();
358
+ switch (tag >>> 3) {
359
+ case 1:
360
+ if (tag !== 10) {
361
+ break;
362
+ }
363
+
364
+ message.snoozeDetails = { $case: "categories", categories: Categories.decode(reader, reader.uint32()) };
365
+ continue;
366
+ case 2:
367
+ if (tag !== 18) {
368
+ break;
369
+ }
370
+
371
+ message.snoozeDetails = { $case: "template", template: reader.string() };
372
+ continue;
373
+ case 3:
374
+ if (tag !== 24) {
375
+ break;
376
+ }
377
+
378
+ message.endTime = longToNumber(reader.int64() as Long);
379
+ continue;
380
+ }
381
+ if ((tag & 7) === 4 || tag === 0) {
382
+ break;
383
+ }
384
+ reader.skipType(tag & 7);
385
+ }
386
+ return message;
387
+ },
388
+
389
+ fromJSON(object: any): TimeBasedSnooze {
390
+ return {
391
+ snoozeDetails: isSet(object.categories)
392
+ ? { $case: "categories", categories: Categories.fromJSON(object.categories) }
393
+ : isSet(object.template)
394
+ ? { $case: "template", template: globalThis.String(object.template) }
395
+ : undefined,
396
+ endTime: isSet(object.endTime) ? globalThis.Number(object.endTime) : 0,
397
+ };
398
+ },
399
+
400
+ toJSON(message: TimeBasedSnooze): unknown {
401
+ const obj: any = {};
402
+ if (message.snoozeDetails?.$case === "categories") {
403
+ obj.categories = Categories.toJSON(message.snoozeDetails.categories);
404
+ }
405
+ if (message.snoozeDetails?.$case === "template") {
406
+ obj.template = message.snoozeDetails.template;
407
+ }
408
+ if (message.endTime !== 0) {
409
+ obj.endTime = Math.round(message.endTime);
410
+ }
411
+ return obj;
412
+ },
413
+
414
+ create(base?: DeepPartial<TimeBasedSnooze>): TimeBasedSnooze {
415
+ return TimeBasedSnooze.fromPartial(base ?? {});
416
+ },
417
+ fromPartial(object: DeepPartial<TimeBasedSnooze>): TimeBasedSnooze {
418
+ const message = createBaseTimeBasedSnooze();
419
+ if (
420
+ object.snoozeDetails?.$case === "categories" &&
421
+ object.snoozeDetails?.categories !== undefined &&
422
+ object.snoozeDetails?.categories !== null
423
+ ) {
424
+ message.snoozeDetails = {
425
+ $case: "categories",
426
+ categories: Categories.fromPartial(object.snoozeDetails.categories),
427
+ };
428
+ }
429
+ if (
430
+ object.snoozeDetails?.$case === "template" &&
431
+ object.snoozeDetails?.template !== undefined &&
432
+ object.snoozeDetails?.template !== null
433
+ ) {
434
+ message.snoozeDetails = { $case: "template", template: object.snoozeDetails.template };
435
+ }
436
+ message.endTime = object.endTime ?? 0;
437
+ return message;
438
+ },
439
+ };
440
+
441
+ function createBaseManagement(): Management {
442
+ return {
443
+ snoozeType: 0,
444
+ snoozeCondition: 0,
445
+ snoozeStatus: 0,
446
+ initialTime: 0,
447
+ expiresTime: 0,
448
+ snoozeDetails: undefined,
449
+ id: "",
450
+ };
451
+ }
452
+
453
+ export const Management = {
454
+ encode(message: Management, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
455
+ if (message.snoozeType !== 0) {
456
+ writer.uint32(8).int32(message.snoozeType);
457
+ }
458
+ if (message.snoozeCondition !== 0) {
459
+ writer.uint32(16).int32(message.snoozeCondition);
460
+ }
461
+ if (message.snoozeStatus !== 0) {
462
+ writer.uint32(24).int32(message.snoozeStatus);
463
+ }
464
+ if (message.initialTime !== 0) {
465
+ writer.uint32(32).int64(message.initialTime);
466
+ }
467
+ if (message.expiresTime !== 0) {
468
+ writer.uint32(40).int64(message.expiresTime);
469
+ }
470
+ switch (message.snoozeDetails?.$case) {
471
+ case "template":
472
+ writer.uint32(50).string(message.snoozeDetails.template);
473
+ break;
474
+ case "categories":
475
+ Categories.encode(message.snoozeDetails.categories, writer.uint32(58).fork()).ldelim();
476
+ break;
477
+ }
478
+ if (message.id !== "") {
479
+ writer.uint32(66).string(message.id);
480
+ }
481
+ return writer;
482
+ },
483
+
484
+ decode(input: _m0.Reader | Uint8Array, length?: number): Management {
485
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
486
+ let end = length === undefined ? reader.len : reader.pos + length;
487
+ const message = createBaseManagement();
488
+ while (reader.pos < end) {
489
+ const tag = reader.uint32();
490
+ switch (tag >>> 3) {
491
+ case 1:
492
+ if (tag !== 8) {
493
+ break;
494
+ }
495
+
496
+ message.snoozeType = reader.int32() as any;
497
+ continue;
498
+ case 2:
499
+ if (tag !== 16) {
500
+ break;
501
+ }
502
+
503
+ message.snoozeCondition = reader.int32() as any;
504
+ continue;
505
+ case 3:
506
+ if (tag !== 24) {
507
+ break;
508
+ }
509
+
510
+ message.snoozeStatus = reader.int32() as any;
511
+ continue;
512
+ case 4:
513
+ if (tag !== 32) {
514
+ break;
515
+ }
516
+
517
+ message.initialTime = longToNumber(reader.int64() as Long);
518
+ continue;
519
+ case 5:
520
+ if (tag !== 40) {
521
+ break;
522
+ }
523
+
524
+ message.expiresTime = longToNumber(reader.int64() as Long);
525
+ continue;
526
+ case 6:
527
+ if (tag !== 50) {
528
+ break;
529
+ }
530
+
531
+ message.snoozeDetails = { $case: "template", template: reader.string() };
532
+ continue;
533
+ case 7:
534
+ if (tag !== 58) {
535
+ break;
536
+ }
537
+
538
+ message.snoozeDetails = { $case: "categories", categories: Categories.decode(reader, reader.uint32()) };
539
+ continue;
540
+ case 8:
541
+ if (tag !== 66) {
542
+ break;
543
+ }
544
+
545
+ message.id = reader.string();
546
+ continue;
547
+ }
548
+ if ((tag & 7) === 4 || tag === 0) {
549
+ break;
550
+ }
551
+ reader.skipType(tag & 7);
552
+ }
553
+ return message;
554
+ },
555
+
556
+ fromJSON(object: any): Management {
557
+ return {
558
+ snoozeType: isSet(object.snoozeType) ? snoozeTypeFromJSON(object.snoozeType) : 0,
559
+ snoozeCondition: isSet(object.snoozeCondition) ? snoozeConditionFromJSON(object.snoozeCondition) : 0,
560
+ snoozeStatus: isSet(object.snoozeStatus) ? snoozeStatusFromJSON(object.snoozeStatus) : 0,
561
+ initialTime: isSet(object.initialTime) ? globalThis.Number(object.initialTime) : 0,
562
+ expiresTime: isSet(object.expiresTime) ? globalThis.Number(object.expiresTime) : 0,
563
+ snoozeDetails: isSet(object.template)
564
+ ? { $case: "template", template: globalThis.String(object.template) }
565
+ : isSet(object.categories)
566
+ ? { $case: "categories", categories: Categories.fromJSON(object.categories) }
567
+ : undefined,
568
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
569
+ };
570
+ },
571
+
572
+ toJSON(message: Management): unknown {
573
+ const obj: any = {};
574
+ if (message.snoozeType !== 0) {
575
+ obj.snoozeType = snoozeTypeToJSON(message.snoozeType);
576
+ }
577
+ if (message.snoozeCondition !== 0) {
578
+ obj.snoozeCondition = snoozeConditionToJSON(message.snoozeCondition);
579
+ }
580
+ if (message.snoozeStatus !== 0) {
581
+ obj.snoozeStatus = snoozeStatusToJSON(message.snoozeStatus);
582
+ }
583
+ if (message.initialTime !== 0) {
584
+ obj.initialTime = Math.round(message.initialTime);
585
+ }
586
+ if (message.expiresTime !== 0) {
587
+ obj.expiresTime = Math.round(message.expiresTime);
588
+ }
589
+ if (message.snoozeDetails?.$case === "template") {
590
+ obj.template = message.snoozeDetails.template;
591
+ }
592
+ if (message.snoozeDetails?.$case === "categories") {
593
+ obj.categories = Categories.toJSON(message.snoozeDetails.categories);
594
+ }
595
+ if (message.id !== "") {
596
+ obj.id = message.id;
597
+ }
598
+ return obj;
599
+ },
600
+
601
+ create(base?: DeepPartial<Management>): Management {
602
+ return Management.fromPartial(base ?? {});
603
+ },
604
+ fromPartial(object: DeepPartial<Management>): Management {
605
+ const message = createBaseManagement();
606
+ message.snoozeType = object.snoozeType ?? 0;
607
+ message.snoozeCondition = object.snoozeCondition ?? 0;
608
+ message.snoozeStatus = object.snoozeStatus ?? 0;
609
+ message.initialTime = object.initialTime ?? 0;
610
+ message.expiresTime = object.expiresTime ?? 0;
611
+ if (
612
+ object.snoozeDetails?.$case === "template" &&
613
+ object.snoozeDetails?.template !== undefined &&
614
+ object.snoozeDetails?.template !== null
615
+ ) {
616
+ message.snoozeDetails = { $case: "template", template: object.snoozeDetails.template };
617
+ }
618
+ if (
619
+ object.snoozeDetails?.$case === "categories" &&
620
+ object.snoozeDetails?.categories !== undefined &&
621
+ object.snoozeDetails?.categories !== null
622
+ ) {
623
+ message.snoozeDetails = {
624
+ $case: "categories",
625
+ categories: Categories.fromPartial(object.snoozeDetails.categories),
626
+ };
627
+ }
628
+ message.id = object.id ?? "";
629
+ return message;
630
+ },
631
+ };
632
+
633
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
634
+
635
+ export type DeepPartial<T> = T extends Builtin ? T
636
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
637
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
638
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
639
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
640
+ : Partial<T>;
641
+
642
+ function longToNumber(long: Long): number {
643
+ if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
644
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
645
+ }
646
+ return long.toNumber();
647
+ }
648
+
649
+ if (_m0.util.Long !== Long) {
650
+ _m0.util.Long = Long as any;
651
+ _m0.configure();
652
+ }
653
+
654
+ function isSet(value: any): boolean {
655
+ return value !== null && value !== undefined;
656
+ }