@google-cloud/datastore
Advanced tools
Comparing version 4.4.1 to 4.5.0
@@ -19,3 +19,2 @@ /** | ||
import { PathType } from '.'; | ||
import { Entities } from './request'; | ||
import * as Protobuf from 'protobufjs'; | ||
@@ -50,2 +49,3 @@ import { google } from '../proto/datastore'; | ||
class Double { | ||
type: string; | ||
value: number; | ||
@@ -63,2 +63,10 @@ constructor(value: number); | ||
/** | ||
* Check if a value is a Datastore Double object converted from JSON. | ||
* | ||
* @private | ||
* @param {*} value | ||
* @returns {boolean} | ||
*/ | ||
function isDsDoubleLike(value: unknown): boolean; | ||
/** | ||
* Build a Datastore Int object. For long integers, a string can be provided. | ||
@@ -75,2 +83,3 @@ * | ||
class Int { | ||
type: string; | ||
value: string; | ||
@@ -87,2 +96,10 @@ constructor(value: number | string); | ||
function isDsInt(value?: {}): boolean; | ||
/** | ||
* Check if a value is a Datastore Int object converted from JSON. | ||
* | ||
* @private | ||
* @param {*} value | ||
* @returns {boolean} | ||
*/ | ||
function isDsIntLike(value: unknown): boolean; | ||
interface Coordinates { | ||
@@ -89,0 +106,0 @@ latitude: number; |
@@ -59,2 +59,7 @@ "use strict"; | ||
/** | ||
* @name Double#type | ||
* @type {string} | ||
*/ | ||
this.type = 'DatastoreDouble'; | ||
/** | ||
* @name Double#value | ||
@@ -79,2 +84,17 @@ * @type {number} | ||
/** | ||
* Check if a value is a Datastore Double object converted from JSON. | ||
* | ||
* @private | ||
* @param {*} value | ||
* @returns {boolean} | ||
*/ | ||
function isDsDoubleLike(value) { | ||
const maybeDsDouble = value; | ||
return (isDsDouble(maybeDsDouble) || | ||
(is.object(maybeDsDouble) && | ||
is.number(maybeDsDouble.value) && | ||
maybeDsDouble.type === 'DatastoreDouble')); | ||
} | ||
entity_1.isDsDoubleLike = isDsDoubleLike; | ||
/** | ||
* Build a Datastore Int object. For long integers, a string can be provided. | ||
@@ -93,2 +113,7 @@ * | ||
/** | ||
* @name Int#type | ||
* @type {string} | ||
*/ | ||
this.type = 'DatastoreInt'; | ||
/** | ||
* @name Int#value | ||
@@ -113,2 +138,17 @@ * @type {string} | ||
/** | ||
* Check if a value is a Datastore Int object converted from JSON. | ||
* | ||
* @private | ||
* @param {*} value | ||
* @returns {boolean} | ||
*/ | ||
function isDsIntLike(value) { | ||
const maybeDsInt = value; | ||
return (isDsInt(maybeDsInt) || | ||
(is.object(maybeDsInt) && | ||
is.string(maybeDsInt.value) && | ||
maybeDsInt.type === 'DatastoreInt')); | ||
} | ||
entity_1.isDsIntLike = isDsIntLike; | ||
/** | ||
* Build a Datastore Geo Point object. | ||
@@ -230,3 +270,5 @@ * | ||
const identifier = options.path.pop(); | ||
if (is.number(identifier) || isDsInt(identifier)) { | ||
if (is.number(identifier) || | ||
isDsInt(identifier) || | ||
isDsIntLike(identifier)) { | ||
this.id = (identifier.value || identifier); | ||
@@ -233,0 +275,0 @@ } |
@@ -20,3 +20,3 @@ /*! | ||
import { Transform } from 'stream'; | ||
import { entity, Entity, EntityProto, ValueProto } from './entity'; | ||
import { entity, Entity, EntityProto, ValueProto, Entities } from './entity'; | ||
import { Query, QueryProto, RunQueryOptions, RunQueryResponse, RunQueryCallback } from './query'; | ||
@@ -151,3 +151,2 @@ import { Datastore } from '.'; | ||
} | ||
export declare type Entities = Entity | Entity[]; | ||
export interface EntityProtoReduceAccumulator { | ||
@@ -154,0 +153,0 @@ [key: string]: ValueProto; |
@@ -7,2 +7,15 @@ # Changelog | ||
## [4.5.0](https://www.github.com/googleapis/nodejs-datastore/compare/v4.4.1...v4.5.0) (2019-11-04) | ||
### Features | ||
* support DSInt / DSDouble recognition from JSON ([#480](https://www.github.com/googleapis/nodejs-datastore/issues/480)) ([9f2fb3c](https://www.github.com/googleapis/nodejs-datastore/commit/9f2fb3cf6fa0672ef2bc252c0765dd84dbbc977a)) | ||
### Bug Fixes | ||
* **types:** removed duplicate declaration ([#524](https://www.github.com/googleapis/nodejs-datastore/issues/524)) ([26cbb67](https://www.github.com/googleapis/nodejs-datastore/commit/26cbb67dd9d81900960363e20a9df545ba0c5675)) | ||
* upgrade and pin to @grpc/grpc-js@0.6.9 ([#526](https://www.github.com/googleapis/nodejs-datastore/issues/526)) ([3b85eab](https://www.github.com/googleapis/nodejs-datastore/commit/3b85eabec858c98f16edd5f04416495f248fc68a)) | ||
### [4.4.1](https://www.github.com/googleapis/nodejs-datastore/compare/v4.4.0...v4.4.1) (2019-10-22) | ||
@@ -9,0 +22,0 @@ |
{ | ||
"name": "@google-cloud/datastore", | ||
"description": "Cloud Datastore Client Library for Node.js", | ||
"version": "4.4.1", | ||
"version": "4.5.0", | ||
"license": "Apache-2.0", | ||
@@ -51,3 +51,3 @@ "author": "Google LLC.", | ||
"@google-cloud/promisify": "^1.0.0", | ||
"@grpc/grpc-js": "^0.6.0", | ||
"@grpc/grpc-js": "0.6.9", | ||
"@types/duplexify": "^3.6.0", | ||
@@ -54,0 +54,0 @@ "@types/long": "^4.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2757136
50048
+ Added@grpc/grpc-js@0.6.9(transitive)
+ Added@types/node@22.13.4(transitive)
- Removed@grpc/grpc-js@0.6.18(transitive)
- Removed@types/node@22.13.1(transitive)
Updated@grpc/grpc-js@0.6.9