@google-cloud/discoveryengine 1.0.0 → 1.1.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +7 -1
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +30 -2
  4. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +15 -2
  5. package/build/protos/google/cloud/discoveryengine/v1/conversation.proto +114 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +303 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/document.proto +8 -5
  8. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +4 -3
  9. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +27 -23
  10. package/build/protos/google/cloud/discoveryengine/v1/schema.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +428 -20
  12. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +48 -39
  13. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +2 -2
  14. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +6 -0
  15. package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +9 -2
  16. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +25 -0
  17. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +115 -3
  18. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +4 -0
  19. package/build/protos/protos.d.ts +10140 -6536
  20. package/build/protos/protos.js +26499 -17277
  21. package/build/protos/protos.json +2311 -1440
  22. package/build/src/index.d.ts +4 -1
  23. package/build/src/index.js +4 -1
  24. package/build/src/v1/completion_service_client.d.ts +156 -6
  25. package/build/src/v1/completion_service_client.js +188 -4
  26. package/build/src/v1/conversational_search_service_client.d.ts +947 -0
  27. package/build/src/v1/conversational_search_service_client.js +1205 -0
  28. package/build/src/v1/conversational_search_service_client_config.json +68 -0
  29. package/build/src/v1/document_service_client.d.ts +165 -18
  30. package/build/src/v1/document_service_client.js +215 -11
  31. package/build/src/v1/index.d.ts +1 -0
  32. package/build/src/v1/index.js +3 -1
  33. package/build/src/v1/schema_service_client.d.ts +148 -4
  34. package/build/src/v1/schema_service_client.js +207 -5
  35. package/build/src/v1/search_service_client.d.ts +238 -28
  36. package/build/src/v1/search_service_client.js +248 -20
  37. package/build/src/v1/user_event_service_client.d.ts +153 -9
  38. package/build/src/v1/user_event_service_client.js +207 -5
  39. package/build/src/v1beta/completion_service_client.d.ts +55 -4
  40. package/build/src/v1beta/completion_service_client.js +60 -4
  41. package/build/src/v1beta/conversational_search_service_client.d.ts +75 -4
  42. package/build/src/v1beta/conversational_search_service_client.js +60 -4
  43. package/build/src/v1beta/document_service_client.d.ts +55 -4
  44. package/build/src/v1beta/document_service_client.js +61 -5
  45. package/build/src/v1beta/recommendation_service_client.d.ts +55 -4
  46. package/build/src/v1beta/recommendation_service_client.js +60 -4
  47. package/build/src/v1beta/schema_service_client.d.ts +55 -4
  48. package/build/src/v1beta/schema_service_client.js +61 -5
  49. package/build/src/v1beta/search_service_client.d.ts +142 -4
  50. package/build/src/v1beta/search_service_client.js +118 -4
  51. package/build/src/v1beta/user_event_service_client.d.ts +55 -4
  52. package/build/src/v1beta/user_event_service_client.js +61 -5
  53. package/package.json +3 -3
