@temporalio/core-bridge 1.8.6 → 1.9.0-rc.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.
Files changed (196) hide show
  1. package/Cargo.lock +189 -152
  2. package/Cargo.toml +1 -0
  3. package/lib/index.d.ts +17 -44
  4. package/lib/index.js.map +1 -1
  5. package/package.json +3 -4
  6. package/releases/aarch64-apple-darwin/index.node +0 -0
  7. package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
  8. package/releases/x86_64-apple-darwin/index.node +0 -0
  9. package/releases/x86_64-pc-windows-msvc/index.node +0 -0
  10. package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
  11. package/sdk-core/.github/workflows/heavy.yml +4 -0
  12. package/sdk-core/.github/workflows/per-pr.yml +96 -0
  13. package/sdk-core/ARCHITECTURE.md +1 -1
  14. package/sdk-core/Cargo.toml +6 -0
  15. package/sdk-core/README.md +37 -21
  16. package/sdk-core/client/Cargo.toml +6 -3
  17. package/sdk-core/client/src/lib.rs +272 -138
  18. package/sdk-core/client/src/metrics.rs +68 -57
  19. package/sdk-core/client/src/raw.rs +191 -45
  20. package/sdk-core/client/src/retry.rs +20 -0
  21. package/sdk-core/client/src/worker_registry/mod.rs +264 -0
  22. package/sdk-core/client/src/workflow_handle/mod.rs +2 -1
  23. package/sdk-core/core/Cargo.toml +16 -18
  24. package/sdk-core/core/src/core_tests/child_workflows.rs +7 -7
  25. package/sdk-core/core/src/core_tests/mod.rs +1 -0
  26. package/sdk-core/core/src/core_tests/replay_flag.rs +29 -39
  27. package/sdk-core/core/src/core_tests/updates.rs +73 -0
  28. package/sdk-core/core/src/core_tests/workflow_tasks.rs +52 -1
  29. package/sdk-core/core/src/ephemeral_server/mod.rs +34 -11
  30. package/sdk-core/core/src/internal_flags.rs +7 -1
  31. package/sdk-core/core/src/lib.rs +19 -36
  32. package/sdk-core/core/src/protosext/mod.rs +11 -3
  33. package/sdk-core/core/src/protosext/protocol_messages.rs +102 -0
  34. package/sdk-core/core/src/replay/mod.rs +100 -48
  35. package/sdk-core/core/src/telemetry/log_export.rs +161 -28
  36. package/sdk-core/core/src/telemetry/metrics.rs +869 -248
  37. package/sdk-core/core/src/telemetry/mod.rs +135 -239
  38. package/sdk-core/core/src/telemetry/prometheus_server.rs +36 -31
  39. package/sdk-core/core/src/test_help/mod.rs +63 -4
  40. package/sdk-core/core/src/worker/activities/activity_heartbeat_manager.rs +12 -2
  41. package/sdk-core/core/src/worker/activities.rs +276 -10
  42. package/sdk-core/core/src/worker/client/mocks.rs +18 -0
  43. package/sdk-core/core/src/worker/client.rs +16 -3
  44. package/sdk-core/core/src/worker/mod.rs +50 -19
  45. package/sdk-core/core/src/worker/slot_provider.rs +175 -0
  46. package/sdk-core/core/src/worker/workflow/driven_workflow.rs +27 -34
  47. package/sdk-core/core/src/worker/workflow/history_update.rs +4 -1
  48. package/sdk-core/core/src/worker/workflow/machines/activity_state_machine.rs +36 -94
  49. package/sdk-core/core/src/worker/workflow/machines/cancel_external_state_machine.rs +34 -22
  50. package/sdk-core/core/src/worker/workflow/machines/cancel_workflow_state_machine.rs +50 -34
  51. package/sdk-core/core/src/worker/workflow/machines/child_workflow_state_machine.rs +106 -92
  52. package/sdk-core/core/src/worker/workflow/machines/continue_as_new_workflow_state_machine.rs +22 -21
  53. package/sdk-core/core/src/worker/workflow/machines/local_activity_state_machine.rs +386 -499
  54. package/sdk-core/core/src/worker/workflow/machines/mod.rs +12 -2
  55. package/sdk-core/core/src/worker/workflow/machines/modify_workflow_properties_state_machine.rs +33 -26
  56. package/sdk-core/core/src/worker/workflow/machines/patch_state_machine.rs +198 -215
  57. package/sdk-core/core/src/worker/workflow/machines/signal_external_state_machine.rs +66 -62
  58. package/sdk-core/core/src/worker/workflow/machines/timer_state_machine.rs +88 -119
  59. package/sdk-core/core/src/worker/workflow/machines/transition_coverage.rs +3 -1
  60. package/sdk-core/core/src/worker/workflow/machines/update_state_machine.rs +411 -0
  61. package/sdk-core/core/src/worker/workflow/machines/upsert_search_attributes_state_machine.rs +26 -25
  62. package/sdk-core/core/src/worker/workflow/machines/workflow_machines.rs +302 -85
  63. package/sdk-core/core/src/worker/workflow/managed_run.rs +179 -132
  64. package/sdk-core/core/src/worker/workflow/mod.rs +121 -46
  65. package/sdk-core/core/src/worker/workflow/run_cache.rs +8 -12
  66. package/sdk-core/core/src/worker/workflow/workflow_stream.rs +45 -38
  67. package/sdk-core/core-api/Cargo.toml +7 -6
  68. package/sdk-core/core-api/src/lib.rs +4 -12
  69. package/sdk-core/core-api/src/telemetry/metrics.rs +334 -0
  70. package/sdk-core/core-api/src/telemetry.rs +53 -42
  71. package/sdk-core/core-api/src/worker.rs +7 -0
  72. package/sdk-core/{.buildkite/docker → docker}/docker-compose.yaml +1 -1
  73. package/sdk-core/etc/dynamic-config.yaml +11 -1
  74. package/sdk-core/fsm/rustfsm_procmacro/Cargo.toml +1 -1
  75. package/sdk-core/fsm/rustfsm_procmacro/src/lib.rs +1 -3
  76. package/sdk-core/fsm/rustfsm_procmacro/tests/trybuild/no_handle_conversions_require_into_fail.stderr +2 -2
  77. package/sdk-core/sdk/Cargo.toml +1 -1
  78. package/sdk-core/sdk/src/lib.rs +85 -7
  79. package/sdk-core/sdk/src/workflow_context/options.rs +4 -0
  80. package/sdk-core/sdk/src/workflow_context.rs +43 -15
  81. package/sdk-core/sdk/src/workflow_future.rs +334 -204
  82. package/sdk-core/sdk-core-protos/Cargo.toml +2 -2
  83. package/sdk-core/sdk-core-protos/build.rs +14 -14
  84. package/sdk-core/sdk-core-protos/protos/api_upstream/.buildkite/Dockerfile +2 -0
  85. package/sdk-core/sdk-core-protos/protos/api_upstream/Makefile +99 -0
  86. package/sdk-core/sdk-core-protos/protos/api_upstream/api-linter.yaml +56 -0
  87. package/sdk-core/sdk-core-protos/protos/api_upstream/buf.gen.yaml +20 -0
  88. package/sdk-core/sdk-core-protos/protos/api_upstream/buf.lock +11 -0
  89. package/sdk-core/sdk-core-protos/protos/api_upstream/buf.yaml +18 -0
  90. package/sdk-core/sdk-core-protos/protos/api_upstream/google/api/annotations.proto +31 -0
  91. package/sdk-core/sdk-core-protos/protos/api_upstream/google/api/http.proto +379 -0
  92. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/any.proto +162 -0
  93. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/descriptor.proto +1212 -0
  94. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/duration.proto +115 -0
  95. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/empty.proto +51 -0
  96. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/timestamp.proto +144 -0
  97. package/sdk-core/sdk-core-protos/protos/api_upstream/google/protobuf/wrappers.proto +123 -0
  98. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/batch/v1/message.proto +3 -5
  99. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/command/v1/message.proto +11 -13
  100. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/common/v1/message.proto +2 -4
  101. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/failed_cause.proto +2 -0
  102. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/reset.proto +1 -1
  103. package/sdk-core/{protos/api_upstream/build/tools.go → sdk-core-protos/protos/api_upstream/temporal/api/export/v1/message.proto} +22 -6
  104. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/filter/v1/message.proto +2 -4
  105. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/history/v1/message.proto +21 -23
  106. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/namespace/v1/message.proto +2 -4
  107. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/operatorservice/v1/request_response.proto +2 -0
  108. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/operatorservice/v1/service.proto +4 -0
  109. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/replication/v1/message.proto +1 -3
  110. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/schedule/v1/message.proto +36 -20
  111. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +13 -0
  112. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/taskqueue/v1/message.proto +2 -4
  113. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/update/v1/message.proto +1 -1
  114. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/version/v1/message.proto +2 -3
  115. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/workflow/v1/message.proto +18 -20
  116. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/workflowservice/v1/request_response.proto +84 -32
  117. package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/workflowservice/v1/service.proto +205 -47
  118. package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/workflow_activation/workflow_activation.proto +57 -0
  119. package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/workflow_commands/workflow_commands.proto +27 -0
  120. package/sdk-core/sdk-core-protos/src/history_builder.rs +67 -2
  121. package/sdk-core/sdk-core-protos/src/lib.rs +75 -2
  122. package/sdk-core/sdk-core-protos/src/utilities.rs +14 -0
  123. package/sdk-core/test-utils/Cargo.toml +5 -1
  124. package/sdk-core/test-utils/src/canned_histories.rs +3 -57
  125. package/sdk-core/test-utils/src/interceptors.rs +46 -0
  126. package/sdk-core/test-utils/src/lib.rs +106 -38
  127. package/sdk-core/tests/integ_tests/metrics_tests.rs +110 -15
  128. package/sdk-core/tests/integ_tests/queries_tests.rs +174 -3
  129. package/sdk-core/tests/integ_tests/update_tests.rs +908 -0
  130. package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +44 -1
  131. package/sdk-core/tests/integ_tests/workflow_tests/cancel_external.rs +1 -1
  132. package/sdk-core/tests/integ_tests/workflow_tests/cancel_wf.rs +1 -1
  133. package/sdk-core/tests/integ_tests/workflow_tests/child_workflows.rs +4 -4
  134. package/sdk-core/tests/integ_tests/workflow_tests/eager.rs +61 -0
  135. package/sdk-core/tests/integ_tests/workflow_tests/replay.rs +27 -2
  136. package/sdk-core/tests/integ_tests/workflow_tests.rs +1 -0
  137. package/sdk-core/tests/main.rs +2 -1
  138. package/sdk-core/tests/runner.rs +15 -2
  139. package/src/conversions.rs +75 -89
  140. package/src/helpers.rs +74 -0
  141. package/src/runtime.rs +17 -6
  142. package/src/worker.rs +14 -61
  143. package/ts/index.ts +21 -52
  144. package/sdk-core/.buildkite/docker/Dockerfile +0 -9
  145. package/sdk-core/.buildkite/docker/build.sh +0 -5
  146. package/sdk-core/.buildkite/docker/docker-compose-ci.yaml +0 -27
  147. package/sdk-core/.buildkite/pipeline.yml +0 -57
  148. package/sdk-core/.github/workflows/semgrep.yml +0 -25
  149. package/sdk-core/core/src/worker/workflow/bridge.rs +0 -35
  150. package/sdk-core/core/src/worker/workflow/managed_run/managed_wf_test.rs +0 -215
  151. package/sdk-core/protos/api_upstream/.buildkite/Dockerfile +0 -2
  152. package/sdk-core/protos/api_upstream/Makefile +0 -80
  153. package/sdk-core/protos/api_upstream/api-linter.yaml +0 -40
  154. package/sdk-core/protos/api_upstream/buf.yaml +0 -9
  155. package/sdk-core/protos/api_upstream/build/go.mod +0 -7
  156. package/sdk-core/protos/api_upstream/build/go.sum +0 -5
  157. package/sdk-core/protos/api_upstream/go.mod +0 -6
  158. package/sdk-core/protos/testsrv_upstream/dependencies/gogoproto/gogo.proto +0 -141
  159. /package/sdk-core/{.buildkite/docker → docker}/docker-compose-telem.yaml +0 -0
  160. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.buildkite/docker-compose.yml +0 -0
  161. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.buildkite/pipeline.yml +0 -0
  162. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/CODEOWNERS +0 -0
  163. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  164. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/workflows/publish-docs.yml +0 -0
  165. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/.github/workflows/trigger-api-go-update.yml +0 -0
  166. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/LICENSE +0 -0
  167. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/README.md +0 -0
  168. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/batch_operation.proto +0 -0
  169. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/command_type.proto +0 -0
  170. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/common.proto +0 -0
  171. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/event_type.proto +0 -0
  172. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/namespace.proto +0 -0
  173. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/query.proto +0 -0
  174. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/schedule.proto +0 -0
  175. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/task_queue.proto +0 -0
  176. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/update.proto +0 -0
  177. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/enums/v1/workflow.proto +0 -0
  178. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/errordetails/v1/message.proto +0 -0
  179. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/failure/v1/message.proto +0 -0
  180. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/protocol/v1/message.proto +0 -0
  181. /package/sdk-core/{protos → sdk-core-protos/protos}/api_upstream/temporal/api/query/v1/message.proto +0 -0
  182. /package/sdk-core/{protos → sdk-core-protos/protos}/google/rpc/status.proto +0 -0
  183. /package/sdk-core/{protos → sdk-core-protos/protos}/grpc/health/v1/health.proto +0 -0
  184. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/activity_result/activity_result.proto +0 -0
  185. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/activity_task/activity_task.proto +0 -0
  186. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/child_workflow/child_workflow.proto +0 -0
  187. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/common/common.proto +0 -0
  188. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/core_interface.proto +0 -0
  189. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/external_data/external_data.proto +0 -0
  190. /package/sdk-core/{protos → sdk-core-protos/protos}/local/temporal/sdk/core/workflow_completion/workflow_completion.proto +0 -0
  191. /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/Makefile +0 -0
  192. /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/api-linter.yaml +0 -0
  193. /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/buf.yaml +0 -0
  194. /package/sdk-core/{protos/api_upstream → sdk-core-protos/protos/testsrv_upstream}/dependencies/gogoproto/gogo.proto +0 -0
  195. /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/temporal/api/testservice/v1/request_response.proto +0 -0
  196. /package/sdk-core/{protos → sdk-core-protos/protos}/testsrv_upstream/temporal/api/testservice/v1/service.proto +0 -0
