@google-cloud/datastore
Advanced tools
Comparing version 8.4.0 to 8.5.0
@@ -65,2 +65,4 @@ /// <reference types="node" /> | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -132,2 +134,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated | ||
* @returns {string} The DNS address for this service. | ||
@@ -137,4 +140,5 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* The DNS address for this API service - same as servicePath, | ||
* exists for compatibility reasons. | ||
* @deprecated | ||
* @returns {string} The DNS address for this service. | ||
@@ -144,2 +148,13 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get servicePath(): string; | ||
/** | ||
* The DNS address for this API service - same as servicePath(). | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -146,0 +161,0 @@ * @returns {number} The default port for this service. |
@@ -121,3 +121,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -132,7 +132,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com'; | ||
this._servicePath = 'datastore.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -142,3 +150,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -161,5 +169,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -299,16 +307,43 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'datastore.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* The DNS address for this API service - same as servicePath, | ||
* exists for compatibility reasons. | ||
* @deprecated | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'datastore.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get servicePath() { | ||
return this._servicePath; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(). | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -315,0 +350,0 @@ * @returns {number} The default port for this service. |
@@ -23,2 +23,4 @@ import type * as gax from 'google-gax'; | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -90,2 +92,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated | ||
* @returns {string} The DNS address for this service. | ||
@@ -95,4 +98,5 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* The DNS address for this API service - same as servicePath, | ||
* exists for compatibility reasons. | ||
* @deprecated | ||
* @returns {string} The DNS address for this service. | ||
@@ -102,2 +106,13 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get servicePath(): string; | ||
/** | ||
* The DNS address for this API service - same as servicePath(). | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -170,6 +185,2 @@ * @returns {number} The default port for this service. | ||
* The GQL query to run. This query must be a non-aggregation query. | ||
* @param {google.datastore.v1.QueryMode} [request.mode] | ||
* Optional. The mode in which the query request is processed. This field is | ||
* optional, and when not provided, it defaults to `NORMAL` mode where no | ||
* additional statistics will be returned with the query results. | ||
* @param {object} [options] | ||
@@ -214,6 +225,2 @@ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
* The GQL query to run. This query must be an aggregation query. | ||
* @param {google.datastore.v1.QueryMode} [request.mode] | ||
* Optional. The mode in which the query request is processed. This field is | ||
* optional, and when not provided, it defaults to `NORMAL` mode where no | ||
* additional statistics will be returned with the query results. | ||
* @param {object} [options] | ||
@@ -220,0 +227,0 @@ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. |
@@ -81,3 +81,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -92,7 +92,15 @@ this.descriptors = { | ||
const staticMembers = this.constructor; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) && | ||
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) { | ||
throw new Error('Please set either universe_domain or universeDomain, but not both.'); | ||
} | ||
this._universeDomain = | ||
(_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com'; | ||
this._servicePath = 'datastore.' + this._universeDomain; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath; | ||
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint)); | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function'); | ||
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {}; | ||
const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
@@ -102,3 +110,3 @@ // Request numeric enum values if REST transport is used. | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
if (servicePath !== this._servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
@@ -121,5 +129,5 @@ } | ||
// Set defaultServicePath on the auth object. | ||
this.auth.defaultServicePath = staticMembers.servicePath; | ||
this.auth.defaultServicePath = this._servicePath; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
if (servicePath === this._servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
@@ -240,16 +248,43 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get servicePath() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'datastore.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* The DNS address for this API service - same as servicePath, | ||
* exists for compatibility reasons. | ||
* @deprecated | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
static get apiEndpoint() { | ||
if (typeof process !== undefined && | ||
typeof process.emitWarning === 'function') { | ||
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); | ||
} | ||
return 'datastore.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get servicePath() { | ||
return this._servicePath; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(). | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -256,0 +291,0 @@ * @returns {number} The default port for this service. |
@@ -7,2 +7,9 @@ # Changelog | ||
## [8.5.0](https://github.com/googleapis/nodejs-datastore/compare/v8.4.0...v8.5.0) (2024-02-06) | ||
### Features | ||
* Trusted Private Cloud support, use the universeDomain parameter ([#1227](https://github.com/googleapis/nodejs-datastore/issues/1227)) ([10480ed](https://github.com/googleapis/nodejs-datastore/commit/10480edfdda99cde5fef470fbf163861528398a0)) | ||
## [8.4.0](https://github.com/googleapis/nodejs-datastore/compare/v8.3.0...v8.4.0) (2024-01-09) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "@google-cloud/datastore", | ||
"version": "8.4.0", | ||
"version": "8.5.0", | ||
"description": "Cloud Datastore Client Library for Node.js", | ||
@@ -64,3 +64,3 @@ "keywords": [ | ||
"c8": "^9.0.0", | ||
"gapic-tools": "^0.2.0", | ||
"gapic-tools": "^0.3.0", | ||
"gts": "^5.0.0", | ||
@@ -67,0 +67,0 @@ "js-yaml": "^4.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4112551
70169