@google-cloud/datastore-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.
- package/README.md +111 -0
- package/build/protos/google/datastore/admin/v1/datastore_admin.proto +506 -0
- package/build/protos/google/datastore/admin/v1/index.proto +122 -0
- package/build/protos/google/datastore/admin/v1/migration.proto +124 -0
- package/build/protos/google/datastore/v1/aggregation_result.proto +62 -0
- package/build/protos/google/datastore/v1/datastore.proto +851 -0
- package/build/protos/google/datastore/v1/entity.proto +217 -0
- package/build/protos/google/datastore/v1/query.proto +622 -0
- package/build/protos/google/datastore/v1/query_profile.proto +91 -0
- package/build/protos/protos.d.ts +18507 -0
- package/build/protos/protos.js +1 -0
- package/build/protos/protos.json +1 -0
- package/build/src/index.d.ts +14 -0
- package/build/src/index.js +30 -0
- package/build/src/index.js.map +1 -0
- package/build/src/v1/datastore_admin_client.d.ts +631 -0
- package/build/src/v1/datastore_admin_client.js +954 -0
- package/build/src/v1/datastore_admin_client.js.map +1 -0
- package/build/src/v1/datastore_admin_client_config.json +56 -0
- package/build/src/v1/datastore_admin_proto_list.json +5 -0
- package/build/src/v1/datastore_client.d.ts +451 -0
- package/build/src/v1/datastore_client.js +806 -0
- package/build/src/v1/datastore_client.js.map +1 -0
- package/build/src/v1/datastore_client_config.json +66 -0
- package/build/src/v1/datastore_proto_list.json +7 -0
- package/build/src/v1/gapic_metadata.json +87 -0
- package/build/src/v1/index.d.ts +2 -0
- package/build/src/v1/index.js +25 -0
- package/build/src/v1/index.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// Copyright 2025 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.datastore.admin.v1;
|
|
18
|
+
|
|
19
|
+
import "google/api/field_behavior.proto";
|
|
20
|
+
|
|
21
|
+
option csharp_namespace = "Google.Cloud.Datastore.Admin.V1";
|
|
22
|
+
option go_package = "cloud.google.com/go/datastore/admin/apiv1/adminpb;adminpb";
|
|
23
|
+
option java_multiple_files = true;
|
|
24
|
+
option java_outer_classname = "IndexProto";
|
|
25
|
+
option java_package = "com.google.datastore.admin.v1";
|
|
26
|
+
option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1";
|
|
27
|
+
option ruby_package = "Google::Cloud::Datastore::Admin::V1";
|
|
28
|
+
|
|
29
|
+
// Datastore composite index definition.
|
|
30
|
+
message Index {
|
|
31
|
+
// For an ordered index, specifies whether each of the entity's ancestors
|
|
32
|
+
// will be included.
|
|
33
|
+
enum AncestorMode {
|
|
34
|
+
// The ancestor mode is unspecified.
|
|
35
|
+
ANCESTOR_MODE_UNSPECIFIED = 0;
|
|
36
|
+
|
|
37
|
+
// Do not include the entity's ancestors in the index.
|
|
38
|
+
NONE = 1;
|
|
39
|
+
|
|
40
|
+
// Include all the entity's ancestors in the index.
|
|
41
|
+
ALL_ANCESTORS = 2;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// The direction determines how a property is indexed.
|
|
45
|
+
enum Direction {
|
|
46
|
+
// The direction is unspecified.
|
|
47
|
+
DIRECTION_UNSPECIFIED = 0;
|
|
48
|
+
|
|
49
|
+
// The property's values are indexed so as to support sequencing in
|
|
50
|
+
// ascending order and also query by <, >, <=, >=, and =.
|
|
51
|
+
ASCENDING = 1;
|
|
52
|
+
|
|
53
|
+
// The property's values are indexed so as to support sequencing in
|
|
54
|
+
// descending order and also query by <, >, <=, >=, and =.
|
|
55
|
+
DESCENDING = 2;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// A property of an index.
|
|
59
|
+
message IndexedProperty {
|
|
60
|
+
// Required. The property name to index.
|
|
61
|
+
string name = 1 [(google.api.field_behavior) = REQUIRED];
|
|
62
|
+
|
|
63
|
+
// Required. The indexed property's direction. Must not be
|
|
64
|
+
// DIRECTION_UNSPECIFIED.
|
|
65
|
+
Direction direction = 2 [(google.api.field_behavior) = REQUIRED];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// The possible set of states of an index.
|
|
69
|
+
enum State {
|
|
70
|
+
// The state is unspecified.
|
|
71
|
+
STATE_UNSPECIFIED = 0;
|
|
72
|
+
|
|
73
|
+
// The index is being created, and cannot be used by queries.
|
|
74
|
+
// There is an active long-running operation for the index.
|
|
75
|
+
// The index is updated when writing an entity.
|
|
76
|
+
// Some index data may exist.
|
|
77
|
+
CREATING = 1;
|
|
78
|
+
|
|
79
|
+
// The index is ready to be used.
|
|
80
|
+
// The index is updated when writing an entity.
|
|
81
|
+
// The index is fully populated from all stored entities it applies to.
|
|
82
|
+
READY = 2;
|
|
83
|
+
|
|
84
|
+
// The index is being deleted, and cannot be used by queries.
|
|
85
|
+
// There is an active long-running operation for the index.
|
|
86
|
+
// The index is not updated when writing an entity.
|
|
87
|
+
// Some index data may exist.
|
|
88
|
+
DELETING = 3;
|
|
89
|
+
|
|
90
|
+
// The index was being created or deleted, but something went wrong.
|
|
91
|
+
// The index cannot by used by queries.
|
|
92
|
+
// There is no active long-running operation for the index,
|
|
93
|
+
// and the most recently finished long-running operation failed.
|
|
94
|
+
// The index is not updated when writing an entity.
|
|
95
|
+
// Some index data may exist.
|
|
96
|
+
ERROR = 4;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Output only. Project ID.
|
|
100
|
+
string project_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
101
|
+
|
|
102
|
+
// Output only. The resource ID of the index.
|
|
103
|
+
string index_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
104
|
+
|
|
105
|
+
// Required. The entity kind to which this index applies.
|
|
106
|
+
string kind = 4 [(google.api.field_behavior) = REQUIRED];
|
|
107
|
+
|
|
108
|
+
// Required. The index's ancestor mode. Must not be
|
|
109
|
+
// ANCESTOR_MODE_UNSPECIFIED.
|
|
110
|
+
AncestorMode ancestor = 5 [(google.api.field_behavior) = REQUIRED];
|
|
111
|
+
|
|
112
|
+
// Required. An ordered sequence of property names and their index attributes.
|
|
113
|
+
//
|
|
114
|
+
// Requires:
|
|
115
|
+
//
|
|
116
|
+
// * A maximum of 100 properties.
|
|
117
|
+
repeated IndexedProperty properties = 6
|
|
118
|
+
[(google.api.field_behavior) = REQUIRED];
|
|
119
|
+
|
|
120
|
+
// Output only. The state of the index.
|
|
121
|
+
State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
122
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Copyright 2025 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.datastore.admin.v1;
|
|
18
|
+
|
|
19
|
+
option csharp_namespace = "Google.Cloud.Datastore.Admin.V1";
|
|
20
|
+
option go_package = "cloud.google.com/go/datastore/admin/apiv1/adminpb;adminpb";
|
|
21
|
+
option java_multiple_files = true;
|
|
22
|
+
option java_outer_classname = "MigrationProto";
|
|
23
|
+
option java_package = "com.google.datastore.admin.v1";
|
|
24
|
+
option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1";
|
|
25
|
+
option ruby_package = "Google::Cloud::Datastore::Admin::V1";
|
|
26
|
+
|
|
27
|
+
// An event signifying a change in state of a [migration from Cloud Datastore to
|
|
28
|
+
// Cloud Firestore in Datastore
|
|
29
|
+
// mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
|
|
30
|
+
message MigrationStateEvent {
|
|
31
|
+
// The new state of the migration.
|
|
32
|
+
MigrationState state = 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// An event signifying the start of a new step in a [migration from Cloud
|
|
36
|
+
// Datastore to Cloud Firestore in Datastore
|
|
37
|
+
// mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
|
|
38
|
+
message MigrationProgressEvent {
|
|
39
|
+
// Concurrency modes for transactions in Cloud Firestore.
|
|
40
|
+
enum ConcurrencyMode {
|
|
41
|
+
// Unspecified.
|
|
42
|
+
CONCURRENCY_MODE_UNSPECIFIED = 0;
|
|
43
|
+
|
|
44
|
+
// Pessimistic concurrency.
|
|
45
|
+
PESSIMISTIC = 1;
|
|
46
|
+
|
|
47
|
+
// Optimistic concurrency.
|
|
48
|
+
OPTIMISTIC = 2;
|
|
49
|
+
|
|
50
|
+
// Optimistic concurrency with entity groups.
|
|
51
|
+
OPTIMISTIC_WITH_ENTITY_GROUPS = 3;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Details for the `PREPARE` step.
|
|
55
|
+
message PrepareStepDetails {
|
|
56
|
+
// The concurrency mode this database will use when it reaches the
|
|
57
|
+
// `REDIRECT_WRITES` step.
|
|
58
|
+
ConcurrencyMode concurrency_mode = 1;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Details for the `REDIRECT_WRITES` step.
|
|
62
|
+
message RedirectWritesStepDetails {
|
|
63
|
+
// Ths concurrency mode for this database.
|
|
64
|
+
ConcurrencyMode concurrency_mode = 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// The step that is starting.
|
|
68
|
+
//
|
|
69
|
+
// An event with step set to `START` indicates that the migration
|
|
70
|
+
// has been reverted back to the initial pre-migration state.
|
|
71
|
+
MigrationStep step = 1;
|
|
72
|
+
|
|
73
|
+
// Details about this step.
|
|
74
|
+
oneof step_details {
|
|
75
|
+
// Details for the `PREPARE` step.
|
|
76
|
+
PrepareStepDetails prepare_step_details = 2;
|
|
77
|
+
|
|
78
|
+
// Details for the `REDIRECT_WRITES` step.
|
|
79
|
+
RedirectWritesStepDetails redirect_writes_step_details = 3;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// States for a migration.
|
|
84
|
+
enum MigrationState {
|
|
85
|
+
// Unspecified.
|
|
86
|
+
MIGRATION_STATE_UNSPECIFIED = 0;
|
|
87
|
+
|
|
88
|
+
// The migration is running.
|
|
89
|
+
RUNNING = 1;
|
|
90
|
+
|
|
91
|
+
// The migration is paused.
|
|
92
|
+
PAUSED = 2;
|
|
93
|
+
|
|
94
|
+
// The migration is complete.
|
|
95
|
+
COMPLETE = 3;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Steps in a migration.
|
|
99
|
+
enum MigrationStep {
|
|
100
|
+
// Unspecified.
|
|
101
|
+
MIGRATION_STEP_UNSPECIFIED = 0;
|
|
102
|
+
|
|
103
|
+
// Pre-migration: the database is prepared for migration.
|
|
104
|
+
PREPARE = 6;
|
|
105
|
+
|
|
106
|
+
// Start of migration.
|
|
107
|
+
START = 1;
|
|
108
|
+
|
|
109
|
+
// Writes are applied synchronously to at least one replica.
|
|
110
|
+
APPLY_WRITES_SYNCHRONOUSLY = 7;
|
|
111
|
+
|
|
112
|
+
// Data is copied to Cloud Firestore and then verified to match the data in
|
|
113
|
+
// Cloud Datastore.
|
|
114
|
+
COPY_AND_VERIFY = 2;
|
|
115
|
+
|
|
116
|
+
// Eventually-consistent reads are redirected to Cloud Firestore.
|
|
117
|
+
REDIRECT_EVENTUALLY_CONSISTENT_READS = 3;
|
|
118
|
+
|
|
119
|
+
// Strongly-consistent reads are redirected to Cloud Firestore.
|
|
120
|
+
REDIRECT_STRONGLY_CONSISTENT_READS = 4;
|
|
121
|
+
|
|
122
|
+
// Writes are redirected to Cloud Firestore.
|
|
123
|
+
REDIRECT_WRITES = 5;
|
|
124
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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.datastore.v1;
|
|
18
|
+
|
|
19
|
+
import "google/datastore/v1/entity.proto";
|
|
20
|
+
import "google/datastore/v1/query.proto";
|
|
21
|
+
import "google/protobuf/timestamp.proto";
|
|
22
|
+
|
|
23
|
+
option csharp_namespace = "Google.Cloud.Datastore.V1";
|
|
24
|
+
option go_package = "cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb";
|
|
25
|
+
option java_multiple_files = true;
|
|
26
|
+
option java_outer_classname = "AggregationResultProto";
|
|
27
|
+
option java_package = "com.google.datastore.v1";
|
|
28
|
+
option php_namespace = "Google\\Cloud\\Datastore\\V1";
|
|
29
|
+
option ruby_package = "Google::Cloud::Datastore::V1";
|
|
30
|
+
|
|
31
|
+
// The result of a single bucket from a Datastore aggregation query.
|
|
32
|
+
//
|
|
33
|
+
// The keys of `aggregate_properties` are the same for all results in an
|
|
34
|
+
// aggregation query, unlike entity queries which can have different fields
|
|
35
|
+
// present for each result.
|
|
36
|
+
message AggregationResult {
|
|
37
|
+
// The result of the aggregation functions, ex: `COUNT(*) AS total_entities`.
|
|
38
|
+
//
|
|
39
|
+
// The key is the
|
|
40
|
+
// [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] assigned to
|
|
41
|
+
// the aggregation function on input and the size of this map equals the
|
|
42
|
+
// number of aggregation functions in the query.
|
|
43
|
+
map<string, Value> aggregate_properties = 2;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// A batch of aggregation results produced by an aggregation query.
|
|
47
|
+
message AggregationResultBatch {
|
|
48
|
+
// The aggregation results for this batch.
|
|
49
|
+
repeated AggregationResult aggregation_results = 1;
|
|
50
|
+
|
|
51
|
+
// The state of the query after the current batch.
|
|
52
|
+
// Only COUNT(*) aggregations are supported in the initial launch. Therefore,
|
|
53
|
+
// expected result type is limited to `NO_MORE_RESULTS`.
|
|
54
|
+
QueryResultBatch.MoreResultsType more_results = 2;
|
|
55
|
+
|
|
56
|
+
// Read timestamp this batch was returned from.
|
|
57
|
+
//
|
|
58
|
+
// In a single transaction, subsequent query result batches for the same query
|
|
59
|
+
// can have a greater timestamp. Each batch's read timestamp
|
|
60
|
+
// is valid for all preceding batches.
|
|
61
|
+
google.protobuf.Timestamp read_time = 3;
|
|
62
|
+
}
|