@@ -0,0 +1,1212 @@
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
+ // Author: kenton@google.com (Kenton Varda)
32
+ // Based on original Protocol Buffers design by
33
+ // Sanjay Ghemawat, Jeff Dean, and others.
34
+ //
35
+ // The messages in this file describe the definitions found in .proto files.
36
+ // A valid .proto file can be translated directly to a FileDescriptorProto
37
+ // without any other information (e.g. without reading its imports).
38
+
39
+ syntax = "proto2";
40
+
41
+ package google.protobuf;
42
+
43
+ option go_package = "google.golang.org/protobuf/types/descriptorpb";
44
+ option java_package = "com.google.protobuf";
45
+ option java_outer_classname = "DescriptorProtos";
46
+ option csharp_namespace = "Google.Protobuf.Reflection";
47
+ option objc_class_prefix = "GPB";
48
+ option cc_enable_arenas = true;
49
+
50
+ // descriptor.proto must be optimized for speed because reflection-based
51
+ // algorithms don't work during bootstrapping.
52
+ option optimize_for = SPEED;
53
+
54
+ // The protocol compiler can output a FileDescriptorSet containing the .proto
55
+ // files it parses.
56
+ message FileDescriptorSet {
57
+ repeated FileDescriptorProto file = 1;
58
+ }
59
+
60
+ // The full set of known editions.
61
+ enum Edition {
62
+ // A placeholder for an unknown edition value.
63
+ EDITION_UNKNOWN = 0;
64
+
65
+ // Legacy syntax "editions". These pre-date editions, but behave much like
66
+ // distinct editions. These can't be used to specify the edition of proto
67
+ // files, but feature definitions must supply proto2/proto3 defaults for
68
+ // backwards compatibility.
69
+ EDITION_PROTO2 = 998;
70
+ EDITION_PROTO3 = 999;
71
+
72
+ // Editions that have been released. The specific values are arbitrary and
73
+ // should not be depended on, but they will always be time-ordered for easy
74
+ // comparison.
75
+ EDITION_2023 = 1000;
76
+
77
+ // Placeholder editions for testing feature resolution. These should not be
78
+ // used or relyed on outside of tests.
79
+ EDITION_1_TEST_ONLY = 1;
80
+ EDITION_2_TEST_ONLY = 2;
81
+ EDITION_99997_TEST_ONLY = 99997;
82
+ EDITION_99998_TEST_ONLY = 99998;
83
+ EDITION_99999_TEST_ONLY = 99999;
84
+ }
85
+
86
+ // Describes a complete .proto file.
87
+ message FileDescriptorProto {
88
+ optional string name = 1; // file name, relative to root of source tree
89
+ optional string package = 2; // e.g. "foo", "foo.bar", etc.
90
+
91
+ // Names of files imported by this file.
92
+ repeated string dependency = 3;
93
+ // Indexes of the public imported files in the dependency list above.
94
+ repeated int32 public_dependency = 10;
95
+ // Indexes of the weak imported files in the dependency list.
96
+ // For Google-internal migration only. Do not use.
97
+ repeated int32 weak_dependency = 11;
98
+
99
+ // All top-level definitions in this file.
100
+ repeated DescriptorProto message_type = 4;
101
+ repeated EnumDescriptorProto enum_type = 5;
102
+ repeated ServiceDescriptorProto service = 6;
103
+ repeated FieldDescriptorProto extension = 7;
104
+
105
+ optional FileOptions options = 8;
106
+
107
+ // This field contains optional information about the original source code.
108
+ // You may safely remove this entire field without harming runtime
109
+ // functionality of the descriptors -- the information is needed only by
110
+ // development tools.
111
+ optional SourceCodeInfo source_code_info = 9;
112
+
113
+ // The syntax of the proto file.
114
+ // The supported values are "proto2", "proto3", and "editions".
115
+ //
116
+ // If `edition` is present, this value must be "editions".
117
+ optional string syntax = 12;
118
+
119
+ // The edition of the proto file.
120
+ optional Edition edition = 14;
121
+ }
122
+
123
+ // Describes a message type.
124
+ message DescriptorProto {
125
+ optional string name = 1;
126
+
127
+ repeated FieldDescriptorProto field = 2;
128
+ repeated FieldDescriptorProto extension = 6;
129
+
130
+ repeated DescriptorProto nested_type = 3;
131
+ repeated EnumDescriptorProto enum_type = 4;
132
+
133
+ message ExtensionRange {
134
+ optional int32 start = 1; // Inclusive.
135
+ optional int32 end = 2; // Exclusive.
136
+
137
+ optional ExtensionRangeOptions options = 3;
138
+ }
139
+ repeated ExtensionRange extension_range = 5;
140
+
141
+ repeated OneofDescriptorProto oneof_decl = 8;
142
+
143
+ optional MessageOptions options = 7;
144
+
145
+ // Range of reserved tag numbers. Reserved tag numbers may not be used by
146
+ // fields or extension ranges in the same message. Reserved ranges may
147
+ // not overlap.
148
+ message ReservedRange {
149
+ optional int32 start = 1; // Inclusive.
150
+ optional int32 end = 2; // Exclusive.
151
+ }
152
+ repeated ReservedRange reserved_range = 9;
153
+ // Reserved field names, which may not be used by fields in the same message.
154
+ // A given name may only be reserved once.
155
+ repeated string reserved_name = 10;
156
+ }
157
+
158
+ message ExtensionRangeOptions {
159
+ // The parser stores options it doesn't recognize here. See above.
160
+ repeated UninterpretedOption uninterpreted_option = 999;
161
+
162
+ message Declaration {
163
+ // The extension number declared within the extension range.
164
+ optional int32 number = 1;
165
+
166
+ // The fully-qualified name of the extension field. There must be a leading
167
+ // dot in front of the full name.
168
+ optional string full_name = 2;
169
+
170
+ // The fully-qualified type name of the extension field. Unlike
171
+ // Metadata.type, Declaration.type must have a leading dot for messages
172
+ // and enums.
173
+ optional string type = 3;
174
+
175
+ // If true, indicates that the number is reserved in the extension range,
176
+ // and any extension field with the number will fail to compile. Set this
177
+ // when a declared extension field is deleted.
178
+ optional bool reserved = 5;
179
+
180
+ // If true, indicates that the extension must be defined as repeated.
181
+ // Otherwise the extension must be defined as optional.
182
+ optional bool repeated = 6;
183
+
184
+ reserved 4; // removed is_repeated
185
+ }
186
+
187
+ // For external users: DO NOT USE. We are in the process of open sourcing
188
+ // extension declaration and executing internal cleanups before it can be
189
+ // used externally.
190
+ repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];
191
+
192
+ // Any features defined in the specific edition.
193
+ optional FeatureSet features = 50;
194
+
195
+ // The verification state of the extension range.
196
+ enum VerificationState {
197
+ // All the extensions of the range must be declared.
198
+ DECLARATION = 0;
199
+ UNVERIFIED = 1;
200
+ }
201
+
202
+ // The verification state of the range.
203
+ // TODO: flip the default to DECLARATION once all empty ranges
204
+ // are marked as UNVERIFIED.
205
+ optional VerificationState verification = 3 [default = UNVERIFIED];
206
+
207
+ // Clients can define custom options in extensions of this message. See above.
208
+ extensions 1000 to max;
209
+ }
210
+
211
+ // Describes a field within a message.
212
+ message FieldDescriptorProto {
213
+ enum Type {
214
+ // 0 is reserved for errors.
215
+ // Order is weird for historical reasons.
216
+ TYPE_DOUBLE = 1;
217
+ TYPE_FLOAT = 2;
218
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
219
+ // negative values are likely.
220
+ TYPE_INT64 = 3;
221
+ TYPE_UINT64 = 4;
222
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
223
+ // negative values are likely.
224
+ TYPE_INT32 = 5;
225
+ TYPE_FIXED64 = 6;
226
+ TYPE_FIXED32 = 7;
227
+ TYPE_BOOL = 8;
228
+ TYPE_STRING = 9;
229
+ // Tag-delimited aggregate.
230
+ // Group type is deprecated and not supported in proto3. However, Proto3
231
+ // implementations should still be able to parse the group wire format and
232
+ // treat group fields as unknown fields.
233
+ TYPE_GROUP = 10;
234
+ TYPE_MESSAGE = 11; // Length-delimited aggregate.
235
+
236
+ // New in version 2.
237
+ TYPE_BYTES = 12;
238
+ TYPE_UINT32 = 13;
239
+ TYPE_ENUM = 14;
240
+ TYPE_SFIXED32 = 15;
241
+ TYPE_SFIXED64 = 16;
242
+ TYPE_SINT32 = 17; // Uses ZigZag encoding.
243
+ TYPE_SINT64 = 18; // Uses ZigZag encoding.
244
+ }
245
+
246
+ enum Label {
247
+ // 0 is reserved for errors
248
+ LABEL_OPTIONAL = 1;
249
+ LABEL_REQUIRED = 2;
250
+ LABEL_REPEATED = 3;
251
+ }
252
+
253
+ optional string name = 1;
254
+ optional int32 number = 3;
255
+ optional Label label = 4;
256
+
257
+ // If type_name is set, this need not be set. If both this and type_name
258
+ // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
259
+ optional Type type = 5;
260
+
261
+ // For message and enum types, this is the name of the type. If the name
262
+ // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
263
+ // rules are used to find the type (i.e. first the nested types within this
264
+ // message are searched, then within the parent, on up to the root
265
+ // namespace).
266
+ optional string type_name = 6;
267
+
268
+ // For extensions, this is the name of the type being extended. It is
269
+ // resolved in the same manner as type_name.
270
+ optional string extendee = 2;
271
+
272
+ // For numeric types, contains the original text representation of the value.
273
+ // For booleans, "true" or "false".
274
+ // For strings, contains the default text contents (not escaped in any way).
275
+ // For bytes, contains the C escaped value. All bytes >= 128 are escaped.
276
+ optional string default_value = 7;
277
+
278
+ // If set, gives the index of a oneof in the containing type's oneof_decl
279
+ // list. This field is a member of that oneof.
280
+ optional int32 oneof_index = 9;
281
+
282
+ // JSON name of this field. The value is set by protocol compiler. If the
283
+ // user has set a "json_name" option on this field, that option's value
284
+ // will be used. Otherwise, it's deduced from the field's name by converting
285
+ // it to camelCase.
286
+ optional string json_name = 10;
287
+
288
+ optional FieldOptions options = 8;
289
+
290
+ // If true, this is a proto3 "optional". When a proto3 field is optional, it
291
+ // tracks presence regardless of field type.
292
+ //
293
+ // When proto3_optional is true, this field must be belong to a oneof to
294
+ // signal to old proto3 clients that presence is tracked for this field. This
295
+ // oneof is known as a "synthetic" oneof, and this field must be its sole
296
+ // member (each proto3 optional field gets its own synthetic oneof). Synthetic
297
+ // oneofs exist in the descriptor only, and do not generate any API. Synthetic
298
+ // oneofs must be ordered after all "real" oneofs.
299
+ //
300
+ // For message fields, proto3_optional doesn't create any semantic change,
301
+ // since non-repeated message fields always track presence. However it still
302
+ // indicates the semantic detail of whether the user wrote "optional" or not.
303
+ // This can be useful for round-tripping the .proto file. For consistency we
304
+ // give message fields a synthetic oneof also, even though it is not required
305
+ // to track presence. This is especially important because the parser can't
306
+ // tell if a field is a message or an enum, so it must always create a
307
+ // synthetic oneof.
308
+ //
309
+ // Proto2 optional fields do not set this flag, because they already indicate
310
+ // optional with `LABEL_OPTIONAL`.
311
+ optional bool proto3_optional = 17;
312
+ }
313
+
314
+ // Describes a oneof.
315
+ message OneofDescriptorProto {
316
+ optional string name = 1;
317
+ optional OneofOptions options = 2;
318
+ }
319
+
320
+ // Describes an enum type.
321
+ message EnumDescriptorProto {
322
+ optional string name = 1;
323
+
324
+ repeated EnumValueDescriptorProto value = 2;
325
+
326
+ optional EnumOptions options = 3;
327
+
328
+ // Range of reserved numeric values. Reserved values may not be used by
329
+ // entries in the same enum. Reserved ranges may not overlap.
330
+ //
331
+ // Note that this is distinct from DescriptorProto.ReservedRange in that it
332
+ // is inclusive such that it can appropriately represent the entire int32
333
+ // domain.
334
+ message EnumReservedRange {
335
+ optional int32 start = 1; // Inclusive.
336
+ optional int32 end = 2; // Inclusive.
337
+ }
338
+
339
+ // Range of reserved numeric values. Reserved numeric values may not be used
340
+ // by enum values in the same enum declaration. Reserved ranges may not
341
+ // overlap.
342
+ repeated EnumReservedRange reserved_range = 4;
343
+
344
+ // Reserved enum value names, which may not be reused. A given name may only
345
+ // be reserved once.
346
+ repeated string reserved_name = 5;
347
+ }
348
+
349
+ // Describes a value within an enum.
350
+ message EnumValueDescriptorProto {
351
+ optional string name = 1;
352
+ optional int32 number = 2;
353
+
354
+ optional EnumValueOptions options = 3;
355
+ }
356
+
357
+ // Describes a service.
358
+ message ServiceDescriptorProto {
359
+ optional string name = 1;
360
+ repeated MethodDescriptorProto method = 2;
361
+
362
+ optional ServiceOptions options = 3;
363
+ }
364
+
365
+ // Describes a method of a service.
366
+ message MethodDescriptorProto {
367
+ optional string name = 1;
368
+
369
+ // Input and output type names. These are resolved in the same way as
370
+ // FieldDescriptorProto.type_name, but must refer to a message type.
371
+ optional string input_type = 2;
372
+ optional string output_type = 3;
373
+
374
+ optional MethodOptions options = 4;
375
+
376
+ // Identifies if client streams multiple client messages
377
+ optional bool client_streaming = 5 [default = false];
378
+ // Identifies if server streams multiple server messages
379
+ optional bool server_streaming = 6 [default = false];
380
+ }
381
+
382
+ // ===================================================================
383
+ // Options
384
+
385
+ // Each of the definitions above may have "options" attached. These are
386
+ // just annotations which may cause code to be generated slightly differently
387
+ // or may contain hints for code that manipulates protocol messages.
388
+ //
389
+ // Clients may define custom options as extensions of the *Options messages.
390
+ // These extensions may not yet be known at parsing time, so the parser cannot
391
+ // store the values in them. Instead it stores them in a field in the *Options
392
+ // message called uninterpreted_option. This field must have the same name
393
+ // across all *Options messages. We then use this field to populate the
394
+ // extensions when we build a descriptor, at which point all protos have been
395
+ // parsed and so all extensions are known.
396
+ //
397
+ // Extension numbers for custom options may be chosen as follows:
398
+ // * For options which will only be used within a single application or
399
+ // organization, or for experimental options, use field numbers 50000
400
+ // through 99999. It is up to you to ensure that you do not use the
401
+ // same number for multiple options.
402
+ // * For options which will be published and used publicly by multiple
403
+ // independent entities, e-mail protobuf-global-extension-registry@google.com
404
+ // to reserve extension numbers. Simply provide your project name (e.g.
405
+ // Objective-C plugin) and your project website (if available) -- there's no
406
+ // need to explain how you intend to use them. Usually you only need one
407
+ // extension number. You can declare multiple options with only one extension
408
+ // number by putting them in a sub-message. See the Custom Options section of
409
+ // the docs for examples:
410
+ // https://developers.google.com/protocol-buffers/docs/proto#options
411
+ // If this turns out to be popular, a web service will be set up
412
+ // to automatically assign option numbers.
413
+
414
+ message FileOptions {
415
+
416
+ // Sets the Java package where classes generated from this .proto will be
417
+ // placed. By default, the proto package is used, but this is often
418
+ // inappropriate because proto packages do not normally start with backwards
419
+ // domain names.
420
+ optional string java_package = 1;
421
+
422
+ // Controls the name of the wrapper Java class generated for the .proto file.
423
+ // That class will always contain the .proto file's getDescriptor() method as
424
+ // well as any top-level extensions defined in the .proto file.
425
+ // If java_multiple_files is disabled, then all the other classes from the
426
+ // .proto file will be nested inside the single wrapper outer class.
427
+ optional string java_outer_classname = 8;
428
+
429
+ // If enabled, then the Java code generator will generate a separate .java
430
+ // file for each top-level message, enum, and service defined in the .proto
431
+ // file. Thus, these types will *not* be nested inside the wrapper class
432
+ // named by java_outer_classname. However, the wrapper class will still be
433
+ // generated to contain the file's getDescriptor() method as well as any
434
+ // top-level extensions defined in the file.
435
+ optional bool java_multiple_files = 10 [default = false];
436
+
437
+ // This option does nothing.
438
+ optional bool java_generate_equals_and_hash = 20 [deprecated=true];
439
+
440
+ // If set true, then the Java2 code generator will generate code that
441
+ // throws an exception whenever an attempt is made to assign a non-UTF-8
442
+ // byte sequence to a string field.
443
+ // Message reflection will do the same.
444
+ // However, an extension field still accepts non-UTF-8 byte sequences.
445
+ // This option has no effect on when used with the lite runtime.
446
+ optional bool java_string_check_utf8 = 27 [default = false];
447
+
448
+ // Generated classes can be optimized for speed or code size.
449
+ enum OptimizeMode {
450
+ SPEED = 1; // Generate complete code for parsing, serialization,
451
+ // etc.
452
+ CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
453
+ LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
454
+ }
455
+ optional OptimizeMode optimize_for = 9 [default = SPEED];
456
+
457
+ // Sets the Go package where structs generated from this .proto will be
458
+ // placed. If omitted, the Go package will be derived from the following:
459
+ // - The basename of the package import path, if provided.
460
+ // - Otherwise, the package statement in the .proto file, if present.
461
+ // - Otherwise, the basename of the .proto file, without extension.
462
+ optional string go_package = 11;
463
+
464
+ // Should generic services be generated in each language? "Generic" services
465
+ // are not specific to any particular RPC system. They are generated by the
466
+ // main code generators in each language (without additional plugins).
467
+ // Generic services were the only kind of service generation supported by
468
+ // early versions of google.protobuf.
469
+ //
470
+ // Generic services are now considered deprecated in favor of using plugins
471
+ // that generate code specific to your particular RPC system. Therefore,
472
+ // these default to false. Old code which depends on generic services should
473
+ // explicitly set them to true.
474
+ optional bool cc_generic_services = 16 [default = false];
475
+ optional bool java_generic_services = 17 [default = false];
476
+ optional bool py_generic_services = 18 [default = false];
477
+ optional bool php_generic_services = 42 [default = false];
478
+
479
+ // Is this file deprecated?
480
+ // Depending on the target platform, this can emit Deprecated annotations
481
+ // for everything in the file, or it will be completely ignored; in the very
482
+ // least, this is a formalization for deprecating files.
483
+ optional bool deprecated = 23 [default = false];
484
+
485
+ // Enables the use of arenas for the proto messages in this file. This applies
486
+ // only to generated classes for C++.
487
+ optional bool cc_enable_arenas = 31 [default = true];
488
+
489
+ // Sets the objective c class prefix which is prepended to all objective c
490
+ // generated classes from this .proto. There is no default.
491
+ optional string objc_class_prefix = 36;
492
+
493
+ // Namespace for generated classes; defaults to the package.
494
+ optional string csharp_namespace = 37;
495
+
496
+ // By default Swift generators will take the proto package and CamelCase it
497
+ // replacing '.' with underscore and use that to prefix the types/symbols
498
+ // defined. When this options is provided, they will use this value instead
499
+ // to prefix the types/symbols defined.
500
+ optional string swift_prefix = 39;
501
+
502
+ // Sets the php class prefix which is prepended to all php generated classes
503
+ // from this .proto. Default is empty.
504
+ optional string php_class_prefix = 40;
505
+
506
+ // Use this option to change the namespace of php generated classes. Default
507
+ // is empty. When this option is empty, the package name will be used for
508
+ // determining the namespace.
509
+ optional string php_namespace = 41;
510
+
511
+ // Use this option to change the namespace of php generated metadata classes.
512
+ // Default is empty. When this option is empty, the proto file name will be
513
+ // used for determining the namespace.
514
+ optional string php_metadata_namespace = 44;
515
+
516
+ // Use this option to change the package of ruby generated classes. Default
517
+ // is empty. When this option is not set, the package name will be used for
518
+ // determining the ruby package.
519
+ optional string ruby_package = 45;
520
+
521
+ // Any features defined in the specific edition.
522
+ optional FeatureSet features = 50;
523
+
524
+ // The parser stores options it doesn't recognize here.
525
+ // See the documentation for the "Options" section above.
526
+ repeated UninterpretedOption uninterpreted_option = 999;
527
+
528
+ // Clients can define custom options in extensions of this message.
529
+ // See the documentation for the "Options" section above.
530
+ extensions 1000 to max;
531
+
532
+ reserved 38;
533
+ }
534
+
535
+ message MessageOptions {
536
+ // Set true to use the old proto1 MessageSet wire format for extensions.
537
+ // This is provided for backwards-compatibility with the MessageSet wire
538
+ // format. You should not use this for any other reason: It's less
539
+ // efficient, has fewer features, and is more complicated.
540
+ //
541
+ // The message must be defined exactly as follows:
542
+ // message Foo {
543
+ // option message_set_wire_format = true;
544
+ // extensions 4 to max;
545
+ // }
546
+ // Note that the message cannot have any defined fields; MessageSets only
547
+ // have extensions.
548
+ //
549
+ // All extensions of your type must be singular messages; e.g. they cannot
550
+ // be int32s, enums, or repeated messages.
551
+ //
552
+ // Because this is an option, the above two restrictions are not enforced by
553
+ // the protocol compiler.
554
+ optional bool message_set_wire_format = 1 [default = false];
555
+
556
+ // Disables the generation of the standard "descriptor()" accessor, which can
557
+ // conflict with a field of the same name. This is meant to make migration
558
+ // from proto1 easier; new code should avoid fields named "descriptor".
559
+ optional bool no_standard_descriptor_accessor = 2 [default = false];
560
+
561
+ // Is this message deprecated?
562
+ // Depending on the target platform, this can emit Deprecated annotations
563
+ // for the message, or it will be completely ignored; in the very least,
564
+ // this is a formalization for deprecating messages.
565
+ optional bool deprecated = 3 [default = false];
566
+
567
+ reserved 4, 5, 6;
568
+
569
+ // NOTE: Do not set the option in .proto files. Always use the maps syntax
570
+ // instead. The option should only be implicitly set by the proto compiler
571
+ // parser.
572
+ //
573
+ // Whether the message is an automatically generated map entry type for the
574
+ // maps field.
575
+ //
576
+ // For maps fields:
577
+ // map<KeyType, ValueType> map_field = 1;
578
+ // The parsed descriptor looks like:
579
+ // message MapFieldEntry {
580
+ // option map_entry = true;
581
+ // optional KeyType key = 1;
582
+ // optional ValueType value = 2;
583
+ // }
584
+ // repeated MapFieldEntry map_field = 1;
585
+ //
586
+ // Implementations may choose not to generate the map_entry=true message, but
587
+ // use a native map in the target language to hold the keys and values.
588
+ // The reflection APIs in such implementations still need to work as
589
+ // if the field is a repeated message field.
590
+ optional bool map_entry = 7;
591
+
592
+ reserved 8; // javalite_serializable
593
+ reserved 9; // javanano_as_lite
594
+
595
+ // Enable the legacy handling of JSON field name conflicts. This lowercases
596
+ // and strips underscored from the fields before comparison in proto3 only.
597
+ // The new behavior takes `json_name` into account and applies to proto2 as
598
+ // well.
599
+ //
600
+ // This should only be used as a temporary measure against broken builds due
601
+ // to the change in behavior for JSON field name conflicts.
602
+ //
603
+ // TODO This is legacy behavior we plan to remove once downstream
604
+ // teams have had time to migrate.
605
+ optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];
606
+
607
+ // Any features defined in the specific edition.
608
+ optional FeatureSet features = 12;
609
+
610
+ // The parser stores options it doesn't recognize here. See above.
611
+ repeated UninterpretedOption uninterpreted_option = 999;
612
+
613
+ // Clients can define custom options in extensions of this message. See above.
614
+ extensions 1000 to max;
615
+ }
616
+
617
+ message FieldOptions {
618
+ // The ctype option instructs the C++ code generator to use a different
619
+ // representation of the field than it normally would. See the specific
620
+ // options below. This option is only implemented to support use of
621
+ // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of
622
+ // type "bytes" in the open source release -- sorry, we'll try to include
623
+ // other types in a future version!
624
+ optional CType ctype = 1 [default = STRING];
625
+ enum CType {
626
+ // Default mode.
627
+ STRING = 0;
628
+
629
+ // The option [ctype=CORD] may be applied to a non-repeated field of type
630
+ // "bytes". It indicates that in C++, the data should be stored in a Cord
631
+ // instead of a string. For very large strings, this may reduce memory
632
+ // fragmentation. It may also allow better performance when parsing from a
633
+ // Cord, or when parsing with aliasing enabled, as the parsed Cord may then
634
+ // alias the original buffer.
635
+ CORD = 1;
636
+
637
+ STRING_PIECE = 2;
638
+ }
639
+ // The packed option can be enabled for repeated primitive fields to enable
640
+ // a more efficient representation on the wire. Rather than repeatedly
641
+ // writing the tag and type for each element, the entire array is encoded as
642
+ // a single length-delimited blob. In proto3, only explicit setting it to
643
+ // false will avoid using packed encoding.
644
+ optional bool packed = 2;
645
+
646
+ // The jstype option determines the JavaScript type used for values of the
647
+ // field. The option is permitted only for 64 bit integral and fixed types
648
+ // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
649
+ // is represented as JavaScript string, which avoids loss of precision that
650
+ // can happen when a large value is converted to a floating point JavaScript.
651
+ // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
652
+ // use the JavaScript "number" type. The behavior of the default option
653
+ // JS_NORMAL is implementation dependent.
654
+ //
655
+ // This option is an enum to permit additional types to be added, e.g.
656
+ // goog.math.Integer.
657
+ optional JSType jstype = 6 [default = JS_NORMAL];
658
+ enum JSType {
659
+ // Use the default type.
660
+ JS_NORMAL = 0;
661
+
662
+ // Use JavaScript strings.
663
+ JS_STRING = 1;
664
+
665
+ // Use JavaScript numbers.
666
+ JS_NUMBER = 2;
667
+ }
668
+
669
+ // Should this field be parsed lazily? Lazy applies only to message-type
670
+ // fields. It means that when the outer message is initially parsed, the
671
+ // inner message's contents will not be parsed but instead stored in encoded
672
+ // form. The inner message will actually be parsed when it is first accessed.
673
+ //
674
+ // This is only a hint. Implementations are free to choose whether to use
675
+ // eager or lazy parsing regardless of the value of this option. However,
676
+ // setting this option true suggests that the protocol author believes that
677
+ // using lazy parsing on this field is worth the additional bookkeeping
678
+ // overhead typically needed to implement it.
679
+ //
680
+ // This option does not affect the public interface of any generated code;
681
+ // all method signatures remain the same. Furthermore, thread-safety of the
682
+ // interface is not affected by this option; const methods remain safe to
683
+ // call from multiple threads concurrently, while non-const methods continue
684
+ // to require exclusive access.
685
+ //
686
+ // Note that implementations may choose not to check required fields within
687
+ // a lazy sub-message. That is, calling IsInitialized() on the outer message
688
+ // may return true even if the inner message has missing required fields.
689
+ // This is necessary because otherwise the inner message would have to be
690
+ // parsed in order to perform the check, defeating the purpose of lazy
691
+ // parsing. An implementation which chooses not to check required fields
692
+ // must be consistent about it. That is, for any particular sub-message, the
693
+ // implementation must either *always* check its required fields, or *never*
694
+ // check its required fields, regardless of whether or not the message has
695
+ // been parsed.
696
+ //
697
+ // As of May 2022, lazy verifies the contents of the byte stream during
698
+ // parsing. An invalid byte stream will cause the overall parsing to fail.
699
+ optional bool lazy = 5 [default = false];
700
+
701
+ // unverified_lazy does no correctness checks on the byte stream. This should
702
+ // only be used where lazy with verification is prohibitive for performance
703
+ // reasons.
704
+ optional bool unverified_lazy = 15 [default = false];
705
+
706
+ // Is this field deprecated?
707
+ // Depending on the target platform, this can emit Deprecated annotations
708
+ // for accessors, or it will be completely ignored; in the very least, this
709
+ // is a formalization for deprecating fields.
710
+ optional bool deprecated = 3 [default = false];
711
+
712
+ // For Google-internal migration only. Do not use.
713
+ optional bool weak = 10 [default = false];
714
+
715
+ // Indicate that the field value should not be printed out when using debug
716
+ // formats, e.g. when the field contains sensitive credentials.
717
+ optional bool debug_redact = 16 [default = false];
718
+
719
+ // If set to RETENTION_SOURCE, the option will be omitted from the binary.
720
+ // Note: as of January 2023, support for this is in progress and does not yet
721
+ // have an effect (b/264593489).
722
+ enum OptionRetention {
723
+ RETENTION_UNKNOWN = 0;
724
+ RETENTION_RUNTIME = 1;
725
+ RETENTION_SOURCE = 2;
726
+ }
727
+
728
+ optional OptionRetention retention = 17;
729
+
730
+ // This indicates the types of entities that the field may apply to when used
731
+ // as an option. If it is unset, then the field may be freely used as an
732
+ // option on any kind of entity. Note: as of January 2023, support for this is
733
+ // in progress and does not yet have an effect (b/264593489).
734
+ enum OptionTargetType {
735
+ TARGET_TYPE_UNKNOWN = 0;
736
+ TARGET_TYPE_FILE = 1;
737
+ TARGET_TYPE_EXTENSION_RANGE = 2;
738
+ TARGET_TYPE_MESSAGE = 3;
739
+ TARGET_TYPE_FIELD = 4;
740
+ TARGET_TYPE_ONEOF = 5;
741
+ TARGET_TYPE_ENUM = 6;
742
+ TARGET_TYPE_ENUM_ENTRY = 7;
743
+ TARGET_TYPE_SERVICE = 8;
744
+ TARGET_TYPE_METHOD = 9;
745
+ }
746
+
747
+ repeated OptionTargetType targets = 19;
748
+
749
+ message EditionDefault {
750
+ optional Edition edition = 3;
751
+ optional string value = 2; // Textproto value.
752
+ }
753
+ repeated EditionDefault edition_defaults = 20;
754
+
755
+ // Any features defined in the specific edition.
756
+ optional FeatureSet features = 21;
757
+
758
+ // The parser stores options it doesn't recognize here. See above.
759
+ repeated UninterpretedOption uninterpreted_option = 999;
760
+
761
+ // Clients can define custom options in extensions of this message. See above.
762
+ extensions 1000 to max;
763
+
764
+ reserved 4; // removed jtype
765
+ reserved 18; // reserve target, target_obsolete_do_not_use
766
+ }
767
+
768
+ message OneofOptions {
769
+ // Any features defined in the specific edition.
770
+ optional FeatureSet features = 1;
771
+
772
+ // The parser stores options it doesn't recognize here. See above.
773
+ repeated UninterpretedOption uninterpreted_option = 999;
774
+
775
+ // Clients can define custom options in extensions of this message. See above.
776
+ extensions 1000 to max;
777
+ }
778
+
779
+ message EnumOptions {
780
+
781
+ // Set this option to true to allow mapping different tag names to the same
782
+ // value.
783
+ optional bool allow_alias = 2;
784
+
785
+ // Is this enum deprecated?
786
+ // Depending on the target platform, this can emit Deprecated annotations
787
+ // for the enum, or it will be completely ignored; in the very least, this
788
+ // is a formalization for deprecating enums.
789
+ optional bool deprecated = 3 [default = false];
790
+
791
+ reserved 5; // javanano_as_lite
792
+
793
+ // Enable the legacy handling of JSON field name conflicts. This lowercases
794
+ // and strips underscored from the fields before comparison in proto3 only.
795
+ // The new behavior takes `json_name` into account and applies to proto2 as
796
+ // well.
797
+ // TODO Remove this legacy behavior once downstream teams have
798
+ // had time to migrate.
799
+ optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];
800
+
801
+ // Any features defined in the specific edition.
802
+ optional FeatureSet features = 7;
803
+
804
+ // The parser stores options it doesn't recognize here. See above.
805
+ repeated UninterpretedOption uninterpreted_option = 999;
806
+
807
+ // Clients can define custom options in extensions of this message. See above.
808
+ extensions 1000 to max;
809
+ }
810
+
811
+ message EnumValueOptions {
812
+ // Is this enum value deprecated?
813
+ // Depending on the target platform, this can emit Deprecated annotations
814
+ // for the enum value, or it will be completely ignored; in the very least,
815
+ // this is a formalization for deprecating enum values.
816
+ optional bool deprecated = 1 [default = false];
817
+
818
+ // Any features defined in the specific edition.
819
+ optional FeatureSet features = 2;
820
+
821
+ // Indicate that fields annotated with this enum value should not be printed
822
+ // out when using debug formats, e.g. when the field contains sensitive
823
+ // credentials.
824
+ optional bool debug_redact = 3 [default = false];
825
+
826
+ // The parser stores options it doesn't recognize here. See above.
827
+ repeated UninterpretedOption uninterpreted_option = 999;
828
+
829
+ // Clients can define custom options in extensions of this message. See above.
830
+ extensions 1000 to max;
831
+ }
832
+
833
+ message ServiceOptions {
834
+
835
+ // Any features defined in the specific edition.
836
+ optional FeatureSet features = 34;
837
+
838
+ // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
839
+ // framework. We apologize for hoarding these numbers to ourselves, but
840
+ // we were already using them long before we decided to release Protocol
841
+ // Buffers.
842
+
843
+ // Is this service deprecated?
844
+ // Depending on the target platform, this can emit Deprecated annotations
845
+ // for the service, or it will be completely ignored; in the very least,
846
+ // this is a formalization for deprecating services.
847
+ optional bool deprecated = 33 [default = false];
848
+
849
+ // The parser stores options it doesn't recognize here. See above.
850
+ repeated UninterpretedOption uninterpreted_option = 999;
851
+
852
+ // Clients can define custom options in extensions of this message. See above.
853
+ extensions 1000 to max;
854
+ }
855
+
856
+ message MethodOptions {
857
+
858
+ // Note: Field numbers 1 through 32 are reserved for Google's internal RPC
859
+ // framework. We apologize for hoarding these numbers to ourselves, but
860
+ // we were already using them long before we decided to release Protocol
861
+ // Buffers.
862
+
863
+ // Is this method deprecated?
864
+ // Depending on the target platform, this can emit Deprecated annotations
865
+ // for the method, or it will be completely ignored; in the very least,
866
+ // this is a formalization for deprecating methods.
867
+ optional bool deprecated = 33 [default = false];
868
+
869
+ // Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
870
+ // or neither? HTTP based RPC implementation may choose GET verb for safe
871
+ // methods, and PUT verb for idempotent methods instead of the default POST.
872
+ enum IdempotencyLevel {
873
+ IDEMPOTENCY_UNKNOWN = 0;
874
+ NO_SIDE_EFFECTS = 1; // implies idempotent
875
+ IDEMPOTENT = 2; // idempotent, but may have side effects
876
+ }
877
+ optional IdempotencyLevel idempotency_level = 34
878
+ [default = IDEMPOTENCY_UNKNOWN];
879
+
880
+ // Any features defined in the specific edition.
881
+ optional FeatureSet features = 35;
882
+
883
+ // The parser stores options it doesn't recognize here. See above.
884
+ repeated UninterpretedOption uninterpreted_option = 999;
885
+
886
+ // Clients can define custom options in extensions of this message. See above.
887
+ extensions 1000 to max;
888
+ }
889
+
890
+ // A message representing a option the parser does not recognize. This only
891
+ // appears in options protos created by the compiler::Parser class.
892
+ // DescriptorPool resolves these when building Descriptor objects. Therefore,
893
+ // options protos in descriptor objects (e.g. returned by Descriptor::options(),
894
+ // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
895
+ // in them.
896
+ message UninterpretedOption {
897
+ // The name of the uninterpreted option. Each string represents a segment in
898
+ // a dot-separated name. is_extension is true iff a segment represents an
899
+ // extension (denoted with parentheses in options specs in .proto files).
900
+ // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents
901
+ // "foo.(bar.baz).moo".
902
+ message NamePart {
903
+ required string name_part = 1;
904
+ required bool is_extension = 2;
905
+ }
906
+ repeated NamePart name = 2;
907
+
908
+ // The value of the uninterpreted option, in whatever type the tokenizer
909
+ // identified it as during parsing. Exactly one of these should be set.
910
+ optional string identifier_value = 3;
911
+ optional uint64 positive_int_value = 4;
912
+ optional int64 negative_int_value = 5;
913
+ optional double double_value = 6;
914
+ optional bytes string_value = 7;
915
+ optional string aggregate_value = 8;
916
+ }
917
+
918
+ // ===================================================================
919
+ // Features
920
+
921
+ // TODO Enums in C++ gencode (and potentially other languages) are
922
+ // not well scoped. This means that each of the feature enums below can clash
923
+ // with each other. The short names we've chosen maximize call-site
924
+ // readability, but leave us very open to this scenario. A future feature will
925
+ // be designed and implemented to handle this, hopefully before we ever hit a
926
+ // conflict here.
927
+ message FeatureSet {
928
+ enum FieldPresence {
929
+ FIELD_PRESENCE_UNKNOWN = 0;
930
+ EXPLICIT = 1;
931
+ IMPLICIT = 2;
932
+ LEGACY_REQUIRED = 3;
933
+ }
934
+ optional FieldPresence field_presence = 1 [
935
+ retention = RETENTION_RUNTIME,
936
+ targets = TARGET_TYPE_FIELD,
937
+ targets = TARGET_TYPE_FILE,
938
+ edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" },
939
+ edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" },
940
+ edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" }
941
+ ];
942
+
943
+ enum EnumType {
944
+ ENUM_TYPE_UNKNOWN = 0;
945
+ OPEN = 1;
946
+ CLOSED = 2;
947
+ }
948
+ optional EnumType enum_type = 2 [
949
+ retention = RETENTION_RUNTIME,
950
+ targets = TARGET_TYPE_ENUM,
951
+ targets = TARGET_TYPE_FILE,
952
+ edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" },
953
+ edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" }
954
+ ];
955
+
956
+ enum RepeatedFieldEncoding {
957
+ REPEATED_FIELD_ENCODING_UNKNOWN = 0;
958
+ PACKED = 1;
959
+ EXPANDED = 2;
960
+ }
961
+ optional RepeatedFieldEncoding repeated_field_encoding = 3 [
962
+ retention = RETENTION_RUNTIME,
963
+ targets = TARGET_TYPE_FIELD,
964
+ targets = TARGET_TYPE_FILE,
965
+ edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" },
966
+ edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" }
967
+ ];
968
+
969
+ enum Utf8Validation {
970
+ UTF8_VALIDATION_UNKNOWN = 0;
971
+ UNVERIFIED = 1;
972
+ VERIFY = 2;
973
+ }
974
+ optional Utf8Validation utf8_validation = 4 [
975
+ retention = RETENTION_RUNTIME,
976
+ targets = TARGET_TYPE_FIELD,
977
+ targets = TARGET_TYPE_FILE,
978
+ edition_defaults = { edition: EDITION_PROTO2, value: "UNVERIFIED" },
979
+ edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" }
980
+ ];
981
+
982
+ enum MessageEncoding {
983
+ MESSAGE_ENCODING_UNKNOWN = 0;
984
+ LENGTH_PREFIXED = 1;
985
+ DELIMITED = 2;
986
+ }
987
+ optional MessageEncoding message_encoding = 5 [
988
+ retention = RETENTION_RUNTIME,
989
+ targets = TARGET_TYPE_FIELD,
990
+ targets = TARGET_TYPE_FILE,
991
+ edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" }
992
+ ];
993
+
994
+ enum JsonFormat {
995
+ JSON_FORMAT_UNKNOWN = 0;
996
+ ALLOW = 1;
997
+ LEGACY_BEST_EFFORT = 2;
998
+ }
999
+ optional JsonFormat json_format = 6 [
1000
+ retention = RETENTION_RUNTIME,
1001
+ targets = TARGET_TYPE_MESSAGE,
1002
+ targets = TARGET_TYPE_ENUM,
1003
+ targets = TARGET_TYPE_FILE,
1004
+ edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" },
1005
+ edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" }
1006
+ ];
1007
+
1008
+ reserved 999;
1009
+
1010
+ extensions 1000; // for Protobuf C++
1011
+ extensions 1001; // for Protobuf Java
1012
+
1013
+ extensions 9995 to 9999; // For internal testing
1014
+ }
1015
+
1016
+ // A compiled specification for the defaults of a set of features. These
1017
+ // messages are generated from FeatureSet extensions and can be used to seed
1018
+ // feature resolution. The resolution with this object becomes a simple search
1019
+ // for the closest matching edition, followed by proto merges.
1020
+ message FeatureSetDefaults {
1021
+ // A map from every known edition with a unique set of defaults to its
1022
+ // defaults. Not all editions may be contained here. For a given edition,
1023
+ // the defaults at the closest matching edition ordered at or before it should
1024
+ // be used. This field must be in strict ascending order by edition.
1025
+ message FeatureSetEditionDefault {
1026
+ optional Edition edition = 3;
1027
+ optional FeatureSet features = 2;
1028
+ }
1029
+ repeated FeatureSetEditionDefault defaults = 1;
1030
+
1031
+ // The minimum supported edition (inclusive) when this was constructed.
1032
+ // Editions before this will not have defaults.
1033
+ optional Edition minimum_edition = 4;
1034
+
1035
+ // The maximum known edition (inclusive) when this was constructed. Editions
1036
+ // after this will not have reliable defaults.
1037
+ optional Edition maximum_edition = 5;
1038
+ }
1039
+
1040
+ // ===================================================================
1041
+ // Optional source code info
1042
+
1043
+ // Encapsulates information about the original source file from which a
1044
+ // FileDescriptorProto was generated.
1045
+ message SourceCodeInfo {
1046
+ // A Location identifies a piece of source code in a .proto file which
1047
+ // corresponds to a particular definition. This information is intended
1048
+ // to be useful to IDEs, code indexers, documentation generators, and similar
1049
+ // tools.
1050
+ //
1051
+ // For example, say we have a file like:
1052
+ // message Foo {
1053
+ // optional string foo = 1;
1054
+ // }
1055
+ // Let's look at just the field definition:
1056
+ // optional string foo = 1;
1057
+ // ^ ^^ ^^ ^ ^^^
1058
+ // a bc de f ghi
1059
+ // We have the following locations:
1060
+ // span path represents
1061
+ // [a,i) [ 4, 0, 2, 0 ] The whole field definition.
1062
+ // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
1063
+ // [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
1064
+ // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
1065
+ // [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
1066
+ //
1067
+ // Notes:
1068
+ // - A location may refer to a repeated field itself (i.e. not to any
1069
+ // particular index within it). This is used whenever a set of elements are
1070
+ // logically enclosed in a single code segment. For example, an entire
1071
+ // extend block (possibly containing multiple extension definitions) will
1072
+ // have an outer location whose path refers to the "extensions" repeated
1073
+ // field without an index.
1074
+ // - Multiple locations may have the same path. This happens when a single
1075
+ // logical declaration is spread out across multiple places. The most
1076
+ // obvious example is the "extend" block again -- there may be multiple
1077
+ // extend blocks in the same scope, each of which will have the same path.
1078
+ // - A location's span is not always a subset of its parent's span. For
1079
+ // example, the "extendee" of an extension declaration appears at the
1080
+ // beginning of the "extend" block and is shared by all extensions within
1081
+ // the block.
1082
+ // - Just because a location's span is a subset of some other location's span
1083
+ // does not mean that it is a descendant. For example, a "group" defines
1084
+ // both a type and a field in a single declaration. Thus, the locations
1085
+ // corresponding to the type and field and their components will overlap.
1086
+ // - Code which tries to interpret locations should probably be designed to
1087
+ // ignore those that it doesn't understand, as more types of locations could
1088
+ // be recorded in the future.
1089
+ repeated Location location = 1;
1090
+ message Location {
1091
+ // Identifies which part of the FileDescriptorProto was defined at this
1092
+ // location.
1093
+ //
1094
+ // Each element is a field number or an index. They form a path from
1095
+ // the root FileDescriptorProto to the place where the definition occurs.
1096
+ // For example, this path:
1097
+ // [ 4, 3, 2, 7, 1 ]
1098
+ // refers to:
1099
+ // file.message_type(3) // 4, 3
1100
+ // .field(7) // 2, 7
1101
+ // .name() // 1
1102
+ // This is because FileDescriptorProto.message_type has field number 4:
1103
+ // repeated DescriptorProto message_type = 4;
1104
+ // and DescriptorProto.field has field number 2:
1105
+ // repeated FieldDescriptorProto field = 2;
1106
+ // and FieldDescriptorProto.name has field number 1:
1107
+ // optional string name = 1;
1108
+ //
1109
+ // Thus, the above path gives the location of a field name. If we removed
1110
+ // the last element:
1111
+ // [ 4, 3, 2, 7 ]
1112
+ // this path refers to the whole field declaration (from the beginning
1113
+ // of the label to the terminating semicolon).
1114
+ repeated int32 path = 1 [packed = true];
1115
+
1116
+ // Always has exactly three or four elements: start line, start column,
1117
+ // end line (optional, otherwise assumed same as start line), end column.
1118
+ // These are packed into a single field for efficiency. Note that line
1119
+ // and column numbers are zero-based -- typically you will want to add
1120
+ // 1 to each before displaying to a user.
1121
+ repeated int32 span = 2 [packed = true];
1122
+
1123
+ // If this SourceCodeInfo represents a complete declaration, these are any
1124
+ // comments appearing before and after the declaration which appear to be
1125
+ // attached to the declaration.
1126
+ //
1127
+ // A series of line comments appearing on consecutive lines, with no other
1128
+ // tokens appearing on those lines, will be treated as a single comment.
1129
+ //
1130
+ // leading_detached_comments will keep paragraphs of comments that appear
1131
+ // before (but not connected to) the current element. Each paragraph,
1132
+ // separated by empty lines, will be one comment element in the repeated
1133
+ // field.
1134
+ //
1135
+ // Only the comment content is provided; comment markers (e.g. //) are
1136
+ // stripped out. For block comments, leading whitespace and an asterisk
1137
+ // will be stripped from the beginning of each line other than the first.
1138
+ // Newlines are included in the output.
1139
+ //
1140
+ // Examples:
1141
+ //
1142
+ // optional int32 foo = 1; // Comment attached to foo.
1143
+ // // Comment attached to bar.
1144
+ // optional int32 bar = 2;
1145
+ //
1146
+ // optional string baz = 3;
1147
+ // // Comment attached to baz.
1148
+ // // Another line attached to baz.
1149
+ //
1150
+ // // Comment attached to moo.
1151
+ // //
1152
+ // // Another line attached to moo.
1153
+ // optional double moo = 4;
1154
+ //
1155
+ // // Detached comment for corge. This is not leading or trailing comments
1156
+ // // to moo or corge because there are blank lines separating it from
1157
+ // // both.
1158
+ //
1159
+ // // Detached comment for corge paragraph 2.
1160
+ //
1161
+ // optional string corge = 5;
1162
+ // /* Block comment attached
1163
+ // * to corge. Leading asterisks
1164
+ // * will be removed. */
1165
+ // /* Block comment attached to
1166
+ // * grault. */
1167
+ // optional int32 grault = 6;
1168
+ //
1169
+ // // ignored detached comments.
1170
+ optional string leading_comments = 3;
1171
+ optional string trailing_comments = 4;
1172
+ repeated string leading_detached_comments = 6;
1173
+ }
1174
+ }
1175
+
1176
+ // Describes the relationship between generated code and its original source
1177
+ // file. A GeneratedCodeInfo message is associated with only one generated
1178
+ // source file, but may contain references to different source .proto files.
1179
+ message GeneratedCodeInfo {
1180
+ // An Annotation connects some span of text in generated code to an element
1181
+ // of its generating .proto file.
1182
+ repeated Annotation annotation = 1;
1183
+ message Annotation {
1184
+ // Identifies the element in the original source .proto file. This field
1185
+ // is formatted the same as SourceCodeInfo.Location.path.
1186
+ repeated int32 path = 1 [packed = true];
1187
+
1188
+ // Identifies the filesystem path to the original source .proto.
1189
+ optional string source_file = 2;
1190
+
1191
+ // Identifies the starting offset in bytes in the generated code
1192
+ // that relates to the identified object.
1193
+ optional int32 begin = 3;
1194
+
1195
+ // Identifies the ending offset in bytes in the generated code that
1196
+ // relates to the identified object. The end offset should be one past
1197
+ // the last relevant byte (so the length of the text = end - begin).
1198
+ optional int32 end = 4;
1199
+
1200
+ // Represents the identified object's effect on the element in the original
1201
+ // .proto file.
1202
+ enum Semantic {
1203
+ // There is no effect or the effect is indescribable.
1204
+ NONE = 0;
1205
+ // The element is set or otherwise mutated.
1206
+ SET = 1;
1207
+ // An alias to the element is returned.
1208
+ ALIAS = 2;
1209
+ }
1210
+ optional Semantic semantic = 5;
1211
+ }
1212
+ }