@google-cloud/firestore-api 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +111 -0
  2. package/build/protos/google/firestore/admin/v1/backup.proto +112 -0
  3. package/build/protos/google/firestore/admin/v1/database.proto +403 -0
  4. package/build/protos/google/firestore/admin/v1/field.proto +154 -0
  5. package/build/protos/google/firestore/admin/v1/firestore_admin.proto +1229 -0
  6. package/build/protos/google/firestore/admin/v1/index.proto +378 -0
  7. package/build/protos/google/firestore/admin/v1/location.proto +30 -0
  8. package/build/protos/google/firestore/admin/v1/operation.proto +330 -0
  9. package/build/protos/google/firestore/admin/v1/realtime_updates.proto +40 -0
  10. package/build/protos/google/firestore/admin/v1/schedule.proto +95 -0
  11. package/build/protos/google/firestore/admin/v1/snapshot.proto +53 -0
  12. package/build/protos/google/firestore/admin/v1/user_creds.proto +86 -0
  13. package/build/protos/google/firestore/v1/aggregation_result.proto +43 -0
  14. package/build/protos/google/firestore/v1/bloom_filter.proto +73 -0
  15. package/build/protos/google/firestore/v1/common.proto +111 -0
  16. package/build/protos/google/firestore/v1/document.proto +247 -0
  17. package/build/protos/google/firestore/v1/explain_stats.proto +41 -0
  18. package/build/protos/google/firestore/v1/firestore.proto +1237 -0
  19. package/build/protos/google/firestore/v1/pipeline.proto +43 -0
  20. package/build/protos/google/firestore/v1/query.proto +600 -0
  21. package/build/protos/google/firestore/v1/query_profile.proto +92 -0
  22. package/build/protos/google/firestore/v1/write.proto +286 -0
  23. package/build/protos/google/firestore/v1beta1/common.proto +82 -0
  24. package/build/protos/google/firestore/v1beta1/document.proto +149 -0
  25. package/build/protos/google/firestore/v1beta1/firestore.proto +900 -0
  26. package/build/protos/google/firestore/v1beta1/query.proto +300 -0
  27. package/build/protos/google/firestore/v1beta1/undeliverable_first_gen_event.proto +75 -0
  28. package/build/protos/google/firestore/v1beta1/write.proto +258 -0
  29. package/build/protos/protos.d.ts +35648 -0
  30. package/build/protos/protos.js +1 -0
  31. package/build/protos/protos.json +1 -0
  32. package/build/src/index.d.ts +13 -0
  33. package/build/src/index.js +30 -0
  34. package/build/src/index.js.map +1 -0
  35. package/build/src/v1/firestore_admin_client.d.ts +1925 -0
  36. package/build/src/v1/firestore_admin_client.js +2734 -0
  37. package/build/src/v1/firestore_admin_client.js.map +1 -0
  38. package/build/src/v1/firestore_admin_client_config.json +172 -0
  39. package/build/src/v1/firestore_admin_proto_list.json +13 -0
  40. package/build/src/v1/firestore_client.d.ts +1204 -0
  41. package/build/src/v1/firestore_client.js +1605 -0
  42. package/build/src/v1/firestore_client.js.map +1 -0
  43. package/build/src/v1/firestore_client_config.json +135 -0
  44. package/build/src/v1/firestore_proto_list.json +12 -0
  45. package/build/src/v1/gapic_metadata.json +351 -0
  46. package/build/src/v1/index.d.ts +2 -0
  47. package/build/src/v1/index.js +25 -0
  48. package/build/src/v1/index.js.map +1 -0
  49. package/build/src/v1beta1/firestore_client.d.ts +930 -0
  50. package/build/src/v1beta1/firestore_client.js +1310 -0
  51. package/build/src/v1beta1/firestore_client.js.map +1 -0
  52. package/build/src/v1beta1/firestore_client_config.json +99 -0
  53. package/build/src/v1beta1/firestore_proto_list.json +8 -0
  54. package/build/src/v1beta1/gapic_metadata.json +165 -0
  55. package/build/src/v1beta1/index.d.ts +1 -0
  56. package/build/src/v1beta1/index.js +23 -0
  57. package/build/src/v1beta1/index.js.map +1 -0
  58. package/package.json +65 -0
