@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,378 @@
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.admin.v1;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+
22
+ option csharp_namespace = "Google.Cloud.Firestore.Admin.V1";
23
+ option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb";
24
+ option java_multiple_files = true;
25
+ option java_outer_classname = "IndexProto";
26
+ option java_package = "com.google.firestore.admin.v1";
27
+ option objc_class_prefix = "GCFS";
28
+ option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";
29
+ option ruby_package = "Google::Cloud::Firestore::Admin::V1";
30
+
31
+ // Cloud Firestore indexes enable simple and complex queries against
32
+ // documents in a database.
33
+ message Index {
34
+ option (google.api.resource) = {
35
+ type: "firestore.googleapis.com/Index"
36
+ pattern: "projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}"
37
+ };
38
+
39
+ // Query Scope defines the scope at which a query is run. This is specified on
40
+ // a StructuredQuery's `from` field.
41
+ enum QueryScope {
42
+ // The query scope is unspecified. Not a valid option.
43
+ QUERY_SCOPE_UNSPECIFIED = 0;
44
+
45
+ // Indexes with a collection query scope specified allow queries
46
+ // against a collection that is the child of a specific document, specified
47
+ // at query time, and that has the collection ID specified by the index.
48
+ COLLECTION = 1;
49
+
50
+ // Indexes with a collection group query scope specified allow queries
51
+ // against all collections that has the collection ID specified by the
52
+ // index.
53
+ COLLECTION_GROUP = 2;
54
+
55
+ // Include all the collections's ancestor in the index. Only available for
56
+ // Datastore Mode databases.
57
+ COLLECTION_RECURSIVE = 3;
58
+ }
59
+
60
+ // API Scope defines the APIs (Firestore Native, or Firestore in
61
+ // Datastore Mode) that are supported for queries.
62
+ enum ApiScope {
63
+ // The index can only be used by the Firestore Native query API.
64
+ // This is the default.
65
+ ANY_API = 0;
66
+
67
+ // The index can only be used by the Firestore in Datastore Mode query API.
68
+ DATASTORE_MODE_API = 1;
69
+
70
+ // The index can only be used by the MONGODB_COMPATIBLE_API.
71
+ MONGODB_COMPATIBLE_API = 2;
72
+ }
73
+
74
+ // A field in an index.
75
+ // The field_path describes which field is indexed, the value_mode describes
76
+ // how the field value is indexed.
77
+ message IndexField {
78
+ // The supported orderings.
79
+ enum Order {
80
+ // The ordering is unspecified. Not a valid option.
81
+ ORDER_UNSPECIFIED = 0;
82
+
83
+ // The field is ordered by ascending field value.
84
+ ASCENDING = 1;
85
+
86
+ // The field is ordered by descending field value.
87
+ DESCENDING = 2;
88
+ }
89
+
90
+ // The supported array value configurations.
91
+ enum ArrayConfig {
92
+ // The index does not support additional array queries.
93
+ ARRAY_CONFIG_UNSPECIFIED = 0;
94
+
95
+ // The index supports array containment queries.
96
+ CONTAINS = 1;
97
+ }
98
+
99
+ // The index configuration to support vector search operations
100
+ message VectorConfig {
101
+ // An index that stores vectors in a flat data structure, and supports
102
+ // exhaustive search.
103
+ message FlatIndex {}
104
+
105
+ // Required. The vector dimension this configuration applies to.
106
+ //
107
+ // The resulting index will only include vectors of this dimension, and
108
+ // can be used for vector search with the same dimension.
109
+ int32 dimension = 1 [(google.api.field_behavior) = REQUIRED];
110
+
111
+ // The type of index used.
112
+ oneof type {
113
+ // Indicates the vector index is a flat index.
114
+ FlatIndex flat = 2;
115
+ }
116
+ }
117
+
118
+ // The configuration for how to index a field for search.
119
+ message SearchConfig {
120
+ // Ways to index the text field value.
121
+ enum TextIndexType {
122
+ // The index type is unspecified. Not a valid option.
123
+ TEXT_INDEX_TYPE_UNSPECIFIED = 0;
124
+
125
+ // Field values are tokenized. This is the only way currently supported
126
+ // for MONGODB_COMPATIBLE_API.
127
+ TOKENIZED = 1;
128
+ }
129
+
130
+ // Types of text matches that are supported for the
131
+ // field.
132
+ enum TextMatchType {
133
+ // The match type is unspecified. Not a valid option.
134
+ TEXT_MATCH_TYPE_UNSPECIFIED = 0;
135
+
136
+ // Match on any indexed field. This is the only way currently supported
137
+ // for MONGODB_COMPATIBLE_API.
138
+ MATCH_GLOBALLY = 1;
139
+ }
140
+
141
+ // Specification of how the field should be indexed for search text
142
+ // indexes.
143
+ message SearchTextIndexSpec {
144
+ // Required. How to index the text field value.
145
+ TextIndexType index_type = 1 [(google.api.field_behavior) = REQUIRED];
146
+
147
+ // Required. How to match the text field value.
148
+ TextMatchType match_type = 2 [(google.api.field_behavior) = REQUIRED];
149
+ }
150
+
151
+ // The specification for how to build a text search index for a field.
152
+ message SearchTextSpec {
153
+ // Required. Specifications for how the field should be indexed.
154
+ // Repeated so that the field can be indexed in multiple ways.
155
+ repeated SearchTextIndexSpec index_specs = 1
156
+ [(google.api.field_behavior) = REQUIRED];
157
+ }
158
+
159
+ // The specification for how to build a geo search index for a field.
160
+ message SearchGeoSpec {
161
+ // Optional. Disables geoJSON indexing for the field. By default,
162
+ // geoJSON points are indexed.
163
+ bool geo_json_indexing_disabled = 1
164
+ [(google.api.field_behavior) = OPTIONAL];
165
+ }
166
+
167
+ // Optional. The specification for building a text search index for a
168
+ // field.
169
+ SearchTextSpec text_spec = 1 [(google.api.field_behavior) = OPTIONAL];
170
+
171
+ // Optional. The specification for building a geo search index for a
172
+ // field.
173
+ SearchGeoSpec geo_spec = 2 [(google.api.field_behavior) = OPTIONAL];
174
+ }
175
+
176
+ // Can be __name__.
177
+ // For single field indexes, this must match the name of the field or may
178
+ // be omitted.
179
+ string field_path = 1;
180
+
181
+ // How the field value is indexed.
182
+ oneof value_mode {
183
+ // Indicates that this field supports ordering by the specified order or
184
+ // comparing using =, !=, <, <=, >, >=.
185
+ Order order = 2;
186
+
187
+ // Indicates that this field supports operations on `array_value`s.
188
+ ArrayConfig array_config = 3;
189
+
190
+ // Indicates that this field supports nearest neighbor and distance
191
+ // operations on vector.
192
+ VectorConfig vector_config = 4;
193
+
194
+ // Indicates that this field supports search operations. This field
195
+ // is only currently supported for indexes with MONGODB_COMPATIBLE_API
196
+ // ApiScope.
197
+ SearchConfig search_config = 5;
198
+ }
199
+ }
200
+
201
+ // The state of an index. During index creation, an index will be in the
202
+ // `CREATING` state. If the index is created successfully, it will transition
203
+ // to the `READY` state. If the index creation encounters a problem, the index
204
+ // will transition to the `NEEDS_REPAIR` state.
205
+ enum State {
206
+ // The state is unspecified.
207
+ STATE_UNSPECIFIED = 0;
208
+
209
+ // The index is being created.
210
+ // There is an active long-running operation for the index.
211
+ // The index is updated when writing a document.
212
+ // Some index data may exist.
213
+ CREATING = 1;
214
+
215
+ // The index is ready to be used.
216
+ // The index is updated when writing a document.
217
+ // The index is fully populated from all stored documents it applies to.
218
+ READY = 2;
219
+
220
+ // The index was being created, but something went wrong.
221
+ // There is no active long-running operation for the index,
222
+ // and the most recently finished long-running operation failed.
223
+ // The index is not updated when writing a document.
224
+ // Some index data may exist.
225
+ // Use the google.longrunning.Operations API to determine why the operation
226
+ // that last attempted to create this index failed, then re-create the
227
+ // index.
228
+ NEEDS_REPAIR = 3;
229
+ }
230
+
231
+ // The density configuration for the index.
232
+ enum Density {
233
+ // Unspecified. It will use database default setting. This value is input
234
+ // only.
235
+ DENSITY_UNSPECIFIED = 0;
236
+
237
+ // An index entry will only exist if ALL fields are present in the document.
238
+ //
239
+ // This is both the default and only allowed value for Standard Edition
240
+ // databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
241
+ // `DATASTORE_MODE_API`).
242
+ //
243
+ // Take for example the following document:
244
+ //
245
+ // ```
246
+ // {
247
+ // "__name__": "...",
248
+ // "a": 1,
249
+ // "b": 2,
250
+ // "c": 3
251
+ // }
252
+ // ```
253
+ //
254
+ // an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
255
+ // entry for this document since `a`, 'b', `c`, and `__name__` are all
256
+ // present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
257
+ // an index entry for this document since `d` is missing.
258
+ //
259
+ // This means that such indexes can only be used to serve a query when the
260
+ // query has either implicit or explicit requirements that all fields from
261
+ // the index are present.
262
+ SPARSE_ALL = 1;
263
+
264
+ // An index entry will exist if ANY field are present in the document.
265
+ //
266
+ // This is used as the definition of a sparse index for Enterprise Edition
267
+ // databases.
268
+ //
269
+ // Take for example the following document:
270
+ //
271
+ // ```
272
+ // {
273
+ // "__name__": "...",
274
+ // "a": 1,
275
+ // "b": 2,
276
+ // "c": 3
277
+ // }
278
+ // ```
279
+ //
280
+ // an index on `(a ASC, d ASC)` will generate an index entry for this
281
+ // document since `a` is present, and will fill in an `unset` value for `d`.
282
+ // An index on `(d ASC, e ASC)` will not generate any index entry as neither
283
+ // `d` nor `e` are present.
284
+ //
285
+ // An index that contains `__name__` will generate an index entry for all
286
+ // documents since Firestore guarantees that all documents have a `__name__`
287
+ // field.
288
+ SPARSE_ANY = 2;
289
+
290
+ // An index entry will exist regardless of if the fields are present or not.
291
+ //
292
+ // This is the default density for an Enterprise Edition database.
293
+ //
294
+ // The index will store `unset` values for fields that are not present in
295
+ // the document.
296
+ DENSE = 3;
297
+ }
298
+
299
+ // Options for search indexes at the definition level.
300
+ message SearchIndexOptions {
301
+ // Optional. The language to use for text search indexes. Used as the
302
+ // default language if not overridden at the document level by specifying
303
+ // the `text_language_override_field`. The language is specified as a BCP 47
304
+ // language code.
305
+ // For indexes with MONGODB_COMPATIBLE_API ApiScope: If unspecified, the
306
+ // default language is English.
307
+ // For indexes with `ANY_API` ApiScope: If unspecified, the default behavior
308
+ // is autodetect.
309
+ string text_language = 1 [(google.api.field_behavior) = OPTIONAL];
310
+
311
+ // Optional. The field in the document that specifies which language to use
312
+ // for that specific document. For indexes with MONGODB_COMPATIBLE_API
313
+ // ApiScope: if unspecified, the language is taken from the "language" field
314
+ // if it exists or from `text_language` if it does not.
315
+ string text_language_override_field_path = 2
316
+ [(google.api.field_behavior) = OPTIONAL];
317
+ }
318
+
319
+ // Output only. A server defined name for this index.
320
+ // The form of this name for composite indexes will be:
321
+ // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
322
+ // For single field indexes, this field will be empty.
323
+ string name = 1;
324
+
325
+ // Indexes with a collection query scope specified allow queries
326
+ // against a collection that is the child of a specific document, specified at
327
+ // query time, and that has the same collection ID.
328
+ //
329
+ // Indexes with a collection group query scope specified allow queries against
330
+ // all collections descended from a specific document, specified at query
331
+ // time, and that have the same collection ID as this index.
332
+ QueryScope query_scope = 2;
333
+
334
+ // The API scope supported by this index.
335
+ ApiScope api_scope = 5;
336
+
337
+ // The fields supported by this index.
338
+ //
339
+ // For composite indexes, this requires a minimum of 2 and a maximum of 100
340
+ // fields. The last field entry is always for the field path `__name__`. If,
341
+ // on creation, `__name__` was not specified as the last field, it will be
342
+ // added automatically with the same direction as that of the last field
343
+ // defined. If the final field in a composite index is not directional, the
344
+ // `__name__` will be ordered ASCENDING (unless explicitly specified).
345
+ //
346
+ // For single field indexes, this will always be exactly one entry with a
347
+ // field path equal to the field path of the associated field.
348
+ repeated IndexField fields = 3;
349
+
350
+ // Output only. The serving state of the index.
351
+ State state = 4;
352
+
353
+ // Immutable. The density configuration of the index.
354
+ Density density = 6 [(google.api.field_behavior) = IMMUTABLE];
355
+
356
+ // Optional. Whether the index is multikey. By default, the index is not
357
+ // multikey. For non-multikey indexes, none of the paths in the index
358
+ // definition reach or traverse an array, except via an explicit array index.
359
+ // For multikey indexes, at most one of the paths in the index definition
360
+ // reach or traverse an array, except via an explicit array index. Violations
361
+ // will result in errors.
362
+ //
363
+ // Note this field only applies to index with MONGODB_COMPATIBLE_API ApiScope.
364
+ bool multikey = 7 [(google.api.field_behavior) = OPTIONAL];
365
+
366
+ // Optional. The number of shards for the index.
367
+ int32 shard_count = 8 [(google.api.field_behavior) = OPTIONAL];
368
+
369
+ // Optional. Whether it is an unique index. Unique index ensures all values
370
+ // for the indexed field(s) are unique across documents.
371
+ bool unique = 10 [(google.api.field_behavior) = OPTIONAL];
372
+
373
+ // Optional. Options for search indexes that are at the index definition
374
+ // level. This field is only currently supported for indexes with
375
+ // MONGODB_COMPATIBLE_API ApiScope.
376
+ SearchIndexOptions search_index_options = 9
377
+ [(google.api.field_behavior) = OPTIONAL];
378
+ }
@@ -0,0 +1,30 @@
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.admin.v1;
18
+
19
+ option csharp_namespace = "Google.Cloud.Firestore.Admin.V1";
20
+ option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb";
21
+ option java_multiple_files = true;
22
+ option java_outer_classname = "LocationProto";
23
+ option java_package = "com.google.firestore.admin.v1";
24
+ option objc_class_prefix = "GCFS";
25
+ option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";
26
+ option ruby_package = "Google::Cloud::Firestore::Admin::V1";
27
+
28
+ // The metadata message for
29
+ // [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
30
+ message LocationMetadata {}