@@ -60,8 +60,7 @@ class UserEventServiceClient {
60
60
  * API remote host.
61
61
  * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
62
62
  * Follows the structure of {@link gapicConfig}.
63
- * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode.
64
- * Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
63
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
65
64
  * For more information, please check the
66
65
  * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
67
66
  * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
@@ -69,7 +68,7 @@ class UserEventServiceClient {
69
68
  * HTTP implementation. Load only fallback version and pass it to the constructor:
70
69
  * ```
71
70
  * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
72
- * const client = new UserEventServiceClient({fallback: 'rest'}, gax);
71
+ * const client = new UserEventServiceClient({fallback: true}, gax);
73
72
  * ```
74
73
  */
75
74
  constructor(opts, gaxInstance) {
@@ -115,6 +114,7 @@ class UserEventServiceClient {
115
114
  if (servicePath === staticMembers.servicePath) {
116
115
  this.auth.defaultScopes = staticMembers.scopes;
117
116
  }
117
+ this.locationsClient = new this._gaxModule.LocationsClient(this._gaxGrpc, opts);
118
118
  // Determine the client header string.
119
119
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
120
120
  if (typeof process !== 'undefined' && 'versions' in process) {
@@ -126,7 +126,7 @@ class UserEventServiceClient {
126
126
  if (!opts.fallback) {
127
127
  clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
128
128
  }
129
- else if (opts.fallback === 'rest') {
129
+ else {
130
130
  clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
131
131
  }
132
132
  if (opts.libName && opts.libVersion) {
@@ -155,7 +155,7 @@ class UserEventServiceClient {
155
155
  auth: this.auth,
156
156
  grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
157
157
  };
158
- if (opts.fallback === 'rest') {
158
+ if (opts.fallback) {
159
159
  lroOptions.protoJson = protoFilesRoot;
160
160
  lroOptions.httpRules = [
161
161
  {
@@ -420,6 +420,61 @@ class UserEventServiceClient {
420
420
  const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importUserEvents, this._gaxModule.createDefaultBackoffSettings());
421
421
  return decodeOperation;
422
422
  }
423
+ /**
424
+ * Gets information about a location.
425
+ *
426
+ * @param {Object} request
427
+ * The request object that will be sent.
428
+ * @param {string} request.name
429
+ * Resource name for the location.
430
+ * @param {object} [options]
431
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details.
432
+ * @returns {Promise} - The promise which resolves to an array.
433
+ * The first element of the array is an object representing {@link google.cloud.location.Location | Location}.
434
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
435
+ * for more details and examples.
436
+ * @example
437
+ * ```
438
+ * const [response] = await client.getLocation(request);
439
+ * ```
440
+ */
441
+ getLocation(request, options, callback) {
442
+ return this.locationsClient.getLocation(request, options, callback);
443
+ }
444
+ /**
445
+ * Lists information about the supported locations for this service. Returns an iterable object.
446
+ *
447
+ * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
448
+ * @param {Object} request
449
+ * The request object that will be sent.
450
+ * @param {string} request.name
451
+ * The resource that owns the locations collection, if applicable.
452
+ * @param {string} request.filter
453
+ * The standard list filter.
454
+ * @param {number} request.pageSize
455
+ * The standard list page size.
456
+ * @param {string} request.pageToken
457
+ * The standard list page token.
458
+ * @param {object} [options]
459
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
460
+ * @returns {Object}
461
+ * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
462
+ * When you iterate the returned iterable, each element will be an object representing
463
+ * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page,
464
+ * so you can stop the iteration when you don't need more results.
465
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
466
+ * for more details and examples.
467
+ * @example
468
+ * ```
469
+ * const iterable = client.listLocationsAsync(request);
470
+ * for await (const response of iterable) {
471
+ * // process response
472
+ * }
473
+ * ```
474
+ */
475
+ listLocationsAsync(request, options) {
476
+ return this.locationsClient.listLocationsAsync(request, options);
477
+ }
423
478
  /**
424
479
  * Gets the latest state of a long-running operation. Clients can use this
425
480
  * method to poll the operation result at intervals as recommended by the API
@@ -1066,6 +1121,7 @@ class UserEventServiceClient {
1066
1121
  return this.userEventServiceStub.then(stub => {
1067
1122
  this._terminated = true;
1068
1123
  stub.close();
1124
+ this.locationsClient.close();
1069
1125
  this.operationsClient.close();
1070
1126
  });
1071
1127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google-cloud/discoveryengine",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Discovery Engine API client for Node.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,8 +56,8 @@
56
56
  "gapic-tools": "^0.1.8",
57
57
  "gts": "^5.0.0",
58
58
  "jsdoc": "^4.0.0",
59
- "jsdoc-fresh": "^2.0.0",
60
- "jsdoc-region-tag": "^2.0.0",
59
+ "jsdoc-fresh": "^3.0.0",
60
+ "jsdoc-region-tag": "^3.0.0",
61
61
  "linkinator": "4.1.2",
62
62
  "long": "^5.2.3",
63
63
  "mocha": "^9.2.2",