@snap/push2web 0.11.0

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.
@@ -0,0 +1,512 @@
1
+ /* eslint-disable */
2
+ import Long from "long";
3
+ import _m0 from "protobufjs/minimal";
4
+ export const protobufPackage = "snapchat.core";
5
+ /**
6
+ * These codes borrow heavily from the GRPC status codes.
7
+ *
8
+ * Sometimes multiple error codes may apply. Services should return
9
+ * the most specific error code that applies. For example, prefer
10
+ * `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply.
11
+ * Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`.
12
+ */
13
+ export var Code;
14
+ (function (Code) {
15
+ /**
16
+ * OK - Not an error; returned on success
17
+ *
18
+ * HTTP Mapping: 200 OK
19
+ */
20
+ Code["OK"] = "OK";
21
+ /**
22
+ * CANCELLED - The operation was cancelled, typically by the caller.
23
+ *
24
+ * HTTP Mapping: 499 Client Closed Request
25
+ */
26
+ Code["CANCELLED"] = "CANCELLED";
27
+ /**
28
+ * UNKNOWN - Unknown error. For example, this error may be returned when
29
+ * a `Status` value received from another address space belongs to
30
+ * an error space that is not known in this address space. Also
31
+ * errors raised by APIs that do not return enough error information
32
+ * may be converted to this error.
33
+ *
34
+ * HTTP Mapping: 500 Internal Server Error
35
+ */
36
+ Code["UNKNOWN"] = "UNKNOWN";
37
+ /**
38
+ * INVALID_ARGUMENT - The client specified an invalid argument. Note that this differs
39
+ * from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments
40
+ * that are problematic regardless of the state of the system
41
+ * (e.g., a malformed file name).
42
+ *
43
+ * HTTP Mapping: 400 Bad Request
44
+ */
45
+ Code["INVALID_ARGUMENT"] = "INVALID_ARGUMENT";
46
+ /**
47
+ * DEADLINE_EXCEEDED - The deadline expired before the operation could complete. For operations
48
+ * that change the state of the system, this error may be returned
49
+ * even if the operation has completed successfully. For example, a
50
+ * successful response from a server could have been delayed long
51
+ * enough for the deadline to expire.
52
+ *
53
+ * HTTP Mapping: 504 Gateway Timeout
54
+ */
55
+ Code["DEADLINE_EXCEEDED"] = "DEADLINE_EXCEEDED";
56
+ /**
57
+ * NOT_FOUND - Some requested entity (e.g., file or directory) was not found.
58
+ *
59
+ * Note to server developers: if a request is denied for an entire class
60
+ * of users, such as gradual feature rollout or undocumented whitelist,
61
+ * `NOT_FOUND` may be used. If a request is denied for some users within
62
+ * a class of users, such as user-based access control, `PERMISSION_DENIED`
63
+ * must be used.
64
+ *
65
+ * HTTP Mapping: 404 Not Found
66
+ */
67
+ Code["NOT_FOUND"] = "NOT_FOUND";
68
+ /**
69
+ * ALREADY_EXISTS - The entity that a client attempted to create (e.g., file or directory)
70
+ * already exists.
71
+ *
72
+ * HTTP Mapping: 409 Conflict
73
+ */
74
+ Code["ALREADY_EXISTS"] = "ALREADY_EXISTS";
75
+ /**
76
+ * PERMISSION_DENIED - The caller does not have permission to execute the specified
77
+ * operation. `PERMISSION_DENIED` must not be used for rejections
78
+ * caused by exhausting some resource (use `RESOURCE_EXHAUSTED`
79
+ * instead for those errors). `PERMISSION_DENIED` must not be
80
+ * used if the caller can not be identified (use `UNAUTHENTICATED`
81
+ * instead for those errors). This error code does not imply the
82
+ * request is valid or the requested entity exists or satisfies
83
+ * other pre-conditions.
84
+ *
85
+ * HTTP Mapping: 403 Forbidden
86
+ */
87
+ Code["PERMISSION_DENIED"] = "PERMISSION_DENIED";
88
+ /**
89
+ * UNAUTHENTICATED - The request does not have valid authentication credentials for the
90
+ * operation.
91
+ *
92
+ * HTTP Mapping: 401 Unauthorized
93
+ */
94
+ Code["UNAUTHENTICATED"] = "UNAUTHENTICATED";
95
+ /**
96
+ * RESOURCE_EXHAUSTED - Some resource has been exhausted, perhaps a per-user quota, or
97
+ * perhaps the entire file system is out of space.
98
+ *
99
+ * HTTP Mapping: 429 Too Many Requests
100
+ */
101
+ Code["RESOURCE_EXHAUSTED"] = "RESOURCE_EXHAUSTED";
102
+ /**
103
+ * FAILED_PRECONDITION - The operation was rejected because the system is not in a state
104
+ * required for the operation's execution. For example, the directory
105
+ * to be deleted is non-empty, an rmdir operation is applied to
106
+ * a non-directory, etc.
107
+ *
108
+ * Service implementors can use the following guidelines to decide
109
+ * between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:
110
+ * (a) Use `UNAVAILABLE` if the client can retry just the failing call.
111
+ * (b) Use `ABORTED` if the client should retry at a higher level
112
+ * (e.g., when a client-specified test-and-set fails, indicating the
113
+ * client should restart a read-modify-write sequence).
114
+ * (c) Use `FAILED_PRECONDITION` if the client should not retry until
115
+ * the system state has been explicitly fixed. E.g., if an "rmdir"
116
+ * fails because the directory is non-empty, `FAILED_PRECONDITION`
117
+ * should be returned since the client should not retry unless
118
+ * the files are deleted from the directory.
119
+ *
120
+ * HTTP Mapping: 400 Bad Request
121
+ */
122
+ Code["FAILED_PRECONDITION"] = "FAILED_PRECONDITION";
123
+ /**
124
+ * ABORTED - The operation was aborted, typically due to a concurrency issue such as
125
+ * a sequencer check failure or transaction abort.
126
+ *
127
+ * See the guidelines above for deciding between `FAILED_PRECONDITION`,
128
+ * `ABORTED`, and `UNAVAILABLE`.
129
+ *
130
+ * HTTP Mapping: 409 Conflict
131
+ */
132
+ Code["ABORTED"] = "ABORTED";
133
+ /**
134
+ * OUT_OF_RANGE - The operation was attempted past the valid range. E.g., seeking or
135
+ * reading past end-of-file.
136
+ *
137
+ * Unlike `INVALID_ARGUMENT`, this error indicates a problem that may
138
+ * be fixed if the system state changes. For example, a 32-bit file
139
+ * system will generate `INVALID_ARGUMENT` if asked to read at an
140
+ * offset that is not in the range [0,2^32-1], but it will generate
141
+ * `OUT_OF_RANGE` if asked to read from an offset past the current
142
+ * file size.
143
+ *
144
+ * There is a fair bit of overlap between `FAILED_PRECONDITION` and
145
+ * `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific
146
+ * error) when it applies so that callers who are iterating through
147
+ * a space can easily look for an `OUT_OF_RANGE` error to detect when
148
+ * they are done.
149
+ *
150
+ * HTTP Mapping: 400 Bad Request
151
+ */
152
+ Code["OUT_OF_RANGE"] = "OUT_OF_RANGE";
153
+ /**
154
+ * UNIMPLEMENTED - The operation is not implemented or is not supported/enabled in this
155
+ * service.
156
+ *
157
+ * HTTP Mapping: 501 Not Implemented
158
+ */
159
+ Code["UNIMPLEMENTED"] = "UNIMPLEMENTED";
160
+ /**
161
+ * INTERNAL - Internal errors. This means that some invariants expected by the
162
+ * underlying system have been broken. This error code is reserved
163
+ * for serious errors.
164
+ *
165
+ * HTTP Mapping: 500 Internal Server Error
166
+ */
167
+ Code["INTERNAL"] = "INTERNAL";
168
+ /**
169
+ * UNAVAILABLE - The service is currently unavailable. This is most likely a
170
+ * transient condition, which can be corrected by retrying with
171
+ * a backoff.
172
+ *
173
+ * See the guidelines above for deciding between `FAILED_PRECONDITION`,
174
+ * `ABORTED`, and `UNAVAILABLE`.
175
+ *
176
+ * HTTP Mapping: 503 Service Unavailable
177
+ */
178
+ Code["UNAVAILABLE"] = "UNAVAILABLE";
179
+ /**
180
+ * DATA_LOSS - Unrecoverable data loss or corruption.
181
+ *
182
+ * HTTP Mapping: 500 Internal Server Error
183
+ */
184
+ Code["DATA_LOSS"] = "DATA_LOSS";
185
+ /** NOT_MODIFIED - Equivalent to HTTP 304 not modified */
186
+ Code["NOT_MODIFIED"] = "NOT_MODIFIED";
187
+ /**
188
+ * DECRYPTION_FAILED - Decryption failed. Similar to DATA_LOSS ("Unrecoverable data loss or corruption."),
189
+ * but HTTP should map to 400 Bad Request, not 500 Internal Server Error.
190
+ * This is not-retriable.
191
+ */
192
+ Code["DECRYPTION_FAILED"] = "DECRYPTION_FAILED";
193
+ /**
194
+ * INVALID_MEDIA - Invalid media. For example: you request an HLS manifest on a still picture, or pngquant on non-png.
195
+ * HTTP should map to 400 Bad Request. This is not-retriable.
196
+ */
197
+ Code["INVALID_MEDIA"] = "INVALID_MEDIA";
198
+ /**
199
+ * IN_PROGRESS - Use to signal that ingestion is in progress and we don't have a result yet.
200
+ * It can be used for other similar processes.
201
+ */
202
+ Code["IN_PROGRESS"] = "IN_PROGRESS";
203
+ /**
204
+ * CONTENT_TOO_LARGE - BOLT can optionally check for content size, before ingestion.
205
+ * This error code signals that the content is too large to be ingested into BOLT.
206
+ * Maximum object size can be specified per use case or per ingestion request.
207
+ */
208
+ Code["CONTENT_TOO_LARGE"] = "CONTENT_TOO_LARGE";
209
+ /**
210
+ * URL_PROTOCOL_NOT_SUPPORTED - BOLT can only download content from URL protocols HTTP and HTTPS.
211
+ * This error code will be returned if the URL provided in an ingestion request has a different protocol.
212
+ */
213
+ Code["URL_PROTOCOL_NOT_SUPPORTED"] = "URL_PROTOCOL_NOT_SUPPORTED";
214
+ /**
215
+ * URL_CONTENT_TYPE_NOT_WHITELISTED - Content downloaded from a URL has to have its content-type header whitelisted for the use case making
216
+ * the ingestion request.
217
+ * This error signals that the URL has a content-type not whitelisted for the use case.
218
+ */
219
+ Code["URL_CONTENT_TYPE_NOT_WHITELISTED"] = "URL_CONTENT_TYPE_NOT_WHITELISTED";
220
+ /**
221
+ * URL_DOWNLOAD_FAILURE - This error signals that BOLT failed to download content from the URL provided in the ingestion request.
222
+ * The HTTP status code is reported in error_code.
223
+ */
224
+ Code["URL_DOWNLOAD_FAILURE"] = "URL_DOWNLOAD_FAILURE";
225
+ /**
226
+ * CLOUD_STORAGE_FAILURE - This error signals that BOLT failed to carry out a cloud storage operation.
227
+ * This can happen when getting content size from the external bucket provided in the ingestion request or when
228
+ * trying to do the first copy to a BOLT bucket.
229
+ * The HTTP status code is reported in error code.
230
+ */
231
+ Code["CLOUD_STORAGE_FAILURE"] = "CLOUD_STORAGE_FAILURE";
232
+ Code["UNRECOGNIZED"] = "UNRECOGNIZED";
233
+ })(Code || (Code = {}));
234
+ export function codeFromJSON(object) {
235
+ switch (object) {
236
+ case 0:
237
+ case "OK":
238
+ return Code.OK;
239
+ case 1:
240
+ case "CANCELLED":
241
+ return Code.CANCELLED;
242
+ case 2:
243
+ case "UNKNOWN":
244
+ return Code.UNKNOWN;
245
+ case 3:
246
+ case "INVALID_ARGUMENT":
247
+ return Code.INVALID_ARGUMENT;
248
+ case 4:
249
+ case "DEADLINE_EXCEEDED":
250
+ return Code.DEADLINE_EXCEEDED;
251
+ case 5:
252
+ case "NOT_FOUND":
253
+ return Code.NOT_FOUND;
254
+ case 6:
255
+ case "ALREADY_EXISTS":
256
+ return Code.ALREADY_EXISTS;
257
+ case 7:
258
+ case "PERMISSION_DENIED":
259
+ return Code.PERMISSION_DENIED;
260
+ case 16:
261
+ case "UNAUTHENTICATED":
262
+ return Code.UNAUTHENTICATED;
263
+ case 8:
264
+ case "RESOURCE_EXHAUSTED":
265
+ return Code.RESOURCE_EXHAUSTED;
266
+ case 9:
267
+ case "FAILED_PRECONDITION":
268
+ return Code.FAILED_PRECONDITION;
269
+ case 10:
270
+ case "ABORTED":
271
+ return Code.ABORTED;
272
+ case 11:
273
+ case "OUT_OF_RANGE":
274
+ return Code.OUT_OF_RANGE;
275
+ case 12:
276
+ case "UNIMPLEMENTED":
277
+ return Code.UNIMPLEMENTED;
278
+ case 13:
279
+ case "INTERNAL":
280
+ return Code.INTERNAL;
281
+ case 14:
282
+ case "UNAVAILABLE":
283
+ return Code.UNAVAILABLE;
284
+ case 15:
285
+ case "DATA_LOSS":
286
+ return Code.DATA_LOSS;
287
+ case 100:
288
+ case "NOT_MODIFIED":
289
+ return Code.NOT_MODIFIED;
290
+ case 101:
291
+ case "DECRYPTION_FAILED":
292
+ return Code.DECRYPTION_FAILED;
293
+ case 102:
294
+ case "INVALID_MEDIA":
295
+ return Code.INVALID_MEDIA;
296
+ case 200:
297
+ case "IN_PROGRESS":
298
+ return Code.IN_PROGRESS;
299
+ case 201:
300
+ case "CONTENT_TOO_LARGE":
301
+ return Code.CONTENT_TOO_LARGE;
302
+ case 202:
303
+ case "URL_PROTOCOL_NOT_SUPPORTED":
304
+ return Code.URL_PROTOCOL_NOT_SUPPORTED;
305
+ case 203:
306
+ case "URL_CONTENT_TYPE_NOT_WHITELISTED":
307
+ return Code.URL_CONTENT_TYPE_NOT_WHITELISTED;
308
+ case 204:
309
+ case "URL_DOWNLOAD_FAILURE":
310
+ return Code.URL_DOWNLOAD_FAILURE;
311
+ case 205:
312
+ case "CLOUD_STORAGE_FAILURE":
313
+ return Code.CLOUD_STORAGE_FAILURE;
314
+ case -1:
315
+ case "UNRECOGNIZED":
316
+ default:
317
+ return Code.UNRECOGNIZED;
318
+ }
319
+ }
320
+ export function codeToJSON(object) {
321
+ switch (object) {
322
+ case Code.OK:
323
+ return "OK";
324
+ case Code.CANCELLED:
325
+ return "CANCELLED";
326
+ case Code.UNKNOWN:
327
+ return "UNKNOWN";
328
+ case Code.INVALID_ARGUMENT:
329
+ return "INVALID_ARGUMENT";
330
+ case Code.DEADLINE_EXCEEDED:
331
+ return "DEADLINE_EXCEEDED";
332
+ case Code.NOT_FOUND:
333
+ return "NOT_FOUND";
334
+ case Code.ALREADY_EXISTS:
335
+ return "ALREADY_EXISTS";
336
+ case Code.PERMISSION_DENIED:
337
+ return "PERMISSION_DENIED";
338
+ case Code.UNAUTHENTICATED:
339
+ return "UNAUTHENTICATED";
340
+ case Code.RESOURCE_EXHAUSTED:
341
+ return "RESOURCE_EXHAUSTED";
342
+ case Code.FAILED_PRECONDITION:
343
+ return "FAILED_PRECONDITION";
344
+ case Code.ABORTED:
345
+ return "ABORTED";
346
+ case Code.OUT_OF_RANGE:
347
+ return "OUT_OF_RANGE";
348
+ case Code.UNIMPLEMENTED:
349
+ return "UNIMPLEMENTED";
350
+ case Code.INTERNAL:
351
+ return "INTERNAL";
352
+ case Code.UNAVAILABLE:
353
+ return "UNAVAILABLE";
354
+ case Code.DATA_LOSS:
355
+ return "DATA_LOSS";
356
+ case Code.NOT_MODIFIED:
357
+ return "NOT_MODIFIED";
358
+ case Code.DECRYPTION_FAILED:
359
+ return "DECRYPTION_FAILED";
360
+ case Code.INVALID_MEDIA:
361
+ return "INVALID_MEDIA";
362
+ case Code.IN_PROGRESS:
363
+ return "IN_PROGRESS";
364
+ case Code.CONTENT_TOO_LARGE:
365
+ return "CONTENT_TOO_LARGE";
366
+ case Code.URL_PROTOCOL_NOT_SUPPORTED:
367
+ return "URL_PROTOCOL_NOT_SUPPORTED";
368
+ case Code.URL_CONTENT_TYPE_NOT_WHITELISTED:
369
+ return "URL_CONTENT_TYPE_NOT_WHITELISTED";
370
+ case Code.URL_DOWNLOAD_FAILURE:
371
+ return "URL_DOWNLOAD_FAILURE";
372
+ case Code.CLOUD_STORAGE_FAILURE:
373
+ return "CLOUD_STORAGE_FAILURE";
374
+ default:
375
+ return "UNKNOWN";
376
+ }
377
+ }
378
+ export function codeToNumber(object) {
379
+ switch (object) {
380
+ case Code.OK:
381
+ return 0;
382
+ case Code.CANCELLED:
383
+ return 1;
384
+ case Code.UNKNOWN:
385
+ return 2;
386
+ case Code.INVALID_ARGUMENT:
387
+ return 3;
388
+ case Code.DEADLINE_EXCEEDED:
389
+ return 4;
390
+ case Code.NOT_FOUND:
391
+ return 5;
392
+ case Code.ALREADY_EXISTS:
393
+ return 6;
394
+ case Code.PERMISSION_DENIED:
395
+ return 7;
396
+ case Code.UNAUTHENTICATED:
397
+ return 16;
398
+ case Code.RESOURCE_EXHAUSTED:
399
+ return 8;
400
+ case Code.FAILED_PRECONDITION:
401
+ return 9;
402
+ case Code.ABORTED:
403
+ return 10;
404
+ case Code.OUT_OF_RANGE:
405
+ return 11;
406
+ case Code.UNIMPLEMENTED:
407
+ return 12;
408
+ case Code.INTERNAL:
409
+ return 13;
410
+ case Code.UNAVAILABLE:
411
+ return 14;
412
+ case Code.DATA_LOSS:
413
+ return 15;
414
+ case Code.NOT_MODIFIED:
415
+ return 100;
416
+ case Code.DECRYPTION_FAILED:
417
+ return 101;
418
+ case Code.INVALID_MEDIA:
419
+ return 102;
420
+ case Code.IN_PROGRESS:
421
+ return 200;
422
+ case Code.CONTENT_TOO_LARGE:
423
+ return 201;
424
+ case Code.URL_PROTOCOL_NOT_SUPPORTED:
425
+ return 202;
426
+ case Code.URL_CONTENT_TYPE_NOT_WHITELISTED:
427
+ return 203;
428
+ case Code.URL_DOWNLOAD_FAILURE:
429
+ return 204;
430
+ case Code.CLOUD_STORAGE_FAILURE:
431
+ return 205;
432
+ default:
433
+ return 0;
434
+ }
435
+ }
436
+ function createBaseCodeProperties() {
437
+ return { errorCode: 0, errorDescription: "", isRetryable: false, source: "" };
438
+ }
439
+ export const CodeProperties = {
440
+ encode(message, writer = _m0.Writer.create()) {
441
+ if (message.errorCode !== 0) {
442
+ writer.uint32(8).uint32(message.errorCode);
443
+ }
444
+ if (message.errorDescription !== "") {
445
+ writer.uint32(18).string(message.errorDescription);
446
+ }
447
+ if (message.isRetryable === true) {
448
+ writer.uint32(24).bool(message.isRetryable);
449
+ }
450
+ if (message.source !== "") {
451
+ writer.uint32(34).string(message.source);
452
+ }
453
+ return writer;
454
+ },
455
+ decode(input, length) {
456
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
457
+ let end = length === undefined ? reader.len : reader.pos + length;
458
+ const message = createBaseCodeProperties();
459
+ while (reader.pos < end) {
460
+ const tag = reader.uint32();
461
+ switch (tag >>> 3) {
462
+ case 1:
463
+ message.errorCode = reader.uint32();
464
+ break;
465
+ case 2:
466
+ message.errorDescription = reader.string();
467
+ break;
468
+ case 3:
469
+ message.isRetryable = reader.bool();
470
+ break;
471
+ case 4:
472
+ message.source = reader.string();
473
+ break;
474
+ default:
475
+ reader.skipType(tag & 7);
476
+ break;
477
+ }
478
+ }
479
+ return message;
480
+ },
481
+ fromJSON(object) {
482
+ return {
483
+ errorCode: isSet(object.errorCode) ? Number(object.errorCode) : 0,
484
+ errorDescription: isSet(object.errorDescription) ? String(object.errorDescription) : "",
485
+ isRetryable: isSet(object.isRetryable) ? Boolean(object.isRetryable) : false,
486
+ source: isSet(object.source) ? String(object.source) : "",
487
+ };
488
+ },
489
+ toJSON(message) {
490
+ const obj = {};
491
+ message.errorCode !== undefined && (obj.errorCode = Math.round(message.errorCode));
492
+ message.errorDescription !== undefined && (obj.errorDescription = message.errorDescription);
493
+ message.isRetryable !== undefined && (obj.isRetryable = message.isRetryable);
494
+ message.source !== undefined && (obj.source = message.source);
495
+ return obj;
496
+ },
497
+ fromPartial(object) {
498
+ const message = createBaseCodeProperties();
499
+ message.errorCode = object.errorCode ?? 0;
500
+ message.errorDescription = object.errorDescription ?? "";
501
+ message.isRetryable = object.isRetryable ?? false;
502
+ message.source = object.source ?? "";
503
+ return message;
504
+ },
505
+ };
506
+ if (_m0.util.Long !== Long) {
507
+ _m0.util.Long = Long;
508
+ _m0.configure();
509
+ }
510
+ function isSet(value) {
511
+ return value !== null && value !== undefined;
512
+ }
@@ -0,0 +1 @@
1
+ export declare const protobufPackage = "google.api";
@@ -0,0 +1,8 @@
1
+ /* eslint-disable */
2
+ import Long from "long";
3
+ import _m0 from "protobufjs/minimal";
4
+ export const protobufPackage = "google.api";
5
+ if (_m0.util.Long !== Long) {
6
+ _m0.util.Long = Long;
7
+ _m0.configure();
8
+ }