@@ -0,0 +1,73 @@
1
+ // Copyright 2026 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
+
15
+ syntax = "proto3";
16
+
17
+ package google.firestore.v1;
18
+
19
+ option csharp_namespace = "Google.Cloud.Firestore.V1";
20
+ option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb";
21
+ option java_multiple_files = true;
22
+ option java_outer_classname = "BloomFilterProto";
23
+ option java_package = "com.google.firestore.v1";
24
+ option objc_class_prefix = "GCFS";
25
+ option php_namespace = "Google\\Cloud\\Firestore\\V1";
26
+ option ruby_package = "Google::Cloud::Firestore::V1";
27
+
28
+ // A sequence of bits, encoded in a byte array.
29
+ //
30
+ // Each byte in the `bitmap` byte array stores 8 bits of the sequence. The only
31
+ // exception is the last byte, which may store 8 _or fewer_ bits. The `padding`
32
+ // defines the number of bits of the last byte to be ignored as "padding". The
33
+ // values of these "padding" bits are unspecified and must be ignored.
34
+ //
35
+ // To retrieve the first bit, bit 0, calculate: `(bitmap[0] & 0x01) != 0`.
36
+ // To retrieve the second bit, bit 1, calculate: `(bitmap[0] & 0x02) != 0`.
37
+ // To retrieve the third bit, bit 2, calculate: `(bitmap[0] & 0x04) != 0`.
38
+ // To retrieve the fourth bit, bit 3, calculate: `(bitmap[0] & 0x08) != 0`.
39
+ // To retrieve bit n, calculate: `(bitmap[n / 8] & (0x01 << (n % 8))) != 0`.
40
+ //
41
+ // The "size" of a `BitSequence` (the number of bits it contains) is calculated
42
+ // by this formula: `(bitmap.length * 8) - padding`.
43
+ message BitSequence {
44
+ // The bytes that encode the bit sequence.
45
+ // May have a length of zero.
46
+ bytes bitmap = 1;
47
+
48
+ // The number of bits of the last byte in `bitmap` to ignore as "padding".
49
+ // If the length of `bitmap` is zero, then this value must be `0`.
50
+ // Otherwise, this value must be between 0 and 7, inclusive.
51
+ int32 padding = 2;
52
+ }
53
+
54
+ // A bloom filter (https://en.wikipedia.org/wiki/Bloom_filter).
55
+ //
56
+ // The bloom filter hashes the entries with MD5 and treats the resulting 128-bit
57
+ // hash as 2 distinct 64-bit hash values, interpreted as unsigned integers
58
+ // using 2's complement encoding.
59
+ //
60
+ // These two hash values, named `h1` and `h2`, are then used to compute the
61
+ // `hash_count` hash values using the formula, starting at `i=0`:
62
+ //
63
+ // h(i) = h1 + (i * h2)
64
+ //
65
+ // These resulting values are then taken modulo the number of bits in the bloom
66
+ // filter to get the bits of the bloom filter to test for the given entry.
67
+ message BloomFilter {
68
+ // The bloom filter data.
69
+ BitSequence bits = 1;
70
+
71
+ // The number of hashes used by the algorithm.
72
+ int32 hash_count = 2;
73
+ }
@@ -0,0 +1,111 @@
1
+ // Copyright 2026 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
+
15
+ syntax = "proto3";
16
+
17
+ package google.firestore.v1;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/protobuf/timestamp.proto";
21
+
22
+ option csharp_namespace = "Google.Cloud.Firestore.V1";
23
+ option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb";
24
+ option java_multiple_files = true;
25
+ option java_outer_classname = "CommonProto";
26
+ option java_package = "com.google.firestore.v1";
27
+ option objc_class_prefix = "GCFS";
28
+ option php_namespace = "Google\\Cloud\\Firestore\\V1";
29
+ option ruby_package = "Google::Cloud::Firestore::V1";
30
+
31
+ // A set of field paths on a document.
32
+ // Used to restrict a get or update operation on a document to a subset of its
33
+ // fields.
34
+ // This is different from standard field masks, as this is always scoped to a
35
+ // [Document][google.firestore.v1.Document], and takes in account the dynamic
36
+ // nature of [Value][google.firestore.v1.Value].
37
+ message DocumentMask {
38
+ // The list of field paths in the mask. See
39
+ // [Document.fields][google.firestore.v1.Document.fields] for a field path
40
+ // syntax reference.
41
+ repeated string field_paths = 1;
42
+ }
43
+
44
+ // A precondition on a document, used for conditional operations.
45
+ message Precondition {
46
+ // The type of precondition.
47
+ oneof condition_type {
48
+ // When set to `true`, the target document must exist.
49
+ // When set to `false`, the target document must not exist.
50
+ bool exists = 1;
51
+
52
+ // When set, the target document must exist and have been last updated at
53
+ // that time. Timestamp must be microsecond aligned.
54
+ google.protobuf.Timestamp update_time = 2;
55
+ }
56
+ }
57
+
58
+ // Options for creating a new transaction.
59
+ message TransactionOptions {
60
+ // The type of concurrency control mode for transactions.
61
+ enum ConcurrencyMode {
62
+ // Start the transaction with the database-level default concurrency mode.
63
+ CONCURRENCY_MODE_UNSPECIFIED = 0;
64
+
65
+ // Use optimistic concurrency control for the new transaction.
66
+ OPTIMISTIC = 1;
67
+
68
+ // Use pessimistic concurrency control for the new transaction.
69
+ PESSIMISTIC = 2;
70
+ }
71
+
72
+ // Options for a transaction that can be used to read and write documents.
73
+ message ReadWrite {
74
+ // An optional transaction to retry.
75
+ bytes retry_transaction = 1;
76
+
77
+ // Optional. The concurrency control mode to use for this transaction.
78
+ //
79
+ // A database is able to use different concurrency modes for different
80
+ // transactions simultaneously.
81
+ //
82
+ // 3rd party auth requests are only allowed to create optimistic
83
+ // read-write transactions and must specify that here even if the
84
+ // database-level setting is already configured to optimistic.
85
+ ConcurrencyMode concurrency_mode = 2
86
+ [(google.api.field_behavior) = OPTIONAL];
87
+ }
88
+
89
+ // Options for a transaction that can only be used to read documents.
90
+ message ReadOnly {
91
+ // The consistency mode for this transaction. If not set, defaults to strong
92
+ // consistency.
93
+ oneof consistency_selector {
94
+ // Reads documents at the given time.
95
+ //
96
+ // This must be a microsecond precision timestamp within the past one
97
+ // hour, or if Point-in-Time Recovery is enabled, can additionally be a
98
+ // whole minute timestamp within the past 7 days.
99
+ google.protobuf.Timestamp read_time = 2;
100
+ }
101
+ }
102
+
103
+ // The mode of the transaction.
104
+ oneof mode {
105
+ // The transaction can only be used for read operations.
106
+ ReadOnly read_only = 2;
107
+
108
+ // The transaction can be used for both read and write operations.
109
+ ReadWrite read_write = 3;
110
+ }
111
+ }
@@ -0,0 +1,247 @@
1
+ // Copyright 2026 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
+
15
+ syntax = "proto3";
16
+
17
+ package google.firestore.v1;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/protobuf/struct.proto";
21
+ import "google/protobuf/timestamp.proto";
22
+ import "google/type/latlng.proto";
23
+
24
+ option csharp_namespace = "Google.Cloud.Firestore.V1";
25
+ option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb";
26
+ option java_multiple_files = true;
27
+ option java_outer_classname = "DocumentProto";
28
+ option java_package = "com.google.firestore.v1";
29
+ option objc_class_prefix = "GCFS";
30
+ option php_namespace = "Google\\Cloud\\Firestore\\V1";
31
+ option ruby_package = "Google::Cloud::Firestore::V1";
32
+
33
+ // A Firestore document.
34
+ //
35
+ // Must not exceed 1 MiB - 4 bytes.
36
+ message Document {
37
+ // The resource name of the document, for example
38
+ // `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
39
+ string name = 1;
40
+
41
+ // The document's fields.
42
+ //
43
+ // The map keys represent field names.
44
+ //
45
+ // Field names matching the regular expression `__.*__` are reserved. Reserved
46
+ // field names are forbidden except in certain documented contexts. The field
47
+ // names, represented as UTF-8, must not exceed 1,500 bytes and cannot be
48
+ // empty.
49
+ //
50
+ // Field paths may be used in other contexts to refer to structured fields
51
+ // defined here. For `map_value`, the field path is represented by a
52
+ // dot-delimited (`.`) string of segments. Each segment is either a simple
53
+ // field name (defined below) or a quoted field name. For example, the
54
+ // structured field `"foo" : { map_value: { "x&y" : { string_value: "hello"
55
+ // }}}` would be represented by the field path `` foo.`x&y` ``.
56
+ //
57
+ // A simple field name contains only characters `a` to `z`, `A` to `Z`,
58
+ // `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
59
+ // `foo_bar_17`.
60
+ //
61
+ // A quoted field name starts and ends with `` ` `` and
62
+ // may contain any character. Some characters, including `` ` ``, must be
63
+ // escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
64
+ // `` `bak\`tik` `` represents `` bak`tik ``.
65
+ map<string, Value> fields = 2;
66
+
67
+ // Output only. The time at which the document was created.
68
+ //
69
+ // This value increases monotonically when a document is deleted then
70
+ // recreated. It can also be compared to values from other documents and
71
+ // the `read_time` of a query.
72
+ google.protobuf.Timestamp create_time = 3;
73
+
74
+ // Output only. The time at which the document was last changed.
75
+ //
76
+ // This value is initially set to the `create_time` then increases
77
+ // monotonically with each change to the document. It can also be
78
+ // compared to values from other documents and the `read_time` of a query.
79
+ google.protobuf.Timestamp update_time = 4;
80
+ }
81
+
82
+ // A message that can hold any of the supported value types.
83
+ message Value {
84
+ // Must have a value set.
85
+ oneof value_type {
86
+ // A null value.
87
+ google.protobuf.NullValue null_value = 11;
88
+
89
+ // A boolean value.
90
+ bool boolean_value = 1;
91
+
92
+ // An integer value.
93
+ int64 integer_value = 2;
94
+
95
+ // A double value.
96
+ double double_value = 3;
97
+
98
+ // A timestamp value.
99
+ //
100
+ // Precise only to microseconds. When stored, any additional precision is
101
+ // rounded down.
102
+ google.protobuf.Timestamp timestamp_value = 10;
103
+
104
+ // A string value.
105
+ //
106
+ // The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes.
107
+ // Only the first 1,500 bytes of the UTF-8 representation are considered by
108
+ // queries.
109
+ string string_value = 17;
110
+
111
+ // A bytes value.
112
+ //
113
+ // Must not exceed 1 MiB - 89 bytes.
114
+ // Only the first 1,500 bytes are considered by queries.
115
+ bytes bytes_value = 18;
116
+
117
+ // A reference to a document. For example:
118
+ // `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
119
+ string reference_value = 5;
120
+
121
+ // A geo point value representing a point on the surface of Earth.
122
+ google.type.LatLng geo_point_value = 8;
123
+
124
+ // An array value.
125
+ //
126
+ // Cannot directly contain another array value, though can contain a
127
+ // map which contains another array.
128
+ ArrayValue array_value = 9;
129
+
130
+ // A map value.
131
+ MapValue map_value = 6;
132
+
133
+ // Value which references a field.
134
+ //
135
+ // This is considered relative (vs absolute) since it only refers to a field
136
+ // and not a field within a particular document.
137
+ //
138
+ // **Requires:**
139
+ //
140
+ // * Must follow [field reference][FieldReference.field_path] limitations.
141
+ //
142
+ // * Not allowed to be used when writing documents.
143
+ string field_reference_value = 19;
144
+
145
+ // Pointer to a variable defined elsewhere in a pipeline.
146
+ //
147
+ // Unlike `field_reference_value` which references a field within a
148
+ // document, this refers to a variable, defined in a separate namespace than
149
+ // the fields of a document.
150
+ string variable_reference_value = 22;
151
+
152
+ // A value that represents an unevaluated expression.
153
+ //
154
+ // **Requires:**
155
+ //
156
+ // * Not allowed to be used when writing documents.
157
+ Function function_value = 20;
158
+
159
+ // A value that represents an unevaluated pipeline.
160
+ //
161
+ // **Requires:**
162
+ //
163
+ // * Not allowed to be used when writing documents.
164
+ Pipeline pipeline_value = 21;
165
+ }
166
+ }
167
+
168
+ // An array value.
169
+ message ArrayValue {
170
+ // Values in the array.
171
+ repeated Value values = 1;
172
+ }
173
+
174
+ // A map value.
175
+ message MapValue {
176
+ // The map's fields.
177
+ //
178
+ // The map keys represent field names. Field names matching the regular
179
+ // expression `__.*__` are reserved. Reserved field names are forbidden except
180
+ // in certain documented contexts. The map keys, represented as UTF-8, must
181
+ // not exceed 1,500 bytes and cannot be empty.
182
+ map<string, Value> fields = 1;
183
+ }
184
+
185
+ // Represents an unevaluated scalar expression.
186
+ //
187
+ // For example, the expression `like(user_name, "%alice%")` is represented as:
188
+ //
189
+ // ```
190
+ // name: "like"
191
+ // args { field_reference: "user_name" }
192
+ // args { string_value: "%alice%" }
193
+ // ```
194
+ message Function {
195
+ // Required. The name of the function to evaluate.
196
+ //
197
+ // **Requires:**
198
+ //
199
+ // * must be in snake case (lower case with underscore separator).
200
+ string name = 1 [(google.api.field_behavior) = REQUIRED];
201
+
202
+ // Optional. Ordered list of arguments the given function expects.
203
+ repeated Value args = 2 [(google.api.field_behavior) = OPTIONAL];
204
+
205
+ // Optional. Optional named arguments that certain functions may support.
206
+ map<string, Value> options = 3 [(google.api.field_behavior) = OPTIONAL];
207
+ }
208
+
209
+ // A Firestore query represented as an ordered list of operations / stages.
210
+ message Pipeline {
211
+ // A single operation within a pipeline.
212
+ //
213
+ // A stage is made up of a unique name, and a list of arguments. The exact
214
+ // number of arguments & types is dependent on the stage type.
215
+ //
216
+ // To give an example, the stage `filter(state = "MD")` would be encoded as:
217
+ //
218
+ // ```
219
+ // name: "filter"
220
+ // args {
221
+ // function_value {
222
+ // name: "eq"
223
+ // args { field_reference_value: "state" }
224
+ // args { string_value: "MD" }
225
+ // }
226
+ // }
227
+ // ```
228
+ //
229
+ // See public documentation for the full list.
230
+ message Stage {
231
+ // Required. The name of the stage to evaluate.
232
+ //
233
+ // **Requires:**
234
+ //
235
+ // * must be in snake case (lower case with underscore separator).
236
+ string name = 1 [(google.api.field_behavior) = REQUIRED];
237
+
238
+ // Optional. Ordered list of arguments the given stage expects.
239
+ repeated Value args = 2 [(google.api.field_behavior) = OPTIONAL];
240
+
241
+ // Optional. Optional named arguments that certain functions may support.
242
+ map<string, Value> options = 3 [(google.api.field_behavior) = OPTIONAL];
243
+ }
244
+
245
+ // Required. Ordered list of stages to evaluate.
246
+ repeated Stage stages = 1 [(google.api.field_behavior) = REQUIRED];
247
+ }
@@ -0,0 +1,41 @@
1
+ // Copyright 2026 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
+
15
+ syntax = "proto3";
16
+
17
+ package google.firestore.v1;
18
+
19
+ import "google/protobuf/any.proto";
20
+
21
+ option csharp_namespace = "Google.Cloud.Firestore.V1";
22
+ option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb";
23
+ option java_multiple_files = true;
24
+ option java_outer_classname = "ExplainStatsProto";
25
+ option java_package = "com.google.firestore.v1";
26
+ option php_namespace = "Google\\Cloud\\Firestore\\V1";
27
+ option ruby_package = "Google::Cloud::Firestore::V1";
28
+
29
+ // Specification of Firestore Explain Stats fields.
30
+
31
+ // Pipeline explain stats.
32
+ //
33
+ // Depending on the explain options in the original request, this can contain
34
+ // the optimized plan and / or execution stats.
35
+ message ExplainStats {
36
+ // The format depends on the `output_format` options in the request.
37
+ //
38
+ // Currently there are two supported options: `TEXT` and `JSON`.
39
+ // Both supply a `google.protobuf.StringValue`.
40
+ google.protobuf.Any data = 1;
41
+ }