@coralogix/rum-cli 1.1.21 → 1.1.24

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 (206) hide show
  1. package/README.md +32 -9
  2. package/api/client/client-factory.ts +26 -0
  3. package/api/client/request-builder.ts +122 -0
  4. package/api/dsym.api.ts +61 -0
  5. package/api/react-native.api.ts +67 -0
  6. package/api/{rum-api.ts → source-maps.api.ts} +15 -23
  7. package/cli/commands/dsym/index.ts +5 -0
  8. package/cli/commands/dsym/upload-dsym-command.ts +36 -0
  9. package/cli/commands/react-native/index.ts +5 -0
  10. package/cli/commands/react-native/upload-react-native-source-maps-command.ts +42 -0
  11. package/cli/commands/{delete-source-maps-command.ts → source-maps/delete-source-maps-command.ts} +8 -10
  12. package/cli/commands/source-maps/index.ts +7 -0
  13. package/cli/commands/{update-source-maps-command.ts → source-maps/update-source-maps-command.ts} +8 -10
  14. package/cli/commands/{upload-source-maps-command.ts → source-maps/upload-source-maps-command.ts} +8 -10
  15. package/cli/rum-cli.ts +17 -7
  16. package/config/config.ts +10 -4
  17. package/consts/consts.ts +2 -0
  18. package/dist/api/client/client-factory.d.ts +355 -0
  19. package/dist/api/client/client-factory.js +31 -0
  20. package/dist/api/client/request-builder.d.ts +33 -0
  21. package/dist/api/client/request-builder.js +58 -0
  22. package/dist/api/dsym.api.d.ts +4 -0
  23. package/dist/api/dsym.api.js +50 -0
  24. package/dist/api/react-native.api.d.ts +4 -0
  25. package/dist/api/react-native.api.js +50 -0
  26. package/dist/api/{rum-api.d.ts → source-maps.api.d.ts} +2 -2
  27. package/dist/api/source-maps.api.js +97 -0
  28. package/dist/cli/commands/dsym/index.d.ts +4 -0
  29. package/dist/cli/commands/dsym/index.js +6 -0
  30. package/dist/cli/commands/dsym/upload-dsym-command.d.ts +2 -0
  31. package/dist/cli/commands/dsym/upload-dsym-command.js +45 -0
  32. package/dist/cli/commands/react-native/index.d.ts +4 -0
  33. package/dist/cli/commands/react-native/index.js +6 -0
  34. package/dist/cli/commands/react-native/upload-react-native-source-maps-command.d.ts +2 -0
  35. package/dist/cli/commands/react-native/upload-react-native-source-maps-command.js +51 -0
  36. package/dist/cli/commands/source-maps/delete-source-maps-command.d.ts +2 -0
  37. package/dist/cli/commands/source-maps/delete-source-maps-command.js +41 -0
  38. package/dist/cli/commands/source-maps/index.d.ts +6 -0
  39. package/dist/cli/commands/source-maps/index.js +8 -0
  40. package/dist/cli/commands/source-maps/update-source-maps-command.d.ts +2 -0
  41. package/dist/cli/commands/source-maps/update-source-maps-command.js +46 -0
  42. package/dist/cli/commands/source-maps/upload-source-maps-command.d.ts +2 -0
  43. package/dist/cli/commands/source-maps/upload-source-maps-command.js +45 -0
  44. package/dist/cli/rum-cli.js +14 -8
  45. package/dist/config/config.d.ts +5 -2
  46. package/dist/config/config.js +6 -3
  47. package/dist/consts/consts.d.ts +1 -0
  48. package/dist/consts/consts.js +3 -2
  49. package/dist/models/dsym-commands.model.d.ts +11 -0
  50. package/dist/models/dsym-commands.model.js +3 -0
  51. package/dist/models/react-native-commands.model.d.ts +11 -0
  52. package/dist/models/react-native-commands.model.js +3 -0
  53. package/dist/models/{commands.model.d.ts → source-maps-commands.model.d.ts} +3 -3
  54. package/dist/models/source-maps-commands.model.js +3 -0
  55. package/dist/proto-models/com/coralogix/blobset/v2/audit_log.d.ts +24 -0
  56. package/dist/proto-models/com/coralogix/blobset/v2/audit_log.js +64 -0
  57. package/dist/proto-models/com/coralogix/blobset/v2/blobset_query_service.d.ts +111 -0
  58. package/dist/proto-models/com/coralogix/blobset/v2/blobset_query_service.js +31 -0
  59. package/dist/proto-models/com/coralogix/blobset/v2/blobset_service.d.ts +67 -0
  60. package/dist/proto-models/com/coralogix/blobset/v2/blobset_service.js +174 -0
  61. package/dist/proto-models/com/coralogix/blobset/v2/dsym.d.ts +58 -0
  62. package/dist/proto-models/com/coralogix/blobset/v2/dsym.js +331 -0
  63. package/dist/proto-models/com/coralogix/blobset/v2/entity_metadata.d.ts +78 -0
  64. package/dist/proto-models/com/coralogix/blobset/v2/entity_metadata.js +459 -0
  65. package/dist/proto-models/com/coralogix/blobset/v2/entity_type.d.ts +9 -0
  66. package/dist/proto-models/com/coralogix/blobset/v2/entity_type.js +47 -0
  67. package/dist/proto-models/com/coralogix/blobset/v2/react_native.d.ts +54 -0
  68. package/dist/proto-models/com/coralogix/blobset/v2/react_native.js +313 -0
  69. package/dist/proto-models/com/coralogix/blobset/v2/s3_metadata.d.ts +30 -0
  70. package/dist/proto-models/com/coralogix/blobset/v2/s3_metadata.js +126 -0
  71. package/dist/proto-models/com/coralogix/rum/v2/analytics.d.ts +1 -1
  72. package/dist/proto-models/com/coralogix/rum/v2/analytics.js +115 -102
  73. package/dist/proto-models/com/coralogix/rum/v2/audit_log.d.ts +1 -1
  74. package/dist/proto-models/com/coralogix/rum/v2/audit_log.js +5 -3
  75. package/dist/proto-models/com/coralogix/rum/v2/chunk.d.ts +1 -1
  76. package/dist/proto-models/com/coralogix/rum/v2/chunk.js +54 -49
  77. package/dist/proto-models/com/coralogix/rum/v2/file.d.ts +1 -1
  78. package/dist/proto-models/com/coralogix/rum/v2/file.js +24 -34
  79. package/dist/proto-models/com/coralogix/rum/v2/hide_errors.d.ts +44 -0
  80. package/dist/proto-models/com/coralogix/rum/v2/hide_errors.js +195 -0
  81. package/dist/proto-models/com/coralogix/rum/v2/release_entity_metadata.d.ts +78 -0
  82. package/dist/proto-models/com/coralogix/rum/v2/release_entity_metadata.js +459 -0
  83. package/dist/proto-models/com/coralogix/rum/v2/release_entity_type.d.ts +9 -0
  84. package/dist/proto-models/com/coralogix/rum/v2/release_entity_type.js +47 -0
  85. package/dist/proto-models/com/coralogix/rum/v2/rum_hide_errors_service.d.ts +198 -0
  86. package/dist/proto-models/com/coralogix/rum/v2/rum_hide_errors_service.js +517 -0
  87. package/dist/proto-models/com/coralogix/rum/v2/rum_react_native_source_map_service.d.ts +69 -0
  88. package/dist/proto-models/com/coralogix/rum/v2/rum_react_native_source_map_service.js +189 -0
  89. package/dist/proto-models/com/coralogix/rum/v2/rum_saved_filters_service.d.ts +480 -0
  90. package/dist/proto-models/com/coralogix/rum/v2/rum_saved_filters_service.js +1420 -0
  91. package/dist/proto-models/com/coralogix/rum/v2/rum_sdk_versions.d.ts +41 -0
  92. package/dist/proto-models/com/coralogix/rum/v2/rum_sdk_versions.js +217 -0
  93. package/dist/proto-models/com/coralogix/rum/v2/rum_service.d.ts +143 -3
  94. package/dist/proto-models/com/coralogix/rum/v2/rum_service.js +595 -127
  95. package/dist/proto-models/com/coralogix/rum/v2/rum_session_recording_service.d.ts +1 -59
  96. package/dist/proto-models/com/coralogix/rum/v2/rum_session_recording_service.js +4 -175
  97. package/dist/proto-models/com/coralogix/rum/v2/rum_settings.d.ts +45 -0
  98. package/dist/proto-models/com/coralogix/rum/v2/rum_settings.js +193 -0
  99. package/dist/proto-models/com/coralogix/rum/v2/rum_settings_service.d.ts +107 -0
  100. package/dist/proto-models/com/coralogix/rum/v2/rum_settings_service.js +214 -0
  101. package/dist/proto-models/com/coralogix/rum/v2/rum_snooze_errors_service.d.ts +261 -0
  102. package/dist/proto-models/com/coralogix/rum/v2/rum_snooze_errors_service.js +698 -0
  103. package/dist/proto-models/com/coralogix/rum/v2/rum_source_map_service.d.ts +93 -1
  104. package/dist/proto-models/com/coralogix/rum/v2/rum_source_map_service.js +325 -42
  105. package/dist/proto-models/com/coralogix/rum/v2/saved_filter.d.ts +55 -0
  106. package/dist/proto-models/com/coralogix/rum/v2/saved_filter.js +267 -0
  107. package/dist/proto-models/com/coralogix/rum/v2/snooze_errors.d.ts +109 -0
  108. package/dist/proto-models/com/coralogix/rum/v2/snooze_errors.js +580 -0
  109. package/dist/proto-models/com/coralogix/rum/v2/source_code_file_mapping.d.ts +1 -1
  110. package/dist/proto-models/com/coralogix/rum/v2/source_code_file_mapping.js +47 -24
  111. package/dist/proto-models/com/coralogix/rum/v2/source_map_release.d.ts +1 -1
  112. package/dist/proto-models/com/coralogix/rum/v2/source_map_release.js +43 -38
  113. package/dist/proto-models/com/coralogix/rum/v2/template.d.ts +14 -1
  114. package/dist/proto-models/com/coralogix/rum/v2/template.js +148 -54
  115. package/dist/proto-models/google/protobuf/descriptor.d.ts +1 -1
  116. package/dist/proto-models/google/protobuf/descriptor.js +537 -427
  117. package/dist/services/dsym.service.d.ts +3 -0
  118. package/dist/services/dsym.service.js +36 -0
  119. package/dist/services/react-native.service.d.ts +3 -0
  120. package/dist/services/react-native.service.js +37 -0
  121. package/dist/services/source-maps.service.js +12 -14
  122. package/dist/utils/file-processor.utils.d.ts +12 -0
  123. package/dist/utils/file-processor.utils.js +196 -0
  124. package/dist/utils/shared.utils.d.ts +9 -0
  125. package/dist/utils/shared.utils.js +62 -0
  126. package/models/dsym-commands.model.ts +11 -0
  127. package/models/react-native-commands.model.ts +11 -0
  128. package/models/{commands.model.ts → source-maps-commands.model.ts} +3 -3
  129. package/package.json +4 -3
  130. package/proto-models/com/coralogix/blobset/v2/audit_log.ts +78 -0
  131. package/proto-models/com/coralogix/blobset/v2/blobset_query_service.ts +30 -0
  132. package/proto-models/com/coralogix/blobset/v2/blobset_service.ts +203 -0
  133. package/proto-models/com/coralogix/blobset/v2/dsym.ts +394 -0
  134. package/proto-models/com/coralogix/blobset/v2/entity_metadata.ts +537 -0
  135. package/proto-models/com/coralogix/blobset/v2/entity_type.ts +44 -0
  136. package/proto-models/com/coralogix/blobset/v2/react_native.ts +361 -0
  137. package/proto-models/com/coralogix/blobset/v2/s3_metadata.ts +148 -0
  138. package/proto-models/com/coralogix/rum/v2/analytics.ts +113 -108
  139. package/proto-models/com/coralogix/rum/v2/audit_log.ts +6 -4
  140. package/proto-models/com/coralogix/rum/v2/chunk.ts +55 -56
  141. package/proto-models/com/coralogix/rum/v2/file.ts +25 -39
  142. package/proto-models/com/coralogix/rum/v2/hide_errors.ts +225 -0
  143. package/proto-models/com/coralogix/rum/v2/release_entity_metadata.ts +537 -0
  144. package/proto-models/com/coralogix/rum/v2/release_entity_type.ts +44 -0
  145. package/proto-models/com/coralogix/rum/v2/rum_hide_errors_service.ts +599 -0
  146. package/proto-models/com/coralogix/rum/v2/rum_react_native_source_map_service.ts +223 -0
  147. package/proto-models/com/coralogix/rum/v2/rum_saved_filters_service.ts +1673 -0
  148. package/proto-models/com/coralogix/rum/v2/rum_sdk_versions.ts +254 -0
  149. package/proto-models/com/coralogix/rum/v2/rum_service.ts +672 -146
  150. package/proto-models/com/coralogix/rum/v2/rum_session_recording_service.ts +1 -208
  151. package/proto-models/com/coralogix/rum/v2/rum_settings.ts +209 -0
  152. package/proto-models/com/coralogix/rum/v2/rum_settings_service.ts +260 -0
  153. package/proto-models/com/coralogix/rum/v2/rum_snooze_errors_service.ts +818 -0
  154. package/proto-models/com/coralogix/rum/v2/rum_source_map_service.ts +369 -46
  155. package/proto-models/com/coralogix/rum/v2/saved_filter.ts +301 -0
  156. package/proto-models/com/coralogix/rum/v2/snooze_errors.ts +656 -0
  157. package/proto-models/com/coralogix/rum/v2/source_code_file_mapping.ts +48 -27
  158. package/proto-models/com/coralogix/rum/v2/source_map_release.ts +44 -44
  159. package/proto-models/com/coralogix/rum/v2/template.ts +161 -59
  160. package/proto-models/google/protobuf/descriptor.ts +551 -464
  161. package/protofetch.lock +21 -2
  162. package/protofetch.toml +6 -1
  163. package/protos/com/coralogix/blobset/v2/audit_log.proto +13 -0
  164. package/protos/com/coralogix/blobset/v2/blobset_query_service.proto +12 -0
  165. package/protos/com/coralogix/blobset/v2/blobset_service.proto +18 -0
  166. package/protos/com/coralogix/blobset/v2/dsym.proto +19 -0
  167. package/protos/com/coralogix/blobset/v2/entity_metadata.proto +36 -0
  168. package/protos/com/coralogix/blobset/v2/entity_type.proto +10 -0
  169. package/protos/com/coralogix/blobset/v2/react_native.proto +23 -0
  170. package/protos/com/coralogix/blobset/v2/s3_metadata.proto +14 -0
  171. package/protos/com/coralogix/rum/v2/hide_errors.proto +19 -0
  172. package/protos/com/coralogix/rum/v2/release_entity_metadata.proto +35 -0
  173. package/protos/com/coralogix/rum/v2/release_entity_type.proto +10 -0
  174. package/protos/com/coralogix/rum/v2/rum_hide_errors_service.proto +42 -0
  175. package/protos/com/coralogix/rum/v2/rum_react_native_source_map_service.proto +19 -0
  176. package/protos/com/coralogix/rum/v2/rum_saved_filters_service.proto +117 -0
  177. package/protos/com/coralogix/rum/v2/rum_sdk_versions.proto +16 -0
  178. package/protos/com/coralogix/rum/v2/rum_service.proto +36 -0
  179. package/protos/com/coralogix/rum/v2/rum_session_recording_service.proto +1 -12
  180. package/protos/com/coralogix/rum/v2/rum_settings.proto +26 -0
  181. package/protos/com/coralogix/rum/v2/rum_settings_service.proto +21 -0
  182. package/protos/com/coralogix/rum/v2/rum_snooze_errors_service.proto +64 -0
  183. package/protos/com/coralogix/rum/v2/rum_source_map_service.proto +20 -1
  184. package/protos/com/coralogix/rum/v2/saved_filter.proto +28 -0
  185. package/protos/com/coralogix/rum/v2/snooze_errors.proto +55 -0
  186. package/protos/com/coralogix/rum/v2/template.proto +6 -0
  187. package/protoset.bin +0 -0
  188. package/services/dsym.service.ts +33 -0
  189. package/services/react-native.service.ts +34 -0
  190. package/services/source-maps.service.ts +12 -14
  191. package/utils/file-processor.utils.ts +176 -0
  192. package/utils/shared.utils.ts +52 -0
  193. package/cli/commands/index.ts +0 -7
  194. package/dist/api/rum-api.js +0 -104
  195. package/dist/cli/commands/delete-source-maps-command.d.ts +0 -2
  196. package/dist/cli/commands/delete-source-maps-command.js +0 -43
  197. package/dist/cli/commands/index.d.ts +0 -6
  198. package/dist/cli/commands/index.js +0 -8
  199. package/dist/cli/commands/update-source-maps-command.d.ts +0 -2
  200. package/dist/cli/commands/update-source-maps-command.js +0 -48
  201. package/dist/cli/commands/upload-source-maps-command.d.ts +0 -2
  202. package/dist/cli/commands/upload-source-maps-command.js +0 -47
  203. package/dist/models/commands.model.js +0 -3
  204. package/dist/utils/index.d.ts +0 -6
  205. package/dist/utils/index.js +0 -115
  206. package/utils/index.ts +0 -93
