@google-cloud/redis-cluster
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -39,2 +39,4 @@ /// <reference types="node" /> | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -110,2 +112,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -115,4 +118,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -122,2 +125,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -124,0 +133,0 @@ * @returns {number} The default port for this service. |
@@ -95,3 +95,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -106,7 +106,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 = 'redis.' + 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); | ||
@@ -116,3 +124,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; | ||
@@ -135,5 +143,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; | ||
@@ -285,16 +293,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @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 'redis.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @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 'redis.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -301,0 +328,0 @@ * @returns {number} The default port for this service. |
@@ -39,2 +39,4 @@ /// <reference types="node" /> | ||
private _defaults; | ||
private _universeDomain; | ||
private _servicePath; | ||
auth: gax.GoogleAuth; | ||
@@ -110,2 +112,3 @@ descriptors: Descriptors; | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -115,4 +118,4 @@ */ | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @returns {string} The DNS address for this service. | ||
@@ -122,2 +125,8 @@ */ | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint(): string; | ||
get universeDomain(): string; | ||
/** | ||
* The port for this API service. | ||
@@ -124,0 +133,0 @@ * @returns {number} The default port for this service. |
@@ -95,3 +95,3 @@ "use strict"; | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
this._terminated = false; | ||
@@ -106,7 +106,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 = 'redis.' + 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); | ||
@@ -116,3 +124,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; | ||
@@ -135,5 +143,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; | ||
@@ -286,16 +294,35 @@ } | ||
* The DNS address for this API service. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @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 'redis.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service - same as servicePath(), | ||
* exists for compatibility reasons. | ||
* The DNS address for this API service - same as servicePath. | ||
* @deprecated Use the apiEndpoint method of the client instance. | ||
* @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 'redis.googleapis.com'; | ||
} | ||
/** | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
get apiEndpoint() { | ||
return this._servicePath; | ||
} | ||
get universeDomain() { | ||
return this._universeDomain; | ||
} | ||
/** | ||
* The port for this API service. | ||
@@ -302,0 +329,0 @@ * @returns {number} The default port for this service. |
# Changelog | ||
## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/redis-cluster-v0.1.0...redis-cluster-v0.2.0) (2024-02-09) | ||
### Features | ||
* Trusted Private Cloud support, use the universeDomain parameter ([#5027](https://github.com/googleapis/google-cloud-node/issues/5027)) ([88763bb](https://github.com/googleapis/google-cloud-node/commit/88763bb1b7ce9ff884b9e3f476230d38985b2ff2)) | ||
## 0.1.0 (2024-01-18) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "@google-cloud/redis-cluster", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Google Cloud Memorystore for Redis API client for Node.js", | ||
@@ -55,3 +55,3 @@ "repository": { | ||
"c8": "^8.0.1", | ||
"gapic-tools": "^0.2.0", | ||
"gapic-tools": "^0.3.0", | ||
"gts": "^5.0.0", | ||
@@ -58,0 +58,0 @@ "jsdoc": "^4.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2417439
39723