@maxim_mazurok/gapi.client.datastore-v1beta1 0.0.20220715
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/index.d.ts +371 -0
- package/package.json +20 -0
- package/readme.md +81 -0
- package/tests.ts +76 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Cloud Datastore API v1beta1 0.0 */
|
|
2
|
+
// Project: https://cloud.google.com/datastore/
|
|
3
|
+
// Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
|
|
4
|
+
// Nick Amoscato <https://github.com/namoscato>
|
|
5
|
+
// Declan Vong <https://github.com/declanvong>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
// TypeScript Version: 2.8
|
|
8
|
+
|
|
9
|
+
// IMPORTANT
|
|
10
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
11
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
12
|
+
// Generated from: https://datastore.googleapis.com/$discovery/rest?version=v1beta1
|
|
13
|
+
// Revision: 20220715
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load Cloud Datastore API v1beta1 */
|
|
19
|
+
function load(urlOrObject: "https://datastore.googleapis.com/$discovery/rest?version=v1beta1"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "datastore", version: "v1beta1"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "datastore", version: "v1beta1", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace datastore {
|
|
26
|
+
interface GoogleDatastoreAdminV1beta1CommonMetadata {
|
|
27
|
+
/** The time the operation ended, either successfully or otherwise. */
|
|
28
|
+
endTime?: string;
|
|
29
|
+
/** The client-assigned labels which were provided when the operation was created. May also include additional labels. */
|
|
30
|
+
labels?: { [P in string]: string };
|
|
31
|
+
/** The type of the operation. Can be used as a filter in ListOperationsRequest. */
|
|
32
|
+
operationType?: string;
|
|
33
|
+
/** The time that work began on the operation. */
|
|
34
|
+
startTime?: string;
|
|
35
|
+
/** The current state of the Operation. */
|
|
36
|
+
state?: string;
|
|
37
|
+
}
|
|
38
|
+
interface GoogleDatastoreAdminV1beta1EntityFilter {
|
|
39
|
+
/** If empty, then this represents all kinds. */
|
|
40
|
+
kinds?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* An empty list represents all namespaces. This is the preferred usage for projects that don't use namespaces. An empty string element represents the default namespace. This should be
|
|
43
|
+
* used if the project has data in non-default namespaces, but doesn't want to include them. Each namespace in this list must be unique.
|
|
44
|
+
*/
|
|
45
|
+
namespaceIds?: string[];
|
|
46
|
+
}
|
|
47
|
+
interface GoogleDatastoreAdminV1beta1ExportEntitiesMetadata {
|
|
48
|
+
/** Metadata common to all Datastore Admin operations. */
|
|
49
|
+
common?: GoogleDatastoreAdminV1beta1CommonMetadata;
|
|
50
|
+
/** Description of which entities are being exported. */
|
|
51
|
+
entityFilter?: GoogleDatastoreAdminV1beta1EntityFilter;
|
|
52
|
+
/**
|
|
53
|
+
* Location for the export metadata and data files. This will be the same value as the google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix field. The final output
|
|
54
|
+
* location is provided in google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url.
|
|
55
|
+
*/
|
|
56
|
+
outputUrlPrefix?: string;
|
|
57
|
+
/** An estimate of the number of bytes processed. */
|
|
58
|
+
progressBytes?: GoogleDatastoreAdminV1beta1Progress;
|
|
59
|
+
/** An estimate of the number of entities processed. */
|
|
60
|
+
progressEntities?: GoogleDatastoreAdminV1beta1Progress;
|
|
61
|
+
}
|
|
62
|
+
interface GoogleDatastoreAdminV1beta1ExportEntitiesRequest {
|
|
63
|
+
/** Description of what data from the project is included in the export. */
|
|
64
|
+
entityFilter?: GoogleDatastoreAdminV1beta1EntityFilter;
|
|
65
|
+
/** Client-assigned labels. */
|
|
66
|
+
labels?: { [P in string]: string };
|
|
67
|
+
/**
|
|
68
|
+
* Location for the export metadata and data files. The full resource URL of the external storage location. Currently, only Google Cloud Storage is supported. So output_url_prefix
|
|
69
|
+
* should be of the form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud Storage namespace
|
|
70
|
+
* path (this is not a Cloud Datastore namespace). For more information about Cloud Storage namespace paths, see [Object name
|
|
71
|
+
* considerations](https://cloud.google.com/storage/docs/naming#object-considerations). The resulting files will be nested deeper than the specified URL prefix. The final output URL
|
|
72
|
+
* will be provided in the google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url field. That value should be used for subsequent ImportEntities operations. By nesting the
|
|
73
|
+
* data files deeper, the same Cloud Storage bucket can be used in multiple ExportEntities operations without conflict.
|
|
74
|
+
*/
|
|
75
|
+
outputUrlPrefix?: string;
|
|
76
|
+
}
|
|
77
|
+
interface GoogleDatastoreAdminV1beta1ExportEntitiesResponse {
|
|
78
|
+
/**
|
|
79
|
+
* Location of the output metadata file. This can be used to begin an import into Cloud Datastore (this project or another project). See
|
|
80
|
+
* google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url. Only present if the operation completed successfully.
|
|
81
|
+
*/
|
|
82
|
+
outputUrl?: string;
|
|
83
|
+
}
|
|
84
|
+
interface GoogleDatastoreAdminV1beta1ImportEntitiesMetadata {
|
|
85
|
+
/** Metadata common to all Datastore Admin operations. */
|
|
86
|
+
common?: GoogleDatastoreAdminV1beta1CommonMetadata;
|
|
87
|
+
/** Description of which entities are being imported. */
|
|
88
|
+
entityFilter?: GoogleDatastoreAdminV1beta1EntityFilter;
|
|
89
|
+
/** The location of the import metadata file. This will be the same value as the google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url field. */
|
|
90
|
+
inputUrl?: string;
|
|
91
|
+
/** An estimate of the number of bytes processed. */
|
|
92
|
+
progressBytes?: GoogleDatastoreAdminV1beta1Progress;
|
|
93
|
+
/** An estimate of the number of entities processed. */
|
|
94
|
+
progressEntities?: GoogleDatastoreAdminV1beta1Progress;
|
|
95
|
+
}
|
|
96
|
+
interface GoogleDatastoreAdminV1beta1ImportEntitiesRequest {
|
|
97
|
+
/**
|
|
98
|
+
* Optionally specify which kinds/namespaces are to be imported. If provided, the list must be a subset of the EntityFilter used in creating the export, otherwise a FAILED_PRECONDITION
|
|
99
|
+
* error will be returned. If no filter is specified then all entities from the export are imported.
|
|
100
|
+
*/
|
|
101
|
+
entityFilter?: GoogleDatastoreAdminV1beta1EntityFilter;
|
|
102
|
+
/**
|
|
103
|
+
* The full resource URL of the external storage location. Currently, only Google Cloud Storage is supported. So input_url should be of the form:
|
|
104
|
+
* `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is an optional Cloud Storage
|
|
105
|
+
* namespace path (this is not a Cloud Datastore namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written by the ExportEntities operation. For more information about
|
|
106
|
+
* Cloud Storage namespace paths, see [Object name considerations](https://cloud.google.com/storage/docs/naming#object-considerations). For more information, see
|
|
107
|
+
* google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url.
|
|
108
|
+
*/
|
|
109
|
+
inputUrl?: string;
|
|
110
|
+
/** Client-assigned labels. */
|
|
111
|
+
labels?: { [P in string]: string };
|
|
112
|
+
}
|
|
113
|
+
interface GoogleDatastoreAdminV1beta1Progress {
|
|
114
|
+
/** The amount of work that has been completed. Note that this may be greater than work_estimated. */
|
|
115
|
+
workCompleted?: string;
|
|
116
|
+
/** An estimate of how much work needs to be performed. May be zero if the work estimate is unavailable. */
|
|
117
|
+
workEstimated?: string;
|
|
118
|
+
}
|
|
119
|
+
interface GoogleDatastoreAdminV1CommonMetadata {
|
|
120
|
+
/** The time the operation ended, either successfully or otherwise. */
|
|
121
|
+
endTime?: string;
|
|
122
|
+
/** The client-assigned labels which were provided when the operation was created. May also include additional labels. */
|
|
123
|
+
labels?: { [P in string]: string };
|
|
124
|
+
/** The type of the operation. Can be used as a filter in ListOperationsRequest. */
|
|
125
|
+
operationType?: string;
|
|
126
|
+
/** The time that work began on the operation. */
|
|
127
|
+
startTime?: string;
|
|
128
|
+
/** The current state of the Operation. */
|
|
129
|
+
state?: string;
|
|
130
|
+
}
|
|
131
|
+
interface GoogleDatastoreAdminV1DatastoreFirestoreMigrationMetadata {
|
|
132
|
+
/** The current state of migration from Cloud Datastore to Cloud Firestore in Datastore mode. */
|
|
133
|
+
migrationState?: string;
|
|
134
|
+
/** The current step of migration from Cloud Datastore to Cloud Firestore in Datastore mode. */
|
|
135
|
+
migrationStep?: string;
|
|
136
|
+
}
|
|
137
|
+
interface GoogleDatastoreAdminV1EntityFilter {
|
|
138
|
+
/** If empty, then this represents all kinds. */
|
|
139
|
+
kinds?: string[];
|
|
140
|
+
/**
|
|
141
|
+
* An empty list represents all namespaces. This is the preferred usage for projects that don't use namespaces. An empty string element represents the default namespace. This should be
|
|
142
|
+
* used if the project has data in non-default namespaces, but doesn't want to include them. Each namespace in this list must be unique.
|
|
143
|
+
*/
|
|
144
|
+
namespaceIds?: string[];
|
|
145
|
+
}
|
|
146
|
+
interface GoogleDatastoreAdminV1ExportEntitiesMetadata {
|
|
147
|
+
/** Metadata common to all Datastore Admin operations. */
|
|
148
|
+
common?: GoogleDatastoreAdminV1CommonMetadata;
|
|
149
|
+
/** Description of which entities are being exported. */
|
|
150
|
+
entityFilter?: GoogleDatastoreAdminV1EntityFilter;
|
|
151
|
+
/**
|
|
152
|
+
* Location for the export metadata and data files. This will be the same value as the google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix field. The final output
|
|
153
|
+
* location is provided in google.datastore.admin.v1.ExportEntitiesResponse.output_url.
|
|
154
|
+
*/
|
|
155
|
+
outputUrlPrefix?: string;
|
|
156
|
+
/** An estimate of the number of bytes processed. */
|
|
157
|
+
progressBytes?: GoogleDatastoreAdminV1Progress;
|
|
158
|
+
/** An estimate of the number of entities processed. */
|
|
159
|
+
progressEntities?: GoogleDatastoreAdminV1Progress;
|
|
160
|
+
}
|
|
161
|
+
interface GoogleDatastoreAdminV1ExportEntitiesResponse {
|
|
162
|
+
/**
|
|
163
|
+
* Location of the output metadata file. This can be used to begin an import into Cloud Datastore (this project or another project). See
|
|
164
|
+
* google.datastore.admin.v1.ImportEntitiesRequest.input_url. Only present if the operation completed successfully.
|
|
165
|
+
*/
|
|
166
|
+
outputUrl?: string;
|
|
167
|
+
}
|
|
168
|
+
interface GoogleDatastoreAdminV1ImportEntitiesMetadata {
|
|
169
|
+
/** Metadata common to all Datastore Admin operations. */
|
|
170
|
+
common?: GoogleDatastoreAdminV1CommonMetadata;
|
|
171
|
+
/** Description of which entities are being imported. */
|
|
172
|
+
entityFilter?: GoogleDatastoreAdminV1EntityFilter;
|
|
173
|
+
/** The location of the import metadata file. This will be the same value as the google.datastore.admin.v1.ExportEntitiesResponse.output_url field. */
|
|
174
|
+
inputUrl?: string;
|
|
175
|
+
/** An estimate of the number of bytes processed. */
|
|
176
|
+
progressBytes?: GoogleDatastoreAdminV1Progress;
|
|
177
|
+
/** An estimate of the number of entities processed. */
|
|
178
|
+
progressEntities?: GoogleDatastoreAdminV1Progress;
|
|
179
|
+
}
|
|
180
|
+
interface GoogleDatastoreAdminV1IndexOperationMetadata {
|
|
181
|
+
/** Metadata common to all Datastore Admin operations. */
|
|
182
|
+
common?: GoogleDatastoreAdminV1CommonMetadata;
|
|
183
|
+
/** The index resource ID that this operation is acting on. */
|
|
184
|
+
indexId?: string;
|
|
185
|
+
/** An estimate of the number of entities processed. */
|
|
186
|
+
progressEntities?: GoogleDatastoreAdminV1Progress;
|
|
187
|
+
}
|
|
188
|
+
interface GoogleDatastoreAdminV1MigrationProgressEvent {
|
|
189
|
+
/** Details for the `PREPARE` step. */
|
|
190
|
+
prepareStepDetails?: GoogleDatastoreAdminV1PrepareStepDetails;
|
|
191
|
+
/** Details for the `REDIRECT_WRITES` step. */
|
|
192
|
+
redirectWritesStepDetails?: GoogleDatastoreAdminV1RedirectWritesStepDetails;
|
|
193
|
+
/** The step that is starting. An event with step set to `START` indicates that the migration has been reverted back to the initial pre-migration state. */
|
|
194
|
+
step?: string;
|
|
195
|
+
}
|
|
196
|
+
interface GoogleDatastoreAdminV1MigrationStateEvent {
|
|
197
|
+
/** The new state of the migration. */
|
|
198
|
+
state?: string;
|
|
199
|
+
}
|
|
200
|
+
interface GoogleDatastoreAdminV1PrepareStepDetails {
|
|
201
|
+
/** The concurrency mode this database will use when it reaches the `REDIRECT_WRITES` step. */
|
|
202
|
+
concurrencyMode?: string;
|
|
203
|
+
}
|
|
204
|
+
interface GoogleDatastoreAdminV1Progress {
|
|
205
|
+
/** The amount of work that has been completed. Note that this may be greater than work_estimated. */
|
|
206
|
+
workCompleted?: string;
|
|
207
|
+
/** An estimate of how much work needs to be performed. May be zero if the work estimate is unavailable. */
|
|
208
|
+
workEstimated?: string;
|
|
209
|
+
}
|
|
210
|
+
interface GoogleDatastoreAdminV1RedirectWritesStepDetails {
|
|
211
|
+
/** Ths concurrency mode for this database. */
|
|
212
|
+
concurrencyMode?: string;
|
|
213
|
+
}
|
|
214
|
+
interface GoogleLongrunningOperation {
|
|
215
|
+
/** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
|
|
216
|
+
done?: boolean;
|
|
217
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
218
|
+
error?: Status;
|
|
219
|
+
/**
|
|
220
|
+
* Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such
|
|
221
|
+
* metadata. Any method that returns a long-running operation should document the metadata type, if any.
|
|
222
|
+
*/
|
|
223
|
+
metadata?: { [P in string]: any };
|
|
224
|
+
/**
|
|
225
|
+
* The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending
|
|
226
|
+
* with `operations/{unique_id}`.
|
|
227
|
+
*/
|
|
228
|
+
name?: string;
|
|
229
|
+
/**
|
|
230
|
+
* The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the
|
|
231
|
+
* original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the
|
|
232
|
+
* original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
|
|
233
|
+
*/
|
|
234
|
+
response?: { [P in string]: any };
|
|
235
|
+
}
|
|
236
|
+
interface Status {
|
|
237
|
+
/** The status code, which should be an enum value of google.rpc.Code. */
|
|
238
|
+
code?: number;
|
|
239
|
+
/** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
|
|
240
|
+
details?: Array<{ [P in string]: any }>;
|
|
241
|
+
/**
|
|
242
|
+
* A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the
|
|
243
|
+
* client.
|
|
244
|
+
*/
|
|
245
|
+
message?: string;
|
|
246
|
+
}
|
|
247
|
+
interface ProjectsResource {
|
|
248
|
+
/**
|
|
249
|
+
* Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in
|
|
250
|
+
* the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used
|
|
251
|
+
* once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.
|
|
252
|
+
*/
|
|
253
|
+
export(request: {
|
|
254
|
+
/** V1 error format. */
|
|
255
|
+
"$.xgafv"?: string;
|
|
256
|
+
/** OAuth access token. */
|
|
257
|
+
access_token?: string;
|
|
258
|
+
/** Data format for response. */
|
|
259
|
+
alt?: string;
|
|
260
|
+
/** JSONP */
|
|
261
|
+
callback?: string;
|
|
262
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
263
|
+
fields?: string;
|
|
264
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
265
|
+
key?: string;
|
|
266
|
+
/** OAuth 2.0 token for the current user. */
|
|
267
|
+
oauth_token?: string;
|
|
268
|
+
/** Returns response with indentations and line breaks. */
|
|
269
|
+
prettyPrint?: boolean;
|
|
270
|
+
/** Project ID against which to make the request. */
|
|
271
|
+
projectId: string;
|
|
272
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
273
|
+
quotaUser?: string;
|
|
274
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
275
|
+
upload_protocol?: string;
|
|
276
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
277
|
+
uploadType?: string;
|
|
278
|
+
/** Request body */
|
|
279
|
+
resource: GoogleDatastoreAdminV1beta1ExportEntitiesRequest;
|
|
280
|
+
}): Request<GoogleLongrunningOperation>;
|
|
281
|
+
export(request: {
|
|
282
|
+
/** V1 error format. */
|
|
283
|
+
"$.xgafv"?: string;
|
|
284
|
+
/** OAuth access token. */
|
|
285
|
+
access_token?: string;
|
|
286
|
+
/** Data format for response. */
|
|
287
|
+
alt?: string;
|
|
288
|
+
/** JSONP */
|
|
289
|
+
callback?: string;
|
|
290
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
291
|
+
fields?: string;
|
|
292
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
293
|
+
key?: string;
|
|
294
|
+
/** OAuth 2.0 token for the current user. */
|
|
295
|
+
oauth_token?: string;
|
|
296
|
+
/** Returns response with indentations and line breaks. */
|
|
297
|
+
prettyPrint?: boolean;
|
|
298
|
+
/** Project ID against which to make the request. */
|
|
299
|
+
projectId: string;
|
|
300
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
301
|
+
quotaUser?: string;
|
|
302
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
303
|
+
upload_protocol?: string;
|
|
304
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
305
|
+
uploadType?: string;
|
|
306
|
+
},
|
|
307
|
+
body: GoogleDatastoreAdminV1beta1ExportEntitiesRequest): Request<GoogleLongrunningOperation>;
|
|
308
|
+
/**
|
|
309
|
+
* Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed
|
|
310
|
+
* via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.
|
|
311
|
+
*/
|
|
312
|
+
import(request: {
|
|
313
|
+
/** V1 error format. */
|
|
314
|
+
"$.xgafv"?: string;
|
|
315
|
+
/** OAuth access token. */
|
|
316
|
+
access_token?: string;
|
|
317
|
+
/** Data format for response. */
|
|
318
|
+
alt?: string;
|
|
319
|
+
/** JSONP */
|
|
320
|
+
callback?: string;
|
|
321
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
322
|
+
fields?: string;
|
|
323
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
324
|
+
key?: string;
|
|
325
|
+
/** OAuth 2.0 token for the current user. */
|
|
326
|
+
oauth_token?: string;
|
|
327
|
+
/** Returns response with indentations and line breaks. */
|
|
328
|
+
prettyPrint?: boolean;
|
|
329
|
+
/** Project ID against which to make the request. */
|
|
330
|
+
projectId: string;
|
|
331
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
332
|
+
quotaUser?: string;
|
|
333
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
334
|
+
upload_protocol?: string;
|
|
335
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
336
|
+
uploadType?: string;
|
|
337
|
+
/** Request body */
|
|
338
|
+
resource: GoogleDatastoreAdminV1beta1ImportEntitiesRequest;
|
|
339
|
+
}): Request<GoogleLongrunningOperation>;
|
|
340
|
+
import(request: {
|
|
341
|
+
/** V1 error format. */
|
|
342
|
+
"$.xgafv"?: string;
|
|
343
|
+
/** OAuth access token. */
|
|
344
|
+
access_token?: string;
|
|
345
|
+
/** Data format for response. */
|
|
346
|
+
alt?: string;
|
|
347
|
+
/** JSONP */
|
|
348
|
+
callback?: string;
|
|
349
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
350
|
+
fields?: string;
|
|
351
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
352
|
+
key?: string;
|
|
353
|
+
/** OAuth 2.0 token for the current user. */
|
|
354
|
+
oauth_token?: string;
|
|
355
|
+
/** Returns response with indentations and line breaks. */
|
|
356
|
+
prettyPrint?: boolean;
|
|
357
|
+
/** Project ID against which to make the request. */
|
|
358
|
+
projectId: string;
|
|
359
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
360
|
+
quotaUser?: string;
|
|
361
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
362
|
+
upload_protocol?: string;
|
|
363
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
364
|
+
uploadType?: string;
|
|
365
|
+
},
|
|
366
|
+
body: GoogleDatastoreAdminV1beta1ImportEntitiesRequest): Request<GoogleLongrunningOperation>;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const projects: ProjectsResource;
|
|
370
|
+
}
|
|
371
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.datastore-v1beta1",
|
|
3
|
+
"version": "0.0.20220715",
|
|
4
|
+
"description": "TypeScript typings for Cloud Datastore API v1beta1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"email": "maxim@mazurok.com",
|
|
8
|
+
"name": "Maxim Mazurok",
|
|
9
|
+
"url": "https://maxim.mazurok.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# TypeScript typings for Cloud Datastore API v1beta1
|
|
2
|
+
|
|
3
|
+
Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/datastore/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Cloud Datastore API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.datastore-v1beta1 --save-dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
You need to initialize Google API client in your code:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
gapi.load('client', () => {
|
|
20
|
+
// now we can use gapi.client
|
|
21
|
+
// ...
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then load api client wrapper:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
gapi.client.load('https://datastore.googleapis.com/$discovery/rest?version=v1beta1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.datastore
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
36
|
+
gapi.client.load('datastore', 'v1beta1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.datastore
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// declare client_id registered in Google Developers Console
|
|
46
|
+
var client_id = '',
|
|
47
|
+
scope = [
|
|
48
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
49
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
50
|
+
|
|
51
|
+
// View and manage your Google Cloud Datastore data
|
|
52
|
+
'https://www.googleapis.com/auth/datastore',
|
|
53
|
+
],
|
|
54
|
+
immediate = true;
|
|
55
|
+
// ...
|
|
56
|
+
|
|
57
|
+
gapi.auth.authorize(
|
|
58
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
59
|
+
authResult => {
|
|
60
|
+
if (authResult && !authResult.error) {
|
|
61
|
+
/* handle successful authorization */
|
|
62
|
+
} else {
|
|
63
|
+
/* handle authorization error */
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
After that you can use Cloud Datastore API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
|
|
72
|
+
/*
|
|
73
|
+
Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.
|
|
74
|
+
*/
|
|
75
|
+
await gapi.client.datastore.projects.export({ projectId: "projectId", });
|
|
76
|
+
|
|
77
|
+
/*
|
|
78
|
+
Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.
|
|
79
|
+
*/
|
|
80
|
+
await gapi.client.datastore.projects.import({ projectId: "projectId", });
|
|
81
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.datastore-v1beta1 definition tests */
|
|
2
|
+
// IMPORTANT
|
|
3
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
|
+
|
|
6
|
+
// Revision: 20220715
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://datastore.googleapis.com/$discovery/rest?version=v1beta1');
|
|
12
|
+
/** now we can use gapi.client.datastore */
|
|
13
|
+
|
|
14
|
+
/** don't forget to authenticate your client before sending any request to resources: */
|
|
15
|
+
/** declare client_id registered in Google Developers Console */
|
|
16
|
+
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
|
17
|
+
const scope = [
|
|
18
|
+
/** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
|
|
19
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
20
|
+
/** View and manage your Google Cloud Datastore data */
|
|
21
|
+
'https://www.googleapis.com/auth/datastore',
|
|
22
|
+
];
|
|
23
|
+
const immediate = false;
|
|
24
|
+
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
25
|
+
if (authResult && !authResult.error) {
|
|
26
|
+
/** handle successful authorization */
|
|
27
|
+
run();
|
|
28
|
+
} else {
|
|
29
|
+
/** handle authorization error */
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
async function run() {
|
|
34
|
+
/**
|
|
35
|
+
* Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the
|
|
36
|
+
* export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the
|
|
37
|
+
* associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.
|
|
38
|
+
*/
|
|
39
|
+
await gapi.client.datastore.projects.export({
|
|
40
|
+
projectId: "Test string",
|
|
41
|
+
}, {
|
|
42
|
+
entityFilter: {
|
|
43
|
+
kinds: [
|
|
44
|
+
"Test string"
|
|
45
|
+
],
|
|
46
|
+
namespaceIds: [
|
|
47
|
+
"Test string"
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
labels: {
|
|
51
|
+
A: "Test string"
|
|
52
|
+
},
|
|
53
|
+
outputUrlPrefix: "Test string",
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via
|
|
57
|
+
* the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.
|
|
58
|
+
*/
|
|
59
|
+
await gapi.client.datastore.projects.import({
|
|
60
|
+
projectId: "Test string",
|
|
61
|
+
}, {
|
|
62
|
+
entityFilter: {
|
|
63
|
+
kinds: [
|
|
64
|
+
"Test string"
|
|
65
|
+
],
|
|
66
|
+
namespaceIds: [
|
|
67
|
+
"Test string"
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
inputUrl: "Test string",
|
|
71
|
+
labels: {
|
|
72
|
+
A: "Test string"
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": ["es6", "dom"],
|
|
5
|
+
"noImplicitAny": true,
|
|
6
|
+
"noImplicitThis": true,
|
|
7
|
+
"strictNullChecks": true,
|
|
8
|
+
"baseUrl": "../",
|
|
9
|
+
"typeRoots": [
|
|
10
|
+
"../"
|
|
11
|
+
],
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"strictFunctionTypes": true
|
|
16
|
+
},
|
|
17
|
+
"files": ["index.d.ts", "tests.ts"]
|
|
18
|
+
}
|