@@ -11,7 +11,7 @@ export interface FileMetadata {
11
11
  }
12
12
 
13
13
  function createBaseFileMetadata(): FileMetadata {
14
- return { chunkName: "", size: 0, content: new Uint8Array() };
14
+ return { chunkName: "", size: 0, content: new Uint8Array(0) };
15
15
  }
16
16
 
17
17
  export const FileMetadata = {
@@ -67,58 +67,43 @@ export const FileMetadata = {
67
67
 
68
68
  fromJSON(object: any): FileMetadata {
69
69
  return {
70
- chunkName: isSet(object.chunkName) ? String(object.chunkName) : "",
71
- size: isSet(object.size) ? Number(object.size) : 0,
72
- content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(),
70
+ chunkName: isSet(object.chunkName) ? globalThis.String(object.chunkName) : "",
71
+ size: isSet(object.size) ? globalThis.Number(object.size) : 0,
72
+ content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),
73
73
  };
74
74
  },
75
75
 
76
76
  toJSON(message: FileMetadata): unknown {
77
77
  const obj: any = {};
78
- message.chunkName !== undefined && (obj.chunkName = message.chunkName);
79
- message.size !== undefined && (obj.size = Math.round(message.size));
80
- message.content !== undefined &&
81
- (obj.content = base64FromBytes(message.content !== undefined ? message.content : new Uint8Array()));
78
+ if (message.chunkName !== "") {
79
+ obj.chunkName = message.chunkName;
80
+ }
81
+ if (message.size !== 0) {
82
+ obj.size = Math.round(message.size);
83
+ }
84
+ if (message.content.length !== 0) {
85
+ obj.content = base64FromBytes(message.content);
86
+ }
82
87
  return obj;
83
88
  },
84
89
 
85
90
  create(base?: DeepPartial<FileMetadata>): FileMetadata {
86
91
  return FileMetadata.fromPartial(base ?? {});
87
92
  },
88
-
89
93
  fromPartial(object: DeepPartial<FileMetadata>): FileMetadata {
90
94
  const message = createBaseFileMetadata();
91
95
  message.chunkName = object.chunkName ?? "";
92
96
  message.size = object.size ?? 0;
93
- message.content = object.content ?? new Uint8Array();
97
+ message.content = object.content ?? new Uint8Array(0);
94
98
  return message;
95
99
  },
96
100
  };
