@google-cloud/dlp 5.1.1 → 5.2.0

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/PACKAGE NAME?activeTab=versions
6
6
 
7
+ ## [5.2.0](https://github.com/googleapis/google-cloud-node/compare/dlp-v5.1.1...dlp-v5.2.0) (2024-02-09)
8
+
9
+
10
+ ### Features
11
+
12
+ * Trusted Private Cloud support, use the universeDomain parameter ([#5029](https://github.com/googleapis/google-cloud-node/issues/5029)) ([09e59ad](https://github.com/googleapis/google-cloud-node/commit/09e59ad6e34001a33d01894ccd5a0643f1a84883))
13
+
7
14
  ## [5.1.1](https://github.com/googleapis/google-cloud-node/compare/dlp-v5.1.0...dlp-v5.1.1) (2023-12-05)
8
15
 
9
16
 
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Google LLC
1
+ // Copyright 2024 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Google LLC
1
+ // Copyright 2024 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2023 Google LLC
2
+ // Copyright 2024 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -24,6 +24,8 @@ export declare class DlpServiceClient {
24
24
  private _gaxGrpc;
25
25
  private _protos;
26
26
  private _defaults;
27
+ private _universeDomain;
28
+ private _servicePath;
27
29
  auth: gax.GoogleAuth;
28
30
  descriptors: Descriptors;
29
31
  warn: (code: string, message: string, warnType?: string) => void;
@@ -93,15 +95,22 @@ export declare class DlpServiceClient {
93
95
  }>;
94
96
  /**
95
97
  * The DNS address for this API service.
98
+ * @deprecated Use the apiEndpoint method of the client instance.
96
99
  * @returns {string} The DNS address for this service.
97
100
  */
98
101
  static get servicePath(): string;
99
102
  /**
100
- * The DNS address for this API service - same as servicePath(),
101
- * exists for compatibility reasons.
103
+ * The DNS address for this API service - same as servicePath.
104
+ * @deprecated Use the apiEndpoint method of the client instance.
102
105
  * @returns {string} The DNS address for this service.
103
106
  */
104
107
  static get apiEndpoint(): string;
108
+ /**
109
+ * The DNS address for this API service.
110
+ * @returns {string} The DNS address for this service.
111
+ */
112
+ get apiEndpoint(): string;
113
+ get universeDomain(): string;
105
114
  /**
106
115
  * The port for this API service.
107
116
  * @returns {number} The default port for this service.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2023 Google LLC
2
+ // Copyright 2024 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ class DlpServiceClient {
80
80
  * ```
81
81
  */
82
82
  constructor(opts, gaxInstance) {
83
- var _a, _b;
83
+ var _a, _b, _c, _d;
84
84
  this._terminated = false;
85
85
  this.descriptors = {
86
86
  page: {},
@@ -90,16 +90,24 @@ class DlpServiceClient {
90
90
  };
91
91
  // Ensure that options include all the required fields.
92
92
  const staticMembers = this.constructor;
93
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
93
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
94
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
95
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
96
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
97
+ }
98
+ this._universeDomain =
99
+ (_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';
100
+ this._servicePath = 'dlp.' + this._universeDomain;
101
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
94
102
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
95
103
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
96
- const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
97
- 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');
104
+ const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
105
+ 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');
98
106
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
99
107
  // Request numeric enum values if REST transport is used.
100
108
  opts.numericEnums = true;
101
109
  // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
102
- if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
110
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
103
111
  opts['scopes'] = staticMembers.scopes;
104
112
  }
105
113
  // Load google-gax module synchronously if needed
@@ -117,9 +125,9 @@ class DlpServiceClient {
117
125
  // Set useJWTAccessWithScope on the auth object.
118
126
  this.auth.useJWTAccessWithScope = true;
119
127
  // Set defaultServicePath on the auth object.
120
- this.auth.defaultServicePath = staticMembers.servicePath;
128
+ this.auth.defaultServicePath = this._servicePath;
121
129
  // Set the default scopes in auth client if needed.
122
- if (servicePath === staticMembers.servicePath) {
130
+ if (servicePath === this._servicePath) {
123
131
  this.auth.defaultScopes = staticMembers.scopes;
124
132
  }
125
133
  this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
@@ -272,19 +280,38 @@ class DlpServiceClient {
272
280
  }
273
281
  /**
274
282
  * The DNS address for this API service.
283
+ * @deprecated Use the apiEndpoint method of the client instance.
275
284
  * @returns {string} The DNS address for this service.
276
285
  */
277
286
  static get servicePath() {
287
+ if (typeof process !== undefined &&
288
+ typeof process.emitWarning === 'function') {
289
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
290
+ }
278
291
  return 'dlp.googleapis.com';
279
292
  }
280
293
  /**
281
- * The DNS address for this API service - same as servicePath(),
282
- * exists for compatibility reasons.
294
+ * The DNS address for this API service - same as servicePath.
295
+ * @deprecated Use the apiEndpoint method of the client instance.
283
296
  * @returns {string} The DNS address for this service.
284
297
  */
285
298
  static get apiEndpoint() {
299
+ if (typeof process !== undefined &&
300
+ typeof process.emitWarning === 'function') {
301
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
302
+ }
286
303
  return 'dlp.googleapis.com';
287
304
  }
305
+ /**
306
+ * The DNS address for this API service.
307
+ * @returns {string} The DNS address for this service.
308
+ */
309
+ get apiEndpoint() {
310
+ return this._servicePath;
311
+ }
312
+ get universeDomain() {
313
+ return this._universeDomain;
314
+ }
288
315
  /**
289
316
  * The port for this API service.
290
317
  * @returns {number} The default port for this service.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2023 Google LLC
2
+ // Copyright 2024 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@google-cloud/dlp",
3
3
  "description": "DLP API client for Node.js",
4
- "version": "5.1.1",
4
+ "version": "5.2.0",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Google Inc",
7
7
  "engines": {
@@ -55,7 +55,7 @@
55
55
  "@types/node": "^20.4.5",
56
56
  "@types/sinon": "^17.0.0",
57
57
  "c8": "^8.0.1",
58
- "gapic-tools": "^0.2.0",
58
+ "gapic-tools": "^0.3.0",
59
59
  "gts": "^5.0.0",
60
60
  "jsdoc": "^4.0.0",
61
61
  "jsdoc-fresh": "^3.0.0",