@maxim_mazurok/gapi.client.datastore-v1beta3 0.0.20220921 → 0.0.20221029

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 (4) hide show
  1. package/index.d.ts +119 -1
  2. package/package.json +1 -1
  3. package/readme.md +5 -0
  4. package/tests.ts +223 -1
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://datastore.googleapis.com/$discovery/rest?version=v1beta3
12
- // Revision: 20220921
12
+ // Revision: 20221029
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -22,6 +22,41 @@ declare namespace gapi.client {
22
22
  function load(name: "datastore", version: "v1beta3", callback: () => any): void;
23
23
 
24
24
  namespace datastore {
25
+ interface Aggregation {
26
+ /**
27
+ * Optional. Optional name of the property to store the result of the aggregation. If not provided, Datastore will pick a default name following the format `property_`. For example:
28
+ * ``` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT_UP_TO(4) OVER ( ... ); ``` becomes: ``` AGGREGATE COUNT_UP_TO(1) AS
29
+ * count_up_to_1, COUNT_UP_TO(2) AS property_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT_UP_TO(4) AS property_2 OVER ( ... ); ``` Requires: * Must be unique across all aggregation
30
+ * aliases. * Conform to entity property name limitations.
31
+ */
32
+ alias?: string;
33
+ /** Count aggregator. */
34
+ count?: Count;
35
+ }
36
+ interface AggregationQuery {
37
+ /** Optional. Series of aggregations to apply over the results of the `nested_query`. Requires: * A minimum of one and maximum of five aggregations per query. */
38
+ aggregations?: Aggregation[];
39
+ /** Nested query for aggregation */
40
+ nestedQuery?: Query;
41
+ }
42
+ interface AggregationResult {
43
+ /**
44
+ * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. The key is the alias assigned to the aggregation function on input and the size of this map equals the
45
+ * number of aggregation functions in the query.
46
+ */
47
+ aggregateProperties?: { [P in string]: Value };
48
+ }
49
+ interface AggregationResultBatch {
50
+ /** The aggregation results for this batch. */
51
+ aggregationResults?: AggregationResult[];
52
+ /** The state of the query after the current batch. Only COUNT(*) aggregations are supported in the initial launch. Therefore, expected result type is limited to `NO_MORE_RESULTS`. */
53
+ moreResults?: string;
54
+ /**
55
+ * Read timestamp this batch was returned from. In a single transaction, subsequent query result batches for the same query can have a greater timestamp. Each batch's read timestamp is
56
+ * valid for all preceding batches.
57
+ */
58
+ readTime?: string;
59
+ }
25
60
  interface AllocateIdsRequest {
26
61
  /** Required. A list of keys with incomplete key paths for which to allocate IDs. No key may be reserved/read-only. */
27
62
  keys?: Key[];
@@ -68,6 +103,14 @@ declare namespace gapi.client {
68
103
  /** The operator for combining multiple filters. */
69
104
  op?: string;
70
105
  }
106
+ interface Count {
107
+ /**
108
+ * Optional. Optional constraint on the maximum number of entities to count. This provides a way to set an upper bound on the number of entities to scan, limiting latency and cost.
109
+ * Unspecified is interpreted as no bound. If a zero value is provided, a count result of zero should always be expected. High-Level Example: ``` AGGREGATE COUNT_UP_TO(1000) OVER (
110
+ * SELECT * FROM k ); ``` Requires: * Must be non-negative when present.
111
+ */
112
+ upTo?: string;
113
+ }
71
114
  interface Entity {
72
115
  /**
73
116
  * The entity's key. An entity must have a key, unless otherwise documented (for example, an entity in `Value.entity_value` may have no key). An entity's kind is its key path's last
@@ -477,6 +520,25 @@ declare namespace gapi.client {
477
520
  // tslint:disable-next-line:no-empty-interface
478
521
  interface RollbackResponse {
479
522
  }
523
+ interface RunAggregationQueryRequest {
524
+ /** The query to run. */
525
+ aggregationQuery?: AggregationQuery;
526
+ /** The GQL query to run. This query must be an aggregation query. */
527
+ gqlQuery?: GqlQuery;
528
+ /**
529
+ * Entities are partitioned into subsets, identified by a partition ID. Queries are scoped to a single partition. This partition ID is normalized with the standard default context
530
+ * partition ID.
531
+ */
532
+ partitionId?: PartitionId;
533
+ /** The options for this query. */
534
+ readOptions?: ReadOptions;
535
+ }
536
+ interface RunAggregationQueryResponse {
537
+ /** A batch of aggregation results. Always present. */
538
+ batch?: AggregationResultBatch;
539
+ /** The parsed form of the `GqlQuery` from the request, if it was set. */
540
+ query?: AggregationQuery;
541
+ }
480
542
  interface RunQueryRequest {
481
543
  /** The GQL query to run. This query must be a non-aggregation query. */
482
544
  gqlQuery?: GqlQuery;
@@ -867,6 +929,62 @@ declare namespace gapi.client {
867
929
  uploadType?: string;
868
930
  },
869
931
  body: RollbackRequest): Request<{}>;
932
+ /** Runs an aggregation query. */
933
+ runAggregationQuery(request: {
934
+ /** V1 error format. */
935
+ "$.xgafv"?: string;
936
+ /** OAuth access token. */
937
+ access_token?: string;
938
+ /** Data format for response. */
939
+ alt?: string;
940
+ /** JSONP */
941
+ callback?: string;
942
+ /** Selector specifying which fields to include in a partial response. */
943
+ fields?: string;
944
+ /** 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. */
945
+ key?: string;
946
+ /** OAuth 2.0 token for the current user. */
947
+ oauth_token?: string;
948
+ /** Returns response with indentations and line breaks. */
949
+ prettyPrint?: boolean;
950
+ /** Required. The ID of the project against which to make the request. */
951
+ projectId: string;
952
+ /** 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. */
953
+ quotaUser?: string;
954
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
955
+ upload_protocol?: string;
956
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
957
+ uploadType?: string;
958
+ /** Request body */
959
+ resource: RunAggregationQueryRequest;
960
+ }): Request<RunAggregationQueryResponse>;
961
+ runAggregationQuery(request: {
962
+ /** V1 error format. */
963
+ "$.xgafv"?: string;
964
+ /** OAuth access token. */
965
+ access_token?: string;
966
+ /** Data format for response. */
967
+ alt?: string;
968
+ /** JSONP */
969
+ callback?: string;
970
+ /** Selector specifying which fields to include in a partial response. */
971
+ fields?: string;
972
+ /** 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. */
973
+ key?: string;
974
+ /** OAuth 2.0 token for the current user. */
975
+ oauth_token?: string;
976
+ /** Returns response with indentations and line breaks. */
977
+ prettyPrint?: boolean;
978
+ /** Required. The ID of the project against which to make the request. */
979
+ projectId: string;
980
+ /** 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. */
981
+ quotaUser?: string;
982
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
983
+ upload_protocol?: string;
984
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
985
+ uploadType?: string;
986
+ },
987
+ body: RunAggregationQueryRequest): Request<RunAggregationQueryResponse>;
870
988
  /** Queries for entities. */
871
989
  runQuery(request: {
872
990
  /** V1 error format. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.datastore-v1beta3",
3
- "version": "0.0.20220921",
3
+ "version": "0.0.20221029",
4
4
  "description": "TypeScript typings for Cloud Datastore API v1beta3",
5
5
  "license": "MIT",
6
6
  "author": {
package/readme.md CHANGED
@@ -99,6 +99,11 @@ Rolls back a transaction.
99
99
  */
100
100
  await gapi.client.datastore.projects.rollback({ projectId: "projectId", });
101
101
 
102
+ /*
103
+ Runs an aggregation query.
104
+ */
105
+ await gapi.client.datastore.projects.runAggregationQuery({ projectId: "projectId", });
106
+
102
107
  /*
103
108
  Queries for entities.
104
109
  */
package/tests.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
4
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
5
 
6
- // Revision: 20220921
6
+ // Revision: 20221029
7
7
 
8
8
  gapi.load('client', async () => {
9
9
  /** now we can use gapi.client */
@@ -289,6 +289,228 @@ gapi.load('client', async () => {
289
289
  }, {
290
290
  transaction: "Test string",
291
291
  });
292
+ /** Runs an aggregation query. */
293
+ await gapi.client.datastore.projects.runAggregationQuery({
294
+ projectId: "Test string",
295
+ }, {
296
+ aggregationQuery: {
297
+ aggregations: [
298
+ {
299
+ alias: "Test string",
300
+ count: {
301
+ upTo: "Test string",
302
+ },
303
+ }
304
+ ],
305
+ nestedQuery: {
306
+ distinctOn: [
307
+ {
308
+ name: "Test string",
309
+ }
310
+ ],
311
+ endCursor: "Test string",
312
+ filter: {
313
+ compositeFilter: {
314
+ filters: undefined,
315
+ op: "Test string",
316
+ },
317
+ propertyFilter: {
318
+ op: "Test string",
319
+ property: {
320
+ name: "Test string",
321
+ },
322
+ value: {
323
+ arrayValue: {
324
+ values: undefined,
325
+ },
326
+ blobValue: "Test string",
327
+ booleanValue: true,
328
+ doubleValue: 42,
329
+ entityValue: {
330
+ key: {
331
+ partitionId: {
332
+ namespaceId: "Test string",
333
+ projectId: "Test string",
334
+ },
335
+ path: [
336
+ {
337
+ id: "Test string",
338
+ kind: "Test string",
339
+ name: "Test string",
340
+ }
341
+ ],
342
+ },
343
+ properties: undefined,
344
+ },
345
+ excludeFromIndexes: true,
346
+ geoPointValue: {
347
+ latitude: 42,
348
+ longitude: 42,
349
+ },
350
+ integerValue: "Test string",
351
+ keyValue: {
352
+ partitionId: {
353
+ namespaceId: "Test string",
354
+ projectId: "Test string",
355
+ },
356
+ path: [
357
+ {
358
+ id: "Test string",
359
+ kind: "Test string",
360
+ name: "Test string",
361
+ }
362
+ ],
363
+ },
364
+ meaning: 42,
365
+ nullValue: "Test string",
366
+ stringValue: "Test string",
367
+ timestampValue: "Test string",
368
+ },
369
+ },
370
+ },
371
+ kind: [
372
+ {
373
+ name: "Test string",
374
+ }
375
+ ],
376
+ limit: 42,
377
+ offset: 42,
378
+ order: [
379
+ {
380
+ direction: "Test string",
381
+ property: {
382
+ name: "Test string",
383
+ },
384
+ }
385
+ ],
386
+ projection: [
387
+ {
388
+ property: {
389
+ name: "Test string",
390
+ },
391
+ }
392
+ ],
393
+ startCursor: "Test string",
394
+ },
395
+ },
396
+ gqlQuery: {
397
+ allowLiterals: true,
398
+ namedBindings: {
399
+ A: {
400
+ cursor: "Test string",
401
+ value: {
402
+ arrayValue: {
403
+ values: undefined,
404
+ },
405
+ blobValue: "Test string",
406
+ booleanValue: true,
407
+ doubleValue: 42,
408
+ entityValue: {
409
+ key: {
410
+ partitionId: {
411
+ namespaceId: "Test string",
412
+ projectId: "Test string",
413
+ },
414
+ path: [
415
+ {
416
+ id: "Test string",
417
+ kind: "Test string",
418
+ name: "Test string",
419
+ }
420
+ ],
421
+ },
422
+ properties: undefined,
423
+ },
424
+ excludeFromIndexes: true,
425
+ geoPointValue: {
426
+ latitude: 42,
427
+ longitude: 42,
428
+ },
429
+ integerValue: "Test string",
430
+ keyValue: {
431
+ partitionId: {
432
+ namespaceId: "Test string",
433
+ projectId: "Test string",
434
+ },
435
+ path: [
436
+ {
437
+ id: "Test string",
438
+ kind: "Test string",
439
+ name: "Test string",
440
+ }
441
+ ],
442
+ },
443
+ meaning: 42,
444
+ nullValue: "Test string",
445
+ stringValue: "Test string",
446
+ timestampValue: "Test string",
447
+ },
448
+ }
449
+ },
450
+ positionalBindings: [
451
+ {
452
+ cursor: "Test string",
453
+ value: {
454
+ arrayValue: {
455
+ values: undefined,
456
+ },
457
+ blobValue: "Test string",
458
+ booleanValue: true,
459
+ doubleValue: 42,
460
+ entityValue: {
461
+ key: {
462
+ partitionId: {
463
+ namespaceId: "Test string",
464
+ projectId: "Test string",
465
+ },
466
+ path: [
467
+ {
468
+ id: "Test string",
469
+ kind: "Test string",
470
+ name: "Test string",
471
+ }
472
+ ],
473
+ },
474
+ properties: undefined,
475
+ },
476
+ excludeFromIndexes: true,
477
+ geoPointValue: {
478
+ latitude: 42,
479
+ longitude: 42,
480
+ },
481
+ integerValue: "Test string",
482
+ keyValue: {
483
+ partitionId: {
484
+ namespaceId: "Test string",
485
+ projectId: "Test string",
486
+ },
487
+ path: [
488
+ {
489
+ id: "Test string",
490
+ kind: "Test string",
491
+ name: "Test string",
492
+ }
493
+ ],
494
+ },
495
+ meaning: 42,
496
+ nullValue: "Test string",
497
+ stringValue: "Test string",
498
+ timestampValue: "Test string",
499
+ },
500
+ }
501
+ ],
502
+ queryString: "Test string",
503
+ },
504
+ partitionId: {
505
+ namespaceId: "Test string",
506
+ projectId: "Test string",
507
+ },
508
+ readOptions: {
509
+ readConsistency: "Test string",
510
+ readTime: "Test string",
511
+ transaction: "Test string",
512
+ },
513
+ });
292
514
  /** Queries for entities. */
293
515
  await gapi.client.datastore.projects.runQuery({
294
516
  projectId: "Test string",