97
101
 
98
- declare var self: any | undefined;
99
- declare var window: any | undefined;
100
- declare var global: any | undefined;
101
- var tsProtoGlobalThis: any = (() => {
102
- if (typeof globalThis !== "undefined") {
103
- return globalThis;
104
- }
105
- if (typeof self !== "undefined") {
106
- return self;
107
- }
108
- if (typeof window !== "undefined") {
109
- return window;
110
- }
111
- if (typeof global !== "undefined") {
112
- return global;
113
- }
114
- throw "Unable to locate global object";
115
- })();
116
-
117
102
  function bytesFromBase64(b64: string): Uint8Array {
118
- if (tsProtoGlobalThis.Buffer) {
119
- return Uint8Array.from(tsProtoGlobalThis.Buffer.from(b64, "base64"));
103
+ if (globalThis.Buffer) {
104
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
120
105
  } else {
121
- const bin = tsProtoGlobalThis.atob(b64);
106
+ const bin = globalThis.atob(b64);
122
107
  const arr = new Uint8Array(bin.length);
123
108
  for (let i = 0; i < bin.length; ++i) {
124
109
  arr[i] = bin.charCodeAt(i);
@@ -128,28 +113,29 @@ function bytesFromBase64(b64: string): Uint8Array {
128
113
  }
129
114
 
130
115
  function base64FromBytes(arr: Uint8Array): string {
131
- if (tsProtoGlobalThis.Buffer) {
132
- return tsProtoGlobalThis.Buffer.from(arr).toString("base64");
116
+ if (globalThis.Buffer) {
117
+ return globalThis.Buffer.from(arr).toString("base64");
133
118
  } else {
134
119
  const bin: string[] = [];
135
120
  arr.forEach((byte) => {
136
- bin.push(String.fromCharCode(byte));
121
+ bin.push(globalThis.String.fromCharCode(byte));
137
122
  });
138
- return tsProtoGlobalThis.btoa(bin.join(""));
123
+ return globalThis.btoa(bin.join(""));
139
124
  }
140
125
  }
141
126
 
142
127
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
143
128
 
144
129
  export type DeepPartial<T> = T extends Builtin ? T
145
- : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
130
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
131
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
146
132
  : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
147
133
  : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
148
134
  : Partial<T>;
149
135
 
150
136
  function longToNumber(long: Long): number {
151
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
152
- throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
137
+ if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
138
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
153
139
  }
154
140
  return long.toNumber();
155
141
  }
@@ -0,0 +1,225 @@
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 HideStatus {
8
+ HIDE_STATUS_UNSPECIFIED = 0,
9
+ HIDE_STATUS_ACTIVE = 1,
10
+ HIDE_STATUS_EXPIRING_SOON = 2,
11
+ }
12
+
13
+ export function hideStatusFromJSON(object: any): HideStatus {
14
+ switch (object) {
15
+ case 0:
16
+ case "HIDE_STATUS_UNSPECIFIED":
17
+ return HideStatus.HIDE_STATUS_UNSPECIFIED;
18
+ case 1:
19
+ case "HIDE_STATUS_ACTIVE":
20
+ return HideStatus.HIDE_STATUS_ACTIVE;
21
+ case 2:
22
+ case "HIDE_STATUS_EXPIRING_SOON":
23
+ return HideStatus.HIDE_STATUS_EXPIRING_SOON;
24
+ default:
25
+ throw new globalThis.Error("Unrecognized enum value " + object + " for enum HideStatus");
26
+ }
27
+ }
28
+
29
+ export function hideStatusToJSON(object: HideStatus): string {
30
+ switch (object) {
31
+ case HideStatus.HIDE_STATUS_UNSPECIFIED:
32
+ return "HIDE_STATUS_UNSPECIFIED";
33
+ case HideStatus.HIDE_STATUS_ACTIVE:
34
+ return "HIDE_STATUS_ACTIVE";
35
+ case HideStatus.HIDE_STATUS_EXPIRING_SOON:
36
+ return "HIDE_STATUS_EXPIRING_SOON";
37
+ default:
38
+ throw new globalThis.Error("Unrecognized enum value " + object + " for enum HideStatus");
39
+ }
40
+ }
41
+
42
+ export interface ExpiresConditions {
43
+ endTime?: number | undefined;
44
+ }
45
+
46
+ export interface HideError {
47
+ templateId: string;
48
+ status: HideStatus;
49
+ expiresConditions: ExpiresConditions | undefined;
50
+ }
51
+
52
+ function createBaseExpiresConditions(): ExpiresConditions {
53
+ return { endTime: undefined };
54
+ }
55
+
56
+ export const ExpiresConditions = {
57
+ encode(message: ExpiresConditions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
58
+ if (message.endTime !== undefined) {
59
+ writer.uint32(8).int64(message.endTime);
60
+ }
61
+ return writer;
62
+ },
63
+
64
+ decode(input: _m0.Reader | Uint8Array, length?: number): ExpiresConditions {
65
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
66
+ let end = length === undefined ? reader.len : reader.pos + length;
67
+ const message = createBaseExpiresConditions();
68
+ while (reader.pos < end) {
69
+ const tag = reader.uint32();
70
+ switch (tag >>> 3) {
71
+ case 1:
72
+ if (tag !== 8) {
73
+ break;
74
+ }
75
+
76
+ message.endTime = longToNumber(reader.int64() as Long);
77
+ continue;
78
+ }
79
+ if ((tag & 7) === 4 || tag === 0) {
80
+ break;
81
+ }
82
+ reader.skipType(tag & 7);
83
+ }
84
+ return message;
85
+ },
86
+
87
+ fromJSON(object: any): ExpiresConditions {
88
+ return { endTime: isSet(object.endTime) ? globalThis.Number(object.endTime) : undefined };
89
+ },
90
+
91
+ toJSON(message: ExpiresConditions): unknown {
92
+ const obj: any = {};
93
+ if (message.endTime !== undefined) {
94
+ obj.endTime = Math.round(message.endTime);
95
+ }
96
+ return obj;
97
+ },
98
+
99
+ create(base?: DeepPartial<ExpiresConditions>): ExpiresConditions {
100
+ return ExpiresConditions.fromPartial(base ?? {});
101
+ },
102
+ fromPartial(object: DeepPartial<ExpiresConditions>): ExpiresConditions {
103
+ const message = createBaseExpiresConditions();
104
+ message.endTime = object.endTime ?? undefined;
105
+ return message;
106
+ },
107
+ };
108
+
109
+ function createBaseHideError(): HideError {
110
+ return { templateId: "", status: 0, expiresConditions: undefined };
111
+ }
112
+
113
+ export const HideError = {
114
+ encode(message: HideError, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
115
+ if (message.templateId !== "") {
116
+ writer.uint32(10).string(message.templateId);
117
+ }
118
+ if (message.status !== 0) {
119
+ writer.uint32(16).int32(message.status);
120
+ }
121
+ if (message.expiresConditions !== undefined) {
122
+ ExpiresConditions.encode(message.expiresConditions, writer.uint32(26).fork()).ldelim();
123
+ }
124
+ return writer;
125
+ },
126
+
127
+ decode(input: _m0.Reader | Uint8Array, length?: number): HideError {
128
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
129
+ let end = length === undefined ? reader.len : reader.pos + length;
130
+ const message = createBaseHideError();
131
+ while (reader.pos < end) {
132
+ const tag = reader.uint32();
133
+ switch (tag >>> 3) {
134
+ case 1:
135
+ if (tag !== 10) {
136
+ break;
137
+ }
138
+
139
+ message.templateId = reader.string();
140
+ continue;
141
+ case 2:
142
+ if (tag !== 16) {
143
+ break;
144
+ }
145
+
146
+ message.status = reader.int32() as any;
147
+ continue;
148
+ case 3:
149
+ if (tag !== 26) {
150
+ break;
151
+ }
152
+
153
+ message.expiresConditions = ExpiresConditions.decode(reader, reader.uint32());
154
+ continue;
155
+ }
156
+ if ((tag & 7) === 4 || tag === 0) {
157
+ break;
158
+ }
159
+ reader.skipType(tag & 7);
160
+ }
161
+ return message;
162
+ },
163
+
164
+ fromJSON(object: any): HideError {
165
+ return {
166
+ templateId: isSet(object.templateId) ? globalThis.String(object.templateId) : "",
167
+ status: isSet(object.status) ? hideStatusFromJSON(object.status) : 0,
168
+ expiresConditions: isSet(object.expiresConditions)
169
+ ? ExpiresConditions.fromJSON(object.expiresConditions)
170
+ : undefined,
171
+ };
172
+ },
173
+
174
+ toJSON(message: HideError): unknown {
175
+ const obj: any = {};
176
+ if (message.templateId !== "") {
177
+ obj.templateId = message.templateId;
178
+ }
179
+ if (message.status !== 0) {
180
+ obj.status = hideStatusToJSON(message.status);
181
+ }
182
+ if (message.expiresConditions !== undefined) {
183
+ obj.expiresConditions = ExpiresConditions.toJSON(message.expiresConditions);
184
+ }
185
+ return obj;
186
+ },
187
+
188
+ create(base?: DeepPartial<HideError>): HideError {
189
+ return HideError.fromPartial(base ?? {});
190
+ },
191
+ fromPartial(object: DeepPartial<HideError>): HideError {
192
+ const message = createBaseHideError();
193
+ message.templateId = object.templateId ?? "";
194
+ message.status = object.status ?? 0;
195
+ message.expiresConditions = (object.expiresConditions !== undefined && object.expiresConditions !== null)
196
+ ? ExpiresConditions.fromPartial(object.expiresConditions)
197
+ : undefined;
198
+ return message;
199
+ },
200
+ };
201
+
202
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
203
+
204
+ export type DeepPartial<T> = T extends Builtin ? T
205
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
206
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
207
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
208
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
209
+ : Partial<T>;
210
+
211
+ function longToNumber(long: Long): number {
212
+ if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
213
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
214
+ }
215
+ return long.toNumber();
216
+ }
217
+
218
+ if (_m0.util.Long !== Long) {
219
+ _m0.util.Long = Long as any;
220
+ _m0.configure();
221
+ }
222
+
223
+ function isSet(value: any): boolean {
224
+ return value !== null && value !== undefined;
225
+ }