connector_service.proto 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // Copyright 2024 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. //adopted from third_party/firebase/dataconnect/emulator/server/api/connector_service.proto
  15. syntax = "proto3";
  16. package google.firebase.dataconnect.v1alpha;
  17. import "google/api/annotations.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/protobuf/struct.proto";
  20. import "graphql_error.proto";
  21. option java_package = "com.google.firebase.dataconnect.v1alpha";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "ConnectorServiceProto";
  24. // Firebase Data Connect provides means to deploy a set of predefined GraphQL
  25. // operations (queries and mutations) as a Connector.
  26. //
  27. // Firebase developers can build mobile and web apps that uses Connectors
  28. // to access Data Sources directly. Connectors allow operations without
  29. // admin credentials and help Firebase customers control the API exposure.
  30. //
  31. // Note: `ConnectorService` doesn't check IAM permissions and instead developers
  32. // must define auth policies on each pre-defined operation to secure this
  33. // connector. The auth policies typically define rules on the Firebase Auth
  34. // token.
  35. service ConnectorService {
  36. // Execute a predefined query in a Connector.
  37. rpc ExecuteQuery(ExecuteQueryRequest) returns (ExecuteQueryResponse) {
  38. option (google.api.http) = {
  39. post: "/v1alpha/{name=projects/*/locations/*/services/*/connectors/*}:executeQuery"
  40. body: "*"
  41. };
  42. }
  43. // Execute a predefined mutation in a Connector.
  44. rpc ExecuteMutation(ExecuteMutationRequest)
  45. returns (ExecuteMutationResponse) {
  46. option (google.api.http) = {
  47. post: "/v1alpha/{name=projects/*/locations/*/services/*/connectors/*}:executeMutation"
  48. body: "*"
  49. };
  50. }
  51. }
  52. // The ExecuteQuery request to Firebase Data Connect.
  53. message ExecuteQueryRequest {
  54. // The resource name of the connector to find the predefined query, in
  55. // the format:
  56. // ```
  57. // projects/{project}/locations/{location}/services/{service}/connectors/{connector}
  58. // ```
  59. string name = 1 [
  60. (google.api.field_behavior) = REQUIRED
  61. ];
  62. // The name of the GraphQL operation name.
  63. // Required because all Connector operations must be named.
  64. // See https://graphql.org/learn/queries/#operation-name.
  65. // (-- api-linter: core::0122::name-suffix=disabled
  66. // aip.dev/not-precedent: Must conform to GraphQL HTTP spec standard. --)
  67. string operation_name = 2 [(google.api.field_behavior) = REQUIRED];
  68. // Values for GraphQL variables provided in this request.
  69. google.protobuf.Struct variables = 3 [(google.api.field_behavior) = OPTIONAL];
  70. }
  71. // The ExecuteMutation request to Firebase Data Connect.
  72. message ExecuteMutationRequest {
  73. // The resource name of the connector to find the predefined mutation, in
  74. // the format:
  75. // ```
  76. // projects/{project}/locations/{location}/services/{service}/connectors/{connector}
  77. // ```
  78. string name = 1 [
  79. (google.api.field_behavior) = REQUIRED
  80. ];
  81. // The name of the GraphQL operation name.
  82. // Required because all Connector operations must be named.
  83. // See https://graphql.org/learn/queries/#operation-name.
  84. // (-- api-linter: core::0122::name-suffix=disabled
  85. // aip.dev/not-precedent: Must conform to GraphQL HTTP spec standard. --)
  86. string operation_name = 2 [(google.api.field_behavior) = REQUIRED];
  87. // Values for GraphQL variables provided in this request.
  88. google.protobuf.Struct variables = 3 [(google.api.field_behavior) = OPTIONAL];
  89. }
  90. // The ExecuteQuery response from Firebase Data Connect.
  91. message ExecuteQueryResponse {
  92. // The result of executing the requested operation.
  93. google.protobuf.Struct data = 1;
  94. // Errors of this response.
  95. repeated GraphqlError errors = 2;
  96. }
  97. // The ExecuteMutation response from Firebase Data Connect.
  98. message ExecuteMutationResponse {
  99. // The result of executing the requested operation.
  100. google.protobuf.Struct data = 1;
  101. // Errors of this response.
  102. repeated GraphqlError errors = 2;
  103. }