protobufjs 4.1.2 → 5.0.2

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 (188) hide show
  1. package/.travis.yml +3 -1
  2. package/README.md +147 -25
  3. package/bin/pbjs +2 -2
  4. package/bower.json +3 -3
  5. package/cli/pbjs/targets/amd.js +1 -1
  6. package/cli/pbjs/targets/json.js +9 -1
  7. package/cli/pbjs/targets/proto.js +48 -24
  8. package/cli/pbjs/util.js +1 -1
  9. package/cli/pbjs.js +9 -2
  10. package/dist/README.md +10 -10
  11. package/dist/{ProtoBuf-light.js → protobuf-light.js} +207 -152
  12. package/dist/protobuf-light.min.js +94 -0
  13. package/dist/protobuf-light.min.js.gz +0 -0
  14. package/dist/protobuf-light.min.map +8 -0
  15. package/dist/{ProtoBuf.js → protobuf.js} +265 -175
  16. package/dist/protobuf.min.js +116 -0
  17. package/dist/protobuf.min.js.gz +0 -0
  18. package/dist/protobuf.min.map +8 -0
  19. package/docs/ProtoBuf.Builder.Message.html +1473 -967
  20. package/docs/ProtoBuf.Builder.Service.html +266 -197
  21. package/docs/ProtoBuf.Builder.html +758 -542
  22. package/docs/ProtoBuf.DotProto.Parser.html +223 -161
  23. package/docs/ProtoBuf.DotProto.Tokenizer.html +344 -248
  24. package/docs/ProtoBuf.DotProto.html +20 -12
  25. package/docs/ProtoBuf.Element.html +554 -554
  26. package/docs/ProtoBuf.Map.html +158 -123
  27. package/docs/ProtoBuf.Reflect.Element.html +286 -143
  28. package/docs/ProtoBuf.Reflect.Enum.Value.html +329 -228
  29. package/docs/ProtoBuf.Reflect.Enum.html +757 -537
  30. package/docs/ProtoBuf.Reflect.Extension.html +73 -56
  31. package/docs/ProtoBuf.Reflect.Message.ExtensionField.html +1013 -740
  32. package/docs/ProtoBuf.Reflect.Message.Field.html +926 -649
  33. package/docs/ProtoBuf.Reflect.Message.OneOf.html +327 -245
  34. package/docs/ProtoBuf.Reflect.Message.html +919 -652
  35. package/docs/ProtoBuf.Reflect.Namespace.html +648 -447
  36. package/docs/ProtoBuf.Reflect.Service.Method.html +363 -251
  37. package/docs/ProtoBuf.Reflect.Service.RPCMethod.html +545 -397
  38. package/docs/ProtoBuf.Reflect.Service.html +721 -511
  39. package/docs/ProtoBuf.Reflect.T.html +268 -197
  40. package/docs/ProtoBuf.Reflect.html +20 -12
  41. package/docs/ProtoBuf.Util.html +169 -118
  42. package/docs/ProtoBuf.html +840 -628
  43. package/docs/ProtoBuf.js.html +271 -180
  44. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  45. package/docs/fonts/OpenSans-Bold-webfont.svg +1830 -0
  46. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  47. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  48. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  49. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  50. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  51. package/docs/fonts/OpenSans-Italic-webfont.svg +1830 -0
  52. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  53. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  54. package/docs/fonts/OpenSans-Light-webfont.svg +1831 -0
  55. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  56. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  57. package/docs/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  58. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  59. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  60. package/docs/fonts/OpenSans-Regular-webfont.svg +1831 -0
  61. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  62. package/docs/index.html +7 -5
  63. package/docs/styles/jsdoc-default.css +95 -75
  64. package/docs/styles/prettify-tomorrow.css +1 -1
  65. package/donate.png +0 -0
  66. package/examples/protoify/json.js +123 -123
  67. package/examples/protoify/json.json +123 -123
  68. package/examples/websocket/server.js +4 -4
  69. package/externs/{ProtoBuf.js → protobuf.js} +933 -922
  70. package/index.js +1 -18
  71. package/jsdoc.json +1 -1
  72. package/package.json +11 -11
  73. package/protobuf.png +0 -0
  74. package/scripts/build.js +53 -58
  75. package/src/ProtoBuf/Builder/Message.js +18 -9
  76. package/src/ProtoBuf/Builder/Service.js +3 -0
  77. package/src/ProtoBuf/Builder.js +34 -10
  78. package/src/ProtoBuf/DotProto/Parser.js +58 -23
  79. package/src/ProtoBuf/Reflect/Element.js +17 -4
  80. package/src/ProtoBuf/Reflect/Message/Field.js +6 -5
  81. package/src/ProtoBuf/Reflect/Message.js +9 -4
  82. package/src/ProtoBuf/Util.js +116 -116
  83. package/src/bower.json +2 -2
  84. package/src/google/protobuf/descriptor.json +55 -15
  85. package/src/{ProtoBuf.js → protobuf.js} +0 -0
  86. package/src/wrap.js +4 -4
  87. package/tests/bench.txt +373 -373
  88. package/tests/complex.json +8 -1
  89. package/tests/custom-options.json +169 -169
  90. package/tests/extend.json +71 -71
  91. package/tests/imports-weak.proto +7 -0
  92. package/tests/imports.json +83 -83
  93. package/tests/nodeunit-browser/nodeunit.css +70 -70
  94. package/tests/nodeunit-browser/nodeunit.js +2108 -2108
  95. package/tests/options.json +32 -32
  96. package/tests/proto2js/Bar.json +46 -46
  97. package/tests/suite.js +107 -82
  98. package/ProtoBuf.png +0 -0
  99. package/dist/ProtoBuf-light.min.js +0 -87
  100. package/dist/ProtoBuf-light.min.js.gz +0 -0
  101. package/dist/ProtoBuf-light.min.map +0 -8
  102. package/dist/ProtoBuf.min.js +0 -108
  103. package/dist/ProtoBuf.min.js.gz +0 -0
  104. package/dist/ProtoBuf.min.map +0 -8
  105. package/externs/ByteBuffer.js +0 -767
  106. package/externs/Long.js +0 -328
  107. package/sandbox/gapi/googleapis/google/api/annotations.proto +0 -29
  108. package/sandbox/gapi/googleapis/google/api/http.proto +0 -245
  109. package/sandbox/gapi/googleapis/google/datastore/v1beta3/datastore.proto +0 -281
  110. package/sandbox/gapi/googleapis/google/datastore/v1beta3/entity.proto +0 -189
  111. package/sandbox/gapi/googleapis/google/datastore/v1beta3/query.proto +0 -281
  112. package/sandbox/gapi/googleapis/google/longrunning/operations.proto +0 -144
  113. package/sandbox/gapi/googleapis/google/protobuf/any.proto +0 -98
  114. package/sandbox/gapi/googleapis/google/protobuf/any_test.proto +0 -41
  115. package/sandbox/gapi/googleapis/google/protobuf/api.proto +0 -201
  116. package/sandbox/gapi/googleapis/google/protobuf/descriptor.proto +0 -773
  117. package/sandbox/gapi/googleapis/google/protobuf/duration.proto +0 -95
  118. package/sandbox/gapi/googleapis/google/protobuf/empty.proto +0 -50
  119. package/sandbox/gapi/googleapis/google/protobuf/field_mask.proto +0 -167
  120. package/sandbox/gapi/googleapis/google/protobuf/map_lite_unittest.proto +0 -130
  121. package/sandbox/gapi/googleapis/google/protobuf/map_proto2_unittest.proto +0 -60
  122. package/sandbox/gapi/googleapis/google/protobuf/map_unittest.proto +0 -129
  123. package/sandbox/gapi/googleapis/google/protobuf/map_unittest_proto3.proto +0 -120
  124. package/sandbox/gapi/googleapis/google/protobuf/source_context.proto +0 -47
  125. package/sandbox/gapi/googleapis/google/protobuf/struct.proto +0 -94
  126. package/sandbox/gapi/googleapis/google/protobuf/timestamp.proto +0 -107
  127. package/sandbox/gapi/googleapis/google/protobuf/type.proto +0 -176
  128. package/sandbox/gapi/googleapis/google/protobuf/unittest.proto +0 -878
  129. package/sandbox/gapi/googleapis/google/protobuf/unittest_arena.proto +0 -46
  130. package/sandbox/gapi/googleapis/google/protobuf/unittest_custom_options.proto +0 -394
  131. package/sandbox/gapi/googleapis/google/protobuf/unittest_drop_unknown_fields.proto +0 -58
  132. package/sandbox/gapi/googleapis/google/protobuf/unittest_embed_optimize_for.proto +0 -51
  133. package/sandbox/gapi/googleapis/google/protobuf/unittest_empty.proto +0 -38
  134. package/sandbox/gapi/googleapis/google/protobuf/unittest_enormous_descriptor.proto +0 -1048
  135. package/sandbox/gapi/googleapis/google/protobuf/unittest_import.proto +0 -66
  136. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_lite.proto +0 -52
  137. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_proto3.proto +0 -68
  138. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public.proto +0 -41
  139. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public_lite.proto +0 -43
  140. package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public_proto3.proto +0 -42
  141. package/sandbox/gapi/googleapis/google/protobuf/unittest_lite.proto +0 -385
  142. package/sandbox/gapi/googleapis/google/protobuf/unittest_lite_imports_nonlite.proto +0 -44
  143. package/sandbox/gapi/googleapis/google/protobuf/unittest_mset.proto +0 -82
  144. package/sandbox/gapi/googleapis/google/protobuf/unittest_mset_wire_format.proto +0 -52
  145. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena.proto +0 -202
  146. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena_import.proto +0 -37
  147. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena_lite.proto +0 -42
  148. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_field_presence.proto +0 -138
  149. package/sandbox/gapi/googleapis/google/protobuf/unittest_no_generic_services.proto +0 -54
  150. package/sandbox/gapi/googleapis/google/protobuf/unittest_optimize_for.proto +0 -67
  151. package/sandbox/gapi/googleapis/google/protobuf/unittest_preserve_unknown_enum.proto +0 -71
  152. package/sandbox/gapi/googleapis/google/protobuf/unittest_preserve_unknown_enum2.proto +0 -50
  153. package/sandbox/gapi/googleapis/google/protobuf/unittest_proto3.proto +0 -388
  154. package/sandbox/gapi/googleapis/google/protobuf/unittest_proto3_arena.proto +0 -206
  155. package/sandbox/gapi/googleapis/google/protobuf/unittest_well_known_types.proto +0 -112
  156. package/sandbox/gapi/googleapis/google/protobuf/unknown_enum_test.proto +0 -62
  157. package/sandbox/gapi/googleapis/google/protobuf/wrappers.proto +0 -117
  158. package/sandbox/gapi/googleapis/google/rpc/code.proto +0 -190
  159. package/sandbox/gapi/googleapis/google/rpc/error_details.proto +0 -157
  160. package/sandbox/gapi/googleapis/google/rpc/status.proto +0 -90
  161. package/sandbox/gapi/googleapis/google/type/color.proto +0 -163
  162. package/sandbox/gapi/googleapis/google/type/date.proto +0 -43
  163. package/sandbox/gapi/googleapis/google/type/dayofweek.proto +0 -50
  164. package/sandbox/gapi/googleapis/google/type/latlng.proto +0 -36
  165. package/sandbox/gapi/googleapis/google/type/money.proto +0 -40
  166. package/sandbox/gapi/googleapis/google/type/timeofday.proto +0 -42
  167. package/sandbox/gapi/test.js +0 -17
  168. package/sandbox/gapi/test.proto +0 -12
  169. package/sandbox/issue146/MyOptions.proto +0 -28
  170. package/sandbox/issue146/Sample.proto +0 -21
  171. package/sandbox/issue146/main.js +0 -3
  172. package/sandbox/issue147/enum.proto +0 -8
  173. package/sandbox/issue147/main.js +0 -3
  174. package/sandbox/issue182/commands.proto +0 -10
  175. package/sandbox/issue182/execute.js +0 -22
  176. package/sandbox/issue182/session_commands.proto +0 -14
  177. package/sandbox/issue289/A.proto +0 -8
  178. package/sandbox/issue289/B.proto +0 -8
  179. package/sandbox/issue289/common.proto +0 -5
  180. package/sandbox/issue289/main.js +0 -7
  181. package/sandbox/issue300/IAuth.proto +0 -14
  182. package/sandbox/issue300/Request.proto +0 -14
  183. package/sandbox/issue300/main.js +0 -26
  184. package/sandbox/issue42/innerextend.proto +0 -18
  185. package/sandbox/issue42/main.js +0 -8
  186. package/sandbox/issue42/outerextend.proto +0 -17
  187. package/tests/gtfs-realtime.proto +0 -552
  188. package/webpack.config.js +0 -9
