@coralogix/rum-cli 1.1.25 → 1.1.27

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