@google-cloud/dms 3.1.0 → 3.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
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.2.0](https://github.com/googleapis/google-cloud-node/compare/dms-v3.1.0...dms-v3.2.0) (2024-02-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * Support for Trusted Private Cloud ([895830a](https://github.com/googleapis/google-cloud-node/commit/895830a3ef91666c30a96a7f68bd4cd1f582d58d))
9
+
3
10
  ## [3.1.0](https://github.com/googleapis/google-cloud-node/compare/dms-v3.0.0...dms-v3.1.0) (2023-09-06)
4
11
 
5
12
 
@@ -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.
@@ -16,6 +16,8 @@ export declare class DataMigrationServiceClient {
16
16
  private _gaxGrpc;
17
17
  private _protos;
18
18
  private _defaults;
19
+ private _universeDomain;
20
+ private _servicePath;
19
21
  auth: gax.GoogleAuth;
20
22
  descriptors: Descriptors;
21
23
  warn: (code: string, message: string, warnType?: string) => void;
@@ -87,15 +89,22 @@ export declare class DataMigrationServiceClient {
87
89
  }>;
88
90
  /**
89
91
  * The DNS address for this API service.
92
+ * @deprecated Use the apiEndpoint method of the client instance.
90
93
  * @returns {string} The DNS address for this service.
91
94
  */
92
95
  static get servicePath(): string;
93
96
  /**
94
- * The DNS address for this API service - same as servicePath(),
95
- * exists for compatibility reasons.
97
+ * The DNS address for this API service - same as servicePath.
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 apiEndpoint(): string;
102
+ /**
103
+ * The DNS address for this API service.
104
+ * @returns {string} The DNS address for this service.
105
+ */
106
+ get apiEndpoint(): string;
107
+ get universeDomain(): string;
99
108
  /**
100
109
  * The port for this API service.
101
110
  * @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.
@@ -72,7 +72,7 @@ class DataMigrationServiceClient {
72
72
  * ```
73
73
  */
74
74
  constructor(opts, gaxInstance) {
75
- var _a, _b;
75
+ var _a, _b, _c, _d;
76
76
  this._terminated = false;
77
77
  this.descriptors = {
78
78
  page: {},
@@ -82,16 +82,24 @@ class DataMigrationServiceClient {
82
82
  };
83
83
  // Ensure that options include all the required fields.
84
84
  const staticMembers = this.constructor;
85
- const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath;
85
+ if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
86
+ (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
87
+ (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
88
+ throw new Error('Please set either universe_domain or universeDomain, but not both.');
89
+ }
90
+ this._universeDomain =
91
+ (_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';
92
+ this._servicePath = 'datamigration.' + this._universeDomain;
93
+ const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
86
94
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
87
95
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
88
- const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {};
89
- 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');
96
+ const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
97
+ 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');
90
98
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
91
99
  // Request numeric enum values if REST transport is used.
92
100
  opts.numericEnums = true;
93
101
  // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
94
- if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
102
+ if (servicePath !== this._servicePath && !('scopes' in opts)) {
95
103
  opts['scopes'] = staticMembers.scopes;
96
104
  }
97
105
  // Load google-gax module synchronously if needed
@@ -109,9 +117,9 @@ class DataMigrationServiceClient {
109
117
  // Set useJWTAccessWithScope on the auth object.
110
118
  this.auth.useJWTAccessWithScope = true;
111
119
  // Set defaultServicePath on the auth object.
112
- this.auth.defaultServicePath = staticMembers.servicePath;
120
+ this.auth.defaultServicePath = this._servicePath;
113
121
  // Set the default scopes in auth client if needed.
114
- if (servicePath === staticMembers.servicePath) {
122
+ if (servicePath === this._servicePath) {
115
123
  this.auth.defaultScopes = staticMembers.scopes;
116
124
  }
117
125
  this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts);
@@ -420,19 +428,38 @@ class DataMigrationServiceClient {
420
428
  }
421
429
  /**
422
430
  * The DNS address for this API service.
431
+ * @deprecated Use the apiEndpoint method of the client instance.
423
432
  * @returns {string} The DNS address for this service.
424
433
  */
425
434
  static get servicePath() {
435
+ if (typeof process !== undefined &&
436
+ typeof process.emitWarning === 'function') {
437
+ process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
438
+ }
426
439
  return 'datamigration.googleapis.com';
427
440
  }
428
441
  /**
429
- * The DNS address for this API service - same as servicePath(),
430
- * exists for compatibility reasons.
442
+ * The DNS address for this API service - same as servicePath.
443
+ * @deprecated Use the apiEndpoint method of the client instance.
431
444
  * @returns {string} The DNS address for this service.
432
445
  */
433
446
  static get apiEndpoint() {
447
+ if (typeof process !== undefined &&
448
+ typeof process.emitWarning === 'function') {
449
+ process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
450
+ }
434
451
  return 'datamigration.googleapis.com';
435
452
  }
453
+ /**
454
+ * The DNS address for this API service.
455
+ * @returns {string} The DNS address for this service.
456
+ */
457
+ get apiEndpoint() {
458
+ return this._servicePath;
459
+ }
460
+ get universeDomain() {
461
+ return this._universeDomain;
462
+ }
436
463
  /**
437
464
  * The port for this API service.
438
465
  * @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/dms",
3
3
  "description": "Cloud Database Migration API client for Node.js",
4
- "version": "3.1.0",
4
+ "version": "3.2.0",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Google LLC",
7
7
  "engines": {
@@ -38,7 +38,7 @@
38
38
  "docs-test": "linkinator docs",
39
39
  "fix": "gts fix",
40
40
  "lint": "gts check",
41
- "prepare": "npm run compile-protos && npm run compile",
41
+ "prepare": "npm run compile",
42
42
  "prelint": "cd samples; npm link ../; npm i",
43
43
  "postpack": "minifyProtoJson",
44
44
  "samples-test": "cd samples/ && npm link ../ && npm i && npm test",
@@ -51,10 +51,10 @@
51
51
  "devDependencies": {
52
52
  "@types/mocha": "^9.0.0",
53
53
  "@types/node": "^20.4.5",
54
- "@types/sinon": "^10.0.0",
54
+ "@types/sinon": "^17.0.0",
55
55
  "c8": "^8.0.1",
56
56
  "codecov": "^3.6.5",
57
- "gapic-tools": "^0.1.8",
57
+ "gapic-tools": "^0.3.0",
58
58
  "gts": "^5.0.0",
59
59
  "jsdoc": "^4.0.0",
60
60
  "jsdoc-fresh": "^3.0.0",
@@ -62,8 +62,8 @@
62
62
  "linkinator": "4.1.2",
63
63
  "long": "^5.2.3",
64
64
  "mocha": "^9.2.2",
65
- "pack-n-play": "^1.0.0-2",
66
- "sinon": "^15.0.0",
65
+ "pack-n-play": "^2.0.0",
66
+ "sinon": "^17.0.0",
67
67
  "typescript": "^5.1.6"
68
68
  },
69
69
  "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-clouddms"