@@ -1,62 +0,0 @@
1
- // Protocol Buffers - Google's data interchange format
2
- // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
4
- //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- // Definitions of protos for testing cross-version compatibility. The
32
- // UpRevision message acts as if it were a newer version of the DownRevision
33
- // message. That is, UpRevision shares all the same fields as DownRevision,
34
- // but UpRevision can add fields and add enum values.
35
- syntax = "proto2";
36
-
37
- package google.protobuf.util;
38
-
39
- option csharp_namespace = "Google.ProtocolBuffers.TestProtos";
40
-
41
- message DownRevision {
42
- enum Enum {
43
- DEFAULT_VALUE = 2;
44
- NONDEFAULT_VALUE = 3;
45
- }
46
-
47
- optional Enum value = 1 [default = DEFAULT_VALUE];
48
- repeated Enum values = 2;
49
- }
50
-
51
- message UpRevision {
52
- enum Enum {
53
- DEFAULT_VALUE = 2;
54
- NONDEFAULT_VALUE = 3;
55
- NEW_VALUE = 4;
56
- NEW_VALUE_2 = 5;
57
- NEW_VALUE_3 = 6;
58
- }
59
-
60
- optional Enum value = 1 [default = DEFAULT_VALUE];
61
- repeated Enum values = 2;
62
- }
@@ -1,117 +0,0 @@
1
- // Protocol Buffers - Google's data interchange format
2
- // Copyright 2008 Google Inc. All rights reserved.
3
- // https://developers.google.com/protocol-buffers/
4
- //
5
- // Redistribution and use in source and binary forms, with or without
6
- // modification, are permitted provided that the following conditions are
7
- // met:
8
- //
9
- // * Redistributions of source code must retain the above copyright
10
- // notice, this list of conditions and the following disclaimer.
11
- // * Redistributions in binary form must reproduce the above
12
- // copyright notice, this list of conditions and the following disclaimer
13
- // in the documentation and/or other materials provided with the
14
- // distribution.
15
- // * Neither the name of Google Inc. nor the names of its
16
- // contributors may be used to endorse or promote products derived from
17
- // this software without specific prior written permission.
18
- //
19
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- // Wrappers for primitive (non-message) types. These types are useful
32
- // for embedding primitives in the `google.protobuf.Any` type and for places
33
- // where we need to distinguish between the absence of a primitive
34
- // typed field and its default value.
35
-
36
- syntax = "proto3";
37
-
38
- package google.protobuf;
39
-
40
- option java_generate_equals_and_hash = true;
41
- option java_multiple_files = true;
42
- option java_outer_classname = "WrappersProto";
43
- option java_package = "com.google.protobuf";
44
- option csharp_namespace = "Google.Protobuf.WellKnownTypes";
45
- option objc_class_prefix = "GPB";
46
-
47
- // Wrapper message for `double`.
48
- //
49
- // The JSON representation for `DoubleValue` is JSON number.
50
- message DoubleValue {
51
- // The double value.
52
- double value = 1;
53
- }
54
-
55
- // Wrapper message for `float`.
56
- //
57
- // The JSON representation for `FloatValue` is JSON number.
58
- message FloatValue {
59
- // The float value.
60
- float value = 1;
61
- }
62
-
63
- // Wrapper message for `int64`.
64
- //
65
- // The JSON representation for `Int64Value` is JSON string.
66
- message Int64Value {
67
- // The int64 value.
68
- int64 value = 1;
69
- }
70
-
71
- // Wrapper message for `uint64`.
72
- //
73
- // The JSON representation for `UInt64Value` is JSON string.
74
- message UInt64Value {
75
- // The uint64 value.
76
- uint64 value = 1;
77
- }
78
-
79
- // Wrapper message for `int32`.
80
- //
81
- // The JSON representation for `Int32Value` is JSON number.
82
- message Int32Value {
83
- // The int32 value.
84
- int32 value = 1;
85
- }
86
-
87
- // Wrapper message for `uint32`.
88
- //
89
- // The JSON representation for `UInt32Value` is JSON number.
90
- message UInt32Value {
91
- // The uint32 value.
92
- uint32 value = 1;
93
- }
94
-
95
- // Wrapper message for `bool`.
96
- //
97
- // The JSON representation for `BoolValue` is JSON `true` and `false`.
98
- message BoolValue {
99
- // The bool value.
100
- bool value = 1;
101
- }
102
-
103
- // Wrapper message for `string`.
104
- //
105
- // The JSON representation for `StringValue` is JSON string.
106
- message StringValue {
107
- // The string value.
108
- string value = 1;
109
- }
110
-
111
- // Wrapper message for `bytes`.
112
- //
113
- // The JSON representation for `BytesValue` is JSON string.
114
- message BytesValue {
115
- // The bytes value.
116
- bytes value = 1;
117
- }
@@ -1,190 +0,0 @@
1
- // Copyright (c) 2015, Google Inc.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- syntax = "proto3";
16
-
17
- package google.rpc;
18
-
19
- option java_multiple_files = true;
20
- option java_outer_classname = "CodeProto";
21
- option java_package = "com.google.rpc";
22
-
23
-
24
- // The canonical error codes for Google APIs.
25
- // Warnings:
26
- //
27
- // - Do not change any numeric assignments.
28
- // - Changes to this list should be made only if there is a compelling
29
- // need that can't be satisfied in another way.
30
- //
31
- // Sometimes multiple error codes may apply. Services should return
32
- // the most specific error code that applies. For example, prefer
33
- // `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply.
34
- // Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`.
35
- enum Code {
36
- // Not an error; returned on success
37
- //
38
- // HTTP Mapping: 200 OK
39
- OK = 0;
40
-
41
- // The operation was cancelled, typically by the caller.
42
- //
43
- // HTTP Mapping: 499 Client Closed Request
44
- CANCELLED = 1;
45
-
46
- // Unknown error. For example, this error may be returned when
47
- // a `Status` value received from another address space belongs to
48
- // an error space that is not known in this address space. Also
49
- // errors raised by APIs that do not return enough error information
50
- // may be converted to this error.
51
- //
52
- // HTTP Mapping: 500 Internal Server Error
53
- UNKNOWN = 2;
54
-
55
- // The client specified an invalid argument. Note that this differs
56
- // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments
57
- // that are problematic regardless of the state of the system
58
- // (e.g., a malformed file name).
59
- //
60
- // HTTP Mapping: 400 Bad Request
61
- INVALID_ARGUMENT = 3;
62
-
63
- // The deadline expired before the operation could complete. For operations
64
- // that change the state of the system, this error may be returned
65
- // even if the operation has completed successfully. For example, a
66
- // successful response from a server could have been delayed long
67
- // enough for the deadline to expire.
68
- //
69
- // HTTP Mapping: 504 Gateway Timeout
70
- DEADLINE_EXCEEDED = 4;
71
-
72
- // Some requested entity (e.g., file or directory) was not found.
73
- // For privacy reasons, this code *might* be returned when the client
74
- // does not have the access rights to the entity.
75
- //
76
- // HTTP Mapping: 404 Not Found
77
- NOT_FOUND = 5;
78
-
79
- // The entity that a client attempted to create (e.g., file or directory)
80
- // already exists.
81
- //
82
- // HTTP Mapping: 409 Conflict
83
- ALREADY_EXISTS = 6;
84
-
85
- // The caller does not have permission to execute the specified
86
- // operation. `PERMISSION_DENIED` must not be used for rejections
87
- // caused by exhausting some resource (use `RESOURCE_EXHAUSTED`
88
- // instead for those errors). `PERMISSION_DENIED` must not be
89
- // used if the caller can not be identified (use `UNAUTHENTICATED`
90
- // instead for those errors).
91
- //
92
- // HTTP Mapping: 403 Forbidden
93
- PERMISSION_DENIED = 7;
94
-
95
- // The request does not have valid authentication credentials for the
96
- // operation.
97
- //
98
- // HTTP Mapping: 401 Unauthorized
99
- UNAUTHENTICATED = 16;
100
-
101
- // Some resource has been exhausted, perhaps a per-user quota, or
102
- // perhaps the entire file system is out of space.
103
- //
104
- // HTTP Mapping: 429 Too Many Requests
105
- RESOURCE_EXHAUSTED = 8;
106
-
107
- // The operation was rejected because the system is not in a state
108
- // required for the operation's execution. For example, the directory
109
- // to be deleted is non-empty, an rmdir operation is applied to
110
- // a non-directory, etc.
111
- //
112
- // Service implementors can use the following guidelines to decide
113
- // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:
114
- // (a) Use `UNAVAILABLE` if the client can retry just the failing call.
115
- // (b) Use `ABORTED` if the client should retry at a higher level
116
- // (e.g., restarting a read-modify-write sequence).
117
- // (c) Use `FAILED_PRECONDITION` if the client should not retry until
118
- // the system state has been explicitly fixed. E.g., if an "rmdir"
119
- // fails because the directory is non-empty, `FAILED_PRECONDITION`
120
- // should be returned since the client should not retry unless
121
- // the files are deleted from the directory.
122
- // (d) Use `FAILED_PRECONDITION` if the client performs conditional
123
- // REST Get/Update/Delete on a resource and the resource on the
124
- // server does not match the condition. E.g., conflicting
125
- // read-modify-write on the same resource.
126
- //
127
- // HTTP Mapping: 400 Bad Request
128
- //
129
- // NOTE: HTTP spec says `412 Precondition Failed` should be used only if
130
- // the request contains Etag-related headers. So if the server does see
131
- // Etag-related headers in the request, it may choose to return 412
132
- // instead of 400 for this error code.
133
- FAILED_PRECONDITION = 9;
134
-
135
- // The operation was aborted, typically due to a concurrency issue such as
136
- // a sequencer check failure or transaction abort.
137
- //
138
- // See the guidelines above for deciding between `FAILED_PRECONDITION`,
139
- // `ABORTED`, and `UNAVAILABLE`.
140
- //
141
- // HTTP Mapping: 409 Conflict
142
- ABORTED = 10;
143
-
144
- // The operation was attempted past the valid range. E.g., seeking or
145
- // reading past end-of-file.
146
- //
147
- // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may
148
- // be fixed if the system state changes. For example, a 32-bit file
149
- // system will generate `INVALID_ARGUMENT` if asked to read at an
150
- // offset that is not in the range [0,2^32-1], but it will generate
151
- // `OUT_OF_RANGE` if asked to read from an offset past the current
152
- // file size.
153
- //
154
- // There is a fair bit of overlap between `FAILED_PRECONDITION` and
155
- // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific
156
- // error) when it applies so that callers who are iterating through
157
- // a space can easily look for an `OUT_OF_RANGE` error to detect when
158
- // they are done.
159
- //
160
- // HTTP Mapping: 400 Bad Request
161
- OUT_OF_RANGE = 11;
162
-
163
- // The operation is not implemented or is not supported/enabled in this
164
- // service.
165
- //
166
- // HTTP Mapping: 501 Not Implemented
167
- UNIMPLEMENTED = 12;
168
-
169
- // Internal errors. This means that some invariants expected by the
170
- // underlying system have been broken. This error code is reserved
171
- // for serious errors.
172
- //
173
- // HTTP Mapping: 500 Internal Server Error
174
- INTERNAL = 13;
175
-
176
- // The service is currently unavailable. This is most likely a
177
- // transient condition, which can be corrected by retrying with
178
- // a backoff.
179
- //
180
- // See the guidelines above for deciding between `FAILED_PRECONDITION`,
181
- // `ABORTED`, and `UNAVAILABLE`.
182
- //
183
- // HTTP Mapping: 503 Service Unavailable
184
- UNAVAILABLE = 14;
185
-
186
- // Unrecoverable data loss or corruption.
187
- //
188
- // HTTP Mapping: 500 Internal Server Error
189
- DATA_LOSS = 15;
190
- }
@@ -1,157 +0,0 @@
1
- // Copyright (c) 2015, Google Inc.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- syntax = "proto3";
16
-
17
- package google.rpc;
18
-
19
- import "google/protobuf/duration.proto";
20
-
21
- option java_multiple_files = true;
22
- option java_outer_classname = "ErrorDetailsProto";
23
- option java_package = "com.google.rpc";
24
-
25
-
26
- // Describes when the clients can retry a failed request. Clients could ignore
27
- // the recommendation here or retry when this information is missing from error
28
- // responses.
29
- //
30
- // It's always recommended that clients should use exponential backoff when
31
- // retrying.
32
- //
33
- // Clients should wait until `retry_delay` amount of time has passed since
34
- // receiving the error response before retrying. If retrying requests also
35
- // fail, clients should use an exponential backoff scheme to gradually increase
36
- // the delay between retries based on `retry_delay`, until either a maximum
37
- // number of retires have been reached or a maximum retry delay cap has been
38
- // reached.
39
- message RetryInfo {
40
- // Clients should wait at least this long between retrying the same request.
41
- google.protobuf.Duration retry_delay = 1;
42
- }
43
-
44
- // Describes additional debugging info.
45
- message DebugInfo {
46
- // The stack trace entries indicating where the error occurred.
47
- repeated string stack_entries = 1;
48
-
49
- // Additional debugging information provided by the server.
50
- string detail = 2;
51
- }
52
-
53
- // Describes how a quota check failed.
54
- //
55
- // For example if a daily limit was exceeded for the calling project,
56
- // a service could respond with a QuotaFailure detail containing the project
57
- // id and the description of the quota limit that was exceeded. If the
58
- // calling project hasn't enabled the service in the developer console, then
59
- // a service could respond with the project id and set `service_disabled`
60
- // to true.
61
- //
62
- // Also see RetryDetail and Help types for other details about handling a
63
- // quota failure.
64
- message QuotaFailure {
65
- // A message type used to describe a single quota violation. For example, a
66
- // daily quota or a custom quota that was exceeded.
67
- message Violation {
68
- // The subject on which the quota check failed.
69
- // For example, "clientip:<ip address of client>" or "project:<Google
70
- // developer project id>".
71
- string subject = 1;
72
-
73
- // A description of how the quota check failed. Clients can use this
74
- // description to find more about the quota configuration in the service's
75
- // public documentation, or find the relevant quota limit to adjust through
76
- // developer console.
77
- //
78
- // For example: "Service disabled" or "Daily Limit for read operations
79
- // exceeded".
80
- string description = 2;
81
- }
82
-
83
- // Describes all quota violations.
84
- repeated Violation violations = 1;
85
- }
86
-
87
- // Describes violations in a client request. This error type focuses on the
88
- // syntactic aspects of the request.
89
- message BadRequest {
90
- // A message type used to describe a single bad request field.
91
- message FieldViolation {
92
- // A path leading to a field in the request body. The value will be a
93
- // sequence of dot-separated identifiers that identify a protocol buffer
94
- // field. E.g., "violations.field" would identify this field.
95
- string field = 1;
96
-
97
- // A description of why the request element is bad.
98
- string description = 2;
99
- }
100
-
101
- // Describes all violations in a client request.
102
- repeated FieldViolation field_violations = 1;
103
- }
104
-
105
- // Contains metadata about the request that clients can attach when filing a bug
106
- // or providing other forms of feedback.
107
- message RequestInfo {
108
- // An opaque string that should only be interpreted by the service generating
109
- // it. For example, it can be used to identify requests in the service's logs.
110
- string request_id = 1;
111
-
112
- // Any data that was used to serve this request. For example, an encrypted
113
- // stack trace that can be sent back to the service provider for debugging.
114
- string serving_data = 2;
115
- }
116
-
117
- // Describes the resource that is being accessed.
118
- message ResourceInfo {
119
- // A name for the type of resource being accessed, e.g. "sql table",
120
- // "cloud storage bucket", "file", "Google calendar"; or the type URL
121
- // of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
122
- string resource_type = 1;
123
-
124
- // The name of the resource being accessed. For example, a shared calendar
125
- // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
126
- // error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
127
- string resource_name = 2;
128
-
129
- // The owner of the resource (optional).
130
- // For example, "user:<owner email>" or "project:<Google developer project
131
- // id>".
132
- string owner = 3;
133
-
134
- // Describes what error is encountered when accessing this resource.
135
- // For example, updating a cloud project may require the `writer` permission
136
- // on the developer console project.
137
- string description = 4;
138
- }
139
-
140
- // Provides links to documentation or for performing an out of band action.
141
- //
142
- // For example, if a quota check failed with an error indicating the calling
143
- // project hasn't enabled the accessed service, this can contain a URL pointing
144
- // directly to the right place in the developer console to flip the bit.
145
- message Help {
146
- // Describes a URL link.
147
- message Link {
148
- // Describes what the link offers.
149
- string description = 1;
150
-
151
- // The URL of the link.
152
- string url = 2;
153
- }
154
-
155
- // URL(s) pointing to additional information on handling the current error.
156
- repeated Link links = 1;
157
- }
@@ -1,90 +0,0 @@
1
- // Copyright (c) 2015, Google Inc.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- syntax = "proto3";
16
-
17
- package google.rpc;
18
-
19
- import "google/protobuf/any.proto";
20
-
21
- option java_multiple_files = true;
22
- option java_outer_classname = "StatusProto";
23
- option java_package = "com.google.rpc";
24
-
25
-
26
- // The `Status` type defines a logical error model that is suitable for different
27
- // programming environments, including REST APIs and RPC APIs. It is used by
28
- // [gRPC](https://github.com/grpc). The error model is designed to be:
29
- //
30
- // - Simple to use and understand for most users
31
- // - Flexible enough to meet unexpected needs
32
- //
33
- // # Overview
34
- //
35
- // The `Status` message contains three pieces of data: error code, error message,
36
- // and error details. The error code should be an enum value of
37
- // [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The
38
- // error message should be a developer-facing English message that helps
39
- // developers *understand* and *resolve* the error. If a localized user-facing
40
- // error message is needed, put the localized message in the error details or
41
- // localize it in the client. The optional error details may contain arbitrary
42
- // information about the error. There is a predefined set of error detail types
43
- // in the package `google.rpc` which can be used for common error conditions.
44
- //
45
- // # Language mapping
46
- //
47
- // The `Status` message is the logical representation of the error model, but it
48
- // is not necessarily the actual wire format. When the `Status` message is
49
- // exposed in different client libraries and different wire protocols, it can be
50
- // mapped differently. For example, it will likely be mapped to some exceptions
51
- // in Java, but more likely mapped to some error codes in C.
52
- //
53
- // # Other uses
54
- //
55
- // The error model and the `Status` message can be used in a variety of
56
- // environments, either with or without APIs, to provide a
57
- // consistent developer experience across different environments.
58
- //
59
- // Example uses of this error model include:
60
- //
61
- // - Partial errors. If a service needs to return partial errors to the client,
62
- // it may embed the `Status` in the normal response to indicate the partial
63
- // errors.
64
- //
65
- // - Workflow errors. A typical workflow has multiple steps. Each step may
66
- // have a `Status` message for error reporting purpose.
67
- //
68
- // - Batch operations. If a client uses batch request and batch response, the
69
- // `Status` message should be used directly inside batch response, one for
70
- // each error sub-response.
71
- //
72
- // - Asynchronous operations. If an API call embeds asynchronous operation
73
- // results in its response, the status of those operations should be
74
- // represented directly using the `Status` message.
75
- //
76
- // - Logging. If some API errors are stored in logs, the message `Status` could
77
- // be used directly after any stripping needed for security/privacy reasons.
78
- message Status {
79
- // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
80
- int32 code = 1;
81
-
82
- // A developer-facing error message, which should be in English. Any
83
- // user-facing error message should be localized and sent in the
84
- // [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
85
- string message = 2;
86
-
87
- // A list of messages that carry the error details. There will be a
88
- // common set of message types for APIs to use.
89
- repeated google.protobuf.Any details = 3;
90
- }