@spine-event-engine/proto 2.0.0-snapshot.10
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.
- package/LICENSE +201 -0
- package/README.md +142 -0
- package/REFERENCE.md +83 -0
- package/dist/generated/grpc/health/v1/health_pb.d.ts +115 -0
- package/dist/generated/grpc/health/v1/health_pb.d.ts.map +1 -0
- package/dist/generated/grpc/health/v1/health_pb.js +58 -0
- package/dist/generated/grpc/health/v1/health_pb.js.map +1 -0
- package/dist/generated/proto-module.d.ts +61 -0
- package/dist/generated/proto-module.d.ts.map +1 -0
- package/dist/generated/proto-module.js +315 -0
- package/dist/generated/proto-module.js.map +1 -0
- package/dist/generated/spine/auth/authenticated_subscription_pb.d.ts +47 -0
- package/dist/generated/spine/auth/authenticated_subscription_pb.d.ts.map +1 -0
- package/dist/generated/spine/auth/authenticated_subscription_pb.js +20 -0
- package/dist/generated/spine/auth/authenticated_subscription_pb.js.map +1 -0
- package/dist/generated/spine/auth/authentication_service_pb.d.ts +79 -0
- package/dist/generated/spine/auth/authentication_service_pb.d.ts.map +1 -0
- package/dist/generated/spine/auth/authentication_service_pb.js +34 -0
- package/dist/generated/spine/auth/authentication_service_pb.js.map +1 -0
- package/dist/generated/spine/base/error_pb.d.ts +69 -0
- package/dist/generated/spine/base/error_pb.d.ts.map +1 -0
- package/dist/generated/spine/base/error_pb.js +19 -0
- package/dist/generated/spine/base/error_pb.js.map +1 -0
- package/dist/generated/spine/base/field_path_pb.d.ts +50 -0
- package/dist/generated/spine/base/field_path_pb.d.ts.map +1 -0
- package/dist/generated/spine/base/field_path_pb.js +18 -0
- package/dist/generated/spine/base/field_path_pb.js.map +1 -0
- package/dist/generated/spine/client/command_service_pb.d.ts +46 -0
- package/dist/generated/spine/client/command_service_pb.d.ts.map +1 -0
- package/dist/generated/spine/client/command_service_pb.js +21 -0
- package/dist/generated/spine/client/command_service_pb.js.map +1 -0
- package/dist/generated/spine/client/entities_pb.d.ts +37 -0
- package/dist/generated/spine/client/entities_pb.d.ts.map +1 -0
- package/dist/generated/spine/client/entities_pb.js +19 -0
- package/dist/generated/spine/client/entities_pb.js.map +1 -0
- package/dist/generated/spine/client/filters_pb.d.ts +279 -0
- package/dist/generated/spine/client/filters_pb.d.ts.map +1 -0
- package/dist/generated/spine/client/filters_pb.js +126 -0
- package/dist/generated/spine/client/filters_pb.js.map +1 -0
- package/dist/generated/spine/client/query_pb.d.ts +293 -0
- package/dist/generated/spine/client/query_pb.d.ts.map +1 -0
- package/dist/generated/spine/client/query_pb.js +132 -0
- package/dist/generated/spine/client/query_pb.js.map +1 -0
- package/dist/generated/spine/client/query_service_pb.d.ts +31 -0
- package/dist/generated/spine/client/query_service_pb.d.ts.map +1 -0
- package/dist/generated/spine/client/query_service_pb.js +21 -0
- package/dist/generated/spine/client/query_service_pb.js.map +1 -0
- package/dist/generated/spine/client/subscription_pb.d.ts +361 -0
- package/dist/generated/spine/client/subscription_pb.d.ts.map +1 -0
- package/dist/generated/spine/client/subscription_pb.js +137 -0
- package/dist/generated/spine/client/subscription_pb.js.map +1 -0
- package/dist/generated/spine/client/subscription_record_pb.d.ts +90 -0
- package/dist/generated/spine/client/subscription_record_pb.d.ts.map +1 -0
- package/dist/generated/spine/client/subscription_record_pb.js +52 -0
- package/dist/generated/spine/client/subscription_record_pb.js.map +1 -0
- package/dist/generated/spine/client/subscription_service_pb.d.ts +86 -0
- package/dist/generated/spine/client/subscription_service_pb.d.ts.map +1 -0
- package/dist/generated/spine/client/subscription_service_pb.js +36 -0
- package/dist/generated/spine/client/subscription_service_pb.js.map +1 -0
- package/dist/generated/spine/core/ack_pb.d.ts +47 -0
- package/dist/generated/spine/core/ack_pb.d.ts.map +1 -0
- package/dist/generated/spine/core/ack_pb.js +20 -0
- package/dist/generated/spine/core/ack_pb.js.map +1 -0
- package/dist/generated/spine/core/actor_context_pb.d.ts +74 -0
- package/dist/generated/spine/core/actor_context_pb.d.ts.map +1 -0
- package/dist/generated/spine/core/actor_context_pb.js +23 -0
- package/dist/generated/spine/core/actor_context_pb.js.map +1 -0
- package/dist/generated/spine/core/bounded_context_pb.d.ts +35 -0
- package/dist/generated/spine/core/bounded_context_pb.d.ts.map +1 -0
- package/dist/generated/spine/core/bounded_context_pb.js +18 -0
- package/dist/generated/spine/core/bounded_context_pb.js.map +1 -0
- package/dist/generated/spine/core/command_pb.d.ts +245 -0
- package/dist/generated/spine/core/command_pb.d.ts.map +1 -0
- package/dist/generated/spine/core/command_pb.js +106 -0
- package/dist/generated/spine/core/command_pb.js.map +1 -0
- package/dist/generated/spine/core/diagnostics_pb.d.ts +97 -0
- package/dist/generated/spine/core/diagnostics_pb.d.ts.map +1 -0
- package/dist/generated/spine/core/diagnostics_pb.js +27 -0
- package/dist/generated/spine/core/diagnostics_pb.js.map +1 -0
- package/dist/generated/spine/core/enrichment_pb.d.ts +85 -0
- package/dist/generated/spine/core/enrichment_pb.d.ts.map +1 -0
- package/dist/generated/spine/core/enrichment_pb.js +25 -0
- package/dist/generated/spine/core/enrichment_pb.js.map +1 -0
- package/dist/generated/spine/core/event_pb.d.ts +307 -0
- package/dist/generated/spine/core/event_pb.d.ts.map +1 -0
- package/dist/generated/spine/core/event_pb.js +80 -0
- package/dist/generated/spine/core/event_pb.js.map +1 -0
- package/dist/generated/spine/core/response_pb.d.ts +87 -0
- package/dist/generated/spine/core/response_pb.d.ts.map +1 -0
- package/dist/generated/spine/core/response_pb.js +27 -0
- package/dist/generated/spine/core/response_pb.js.map +1 -0
- package/dist/generated/spine/core/tenant_id_pb.d.ts +64 -0
- package/dist/generated/spine/core/tenant_id_pb.d.ts.map +1 -0
- package/dist/generated/spine/core/tenant_id_pb.js +20 -0
- package/dist/generated/spine/core/tenant_id_pb.js.map +1 -0
- package/dist/generated/spine/core/user_id_pb.d.ts +33 -0
- package/dist/generated/spine/core/user_id_pb.d.ts.map +1 -0
- package/dist/generated/spine/core/user_id_pb.js +18 -0
- package/dist/generated/spine/core/user_id_pb.js.map +1 -0
- package/dist/generated/spine/core/version_pb.d.ts +44 -0
- package/dist/generated/spine/core/version_pb.d.ts.map +1 -0
- package/dist/generated/spine/core/version_pb.js +19 -0
- package/dist/generated/spine/core/version_pb.js.map +1 -0
- package/dist/generated/spine/delivery/admin/admin_service_pb.d.ts +219 -0
- package/dist/generated/spine/delivery/admin/admin_service_pb.d.ts.map +1 -0
- package/dist/generated/spine/delivery/admin/admin_service_pb.js +75 -0
- package/dist/generated/spine/delivery/admin/admin_service_pb.js.map +1 -0
- package/dist/generated/spine/delivery/commands_pb.d.ts +181 -0
- package/dist/generated/spine/delivery/commands_pb.d.ts.map +1 -0
- package/dist/generated/spine/delivery/commands_pb.js +57 -0
- package/dist/generated/spine/delivery/commands_pb.js.map +1 -0
- package/dist/generated/spine/delivery/events_pb.d.ts +230 -0
- package/dist/generated/spine/delivery/events_pb.d.ts.map +1 -0
- package/dist/generated/spine/delivery/events_pb.js +63 -0
- package/dist/generated/spine/delivery/events_pb.js.map +1 -0
- package/dist/generated/spine/delivery/message_delivery_pb.d.ts +205 -0
- package/dist/generated/spine/delivery/message_delivery_pb.d.ts.map +1 -0
- package/dist/generated/spine/delivery/message_delivery_pb.js +50 -0
- package/dist/generated/spine/delivery/message_delivery_pb.js.map +1 -0
- package/dist/generated/spine/delivery/pick_up_outcome_pb.d.ts +58 -0
- package/dist/generated/spine/delivery/pick_up_outcome_pb.d.ts.map +1 -0
- package/dist/generated/spine/delivery/pick_up_outcome_pb.js +20 -0
- package/dist/generated/spine/delivery/pick_up_outcome_pb.js.map +1 -0
- package/dist/generated/spine/delivery/rejections_pb.d.ts +95 -0
- package/dist/generated/spine/delivery/rejections_pb.d.ts.map +1 -0
- package/dist/generated/spine/delivery/rejections_pb.js +32 -0
- package/dist/generated/spine/delivery/rejections_pb.js.map +1 -0
- package/dist/generated/spine/deployment/node_discovery_pb.d.ts +102 -0
- package/dist/generated/spine/deployment/node_discovery_pb.d.ts.map +1 -0
- package/dist/generated/spine/deployment/node_discovery_pb.js +32 -0
- package/dist/generated/spine/deployment/node_discovery_pb.js.map +1 -0
- package/dist/generated/spine/net/email_address_pb.d.ts +37 -0
- package/dist/generated/spine/net/email_address_pb.d.ts.map +1 -0
- package/dist/generated/spine/net/email_address_pb.js +18 -0
- package/dist/generated/spine/net/email_address_pb.js.map +1 -0
- package/dist/generated/spine/net/internet_domain_pb.d.ts +35 -0
- package/dist/generated/spine/net/internet_domain_pb.d.ts.map +1 -0
- package/dist/generated/spine/net/internet_domain_pb.js +18 -0
- package/dist/generated/spine/net/internet_domain_pb.js.map +1 -0
- package/dist/generated/spine/options_pb.d.ts +1932 -0
- package/dist/generated/spine/options_pb.d.ts.map +1 -0
- package/dist/generated/spine/options_pb.js +960 -0
- package/dist/generated/spine/options_pb.js.map +1 -0
- package/dist/generated/spine/server/catchup/catch_up_pb.d.ts +185 -0
- package/dist/generated/spine/server/catchup/catch_up_pb.d.ts.map +1 -0
- package/dist/generated/spine/server/catchup/catch_up_pb.js +77 -0
- package/dist/generated/spine/server/catchup/catch_up_pb.js.map +1 -0
- package/dist/generated/spine/server/delivery/delivery_events_pb.d.ts +79 -0
- package/dist/generated/spine/server/delivery/delivery_events_pb.d.ts.map +1 -0
- package/dist/generated/spine/server/delivery/delivery_events_pb.js +27 -0
- package/dist/generated/spine/server/delivery/delivery_events_pb.js.map +1 -0
- package/dist/generated/spine/server/delivery/delivery_pb.d.ts +265 -0
- package/dist/generated/spine/server/delivery/delivery_pb.d.ts.map +1 -0
- package/dist/generated/spine/server/delivery/delivery_pb.js +63 -0
- package/dist/generated/spine/server/delivery/delivery_pb.js.map +1 -0
- package/dist/generated/spine/server/delivery/inbox_pb.d.ts +272 -0
- package/dist/generated/spine/server/delivery/inbox_pb.d.ts.map +1 -0
- package/dist/generated/spine/server/delivery/inbox_pb.js +139 -0
- package/dist/generated/spine/server/delivery/inbox_pb.js.map +1 -0
- package/dist/generated/spine/server/entity/entity_pb.d.ts +146 -0
- package/dist/generated/spine/server/entity/entity_pb.d.ts.map +1 -0
- package/dist/generated/spine/server/entity/entity_pb.js +62 -0
- package/dist/generated/spine/server/entity/entity_pb.js.map +1 -0
- package/dist/generated/spine/server/entity/state_key_pb.d.ts +46 -0
- package/dist/generated/spine/server/entity/state_key_pb.d.ts.map +1 -0
- package/dist/generated/spine/server/entity/state_key_pb.js +19 -0
- package/dist/generated/spine/server/entity/state_key_pb.js.map +1 -0
- package/dist/generated/spine/server/integration/broker_pb.d.ts +152 -0
- package/dist/generated/spine/server/integration/broker_pb.d.ts.map +1 -0
- package/dist/generated/spine/server/integration/broker_pb.js +65 -0
- package/dist/generated/spine/server/integration/broker_pb.js.map +1 -0
- package/dist/generated/spine/server/server_environment_pb.d.ts +65 -0
- package/dist/generated/spine/server/server_environment_pb.d.ts.map +1 -0
- package/dist/generated/spine/server/server_environment_pb.js +53 -0
- package/dist/generated/spine/server/server_environment_pb.js.map +1 -0
- package/dist/generated/spine/server/transport/transport_pb.d.ts +33 -0
- package/dist/generated/spine/server/transport/transport_pb.d.ts.map +1 -0
- package/dist/generated/spine/server/transport/transport_pb.js +18 -0
- package/dist/generated/spine/server/transport/transport_pb.js.map +1 -0
- package/dist/generated/spine/string/template_string_pb.d.ts +66 -0
- package/dist/generated/spine/string/template_string_pb.d.ts.map +1 -0
- package/dist/generated/spine/string/template_string_pb.js +18 -0
- package/dist/generated/spine/string/template_string_pb.js.map +1 -0
- package/dist/generated/spine/system/server/entity_log_events_pb.d.ts +505 -0
- package/dist/generated/spine/system/server/entity_log_events_pb.d.ts.map +1 -0
- package/dist/generated/spine/system/server/entity_log_events_pb.js +84 -0
- package/dist/generated/spine/system/server/entity_log_events_pb.js.map +1 -0
- package/dist/generated/spine/system/server/entity_type_pb.d.ts +46 -0
- package/dist/generated/spine/system/server/entity_type_pb.d.ts.map +1 -0
- package/dist/generated/spine/system/server/entity_type_pb.js +18 -0
- package/dist/generated/spine/system/server/entity_type_pb.js.map +1 -0
- package/dist/generated/spine/time/time_pb.d.ts +393 -0
- package/dist/generated/spine/time/time_pb.d.ts.map +1 -0
- package/dist/generated/spine/time/time_pb.js +184 -0
- package/dist/generated/spine/time/time_pb.js.map +1 -0
- package/dist/generated/spine/time_options_pb.d.ts +106 -0
- package/dist/generated/spine/time_options_pb.d.ts.map +1 -0
- package/dist/generated/spine/time_options_pb.js +58 -0
- package/dist/generated/spine/time_options_pb.js.map +1 -0
- package/dist/generated/spine/ui/language_pb.d.ts +1140 -0
- package/dist/generated/spine/ui/language_pb.d.ts.map +1 -0
- package/dist/generated/spine/ui/language_pb.js +1141 -0
- package/dist/generated/spine/ui/language_pb.js.map +1 -0
- package/dist/generated/spine/validation/validation_error_pb.d.ts +156 -0
- package/dist/generated/spine/validation/validation_error_pb.d.ts.map +1 -0
- package/dist/generated/spine/validation/validation_error_pb.js +27 -0
- package/dist/generated/spine/validation/validation_error_pb.js.map +1 -0
- package/dist/src/auth/index.d.ts +6 -0
- package/dist/src/auth/index.d.ts.map +1 -0
- package/dist/src/auth/index.js +19 -0
- package/dist/src/auth/index.js.map +1 -0
- package/dist/src/client/index.d.ts +12 -0
- package/dist/src/client/index.d.ts.map +1 -0
- package/dist/src/client/index.js +25 -0
- package/dist/src/client/index.js.map +1 -0
- package/dist/src/delivery/index.d.ts +7 -0
- package/dist/src/delivery/index.d.ts.map +1 -0
- package/dist/src/delivery/index.js +20 -0
- package/dist/src/delivery/index.js.map +1 -0
- package/dist/src/delivery-server/index.d.ts +11 -0
- package/dist/src/delivery-server/index.d.ts.map +1 -0
- package/dist/src/delivery-server/index.js +24 -0
- package/dist/src/delivery-server/index.js.map +1 -0
- package/dist/src/deployment/index.d.ts +5 -0
- package/dist/src/deployment/index.d.ts.map +1 -0
- package/dist/src/deployment/index.js +18 -0
- package/dist/src/deployment/index.js.map +1 -0
- package/dist/src/index.d.ts +333 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +310 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/model/proto-module.d.ts +20 -0
- package/dist/src/model/proto-module.d.ts.map +1 -0
- package/dist/src/model/proto-module.js +15 -0
- package/dist/src/model/proto-module.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/generated/.spine-proto-generation.json +1 -0
- package/generated/grpc/health/v1/health_pb.ts +141 -0
- package/generated/proto-module.ts +320 -0
- package/generated/spine/auth/authenticated_subscription_pb.ts +64 -0
- package/generated/spine/auth/authentication_service_pb.ts +103 -0
- package/generated/spine/base/error_pb.ts +86 -0
- package/generated/spine/base/field_path_pb.ts +63 -0
- package/generated/spine/client/command_service_pb.ts +60 -0
- package/generated/spine/client/entities_pb.ts +51 -0
- package/generated/spine/client/filters_pb.ts +322 -0
- package/generated/spine/client/query_pb.ts +345 -0
- package/generated/spine/client/query_service_pb.ts +45 -0
- package/generated/spine/client/subscription_pb.ts +414 -0
- package/generated/spine/client/subscription_record_pb.ts +114 -0
- package/generated/spine/client/subscription_service_pb.ts +100 -0
- package/generated/spine/core/ack_pb.ts +63 -0
- package/generated/spine/core/actor_context_pb.ts +96 -0
- package/generated/spine/core/bounded_context_pb.ts +48 -0
- package/generated/spine/core/command_pb.ts +287 -0
- package/generated/spine/core/diagnostics_pb.ts +120 -0
- package/generated/spine/core/enrichment_pb.ts +97 -0
- package/generated/spine/core/event_pb.ts +347 -0
- package/generated/spine/core/response_pb.ts +103 -0
- package/generated/spine/core/tenant_id_pb.ts +76 -0
- package/generated/spine/core/user_id_pb.ts +46 -0
- package/generated/spine/core/version_pb.ts +59 -0
- package/generated/spine/delivery/admin/admin_service_pb.ts +253 -0
- package/generated/spine/delivery/commands_pb.ts +219 -0
- package/generated/spine/delivery/events_pb.ts +276 -0
- package/generated/spine/delivery/message_delivery_pb.ts +236 -0
- package/generated/spine/delivery/pick_up_outcome_pb.ts +70 -0
- package/generated/spine/delivery/rejections_pb.ts +120 -0
- package/generated/spine/deployment/node_discovery_pb.ts +127 -0
- package/generated/spine/net/email_address_pb.ts +50 -0
- package/generated/spine/net/internet_domain_pb.ts +48 -0
- package/generated/spine/options_pb.ts +2104 -0
- package/generated/spine/server/catchup/catch_up_pb.ts +224 -0
- package/generated/spine/server/delivery/delivery_events_pb.ts +102 -0
- package/generated/spine/server/delivery/delivery_pb.ts +305 -0
- package/generated/spine/server/delivery/inbox_pb.ts +321 -0
- package/generated/spine/server/entity/entity_pb.ts +176 -0
- package/generated/spine/server/entity/state_key_pb.ts +61 -0
- package/generated/spine/server/integration/broker_pb.ts +183 -0
- package/generated/spine/server/server_environment_pb.ts +83 -0
- package/generated/spine/server/transport/transport_pb.ts +46 -0
- package/generated/spine/string/template_string_pb.ts +78 -0
- package/generated/spine/system/server/entity_log_events_pb.ts +587 -0
- package/generated/spine/system/server/entity_type_pb.ts +56 -0
- package/generated/spine/time/time_pb.ts +465 -0
- package/generated/spine/time_options_pb.ts +129 -0
- package/generated/spine/ui/language_pb.ts +1337 -0
- package/generated/spine/validation/validation_error_pb.ts +181 -0
- package/package.json +64 -0
- package/proto/README.md +81 -0
- package/proto/frozen-descriptor-set.sha256 +3 -0
- package/proto/grpc/health/v1/health.proto +63 -0
- package/proto/spine/auth/authenticated_subscription.proto +36 -0
- package/proto/spine/auth/authentication_service.proto +47 -0
- package/proto/spine/base/error.proto +68 -0
- package/proto/spine/base/field_path.proto +59 -0
- package/proto/spine/client/command_service.proto +62 -0
- package/proto/spine/client/entities.proto +48 -0
- package/proto/spine/client/filters.proto +170 -0
- package/proto/spine/client/query.proto +186 -0
- package/proto/spine/client/query_service.proto +46 -0
- package/proto/spine/client/subscription.proto +220 -0
- package/proto/spine/client/subscription_record.proto +55 -0
- package/proto/spine/client/subscription_service.proto +86 -0
- package/proto/spine/core/ack.proto +55 -0
- package/proto/spine/core/actor_context.proto +76 -0
- package/proto/spine/core/bounded_context.proto +47 -0
- package/proto/spine/core/command.proto +170 -0
- package/proto/spine/core/diagnostics.proto +86 -0
- package/proto/spine/core/enrichment.proto +70 -0
- package/proto/spine/core/event.proto +197 -0
- package/proto/spine/core/response.proto +71 -0
- package/proto/spine/core/tenant_id.proto +61 -0
- package/proto/spine/core/user_id.proto +42 -0
- package/proto/spine/core/version.proto +63 -0
- package/proto/spine/delivery/admin/admin_service.proto +110 -0
- package/proto/spine/delivery/commands.proto +86 -0
- package/proto/spine/delivery/events.proto +107 -0
- package/proto/spine/delivery/message_delivery.proto +90 -0
- package/proto/spine/delivery/pick_up_outcome.proto +40 -0
- package/proto/spine/delivery/rejections.proto +49 -0
- package/proto/spine/deployment/node_discovery.proto +59 -0
- package/proto/spine/net/email_address.proto +46 -0
- package/proto/spine/net/internet_domain.proto +43 -0
- package/proto/spine/options.proto +1628 -0
- package/proto/spine/server/catchup/catch_up.proto +123 -0
- package/proto/spine/server/delivery/delivery.proto +166 -0
- package/proto/spine/server/delivery/delivery_events.proto +72 -0
- package/proto/spine/server/delivery/inbox.proto +169 -0
- package/proto/spine/server/entity/entity.proto +105 -0
- package/proto/spine/server/entity/state_key.proto +55 -0
- package/proto/spine/server/integration/broker.proto +112 -0
- package/proto/spine/server/server_environment.proto +57 -0
- package/proto/spine/server/transport/transport.proto +42 -0
- package/proto/spine/string/template_string.proto +70 -0
- package/proto/spine/system/server/entity_log_events.proto +280 -0
- package/proto/spine/system/server/entity_type.proto +49 -0
- package/proto/spine/time/time.proto +221 -0
- package/proto/spine/time_options.proto +106 -0
- package/proto/spine/ui/language.proto +417 -0
- package/proto/spine/validation/validation_error.proto +133 -0
- package/proto/spine-sources.json +438 -0
- package/spine-proto-manifest.json +112 -0
- package/spine-proto.json +10 -0
|
@@ -0,0 +1,1628 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, TeamDev. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Redistribution and use in source and/or binary forms, with or without
|
|
11
|
+
* modification, must retain the above copyright notice and the following
|
|
12
|
+
* disclaimer.
|
|
13
|
+
*
|
|
14
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
15
|
+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
16
|
+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
17
|
+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
18
|
+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
19
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
20
|
+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
21
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
22
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
23
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
24
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
syntax = "proto3";
|
|
28
|
+
|
|
29
|
+
// API Note on Packaging
|
|
30
|
+
// ---------------------
|
|
31
|
+
// We do not define the package for this file to allow shorter options for user-defined types.
|
|
32
|
+
// This allows writing:
|
|
33
|
+
//
|
|
34
|
+
// option (internal) = true;
|
|
35
|
+
//
|
|
36
|
+
// instead of:
|
|
37
|
+
//
|
|
38
|
+
// option (spine.base.internal) = true;
|
|
39
|
+
//
|
|
40
|
+
|
|
41
|
+
// Custom Type Prefix Option
|
|
42
|
+
// -------------------------
|
|
43
|
+
// The custom `type_url_prefix` option allows specifying a custom type URL prefix for messages
|
|
44
|
+
// defined in a proto file. This option is declared in this file. Other proto files must import
|
|
45
|
+
// `options.proto` to be able to specify custom type URL prefix.
|
|
46
|
+
//
|
|
47
|
+
// It is recommended that the import statement is provided before the line with the `type_url_prefix`
|
|
48
|
+
// option to make it obvious that custom option is defined in the imported file.
|
|
49
|
+
//
|
|
50
|
+
// For example:
|
|
51
|
+
//
|
|
52
|
+
// syntax = "proto3";
|
|
53
|
+
//
|
|
54
|
+
// package my.package;
|
|
55
|
+
//
|
|
56
|
+
// import "spine/options.proto";
|
|
57
|
+
//
|
|
58
|
+
// option (type_url_prefix) = "type.example.org";
|
|
59
|
+
//
|
|
60
|
+
|
|
61
|
+
option (type_url_prefix) = "type.spine.io";
|
|
62
|
+
option java_multiple_files = true;
|
|
63
|
+
option java_outer_classname = "OptionsProto";
|
|
64
|
+
option java_package = "io.spine.option";
|
|
65
|
+
|
|
66
|
+
import "google/protobuf/descriptor.proto";
|
|
67
|
+
|
|
68
|
+
//
|
|
69
|
+
// Reserved Range of Option Field Numbers
|
|
70
|
+
// --------------------------------------
|
|
71
|
+
// Spine Options use the range of option field numbers from the internal range reserved for
|
|
72
|
+
// individual organizations. For details of custom Protobuf options and this range please see:
|
|
73
|
+
//
|
|
74
|
+
// https://developers.google.com/protocol-buffers/docs/proto#customoptions
|
|
75
|
+
//
|
|
76
|
+
// The whole range reserved for individual organizations is 50000-99999.
|
|
77
|
+
// The range used by Spine Options is 73812-75000.
|
|
78
|
+
// In order to prevent number collision with custom options used by a project based on Spine,
|
|
79
|
+
// numbers for custom options defined in this project should be in the range 50000-73811 or
|
|
80
|
+
// 75001-99999.
|
|
81
|
+
//
|
|
82
|
+
|
|
83
|
+
extend google.protobuf.FieldOptions {
|
|
84
|
+
|
|
85
|
+
// Field Validation Constraints
|
|
86
|
+
//-----------------------------
|
|
87
|
+
// For constraints defined via message-based types, please see documentation of corresponding
|
|
88
|
+
// message types.
|
|
89
|
+
//
|
|
90
|
+
|
|
91
|
+
// The option to mark a field as required.
|
|
92
|
+
//
|
|
93
|
+
// When this option is set:
|
|
94
|
+
//
|
|
95
|
+
// 1. For message fields, the field must not be set to the default instance
|
|
96
|
+
// (a message with all fields unset).
|
|
97
|
+
// 2. For enum fields, the field must not be set to the constant whose numeric
|
|
98
|
+
// value is zero — the first constant declared, as required by proto3.
|
|
99
|
+
// 3. For `string` and `bytes` fields, the value must be a non-empty string or
|
|
100
|
+
// a non-empty byte sequence, respectively.
|
|
101
|
+
// 4. For `repeated` and `map` fields, the field is considered missing when it is
|
|
102
|
+
// empty, or when any of its elements (for `map`, any of its values) is itself
|
|
103
|
+
// "missing". A per-element "missing" check is applied as follows:
|
|
104
|
+
//
|
|
105
|
+
// - `string` elements/values: an empty string is treated as missing — analogously
|
|
106
|
+
// to how an empty string is rejected for a singular `(required) string` field.
|
|
107
|
+
// - `bytes` elements/values: an empty byte sequence is treated as missing —
|
|
108
|
+
// analogously to how an empty payload is rejected for a singular
|
|
109
|
+
// `(required) bytes` field.
|
|
110
|
+
// - message elements/values: the default instance is treated as missing —
|
|
111
|
+
// analogously to a singular `(required)` message field.
|
|
112
|
+
// - enum elements/values: a constant whose numeric value is zero is treated as
|
|
113
|
+
// missing — analogously to a singular `(required)` enum field.
|
|
114
|
+
// - Numeric and `bool` elements/values: no per-element check is performed; only
|
|
115
|
+
// the presence of at least one element is required. The notion of "missing" is
|
|
116
|
+
// not meaningful for these types in a collection context.
|
|
117
|
+
//
|
|
118
|
+
// For `map` fields, only values are inspected; keys are not checked. Keys
|
|
119
|
+
// identify entries and are structurally present whenever an entry exists, so
|
|
120
|
+
// `(required)` — which constrains field *content* — applies only to the value
|
|
121
|
+
// side of each entry. Consequently, an empty-string key is allowed as long as
|
|
122
|
+
// its associated value is not missing.
|
|
123
|
+
//
|
|
124
|
+
// Other field types are not supported by the option.
|
|
125
|
+
//
|
|
126
|
+
// Unlike the `required` keyword in Protobuf 2, this option does not affect message
|
|
127
|
+
// serialization or deserialization. Even if a message content violates the requirement
|
|
128
|
+
// set by the option, it would still be a valid message for the Protobuf library.
|
|
129
|
+
//
|
|
130
|
+
// Example: Using `(required)` field validation constraint.
|
|
131
|
+
//
|
|
132
|
+
// message MyOuterMessage {
|
|
133
|
+
// MyMessage field = 1 [(required) = true];
|
|
134
|
+
// }
|
|
135
|
+
//
|
|
136
|
+
bool required = 73812;
|
|
137
|
+
|
|
138
|
+
// See `IfMissingOption`
|
|
139
|
+
IfMissingOption if_missing = 73813;
|
|
140
|
+
|
|
141
|
+
// Reserved 73814 and 73815 for deleted options `decimal_max` and `decimal_min`.
|
|
142
|
+
|
|
143
|
+
// A higher boundary to the range of values of a number.
|
|
144
|
+
MaxOption max = 73816;
|
|
145
|
+
|
|
146
|
+
// A lower boundary to the range of values of a number.
|
|
147
|
+
MinOption min = 73817;
|
|
148
|
+
|
|
149
|
+
// 73818 reserved for the (digits) option.
|
|
150
|
+
|
|
151
|
+
// 73819 reserved for the (when) option.
|
|
152
|
+
|
|
153
|
+
// See `PatternOption`.
|
|
154
|
+
PatternOption pattern = 73820;
|
|
155
|
+
|
|
156
|
+
// Enables in-depth validation for fields that refer to a message.
|
|
157
|
+
//
|
|
158
|
+
// This option applies only to fields that reference a message:
|
|
159
|
+
//
|
|
160
|
+
// 1. Singular message fields.
|
|
161
|
+
// 2. Repeated fields of message types.
|
|
162
|
+
// 3. Map fields with message types as values.
|
|
163
|
+
//
|
|
164
|
+
// When set to `true`, the field is valid only if its value satisfies the validation
|
|
165
|
+
// constraints defined in the corresponding message type:
|
|
166
|
+
//
|
|
167
|
+
// 1. For singular message fields: the message must meet its constraints.
|
|
168
|
+
//
|
|
169
|
+
// Note: default instances are considered valid even if the message has required fields.
|
|
170
|
+
// In such cases, it is unclear whether the field is set with an invalid instance or
|
|
171
|
+
// simply unset.
|
|
172
|
+
//
|
|
173
|
+
// Example:
|
|
174
|
+
//
|
|
175
|
+
// ```
|
|
176
|
+
// // Note that the default instance of `Address` is not valid because the `value` field
|
|
177
|
+
// // is mandatory.
|
|
178
|
+
// message Address {
|
|
179
|
+
// string value = 1 [(required) = true];
|
|
180
|
+
// }
|
|
181
|
+
//
|
|
182
|
+
// // However, the default instance of `Address` in `Student.address` is valid, despite
|
|
183
|
+
// // having `(validate)` constraint that forces the message to meet its constraints.
|
|
184
|
+
// // Since the `address` field is optional for `Student`, `(validate)` would allow
|
|
185
|
+
// // default instances for this field treating them as "no value set".
|
|
186
|
+
// message Student {
|
|
187
|
+
// Address address = 1 [(validate) = true]; // implicit `(required) = false`.
|
|
188
|
+
// }
|
|
189
|
+
//
|
|
190
|
+
// // Make the validated field required to avoid this behavior. In this case, `(validate)`
|
|
191
|
+
// // continues to bypass default instances, but the `(required)` option will report them.
|
|
192
|
+
// message Student {
|
|
193
|
+
// Address address = 1 [(validate) = true, (required) = true];
|
|
194
|
+
// }
|
|
195
|
+
// ```
|
|
196
|
+
//
|
|
197
|
+
// 2. For repeated fields: every element in the repeated field must meet the constraints
|
|
198
|
+
// of its message type.
|
|
199
|
+
//
|
|
200
|
+
// Example:
|
|
201
|
+
//
|
|
202
|
+
// ```
|
|
203
|
+
// // Note that the default instance of `PhoneNumber` is not valid because the `value`
|
|
204
|
+
// // field is mandatory.
|
|
205
|
+
// message PhoneNumber {
|
|
206
|
+
// string value = 1 [(required) = true, (pattern).regex = "^\+?[0-9\s\-()]{1,30}$"];
|
|
207
|
+
// }
|
|
208
|
+
//
|
|
209
|
+
// // In contrast to singular fields, the default instances in `repeated` will also be
|
|
210
|
+
// // reported by the `(validate)` constraint, with those that do not match the pattern.
|
|
211
|
+
// message Student {
|
|
212
|
+
// repeated PhoneNumber number = 1 [(validate) = true];
|
|
213
|
+
// }
|
|
214
|
+
// ```
|
|
215
|
+
//
|
|
216
|
+
// 3. For map fields: each value in the map must meet the constraints of its message type.
|
|
217
|
+
// Note: Protobuf does not allow messages to be used as map keys.
|
|
218
|
+
//
|
|
219
|
+
// Example:
|
|
220
|
+
//
|
|
221
|
+
// ```
|
|
222
|
+
// // Note that the default instance of `PhoneNumber` is not valid because the `value`
|
|
223
|
+
// // field is mandatory.
|
|
224
|
+
// message PhoneNumber {
|
|
225
|
+
// string value = 1 [(required) = true, (pattern).regex = "^\+?[0-9\s\-()]{1,30}$"];
|
|
226
|
+
// }
|
|
227
|
+
//
|
|
228
|
+
// // In contrast to singular fields, the default instances in `map` values will also be
|
|
229
|
+
// // reported by the `(validate)` constraint, with those that do not match the pattern.
|
|
230
|
+
// message Contacts {
|
|
231
|
+
// map<string, PhoneNumber> map = 1 [(validate) = true];
|
|
232
|
+
// }
|
|
233
|
+
// ```
|
|
234
|
+
//
|
|
235
|
+
// If the field contains `google.protobuf.Any`, the option will first attempt to unpack
|
|
236
|
+
// the enclosed message, and only then validate it. However, unpacking is not always possible:
|
|
237
|
+
//
|
|
238
|
+
// 1. The default instance of `Any` is always valid because there is nothing to unpack
|
|
239
|
+
// and validate.
|
|
240
|
+
// 2. Instances with type URLs that are unknown to the application are also valid.
|
|
241
|
+
//
|
|
242
|
+
// Unpacking requires a corresponding Java class to deserialize the message, but if
|
|
243
|
+
// the application does not recognize the type URL, it has no way to determine which
|
|
244
|
+
// class to use.
|
|
245
|
+
//
|
|
246
|
+
// Such may happen when the packed message comes from a newer app version, an external
|
|
247
|
+
// system, or is simply not included in the application’s dependencies.
|
|
248
|
+
//
|
|
249
|
+
bool validate = 73821;
|
|
250
|
+
|
|
251
|
+
// See `IfInvalidOption`.
|
|
252
|
+
IfInvalidOption if_invalid = 73822 [deprecated = true];
|
|
253
|
+
|
|
254
|
+
// See `GoesOption`.
|
|
255
|
+
GoesOption goes = 73823;
|
|
256
|
+
|
|
257
|
+
// Indicates that a field can only be set once.
|
|
258
|
+
//
|
|
259
|
+
// This option allows the target field to accept assignments only if one of the following
|
|
260
|
+
// conditions is met:
|
|
261
|
+
//
|
|
262
|
+
// 1. The current field value is the default for its type.
|
|
263
|
+
// Refer to the official docs on default values: https://protobuf.dev/programming-guides/proto3/#default.
|
|
264
|
+
// 2. The current field value equals to the proposed new value.
|
|
265
|
+
//
|
|
266
|
+
// The option can be applied to the following singular field types:
|
|
267
|
+
//
|
|
268
|
+
// - any message or enum type;
|
|
269
|
+
// - any numeric type;
|
|
270
|
+
// - `bool`, `string` and `bytes`.
|
|
271
|
+
//
|
|
272
|
+
// Repeated fields, maps, and fields with explicit `optional` cardinality are not supported.
|
|
273
|
+
// Such declarations will lead to build-time errors. For more information on field cardinality,
|
|
274
|
+
// refer to the official docs: https://protobuf.dev/programming-guides/proto3/#field-labels.
|
|
275
|
+
//
|
|
276
|
+
// Assigning a value to a message field can be done in various ways in the generated code.
|
|
277
|
+
// It depends on the target language and specific implementation of `protoc`. This option
|
|
278
|
+
// doesn't enforce field immutability at the binary representation level. Also, it does not
|
|
279
|
+
// prevent the use of Protobuf utilities that can construct new messages without using field
|
|
280
|
+
// setters or properties. The primary purpose of this option is to support standard use cases,
|
|
281
|
+
// such as assigning values through setters or retrieving them during data merging.
|
|
282
|
+
//
|
|
283
|
+
// For example, let's take a look on how it works for the generated Java code. The following
|
|
284
|
+
// use cases are supported and validated by the option:
|
|
285
|
+
//
|
|
286
|
+
// 1. Assigning a field value using the field setter.
|
|
287
|
+
// 2. Assigning a field value using the field descriptor.
|
|
288
|
+
// 3. Merging data from another instance of the message class.
|
|
289
|
+
// 4. Merging data from a message's binary representation.
|
|
290
|
+
// 5. Merging specific fields (available for Message fields).
|
|
291
|
+
//
|
|
292
|
+
// Unsupported Java use cases include:
|
|
293
|
+
//
|
|
294
|
+
// 1. Constructing a message using the `DynamicMessage` class.
|
|
295
|
+
// 2. Merging data from messages provided by third-party Protobuf implementations.
|
|
296
|
+
// 3. Clearing a specific field or an entire message.
|
|
297
|
+
//
|
|
298
|
+
// For unsupported scenarios, the option performs no validation. It does not throw errors
|
|
299
|
+
// or print warnings.
|
|
300
|
+
//
|
|
301
|
+
// A typical use case involves a field, such as an ID, which remains constant throughout
|
|
302
|
+
// the lifecycle of an entity.
|
|
303
|
+
//
|
|
304
|
+
// Example: using `(set_once)` field validation constraint.
|
|
305
|
+
//
|
|
306
|
+
// message User {
|
|
307
|
+
// UserId id = 1 [(set_once) = true];
|
|
308
|
+
// }
|
|
309
|
+
//
|
|
310
|
+
// Once set, the `id` field cannot be changed.
|
|
311
|
+
//
|
|
312
|
+
// Use the `(if_set_again).error_msg` option to specify a custom error message that will be used for
|
|
313
|
+
// composing the error upon attempting to re-assign the field value. Refer to the documentation
|
|
314
|
+
// for the corresponding option for an example of its usage.
|
|
315
|
+
//
|
|
316
|
+
bool set_once = 73824;
|
|
317
|
+
|
|
318
|
+
// The option to enforce uniqueness for collection fields.
|
|
319
|
+
//
|
|
320
|
+
// When the option is set to `true`, the behavior is as follows:
|
|
321
|
+
//
|
|
322
|
+
// 1. For `repeated` fields: all elements must be unique.
|
|
323
|
+
// 2. For `map` fields: while the map keys are inherently unique, all associated values
|
|
324
|
+
// must also be unique.
|
|
325
|
+
//
|
|
326
|
+
// Other field types are not supported.
|
|
327
|
+
//
|
|
328
|
+
// Uniqueness is determined by comparing the elements themselves, using their full equality.
|
|
329
|
+
// For example, in Java, it is defined by the `equals()` method. No special cases are applied,
|
|
330
|
+
// such as comparing only specific fields like IDs.
|
|
331
|
+
//
|
|
332
|
+
// Example: using `(distinct)` constraint for a `repeated` field.
|
|
333
|
+
//
|
|
334
|
+
// message Blizzard {
|
|
335
|
+
//
|
|
336
|
+
// // All snowflakes must be unique in this blizzard.
|
|
337
|
+
// //
|
|
338
|
+
// // Attempting to add a snowflake that is equal to an existing one would result
|
|
339
|
+
// // in a constraint violation error.
|
|
340
|
+
// //
|
|
341
|
+
// repeated Snowflake snowflakes = 1 [(distinct) = true];
|
|
342
|
+
// }
|
|
343
|
+
//
|
|
344
|
+
// Example: using `(distinct)` constraint for a `map` field.
|
|
345
|
+
//
|
|
346
|
+
// message UniqueEmails {
|
|
347
|
+
//
|
|
348
|
+
// // The associated email values must be unique.
|
|
349
|
+
// //
|
|
350
|
+
// // Attempting to add a key/value pair where the `Email` value duplicates
|
|
351
|
+
// // an existing one would result in a constraint violation error.
|
|
352
|
+
// //
|
|
353
|
+
// map<string, Email> emails = 1 [(distinct) = true];
|
|
354
|
+
// }
|
|
355
|
+
//
|
|
356
|
+
bool distinct = 73825;
|
|
357
|
+
|
|
358
|
+
// Reserved 73826 for deleted `range` option, which had `string` type.
|
|
359
|
+
|
|
360
|
+
// Defines the error message used if a `set_once` field is set again.
|
|
361
|
+
//
|
|
362
|
+
// Applies only to the fields marked as `set_once`.
|
|
363
|
+
//
|
|
364
|
+
IfSetAgainOption if_set_again = 73827;
|
|
365
|
+
|
|
366
|
+
// Defines the error message used if a `distinct` field has duplicates.
|
|
367
|
+
//
|
|
368
|
+
// Applies only to the repeated fields marked as `distinct`.
|
|
369
|
+
//
|
|
370
|
+
IfHasDuplicatesOption if_has_duplicates = 73828;
|
|
371
|
+
|
|
372
|
+
// The option to indicate that a numeric field is required to have a value that belongs
|
|
373
|
+
// to the specified bounded range.
|
|
374
|
+
//
|
|
375
|
+
// For unbounded ranges, please use `(min)` and `(max)` options.
|
|
376
|
+
//
|
|
377
|
+
RangeOption range = 73829;
|
|
378
|
+
|
|
379
|
+
// Reserved 73830 to 73849 for future validation options.
|
|
380
|
+
|
|
381
|
+
// API Annotations
|
|
382
|
+
//-----------------
|
|
383
|
+
|
|
384
|
+
// Indicates a field that is internal to Spine, not part of the public API, and should not be
|
|
385
|
+
// used by users of the framework.
|
|
386
|
+
//
|
|
387
|
+
// If you plan to implement an extension of the framework, which is going to be
|
|
388
|
+
// wired into the framework, you may use the internal parts. Please consult with the Spine
|
|
389
|
+
// team, as the internal APIs do not have the same stability API guarantee as public ones.
|
|
390
|
+
//
|
|
391
|
+
bool internal = 73850;
|
|
392
|
+
|
|
393
|
+
// Reserved 73851 for the deleted SPI option.
|
|
394
|
+
|
|
395
|
+
// Indicates a field that can change at any time, and has no guarantee of API stability and
|
|
396
|
+
// backward-compatibility.
|
|
397
|
+
//
|
|
398
|
+
// Usage guidelines:
|
|
399
|
+
// 1. This annotation is used only on public API. Internal interfaces should not use it.
|
|
400
|
+
// 2. This annotation can only be added to new API. Adding it to an existing API is considered
|
|
401
|
+
// API-breaking.
|
|
402
|
+
// 3. Removing this annotation from an API gives it stable status.
|
|
403
|
+
//
|
|
404
|
+
bool experimental = 73852;
|
|
405
|
+
|
|
406
|
+
// Signifies that a public API is subject to incompatible changes, or even removal, in a future
|
|
407
|
+
// release.
|
|
408
|
+
//
|
|
409
|
+
// An API bearing this annotation is exempt from any compatibility guarantees made by its
|
|
410
|
+
// containing library. Note that the presence of this annotation implies nothing about the
|
|
411
|
+
// quality of the API in question, only the fact that it is not "API-frozen."
|
|
412
|
+
// It is generally safe for applications to depend on beta APIs, at the cost of
|
|
413
|
+
// some extra work during upgrades.
|
|
414
|
+
//
|
|
415
|
+
bool beta = 73853;
|
|
416
|
+
|
|
417
|
+
// Marks an entity state field as a column.
|
|
418
|
+
//
|
|
419
|
+
// The column fields are stored separately from the entity record and can be specified as
|
|
420
|
+
// filtering criteria during entity querying.
|
|
421
|
+
//
|
|
422
|
+
// The column field should be declared as follows:
|
|
423
|
+
//
|
|
424
|
+
// message UserProfile {
|
|
425
|
+
// ...
|
|
426
|
+
// int32 year_of_registration = 8 [(column) = true];
|
|
427
|
+
// }
|
|
428
|
+
//
|
|
429
|
+
// The `year_of_registration` field value can then be used as a query parameter when reading
|
|
430
|
+
// entities of `UserProfile` type from the server side.
|
|
431
|
+
//
|
|
432
|
+
// The value of a column field can be updated in two ways:
|
|
433
|
+
//
|
|
434
|
+
// 1. In the receptors of the entity, just like any other part of entity state.
|
|
435
|
+
// 2. Using the language-specific tools like the `EntityWithColumns` interface in Java.
|
|
436
|
+
//
|
|
437
|
+
// All column fields are considered optional by the framework.
|
|
438
|
+
//
|
|
439
|
+
// Currently, only entities of projection and process manager type are
|
|
440
|
+
// eligible for having columns (see `EntityOption`).
|
|
441
|
+
// For all other message types the column declarations are ignored.
|
|
442
|
+
//
|
|
443
|
+
// The `repeated` and `map` fields cannot be columns.
|
|
444
|
+
//
|
|
445
|
+
bool column = 73854;
|
|
446
|
+
|
|
447
|
+
// Reserved 73855 to 73890 for future options.
|
|
448
|
+
|
|
449
|
+
// Reserved 73900 for removed `by` option.
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
extend google.protobuf.OneofOptions {
|
|
453
|
+
|
|
454
|
+
// Deprecated: use the `(choice)` option instead.
|
|
455
|
+
bool is_required = 73891 [deprecated = true];
|
|
456
|
+
|
|
457
|
+
// Controls whether a `oneof` group must always have one of its fields set.
|
|
458
|
+
ChoiceOption choice = 73892;
|
|
459
|
+
|
|
460
|
+
// Reserved 73893 to 73899 for future options.
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
extend google.protobuf.MessageOptions {
|
|
464
|
+
|
|
465
|
+
// Validation Constraints
|
|
466
|
+
//------------------------
|
|
467
|
+
|
|
468
|
+
// The default validation error message.
|
|
469
|
+
//
|
|
470
|
+
// Please note, this option is intended for INTERNAL USE only. It applies to message types
|
|
471
|
+
// that extend `FieldOptions` and is not intended for external usage.
|
|
472
|
+
//
|
|
473
|
+
// If a validation option detects a constraint violation and no custom error message is defined
|
|
474
|
+
// for that specific option, it will fall back to the message specified by `(default_message)`.
|
|
475
|
+
//
|
|
476
|
+
// For example, here is how to declare the default message for `(goes)` option:
|
|
477
|
+
//
|
|
478
|
+
// ```
|
|
479
|
+
// message GoesOption {
|
|
480
|
+
// // The default error message.
|
|
481
|
+
// option (default_message) = "The field `${goes.companion}` must also be set when `${field.path}` is set.";
|
|
482
|
+
// }
|
|
483
|
+
// ```
|
|
484
|
+
//
|
|
485
|
+
// Note: The placeholders available within `(default_message)` depend solely on the particular
|
|
486
|
+
// validation option that uses it. Each option may define its own set of placeholders, or none.
|
|
487
|
+
//
|
|
488
|
+
string default_message = 73901 [(internal) = true];
|
|
489
|
+
|
|
490
|
+
// Deprecated: use the `(require)` option instead.
|
|
491
|
+
string required_field = 73902 [deprecated = true];
|
|
492
|
+
|
|
493
|
+
// See `EntityOption`.
|
|
494
|
+
EntityOption entity = 73903;
|
|
495
|
+
|
|
496
|
+
// An external validation constraint for a field.
|
|
497
|
+
//
|
|
498
|
+
// WARNING: This option is deprecated and is scheduled for removal in Spine v2.0.0.
|
|
499
|
+
//
|
|
500
|
+
// Allows re-defining validation constraints for a message when its usage as a field of
|
|
501
|
+
// another type requires alternative constraints. This includes definition of constraints for
|
|
502
|
+
// a message that does not have them defined within the type.
|
|
503
|
+
//
|
|
504
|
+
// A target field of an external constraint should be specified using a fully-qualified
|
|
505
|
+
// field name (e.g. `mypackage.MessageName.field_name`).
|
|
506
|
+
//
|
|
507
|
+
// Example: defining external validation constraint.
|
|
508
|
+
//
|
|
509
|
+
// package io.spine.example;
|
|
510
|
+
//
|
|
511
|
+
// // Defines a change in a string value.
|
|
512
|
+
// //
|
|
513
|
+
// // Both of the fields of this message are not `required` to be able to describe
|
|
514
|
+
// // a change from empty value to non-empty value, or from a non-empty value to
|
|
515
|
+
// // an empty string.
|
|
516
|
+
// //
|
|
517
|
+
// message StringChange {
|
|
518
|
+
//
|
|
519
|
+
// // The value of the field that's changing.
|
|
520
|
+
// string previous_value = 1;
|
|
521
|
+
//
|
|
522
|
+
// // The new value of the field.
|
|
523
|
+
// string new_value = 2;
|
|
524
|
+
// }
|
|
525
|
+
//
|
|
526
|
+
// // A command to change a name of a task.
|
|
527
|
+
// //
|
|
528
|
+
// // The task has a non-empty name. A new name cannot be empty.
|
|
529
|
+
// //
|
|
530
|
+
// message RenameTask {
|
|
531
|
+
//
|
|
532
|
+
// // The ID of the task to rename.
|
|
533
|
+
// string task_id = 1;
|
|
534
|
+
//
|
|
535
|
+
// // Instruction for changing the name.
|
|
536
|
+
// //
|
|
537
|
+
// // The value of `change.previous_value` is the current name of the task.
|
|
538
|
+
// // It cannot be empty.
|
|
539
|
+
// //
|
|
540
|
+
// // The value of `change.new_value` is the new name of the task.
|
|
541
|
+
// // It cannot be empty either.
|
|
542
|
+
// //
|
|
543
|
+
// StringChange change = 1 [(validate) = true];
|
|
544
|
+
// }
|
|
545
|
+
//
|
|
546
|
+
// // External validation constraint for both fields of the `StringChange` message
|
|
547
|
+
// // in the scope of the `RenameTask` command.
|
|
548
|
+
// //
|
|
549
|
+
// message RequireTaskNames {
|
|
550
|
+
// option (constraint_for) = "spine.example.RenameTask.change";
|
|
551
|
+
//
|
|
552
|
+
// string previous_value = 1 [(required) = true];
|
|
553
|
+
// string new_value = 2 [(required) = true];
|
|
554
|
+
// }
|
|
555
|
+
//
|
|
556
|
+
// NOTE: A target field for an external validation constraint must have the option `(validate)`
|
|
557
|
+
// set to `true`. See the definition of the `RenameTask.change` field in the example
|
|
558
|
+
// above. If there is no such option defined, or it is set to `false`, the external
|
|
559
|
+
// constraint will not be applied.
|
|
560
|
+
//
|
|
561
|
+
// External validation constraints can be applied to fields of several types.
|
|
562
|
+
// To do so, separate fully-qualified references to these fields with comma.
|
|
563
|
+
//
|
|
564
|
+
// Example: external validation constraints for multiple fields.
|
|
565
|
+
//
|
|
566
|
+
// // External validation constraint for requiring a new value in renaming commands.
|
|
567
|
+
// message RequireNewName {
|
|
568
|
+
// option (constraint_for) = "spine.example.RenameTask.change,"
|
|
569
|
+
// "spine.example.RenameProject.change,";
|
|
570
|
+
// "spine.example.UpdateComment.text_change;
|
|
571
|
+
//
|
|
572
|
+
// string new_value = 1 [(required) = true];
|
|
573
|
+
// }
|
|
574
|
+
//
|
|
575
|
+
// NOTE: An external validation constraint for a field must be defined only once.
|
|
576
|
+
// Spine Model Compiler does not check such an "overwriting".
|
|
577
|
+
// See the issue: https://github.com/SpineEventEngine/base/issues/318.
|
|
578
|
+
//
|
|
579
|
+
string constraint_for = 73904 [deprecated = true];
|
|
580
|
+
|
|
581
|
+
// Reserved 73905 to 73910 for future validation options.
|
|
582
|
+
|
|
583
|
+
// API Annotations
|
|
584
|
+
//-----------------
|
|
585
|
+
|
|
586
|
+
// Indicates a type usage of which is restricted in one of the following ways.
|
|
587
|
+
//
|
|
588
|
+
// 1. This type is internal to the Spine Event Engine framework. It is not a part of
|
|
589
|
+
// the public API, and must not be used by framework users.
|
|
590
|
+
//
|
|
591
|
+
// 2. The type is internal to a bounded context, artifact of which exposes the type to
|
|
592
|
+
// the outside world (presumably for historical reasons).
|
|
593
|
+
//
|
|
594
|
+
// The type with such an option can be used only inside the bounded context that declares it.
|
|
595
|
+
//
|
|
596
|
+
// The type must not be used neither for inbound (i.e. being sent to the bounded context
|
|
597
|
+
// that declares this type) nor for outbound communication (i.e. being sent by this
|
|
598
|
+
// bounded context outside).
|
|
599
|
+
//
|
|
600
|
+
// An attempt to violate these usage restrictions will result in a runtime error.
|
|
601
|
+
//
|
|
602
|
+
bool internal_type = 73911;
|
|
603
|
+
|
|
604
|
+
// Indicates a file that contains elements of Service Provider Interface (SPI).
|
|
605
|
+
bool SPI_type = 73912;
|
|
606
|
+
|
|
607
|
+
// Indicates a public API that can change at any time, and has no guarantee of
|
|
608
|
+
// API stability and backward-compatibility.
|
|
609
|
+
bool experimental_type = 73913;
|
|
610
|
+
|
|
611
|
+
// Signifies that a public API is subject to incompatible changes, or even removal,
|
|
612
|
+
// in a future release.
|
|
613
|
+
bool beta_type = 73914;
|
|
614
|
+
|
|
615
|
+
// Specifies a characteristic inherent in the given message type.
|
|
616
|
+
//
|
|
617
|
+
// Example: using `(is)` message option.
|
|
618
|
+
//
|
|
619
|
+
// message CreateProject {
|
|
620
|
+
// option (is).java_type = "ProjectCommand";
|
|
621
|
+
//
|
|
622
|
+
// // Remainder omitted.
|
|
623
|
+
// }
|
|
624
|
+
//
|
|
625
|
+
// In the example above, `CreateProject` message is a `ProjectCommand`.
|
|
626
|
+
//
|
|
627
|
+
// To specify a characteristic for every message in a `.proto` file,
|
|
628
|
+
// please use the `(every_is)` file option.
|
|
629
|
+
//
|
|
630
|
+
// If both `(is)` and `(every_is)` options are applicable for a type, both are applied.
|
|
631
|
+
//
|
|
632
|
+
// When targeting Java, specify the name of a Java interface to be implemented by this
|
|
633
|
+
// message via `(is).java_type`.
|
|
634
|
+
//
|
|
635
|
+
// When targeting TypeScript, specify the name of a TypeScript interface to be
|
|
636
|
+
// implemented by this message via `(is).ts_type`.
|
|
637
|
+
//
|
|
638
|
+
IsOption is = 73915;
|
|
639
|
+
|
|
640
|
+
// Reserved 73916 to 73921 for future API annotation options.
|
|
641
|
+
|
|
642
|
+
// Reserved 73922 for removed `enrichment_for` option.
|
|
643
|
+
|
|
644
|
+
// Specifies the natural ordering strategy for this type.
|
|
645
|
+
//
|
|
646
|
+
// Code generators should generate language-specific comparisons based on the field paths.
|
|
647
|
+
//
|
|
648
|
+
// Runtime comparators may use the reflection API to compare field values.
|
|
649
|
+
//
|
|
650
|
+
CompareByOption compare_by = 73923;
|
|
651
|
+
|
|
652
|
+
// The constraint to require at least one of the fields or combinations of fields.
|
|
653
|
+
RequireOption require = 73924;
|
|
654
|
+
|
|
655
|
+
// Reserved 73925 to 73938 for future options.
|
|
656
|
+
|
|
657
|
+
// Reserved 73939 and 73940 for the deleted options `events` and `rejections`.
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
extend google.protobuf.FileOptions {
|
|
661
|
+
|
|
662
|
+
// Specifies a type URL prefix for all types within a file.
|
|
663
|
+
//
|
|
664
|
+
// This type URL will be used when packing messages into `Any`.
|
|
665
|
+
// See `any.proto` for more details.
|
|
666
|
+
//
|
|
667
|
+
string type_url_prefix = 73941;
|
|
668
|
+
|
|
669
|
+
// Indicates a file that contains types usage of which is restricted.
|
|
670
|
+
//
|
|
671
|
+
// For more information on such restrictions please see the documentation of
|
|
672
|
+
// the type option called `internal_type`.
|
|
673
|
+
//
|
|
674
|
+
// If a file contains a declaration of a `service`, this option will NOT be applied to it.
|
|
675
|
+
// A service is not a data type, and therefore, this option does not apply to it.
|
|
676
|
+
// Internal services are not supported.
|
|
677
|
+
//
|
|
678
|
+
bool internal_all = 73942;
|
|
679
|
+
|
|
680
|
+
// Indicates a file that contains elements of Service Provider Interface (SPI).
|
|
681
|
+
//
|
|
682
|
+
// This option applies to messages, enums, and services.
|
|
683
|
+
//
|
|
684
|
+
bool SPI_all = 73943;
|
|
685
|
+
|
|
686
|
+
// Indicates a file declaring public data type API that can change at any time,
|
|
687
|
+
// has no guarantee of API stability and backward-compatibility.
|
|
688
|
+
//
|
|
689
|
+
// If a file contains a declaration of a `service`, this option will NOT be applied to it.
|
|
690
|
+
// A service is not a data type, and therefore, this option does not apply to it.
|
|
691
|
+
// Experimental services are not supported.
|
|
692
|
+
//
|
|
693
|
+
bool experimental_all = 73944;
|
|
694
|
+
|
|
695
|
+
// Signifies that a public data type API is subject to incompatible changes, or even removal,
|
|
696
|
+
// in a future release.
|
|
697
|
+
//
|
|
698
|
+
// If a file contains a declaration of a `service`, this option will NOT be applied to it.
|
|
699
|
+
// A service is not a data type, and therefore, this option does not apply to it.
|
|
700
|
+
// Beta services are not supported.
|
|
701
|
+
//
|
|
702
|
+
bool beta_all = 73945;
|
|
703
|
+
|
|
704
|
+
// Specifies a characteristic common for all the message types in the given file.
|
|
705
|
+
//
|
|
706
|
+
// Example: marking all the messages using the `(every_is)` file option.
|
|
707
|
+
// ```
|
|
708
|
+
// option (every_is).java_type = "ProjectCommand";
|
|
709
|
+
//
|
|
710
|
+
// message CreateProject {
|
|
711
|
+
// // ...
|
|
712
|
+
//
|
|
713
|
+
// message WithAssignee {
|
|
714
|
+
// // ...
|
|
715
|
+
// }
|
|
716
|
+
// }
|
|
717
|
+
//
|
|
718
|
+
// message DeleteProject { /*...*/ }
|
|
719
|
+
// ```
|
|
720
|
+
//
|
|
721
|
+
// In the example above, `CreateProject`, `CreateProject.WithAssignee`, and `DeleteProject`
|
|
722
|
+
// messages are `ProjectCommand`-s.
|
|
723
|
+
//
|
|
724
|
+
// To specify a characteristic for a single message, please use the `(is)` message option.
|
|
725
|
+
// If both `(is)` and `(every_is)` options are applicable for a type, both are applied.
|
|
726
|
+
//
|
|
727
|
+
// When targeting Java, specify the name of a Java interface to be implemented by these
|
|
728
|
+
// message types via `(every_is).java_type`.
|
|
729
|
+
//
|
|
730
|
+
// When targeting TypeScript, specify the name of a TypeScript interface to be
|
|
731
|
+
// implemented by these message types via `(every_is).ts_type`.
|
|
732
|
+
//
|
|
733
|
+
EveryIsOption every_is = 73946;
|
|
734
|
+
|
|
735
|
+
// Reserved 73947 to 73970 for future use.
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
extend google.protobuf.ServiceOptions {
|
|
739
|
+
|
|
740
|
+
// Indicates that the service is a part of Service Provider Interface (SPI).
|
|
741
|
+
bool SPI_service = 73971;
|
|
742
|
+
|
|
743
|
+
// Reserved 73971 to 73980.
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// Reserved 73981 to 74000 for other future Spine Options numbers.
|
|
747
|
+
|
|
748
|
+
//
|
|
749
|
+
// Validation Option Types
|
|
750
|
+
//---------------------------
|
|
751
|
+
|
|
752
|
+
// Defines the error message used if a `required` field is not set.
|
|
753
|
+
//
|
|
754
|
+
// Applies only to the fields marked as `required`.
|
|
755
|
+
//
|
|
756
|
+
message IfMissingOption {
|
|
757
|
+
|
|
758
|
+
// The default error message.
|
|
759
|
+
option (default_message) = "The field `${parent.type}.${field.path}`"
|
|
760
|
+
" of the type `${field.type}` must have a non-default value.";
|
|
761
|
+
|
|
762
|
+
// A user-defined validation error format message.
|
|
763
|
+
//
|
|
764
|
+
// Use `error_msg` instead.
|
|
765
|
+
//
|
|
766
|
+
string msg_format = 1 [deprecated = true];
|
|
767
|
+
|
|
768
|
+
// A user-defined error message.
|
|
769
|
+
//
|
|
770
|
+
// The specified message may include the following placeholders:
|
|
771
|
+
//
|
|
772
|
+
// 1. `${field.path}` – the field path.
|
|
773
|
+
// 2. `${field.type}` – the fully qualified name of the field type.
|
|
774
|
+
// 3. `${parent.type}` – the fully qualified name of the validated message.
|
|
775
|
+
//
|
|
776
|
+
// The placeholders will be replaced at runtime when the error is constructed.
|
|
777
|
+
//
|
|
778
|
+
// Example: using the `(if_missing)` option.
|
|
779
|
+
//
|
|
780
|
+
// message Student {
|
|
781
|
+
// Name name = 1 [(required) = true,
|
|
782
|
+
// (if_missing).error_msg = "The `${field.path}` field is mandatory for `${parent.type}`."];
|
|
783
|
+
// }
|
|
784
|
+
//
|
|
785
|
+
string error_msg = 2;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// Indicates that the numeric field must be greater than or equal to the specified value.
|
|
789
|
+
//
|
|
790
|
+
// The option supports all singular and repeated numeric fields.
|
|
791
|
+
//
|
|
792
|
+
message MinOption {
|
|
793
|
+
|
|
794
|
+
// The default error message.
|
|
795
|
+
option (default_message) = "The field `${parent.type}.${field.path}`"
|
|
796
|
+
" must be ${min.operator} ${min.value}. The passed value: `${field.value}`.";
|
|
797
|
+
|
|
798
|
+
// The string representation of the minimum field value.
|
|
799
|
+
//
|
|
800
|
+
// ## Integer and floating-point values
|
|
801
|
+
//
|
|
802
|
+
// A minimum value for an integer field must use an integer number. Specifying a decimal
|
|
803
|
+
// number is not allowed, even if it has no fractional part (e.g., `5.0` is invalid).
|
|
804
|
+
//
|
|
805
|
+
// A minimum value for a floating-point field must use a decimal separator (`.`), even if
|
|
806
|
+
// the value has no fractional part. An exponent part represented by `E` or `e`, followed
|
|
807
|
+
// by an optional sign and digits is allowed (e.g., `1.2E3`, `0.5e-2`).
|
|
808
|
+
//
|
|
809
|
+
// Example: defining minimum values for integer and floating-point fields.
|
|
810
|
+
//
|
|
811
|
+
// message Measurements {
|
|
812
|
+
// int32 temperature = 1 [(min).value = "0"];
|
|
813
|
+
// uint32 mass = 2 [(min).value = "5"];
|
|
814
|
+
// float degree = 3 [(min).value = "0.0"];
|
|
815
|
+
// double angle = 4 [(min).value = "30.0"];
|
|
816
|
+
// float pressure = 5 [(min).value = "950.0E-2"];
|
|
817
|
+
// }
|
|
818
|
+
//
|
|
819
|
+
// ## Field Type Limitations
|
|
820
|
+
//
|
|
821
|
+
// A minimum value must not fall below the limits of the field type.
|
|
822
|
+
//
|
|
823
|
+
// Example: invalid values that fall below the field type limits.
|
|
824
|
+
//
|
|
825
|
+
// message OverflowMeasurements {
|
|
826
|
+
// float pressure = 1 [(min).value = "-5.5E38"]; // Falls below the `float` minimum.
|
|
827
|
+
// uint32 mass = 2 [(min).value = "-5"]; // Falls below the `uint32` minimum.
|
|
828
|
+
// }
|
|
829
|
+
//
|
|
830
|
+
// ## Field references
|
|
831
|
+
//
|
|
832
|
+
// Instead of numeric literals, you can reference another numeric field.
|
|
833
|
+
// At runtime, the field’s value will be used as the bound. Nested fields are supported.
|
|
834
|
+
//
|
|
835
|
+
// Example: defining minimum values using field references.
|
|
836
|
+
//
|
|
837
|
+
// message Measurements {
|
|
838
|
+
//
|
|
839
|
+
// int32 min_length = 1;
|
|
840
|
+
// int32 length = 2 [(min).value = "min_length"];
|
|
841
|
+
//
|
|
842
|
+
// Limits limits = 3;
|
|
843
|
+
// int32 temperature = 4 [(min).value = "limits.min_temperature"];
|
|
844
|
+
// float pressure = 5 [(min).value = "limits.min_pressure"];
|
|
845
|
+
// }
|
|
846
|
+
//
|
|
847
|
+
// message Limits {
|
|
848
|
+
// int32 min_temperature = 1;
|
|
849
|
+
// float min_pressure = 2;
|
|
850
|
+
// }
|
|
851
|
+
//
|
|
852
|
+
// Note: Field type compatibility is not required in this case; the value is
|
|
853
|
+
// automatically converted. However, only numeric fields can be referenced.
|
|
854
|
+
// Repeated and map fields are not supported.
|
|
855
|
+
//
|
|
856
|
+
string value = 1;
|
|
857
|
+
|
|
858
|
+
// Specifies if the field should be strictly greater than the specified minimum.
|
|
859
|
+
//
|
|
860
|
+
// The default value is false, i.e. the bound is inclusive.
|
|
861
|
+
//
|
|
862
|
+
bool exclusive = 2;
|
|
863
|
+
|
|
864
|
+
// A user-defined validation error format message.
|
|
865
|
+
string msg_format = 3 [deprecated = true];
|
|
866
|
+
|
|
867
|
+
// A user-defined error message.
|
|
868
|
+
//
|
|
869
|
+
// The specified message may include the following placeholders:
|
|
870
|
+
//
|
|
871
|
+
// 1. `${field.value}` - the field value.
|
|
872
|
+
// 2. `${field.path}` – the field path.
|
|
873
|
+
// 3. `${field.type}` – the fully qualified name of the field type.
|
|
874
|
+
// 4. `${parent.type}` – the fully qualified name of the validated message.
|
|
875
|
+
// 5. `${min.value}` – the specified minimum `value`. For referenced fields, the actual
|
|
876
|
+
// field value is also printed in round brackets along with the reference itself.
|
|
877
|
+
// 6. `${min.operator}` – if `exclusive` is set to `true`, this placeholder equals to ">".
|
|
878
|
+
// Otherwise, ">=".
|
|
879
|
+
//
|
|
880
|
+
// The placeholders will be replaced at runtime when the error is constructed.
|
|
881
|
+
//
|
|
882
|
+
string error_msg = 4;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
// Indicates that the numeric field must be less than or equal to the specified value.
|
|
886
|
+
//
|
|
887
|
+
// The option supports all singular and repeated numeric fields.
|
|
888
|
+
//
|
|
889
|
+
message MaxOption {
|
|
890
|
+
|
|
891
|
+
// The default error message.
|
|
892
|
+
option (default_message) = "The field `${parent.type}.${field.path}`"
|
|
893
|
+
" must be ${max.operator} ${max.value}. The passed value: `${field.value}`.";
|
|
894
|
+
|
|
895
|
+
// The string representation of the maximum field value.
|
|
896
|
+
//
|
|
897
|
+
// ## Integer and floating-point values
|
|
898
|
+
//
|
|
899
|
+
// A maximum value for an integer field must use an integer number. Specifying a decimal
|
|
900
|
+
// number is not allowed, even if it has no fractional part (e.g., `5.0` is invalid).
|
|
901
|
+
//
|
|
902
|
+
// A maximum value for a floating-point field must use a decimal separator (`.`), even if
|
|
903
|
+
// the value has no fractional part. An exponent part represented by `E` or `e`, followed
|
|
904
|
+
// by an optional sign and digits is allowed (e.g., `1.2E3`, `0.5e-2`).
|
|
905
|
+
//
|
|
906
|
+
// Example: defining maximum values for integer and floating-point fields.
|
|
907
|
+
//
|
|
908
|
+
// message Measurements {
|
|
909
|
+
// int32 temperature = 1 [(max).value = "270"];
|
|
910
|
+
// uint32 mass = 2 [(max).value = "1200"];
|
|
911
|
+
// float degree = 3 [(max).value = "360.0"];
|
|
912
|
+
// double angle = 4 [(max).value = "90.0"];
|
|
913
|
+
// float pressure = 5 [(max).value = "1050.0E-2"];
|
|
914
|
+
// }
|
|
915
|
+
//
|
|
916
|
+
// ## Field Type Limitations
|
|
917
|
+
//
|
|
918
|
+
// A maximum value must not exceed the limits of the field type.
|
|
919
|
+
//
|
|
920
|
+
// Example: invalid values that exceed the field type limits.
|
|
921
|
+
//
|
|
922
|
+
// message OverflowMeasurements {
|
|
923
|
+
// float pressure = 1 [(min).value = "5.5E38"]; // Exceeds the `float` maximum.
|
|
924
|
+
// int32 mass = 2 [(min).value = "2147483648"]; // Exceeds the `int32` maximum.
|
|
925
|
+
// }
|
|
926
|
+
//
|
|
927
|
+
// ## Field references
|
|
928
|
+
//
|
|
929
|
+
// Instead of numeric literals, you can reference another numeric field.
|
|
930
|
+
// At runtime, the field’s value will be used as the bound. Nested fields are supported.
|
|
931
|
+
//
|
|
932
|
+
// Example: defining maximum values using field references.
|
|
933
|
+
//
|
|
934
|
+
// message Measurements {
|
|
935
|
+
//
|
|
936
|
+
// int32 max_length = 1;
|
|
937
|
+
// int32 length = 2 [(max).value = "max_length"];
|
|
938
|
+
//
|
|
939
|
+
// Limits limits = 3;
|
|
940
|
+
// int32 temperature = 4 [(max).value = "limits.max_temperature"];
|
|
941
|
+
// float pressure = 5 [(max).value = "limits.max_pressure"];
|
|
942
|
+
// }
|
|
943
|
+
//
|
|
944
|
+
// message Limits {
|
|
945
|
+
// int32 max_temperature = 1;
|
|
946
|
+
// float max_pressure = 2;
|
|
947
|
+
// }
|
|
948
|
+
//
|
|
949
|
+
// Note: Field type compatibility is not required in this case; the value is
|
|
950
|
+
// automatically converted. However, only numeric fields can be referenced.
|
|
951
|
+
// Repeated and map fields are not supported.
|
|
952
|
+
//
|
|
953
|
+
string value = 1;
|
|
954
|
+
|
|
955
|
+
// Specifies if the field should be strictly less than the specified maximum.
|
|
956
|
+
//
|
|
957
|
+
// The default value is false, i.e. the bound is inclusive.
|
|
958
|
+
//
|
|
959
|
+
bool exclusive = 2;
|
|
960
|
+
|
|
961
|
+
// A user-defined validation error format message.
|
|
962
|
+
string msg_format = 3 [deprecated = true];
|
|
963
|
+
|
|
964
|
+
// A user-defined error message.
|
|
965
|
+
//
|
|
966
|
+
// The specified message may include the following placeholders:
|
|
967
|
+
//
|
|
968
|
+
// 1. `${field.path}` – the field path.
|
|
969
|
+
// 2. `${field.value}` - the field value.
|
|
970
|
+
// 3. `${field.type}` – the fully qualified name of the field type.
|
|
971
|
+
// 4. `${parent.type}` – the fully qualified name of the validated message.
|
|
972
|
+
// 5. `${max.value}` – the specified maximum `value`. For referenced fields, the actual
|
|
973
|
+
// field value is also printed in round brackets along with the reference itself.
|
|
974
|
+
// 6. `${max.operator}` – if `exclusive` is set to `true`, this placeholder equals to "<".
|
|
975
|
+
// Otherwise, "<=".
|
|
976
|
+
//
|
|
977
|
+
// The placeholders will be replaced at runtime when the error is constructed.
|
|
978
|
+
//
|
|
979
|
+
string error_msg = 4;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
// A string field value must match the given regular expression.
|
|
983
|
+
//
|
|
984
|
+
// This option is applicable only to string fields,
|
|
985
|
+
// including those that are repeated.
|
|
986
|
+
//
|
|
987
|
+
// Example: using the `(pattern)` option.
|
|
988
|
+
//
|
|
989
|
+
// message CreateAccount {
|
|
990
|
+
// string id = 1 [(pattern).regex = "^[A-Za-z0-9+]+$",
|
|
991
|
+
// (pattern).error_msg = "ID must be alphanumerical in `${parent.type}`. Provided: `${field.value}`."];
|
|
992
|
+
// }
|
|
993
|
+
//
|
|
994
|
+
message PatternOption {
|
|
995
|
+
|
|
996
|
+
// The default error message.
|
|
997
|
+
option (default_message) = "The `${parent.type}.${field.path}` field"
|
|
998
|
+
" must match the regular expression `${regex.pattern}` (modifiers: `${regex.modifiers}`)."
|
|
999
|
+
" The passed value: `${field.value}`.";
|
|
1000
|
+
|
|
1001
|
+
// The regular expression that the field value must match.
|
|
1002
|
+
//
|
|
1003
|
+
// Please use the Java regex dialect for the syntax baseline:
|
|
1004
|
+
// https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/Pattern.html
|
|
1005
|
+
//
|
|
1006
|
+
// Note: in Java, regex patterns are not wrapped in explicit delimiters like in Perl or PHP.
|
|
1007
|
+
// Instead, the pattern is provided as a string literal. Therefore, the `/` symbol does not need
|
|
1008
|
+
// to be escaped.
|
|
1009
|
+
//
|
|
1010
|
+
// The provided string literal is passed directly to the regex engine. So, it must be exactly
|
|
1011
|
+
// what you would supply to the `java.util.regex.Pattern.compile()` method.
|
|
1012
|
+
//
|
|
1013
|
+
string regex = 1;
|
|
1014
|
+
|
|
1015
|
+
reserved 2;
|
|
1016
|
+
reserved "flag";
|
|
1017
|
+
|
|
1018
|
+
// Modifiers for this pattern.
|
|
1019
|
+
Modifier modifier = 4;
|
|
1020
|
+
|
|
1021
|
+
// A user-defined validation error format message.
|
|
1022
|
+
string msg_format = 3 [deprecated = true];
|
|
1023
|
+
|
|
1024
|
+
// A user-defined validation error format message.
|
|
1025
|
+
//
|
|
1026
|
+
// The specified message may include the following placeholders:
|
|
1027
|
+
//
|
|
1028
|
+
// 1. `${field.path}` – the field path.
|
|
1029
|
+
// 2. `${field.value}` - the field value.
|
|
1030
|
+
// 3. `${field.type}` – the fully qualified name of the field type.
|
|
1031
|
+
// 4. `${parent.type}` – the fully qualified name of the validated message.
|
|
1032
|
+
// 5. `${regex.pattern}` – the specified regex pattern.
|
|
1033
|
+
// 6. `${regex.modifiers}` – the specified modifiers, if any. For example, `[dot_all, unicode]`.
|
|
1034
|
+
//
|
|
1035
|
+
// The placeholders will be replaced at runtime when the error is constructed.
|
|
1036
|
+
//
|
|
1037
|
+
string error_msg = 5;
|
|
1038
|
+
|
|
1039
|
+
// Regular expression modifiers.
|
|
1040
|
+
//
|
|
1041
|
+
// These modifiers are specifically selected to be supported in many implementation platforms.
|
|
1042
|
+
//
|
|
1043
|
+
message Modifier {
|
|
1044
|
+
|
|
1045
|
+
// Enables the dot (`.`) symbol to match all the characters.
|
|
1046
|
+
//
|
|
1047
|
+
// By default, the dot does not match line break characters.
|
|
1048
|
+
//
|
|
1049
|
+
// May also be known in some platforms as "single line" mode and be encoded with
|
|
1050
|
+
// the `s` flag.
|
|
1051
|
+
//
|
|
1052
|
+
bool dot_all = 1;
|
|
1053
|
+
|
|
1054
|
+
// Allows ignoring the case of the matched symbols.
|
|
1055
|
+
//
|
|
1056
|
+
// For example, if this modifier is specified, string `ABC` would be a complete match for
|
|
1057
|
+
// the regex `[a-z]+`.
|
|
1058
|
+
//
|
|
1059
|
+
// On some platforms may be represented by the `i` flag.
|
|
1060
|
+
//
|
|
1061
|
+
bool case_insensitive = 2;
|
|
1062
|
+
|
|
1063
|
+
// Enables the `^` (caret) and `$` (dollar) signs to match a start and an end of a line
|
|
1064
|
+
// instead of a start and an end of the whole expression.
|
|
1065
|
+
//
|
|
1066
|
+
// On some platforms may be represented by the `m` flag.
|
|
1067
|
+
//
|
|
1068
|
+
bool multiline = 3;
|
|
1069
|
+
|
|
1070
|
+
// Enables matching the whole UTF-8 sequences.
|
|
1071
|
+
//
|
|
1072
|
+
// On some platforms may be represented by the `u` flag.
|
|
1073
|
+
//
|
|
1074
|
+
bool unicode = 4;
|
|
1075
|
+
|
|
1076
|
+
// Allows the matched strings to contain a full match to the pattern and some other
|
|
1077
|
+
// characters as well.
|
|
1078
|
+
//
|
|
1079
|
+
// By default, a string only matches a pattern if it is a full match, i.e. there are no
|
|
1080
|
+
// unaccounted for leading and/or trailing characters.
|
|
1081
|
+
//
|
|
1082
|
+
// This modifier is usually not represented in programming languages, as the control over
|
|
1083
|
+
// whether to match an entire string or only its part is provided to the user by other
|
|
1084
|
+
// language means. For example, in Java, this would be the difference between methods
|
|
1085
|
+
// `matches()` and `find()` of the `java.util.regex.Matcher` class.
|
|
1086
|
+
//
|
|
1087
|
+
bool partial_match = 5;
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
// Specifies the message to show if a validated field happens to be invalid.
|
|
1092
|
+
//
|
|
1093
|
+
// It is applicable only to fields marked with `(validate)`.
|
|
1094
|
+
//
|
|
1095
|
+
message IfInvalidOption {
|
|
1096
|
+
|
|
1097
|
+
// Do not specify an error message for `(validate)`; it is no longer used by
|
|
1098
|
+
// the validation library.
|
|
1099
|
+
option deprecated = true;
|
|
1100
|
+
|
|
1101
|
+
// The default error message.
|
|
1102
|
+
option (default_message) = "The field `${parent.type}.${field.path}` of the type"
|
|
1103
|
+
" `${field.type}` is invalid. The field value: `${field.value}`.";
|
|
1104
|
+
|
|
1105
|
+
// A user-defined validation error format message.
|
|
1106
|
+
//
|
|
1107
|
+
// Use `error_msg` instead.
|
|
1108
|
+
//
|
|
1109
|
+
string msg_format = 1 [deprecated = true];
|
|
1110
|
+
|
|
1111
|
+
// A user-defined error message.
|
|
1112
|
+
//
|
|
1113
|
+
// The specified message may include the following placeholders:
|
|
1114
|
+
//
|
|
1115
|
+
// 1. `${field.path}` – the field path.
|
|
1116
|
+
// 2. `${field.value}` - the field value.
|
|
1117
|
+
// 3. `${field.type}` – the fully qualified name of the field type.
|
|
1118
|
+
// 4. `${parent.type}` – the fully qualified name of the field declaring type.
|
|
1119
|
+
//
|
|
1120
|
+
// The placeholders will be replaced at runtime when the error is constructed.
|
|
1121
|
+
//
|
|
1122
|
+
// Example: using the `(if_invalid)` option.
|
|
1123
|
+
//
|
|
1124
|
+
// message Transaction {
|
|
1125
|
+
// TransactionDetails details = 1 [(validate) = true,
|
|
1126
|
+
// (if_invalid).error_msg = "The `${field.path}` field is invalid."];
|
|
1127
|
+
// }
|
|
1128
|
+
//
|
|
1129
|
+
string error_msg = 2;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
// Specifies that another field must be present if the option's target field is present.
|
|
1133
|
+
//
|
|
1134
|
+
// Unlike the `required_field` that handles combination of required fields, this option is useful
|
|
1135
|
+
// when it is needed to say that an optional field makes sense only when another optional field
|
|
1136
|
+
// is present.
|
|
1137
|
+
//
|
|
1138
|
+
// This option can be applied to the same field types as `(required)`, including both the
|
|
1139
|
+
// target field and its companion. Supported field types are:
|
|
1140
|
+
//
|
|
1141
|
+
// - Messages and enums.
|
|
1142
|
+
// - Repeated fields and maps.
|
|
1143
|
+
// - `string` and `bytes`.
|
|
1144
|
+
//
|
|
1145
|
+
// Example: requiring mutual presence of optional fields.
|
|
1146
|
+
//
|
|
1147
|
+
// message ScheduledItem {
|
|
1148
|
+
// ...
|
|
1149
|
+
// spine.time.LocalDate date = 4;
|
|
1150
|
+
// spine.time.LocalTime time = 5 [(goes).with = "date"];
|
|
1151
|
+
// }
|
|
1152
|
+
//
|
|
1153
|
+
message GoesOption {
|
|
1154
|
+
|
|
1155
|
+
// The default error message.
|
|
1156
|
+
option (default_message) = "The field `${goes.companion}` must also be set when `${field.path}`"
|
|
1157
|
+
" is set in `${parent.type}`.";
|
|
1158
|
+
|
|
1159
|
+
// The name of the companion field whose presence is required for this field to be valid.
|
|
1160
|
+
string with = 1;
|
|
1161
|
+
|
|
1162
|
+
// A user-defined validation error format message.
|
|
1163
|
+
string msg_format = 2 [deprecated = true];
|
|
1164
|
+
|
|
1165
|
+
// A user-defined error message.
|
|
1166
|
+
//
|
|
1167
|
+
// The specified message may include the following placeholders:
|
|
1168
|
+
//
|
|
1169
|
+
// 1. `${field.path}` – the field path.
|
|
1170
|
+
// 2. `${field.value}` – the field value.
|
|
1171
|
+
// 3. `${field.type}` – the fully qualified name of the field type.
|
|
1172
|
+
// 4. `${parent.type}` – the fully qualified name of the validated message.
|
|
1173
|
+
// 5. `${goes.companion}` – the name of the companion specified in `with`.
|
|
1174
|
+
//
|
|
1175
|
+
// The placeholders will be replaced at runtime when the error is constructed.
|
|
1176
|
+
//
|
|
1177
|
+
string error_msg = 3;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
// Defines options of a message representing a state of an entity.
|
|
1181
|
+
message EntityOption {
|
|
1182
|
+
|
|
1183
|
+
// A type of an entity for state of which the message is defined.
|
|
1184
|
+
enum Kind {
|
|
1185
|
+
option allow_alias = true;
|
|
1186
|
+
|
|
1187
|
+
// Reserved for errors.
|
|
1188
|
+
KIND_UNKNOWN = 0;
|
|
1189
|
+
|
|
1190
|
+
// The message is an aggregate state.
|
|
1191
|
+
AGGREGATE = 1;
|
|
1192
|
+
|
|
1193
|
+
// The message is a state of a projection (same as "view").
|
|
1194
|
+
PROJECTION = 2;
|
|
1195
|
+
|
|
1196
|
+
// The message is a state of a view (same as "projection").
|
|
1197
|
+
VIEW = 2;
|
|
1198
|
+
|
|
1199
|
+
// The message is a state of a process manager.
|
|
1200
|
+
PROCESS_MANAGER = 3;
|
|
1201
|
+
|
|
1202
|
+
// The message is a state of an entity, which is not of the type
|
|
1203
|
+
// defined by other members of this enumeration.
|
|
1204
|
+
ENTITY = 4;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
// The type of the entity.
|
|
1208
|
+
Kind kind = 1;
|
|
1209
|
+
|
|
1210
|
+
// The level of visibility of the entity to queries.
|
|
1211
|
+
enum Visibility {
|
|
1212
|
+
|
|
1213
|
+
// Default visibility is different for different types of entities:
|
|
1214
|
+
// - for projections, "FULL" is default;
|
|
1215
|
+
// - for aggregates, process managers, and other entities, "NONE" is default.
|
|
1216
|
+
//
|
|
1217
|
+
DEFAULT = 0;
|
|
1218
|
+
|
|
1219
|
+
// The entity is not visible to queries.
|
|
1220
|
+
NONE = 1;
|
|
1221
|
+
|
|
1222
|
+
// Client-side applications can subscribe to updates of entities of this type.
|
|
1223
|
+
SUBSCRIBE = 2;
|
|
1224
|
+
|
|
1225
|
+
// Client-side applications can query this type of entities.
|
|
1226
|
+
QUERY = 3;
|
|
1227
|
+
|
|
1228
|
+
// Client-side applications can subscribe and query this type of entity.
|
|
1229
|
+
FULL = 4;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
// The visibility of the entity.
|
|
1233
|
+
//
|
|
1234
|
+
// If not defined, the value of this option is `DEFAULT`.
|
|
1235
|
+
//
|
|
1236
|
+
Visibility visibility = 2;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
// Defines a common type for message types declared in the same proto file.
|
|
1240
|
+
//
|
|
1241
|
+
// The nature of the type depends on the target programming language.
|
|
1242
|
+
// For example, the `java_type` property defines a name of the Java interface common
|
|
1243
|
+
// to all message classes generated for the proto file having this option.
|
|
1244
|
+
// Similarly, the `ts_type` property defines a name of the TypeScript interface.
|
|
1245
|
+
//
|
|
1246
|
+
// The option triggers creation of the common type if the `generate` property is set to true.
|
|
1247
|
+
// Otherwise, it is expected that the user provides the reference to an existing type.
|
|
1248
|
+
//
|
|
1249
|
+
message EveryIsOption {
|
|
1250
|
+
|
|
1251
|
+
// Enables the generation of the common type.
|
|
1252
|
+
//
|
|
1253
|
+
// The default value is `false`.
|
|
1254
|
+
//
|
|
1255
|
+
bool generate = 1;
|
|
1256
|
+
|
|
1257
|
+
// The reference to a Java top-level interface.
|
|
1258
|
+
//
|
|
1259
|
+
// The interface cannot be nested into a class or another interface.
|
|
1260
|
+
// If a nested interface is provided, the code generation should fail the build process.
|
|
1261
|
+
//
|
|
1262
|
+
// The value may be a fully-qualified or a simple name.
|
|
1263
|
+
//
|
|
1264
|
+
// When a simple name is set, it is assumed that the interface belongs to
|
|
1265
|
+
// the package of the generated message classes.
|
|
1266
|
+
//
|
|
1267
|
+
// If the value of the `generate` field is set to `false`, the referenced interface must exist.
|
|
1268
|
+
// Otherwise, a compilation error will occur.
|
|
1269
|
+
//
|
|
1270
|
+
// If the value of the `generate` field is set to `true`, the framework will
|
|
1271
|
+
// generate the interface using the given name and the package as described above.
|
|
1272
|
+
//
|
|
1273
|
+
// The generated interface will extend `com.google.protobuf.Message` and
|
|
1274
|
+
// will have no declared methods.
|
|
1275
|
+
//
|
|
1276
|
+
string java_type = 2;
|
|
1277
|
+
|
|
1278
|
+
// The reference to a TypeScript top-level interface.
|
|
1279
|
+
//
|
|
1280
|
+
// The interface cannot be nested into a namespace or a class.
|
|
1281
|
+
// If a nested interface is provided, the code generation should fail the build process.
|
|
1282
|
+
//
|
|
1283
|
+
// The value is a simple name of the interface. It is assumed that the interface
|
|
1284
|
+
// is available in the scope of the generated message types.
|
|
1285
|
+
//
|
|
1286
|
+
// If the value of the `generate` field is set to `false`, the referenced interface must exist.
|
|
1287
|
+
// Otherwise, a compilation error will occur.
|
|
1288
|
+
//
|
|
1289
|
+
// If the value of the `generate` field is set to `true`, the framework will
|
|
1290
|
+
// generate the interface using the given name.
|
|
1291
|
+
//
|
|
1292
|
+
string ts_type = 3;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
// Defines an additional type for a message type in which this option is declared.
|
|
1296
|
+
//
|
|
1297
|
+
// The nature of the type depends on the target programming language.
|
|
1298
|
+
// For example, the `java_type` property defines a name of the Java interface that
|
|
1299
|
+
// the generated message class will implement.
|
|
1300
|
+
// Similarly, the `ts_type` property defines a name of the TypeScript interface.
|
|
1301
|
+
//
|
|
1302
|
+
message IsOption {
|
|
1303
|
+
|
|
1304
|
+
// The reference to a Java top-level interface.
|
|
1305
|
+
//
|
|
1306
|
+
// The interface cannot be nested into a class or another interface.
|
|
1307
|
+
// If a nested interface is provided, the code generation should fail the build process.
|
|
1308
|
+
//
|
|
1309
|
+
// The value may be a fully-qualified or a simple name.
|
|
1310
|
+
//
|
|
1311
|
+
// When a simple name is set, it is assumed that the interface belongs to
|
|
1312
|
+
// the package of the generated message classes.
|
|
1313
|
+
//
|
|
1314
|
+
// The referenced interface must exist. Otherwise, a compilation error will occur.
|
|
1315
|
+
//
|
|
1316
|
+
string java_type = 1;
|
|
1317
|
+
|
|
1318
|
+
// The reference to a TypeScript top-level interface.
|
|
1319
|
+
//
|
|
1320
|
+
// The interface cannot be nested into a namespace or a class.
|
|
1321
|
+
// If a nested interface is provided, the code generation should fail the build process.
|
|
1322
|
+
//
|
|
1323
|
+
// The value is a simple name of the interface. It is assumed that the interface
|
|
1324
|
+
// is available in the scope of the generated message types.
|
|
1325
|
+
//
|
|
1326
|
+
// The referenced interface must exist. Otherwise, a compilation error will occur.
|
|
1327
|
+
//
|
|
1328
|
+
string ts_type = 2;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
// Defines the way to compare two messages of the same type to one another.
|
|
1332
|
+
//
|
|
1333
|
+
// Comparisons can be used to sort values.
|
|
1334
|
+
//
|
|
1335
|
+
// See the `(compare_by)` option.
|
|
1336
|
+
//
|
|
1337
|
+
message CompareByOption {
|
|
1338
|
+
|
|
1339
|
+
// Field paths used for comparisons.
|
|
1340
|
+
//
|
|
1341
|
+
// The allowed field types are:
|
|
1342
|
+
// - any number type;
|
|
1343
|
+
// - `bool` (`false` is less than `true`);
|
|
1344
|
+
// - `string` (in the order of respective Unicode values);
|
|
1345
|
+
// - enumerations (following the order of numbers associated with each constant);
|
|
1346
|
+
// - local messages (generated within the current build) marked with `(compare_by)`;
|
|
1347
|
+
// - external messages (from dependencies), which either marked with `(compare_by)`
|
|
1348
|
+
// OR have a comparator provided in `io.spine.compare.ComparatorRegistry`.
|
|
1349
|
+
//
|
|
1350
|
+
// Other types are not permitted. Repeated or map fields are not permitted either.
|
|
1351
|
+
// Such declarations will lead to build-time errors.
|
|
1352
|
+
//
|
|
1353
|
+
// To refer to nested fields, separate the field names with a dot (`.`).
|
|
1354
|
+
// No fields in the path can be repeated or maps.
|
|
1355
|
+
//
|
|
1356
|
+
// When multiple field paths are specified, comparison is executed in the order of reference.
|
|
1357
|
+
// For example, specifying `["seconds", "nanos"]` makes the comparison mechanism prioritize
|
|
1358
|
+
// the `seconds` field and refer to `nanos` only when `seconds` are equal.
|
|
1359
|
+
//
|
|
1360
|
+
// NOTE: When comparing fields with a message type, a non-set message is always less than
|
|
1361
|
+
// a set message. But if a message is set to a default value, the comparison falls back to
|
|
1362
|
+
// the field-wise comparison, i.e. number values are treated as zeros, `bool` — as `false`,
|
|
1363
|
+
// and so on.
|
|
1364
|
+
//
|
|
1365
|
+
repeated string field = 1;
|
|
1366
|
+
|
|
1367
|
+
// If true, the default order is reversed. For example, numbers are ordered from the greater to
|
|
1368
|
+
// the lower, enums — from the last number value to the 0th value, etc.
|
|
1369
|
+
bool descending = 2;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
// Defines the error message used if a `set_once` field is set again.
|
|
1373
|
+
//
|
|
1374
|
+
// Applies only to the fields marked as `set_once`.
|
|
1375
|
+
//
|
|
1376
|
+
message IfSetAgainOption {
|
|
1377
|
+
|
|
1378
|
+
// The default error message.
|
|
1379
|
+
option (default_message) = "The field `${parent.type}.${field.path}` of the type"
|
|
1380
|
+
" `${field.type}` already has the value `${field.value}` and cannot be reassigned"
|
|
1381
|
+
" to `${field.proposed_value}`.";
|
|
1382
|
+
|
|
1383
|
+
// A user-defined error message.
|
|
1384
|
+
//
|
|
1385
|
+
// The specified message may include the following placeholders:
|
|
1386
|
+
//
|
|
1387
|
+
// 1. `${field.path}` – the field path.
|
|
1388
|
+
// 2. `${field.type}` – the fully qualified name of the field type.
|
|
1389
|
+
// 3. `${field.value}` – the current field value.
|
|
1390
|
+
// 4. `${field.proposed_value}` – the value, which was attempted to be set.
|
|
1391
|
+
// 5. `${parent.type}` – the fully qualified name of the validated message.
|
|
1392
|
+
//
|
|
1393
|
+
// The placeholders will be replaced at runtime when the error is constructed.
|
|
1394
|
+
//
|
|
1395
|
+
// Example: using the `(set_once)` option.
|
|
1396
|
+
//
|
|
1397
|
+
// message User {
|
|
1398
|
+
// UserId id = 1 [(set_once) = true,
|
|
1399
|
+
// (if_set_again).error_msg = "A student ID is used as a permanent identifier within academic system, and cannot be re-assigned."];
|
|
1400
|
+
// }
|
|
1401
|
+
//
|
|
1402
|
+
string error_msg = 1;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
// Defines the error message used if a `distinct` field has duplicates.
|
|
1406
|
+
//
|
|
1407
|
+
// Applies only to the `repeated` and `map` fields marked with the `(distinct)` option.
|
|
1408
|
+
//
|
|
1409
|
+
message IfHasDuplicatesOption {
|
|
1410
|
+
|
|
1411
|
+
// The default error message.
|
|
1412
|
+
option (default_message) = "The field `${parent.type}.${field.path}` of the type"
|
|
1413
|
+
" `${field.type}` must not contain duplicates."
|
|
1414
|
+
" The duplicates found: `${field.duplicates}`.";
|
|
1415
|
+
|
|
1416
|
+
// A user-defined error message.
|
|
1417
|
+
//
|
|
1418
|
+
// The specified message may include the following placeholders:
|
|
1419
|
+
//
|
|
1420
|
+
// 1. `${field.path}` – the field path.
|
|
1421
|
+
// 2. `${field.type}` – the fully qualified name of the field type.
|
|
1422
|
+
// 3. `${field.value}` – the field value (the whole collection).
|
|
1423
|
+
// 4. `${field.duplicates}` – the duplicates found (elements that occur more than once).
|
|
1424
|
+
// 5. `${parent.type}` – the fully qualified name of the validated message.
|
|
1425
|
+
//
|
|
1426
|
+
// The placeholders will be replaced at runtime when the error is constructed.
|
|
1427
|
+
//
|
|
1428
|
+
// Example: using the `(distinct)` option.
|
|
1429
|
+
//
|
|
1430
|
+
// message Blizzard {
|
|
1431
|
+
// repeated Snowflake = 1 [(distinct) = true,
|
|
1432
|
+
// (if_has_duplicates).error_msg = "Every snowflake must be unique! The duplicates found: `${field.duplicates}`."];
|
|
1433
|
+
// }
|
|
1434
|
+
//
|
|
1435
|
+
string error_msg = 1;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
// Indicates that the numeric field must belong to the specified bounded range.
|
|
1439
|
+
//
|
|
1440
|
+
// For unbounded ranges, please use `(min)` and `(max)` options.
|
|
1441
|
+
//
|
|
1442
|
+
// The option supports all singular and repeated numeric fields.
|
|
1443
|
+
//
|
|
1444
|
+
message RangeOption {
|
|
1445
|
+
|
|
1446
|
+
// The default error message.
|
|
1447
|
+
option (default_message) = "The field `${parent.type}.${field.path}` must be within"
|
|
1448
|
+
" the following range: `${range.value}`. The passed value: `${field.value}`.";
|
|
1449
|
+
|
|
1450
|
+
// The string representation of the range.
|
|
1451
|
+
//
|
|
1452
|
+
// A range consists of two bounds: a lower bound and an upper bound. These bounds are
|
|
1453
|
+
// separated by either the `..` or ` .. ` delimiter. Each bound can be either open
|
|
1454
|
+
// or closed. The format of the bounds and the valid values depend on the type of field.
|
|
1455
|
+
//
|
|
1456
|
+
// ## Bound Types
|
|
1457
|
+
//
|
|
1458
|
+
// - Closed bounds include the endpoint and are indicated using square brackets (`[`, `]`).
|
|
1459
|
+
// Example: `[0..10]` represents values from 0 to 10, inclusive.
|
|
1460
|
+
//
|
|
1461
|
+
// - Open bounds exclude the endpoint and are indicated using parentheses (`(`, `)`).
|
|
1462
|
+
// Example: `(0..10)` represents values strictly between 0 and 10.
|
|
1463
|
+
//
|
|
1464
|
+
// The lower bound must be less than or equal to the upper bound.
|
|
1465
|
+
//
|
|
1466
|
+
// ## Integer Fields
|
|
1467
|
+
//
|
|
1468
|
+
// A range for an integer field must use integer numbers. Specifying a decimal number
|
|
1469
|
+
// is not allowed, even if it has no fractional part (e.g., `5.0` is invalid).
|
|
1470
|
+
//
|
|
1471
|
+
// Example: defining ranges for integer fields.
|
|
1472
|
+
//
|
|
1473
|
+
// message Measurements {
|
|
1474
|
+
// int32 length = 1 [(range).value = "[0..100)"];
|
|
1475
|
+
// uint32 mass = 2 [(range).value = "(0..100]"];
|
|
1476
|
+
// }
|
|
1477
|
+
//
|
|
1478
|
+
// ## Floating-Point Fields
|
|
1479
|
+
//
|
|
1480
|
+
// A range for a floating-point field must use a decimal separator (`.`), even if the value
|
|
1481
|
+
// has no fractional part. An exponent part represented by `E` or `e`, followed by an optional
|
|
1482
|
+
// sign and digits is allowed (e.g., `1.2E3`, `0.5e-2`).
|
|
1483
|
+
//
|
|
1484
|
+
// Example: defining ranges for floating-point fields.
|
|
1485
|
+
//
|
|
1486
|
+
// message Measurements {
|
|
1487
|
+
// float degree = 1 [(range).value = "[0.0 .. 360.0)"];
|
|
1488
|
+
// double angle = 2 [(range).value = "(0.0 .. 180.0)"];
|
|
1489
|
+
// float pressure = 3 [(range).value = "[950.0E-2 .. 1050.0E-2]"];
|
|
1490
|
+
// }
|
|
1491
|
+
//
|
|
1492
|
+
// ## Field Type Limitations
|
|
1493
|
+
//
|
|
1494
|
+
// A range must not exceed the limits of the field type.
|
|
1495
|
+
//
|
|
1496
|
+
// Example: invalid ranges that exceed the field type limits.
|
|
1497
|
+
//
|
|
1498
|
+
// message OverflowMeasurements {
|
|
1499
|
+
// float price = 1 [(range).value = "[0, 5.5E38]"]; // Exceeds the `float` maximum.
|
|
1500
|
+
// uint32 size = 2 [(range).value = "[-5; 10]"]; // Falls below the `uint32` minimum.
|
|
1501
|
+
// }
|
|
1502
|
+
//
|
|
1503
|
+
// ## Field references
|
|
1504
|
+
//
|
|
1505
|
+
// Instead of numeric literals, you can reference another numeric field.
|
|
1506
|
+
// At runtime, the field’s value will be used as the bound. Nested fields are supported.
|
|
1507
|
+
//
|
|
1508
|
+
// Example: defining ranges using field references.
|
|
1509
|
+
//
|
|
1510
|
+
// message Measurements {
|
|
1511
|
+
//
|
|
1512
|
+
// int32 max_length = 1;
|
|
1513
|
+
// int32 length = 2 [(range).value = "[1 .. max_length"];
|
|
1514
|
+
//
|
|
1515
|
+
// Limits limits = 3;
|
|
1516
|
+
// int32 temperature = 4 [(range).value = "[limits.low_temp .. limits.high_temp]"];
|
|
1517
|
+
// }
|
|
1518
|
+
//
|
|
1519
|
+
// message Limits {
|
|
1520
|
+
// int32 low_temp = 1;
|
|
1521
|
+
// int32 high_temp = 2;
|
|
1522
|
+
// }
|
|
1523
|
+
//
|
|
1524
|
+
// Note: Field type compatibility is not required in this case; the value is
|
|
1525
|
+
// automatically converted. However, only numeric fields can be referenced.
|
|
1526
|
+
// Repeated and map fields are not supported.
|
|
1527
|
+
//
|
|
1528
|
+
string value = 1;
|
|
1529
|
+
|
|
1530
|
+
// A user-defined error message.
|
|
1531
|
+
//
|
|
1532
|
+
// The specified message may include the following placeholders:
|
|
1533
|
+
//
|
|
1534
|
+
// 1. `${field.path}` – the field path.
|
|
1535
|
+
// 2. `${field.value}` - the field value.
|
|
1536
|
+
// 3. `${field.type}` – the fully qualified name of the field type.
|
|
1537
|
+
// 4. `${parent.type}` – the fully qualified name of the validated message.
|
|
1538
|
+
// 5. `${range.value}` – the specified range. For referenced fields, the actual
|
|
1539
|
+
// field value is also printed in round brackets along with the reference itself.
|
|
1540
|
+
//
|
|
1541
|
+
// The placeholders will be replaced at runtime when the error is constructed.
|
|
1542
|
+
//
|
|
1543
|
+
string error_msg = 2;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
// Controls whether a `oneof` group must always have one of its fields set.
|
|
1547
|
+
//
|
|
1548
|
+
// Note that unlike the `(required)` constraint, this option supports any field types
|
|
1549
|
+
// within the group cases.
|
|
1550
|
+
//
|
|
1551
|
+
message ChoiceOption {
|
|
1552
|
+
|
|
1553
|
+
// The default error message.
|
|
1554
|
+
option (default_message) = "The `oneof` group `${parent.type}.${group.path}` must"
|
|
1555
|
+
" have one of its fields set.";
|
|
1556
|
+
|
|
1557
|
+
// Enables or disables the requirement for the `oneof` group to have a value.
|
|
1558
|
+
bool required = 1;
|
|
1559
|
+
|
|
1560
|
+
// A user-defined error message.
|
|
1561
|
+
//
|
|
1562
|
+
// The specified message may include the following placeholders:
|
|
1563
|
+
//
|
|
1564
|
+
// 1. `${group.path}` – the group path.
|
|
1565
|
+
// 2. `${parent.type}` – the fully qualified name of the validated message.
|
|
1566
|
+
//
|
|
1567
|
+
// The placeholders will be replaced at runtime when the error is constructed.
|
|
1568
|
+
//
|
|
1569
|
+
string error_msg = 2;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
// Declares the field groups, at least one of which must have all of its fields set.
|
|
1573
|
+
//
|
|
1574
|
+
// Unlike the `(required)` field constraint, which requires the presence of
|
|
1575
|
+
// a specific field, this option allows specifying alternative field groups.
|
|
1576
|
+
//
|
|
1577
|
+
message RequireOption {
|
|
1578
|
+
|
|
1579
|
+
// The default error message.
|
|
1580
|
+
option (default_message) = "The message `${message.type}` must have at least one of"
|
|
1581
|
+
" the following field groups set: `${require.fields}`.";
|
|
1582
|
+
|
|
1583
|
+
// A set of field groups, at least one of which must have all of its fields set.
|
|
1584
|
+
//
|
|
1585
|
+
// A field group can include one or more fields joined by the ampersand (`&`) symbol.
|
|
1586
|
+
// `oneof` group names are also valid and can be used along with field names.
|
|
1587
|
+
// Groups are separated using the pipe (`|`) symbol.
|
|
1588
|
+
//
|
|
1589
|
+
// The field type determines when the field is considered set:
|
|
1590
|
+
//
|
|
1591
|
+
// 1. For message or enum fields, it must have a non-default instance.
|
|
1592
|
+
// 2. For `string` and `bytes` fields, it must be non-empty.
|
|
1593
|
+
// 3. For repeated fields and maps, it must contain at least one element.
|
|
1594
|
+
//
|
|
1595
|
+
// Fields of other types are not supported by this option.
|
|
1596
|
+
//
|
|
1597
|
+
// For `oneof`s, the restrictions above do not apply. Any `oneof` group can be used
|
|
1598
|
+
// without considering the field types, and its value will be checked directly without
|
|
1599
|
+
// relying on the default values of the fields within the `oneof`.
|
|
1600
|
+
//
|
|
1601
|
+
// Example: defining two field groups.
|
|
1602
|
+
//
|
|
1603
|
+
// message PersonName {
|
|
1604
|
+
// option (require).fields = "given_name | honorific_prefix & family_name";
|
|
1605
|
+
//
|
|
1606
|
+
// string honorific_prefix = 1;
|
|
1607
|
+
// string given_name = 2;
|
|
1608
|
+
// string middle_name = 3;
|
|
1609
|
+
// string family_name = 4;
|
|
1610
|
+
// string honorific_suffix = 5;
|
|
1611
|
+
// }
|
|
1612
|
+
//
|
|
1613
|
+
// In this example, at least `given_name` or a group of `honorific_prefix`
|
|
1614
|
+
// and `family_name` fields must be set.
|
|
1615
|
+
//
|
|
1616
|
+
string fields = 1;
|
|
1617
|
+
|
|
1618
|
+
// A user-defined error message.
|
|
1619
|
+
//
|
|
1620
|
+
// The specified message may include the following placeholders:
|
|
1621
|
+
//
|
|
1622
|
+
// 1. `${message.type}` – the fully qualified name of the validated message.
|
|
1623
|
+
// 2. `${require.fields}` – the specified field groups.
|
|
1624
|
+
//
|
|
1625
|
+
// The placeholders will be replaced at runtime when the error is constructed.
|
|
1626
|
+
//
|
|
1627
|
+
string error_msg = 2;
|
|
1628
|
+
}
|