@google-cloud/discoveryengine 0.5.0 → 0.7.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 (49) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +38 -21
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +100 -0
  4. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +116 -0
  5. package/build/protos/google/cloud/discoveryengine/v1/document.proto +118 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +313 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +334 -0
  8. package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +86 -0
  9. package/build/protos/google/cloud/discoveryengine/v1/schema.proto +58 -0
  10. package/build/protos/google/cloud/discoveryengine/v1/schema_service.proto +256 -0
  11. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +289 -0
  12. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +458 -0
  13. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +133 -0
  14. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +3 -1
  15. package/build/protos/google/cloud/discoveryengine/v1beta/document_service.proto +34 -0
  16. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +54 -0
  17. package/build/protos/google/cloud/discoveryengine/v1beta/purge_config.proto +86 -0
  18. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +29 -4
  19. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +17 -13
  20. package/build/protos/protos.d.ts +6937 -0
  21. package/build/protos/protos.js +55830 -1
  22. package/build/protos/protos.json +5770 -1
  23. package/build/src/index.d.ts +18 -19
  24. package/build/src/index.js +9 -9
  25. package/build/src/v1/completion_service_client.d.ts +455 -0
  26. package/build/src/v1/completion_service_client.js +659 -0
  27. package/build/src/v1/completion_service_client_config.json +43 -0
  28. package/build/src/v1/document_service_client.d.ts +995 -0
  29. package/build/src/v1/document_service_client.js +1191 -0
  30. package/build/src/v1/document_service_client_config.json +82 -0
  31. package/build/src/v1/index.d.ts +5 -0
  32. package/build/src/v1/index.js +31 -0
  33. package/build/src/v1/schema_service_client.d.ts +795 -0
  34. package/build/src/v1/schema_service_client.js +1129 -0
  35. package/build/src/v1/schema_service_client_config.json +63 -0
  36. package/build/src/v1/search_service_client.d.ts +857 -0
  37. package/build/src/v1/search_service_client.js +1073 -0
  38. package/build/src/v1/search_service_client_config.json +43 -0
  39. package/build/src/v1/user_event_service_client.d.ts +638 -0
  40. package/build/src/v1/user_event_service_client.js +933 -0
  41. package/build/src/v1/user_event_service_client_config.json +62 -0
  42. package/build/src/v1beta/document_service_client.d.ts +115 -0
  43. package/build/src/v1beta/document_service_client.js +49 -0
  44. package/build/src/v1beta/document_service_client_config.json +5 -0
  45. package/build/src/v1beta/schema_service_client.js +6 -0
  46. package/build/src/v1beta/search_service_client.d.ts +78 -12
  47. package/build/src/v1beta/search_service_client.js +52 -8
  48. package/build/src/v1beta/user_event_service_client.js +6 -0
  49. package/package.json +9 -7
@@ -269,6 +269,60 @@ message ImportDocumentsRequest {
269
269
  // be imported. Defaults to
270
270
  // [ReconciliationMode.INCREMENTAL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL].
271
271
  ReconciliationMode reconciliation_mode = 6;
272
+
273
+ // Whether to automatically generate IDs for the documents if absent.
274
+ //
275
+ // If set to `true`,
276
+ // [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s are
277
+ // automatically generated based on the hash of the payload, where IDs may not
278
+ // be consistent during multiple imports. In which case
279
+ // [ReconciliationMode.FULL][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.ReconciliationMode.FULL]
280
+ // is highly recommended to avoid duplicate contents. If unset or set to
281
+ // `false`, [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s
282
+ // have to be specified using
283
+ // [id_field][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.id_field],
284
+ // otherwises, documents without IDs will fail to be imported.
285
+ //
286
+ // Only set this field when using
287
+ // [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
288
+ // [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
289
+ // when
290
+ // [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
291
+ // or
292
+ // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
293
+ // is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown.
294
+ bool auto_generate_ids = 8;
295
+
296
+ // The field in the Cloud Storage and BigQuery sources that indicates the
297
+ // unique IDs of the documents.
298
+ //
299
+ // For [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] it is the
300
+ // key of the JSON field. For instance, `my_id` for JSON `{"my_id":
301
+ // "some_uuid"}`. For
302
+ // [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource] it is
303
+ // the column name of the BigQuery table where the unique ids are stored.
304
+ //
305
+ // The values of the JSON field or the BigQuery column will be used as the
306
+ // [Document.id][google.cloud.discoveryengine.v1beta.Document.id]s. The JSON
307
+ // field or the BigQuery column must be of string type, and the values must be
308
+ // set as valid strings conform to
309
+ // [RFC-1034](https://tools.ietf.org/html/rfc1034) with 1-63 characters.
310
+ // Otherwise, documents without valid IDs will fail to be imported.
311
+ //
312
+ // Only set this field when using
313
+ // [GcsSource][google.cloud.discoveryengine.v1beta.GcsSource] or
314
+ // [BigQuerySource][google.cloud.discoveryengine.v1beta.BigQuerySource], and
315
+ // when
316
+ // [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
317
+ // or
318
+ // [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
319
+ // is `custom`. And only set this field when
320
+ // [auto_generate_ids][google.cloud.discoveryengine.v1beta.ImportDocumentsRequest.auto_generate_ids]
321
+ // is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.
322
+ //
323
+ // If it is unset, a default value `_id` is used when importing from the
324
+ // allowed data sources.
325
+ string id_field = 9;
272
326
  }
273
327
 
274
328
  // Response of the
@@ -0,0 +1,86 @@
1
+ // Copyright 2022 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.cloud.discoveryengine.v1beta;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/protobuf/timestamp.proto";
22
+
23
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
24
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
25
+ option java_multiple_files = true;
26
+ option java_outer_classname = "PurgeConfigProto";
27
+ option java_package = "com.google.cloud.discoveryengine.v1beta";
28
+ option objc_class_prefix = "DISCOVERYENGINE";
29
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
30
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
31
+
32
+ // Request message for
33
+ // [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1beta.DocumentService.PurgeDocuments]
34
+ // method.
35
+ message PurgeDocumentsRequest {
36
+ // Required. The parent resource name, such as
37
+ // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
38
+ string parent = 1 [
39
+ (google.api.field_behavior) = REQUIRED,
40
+ (google.api.resource_reference) = {
41
+ type: "discoveryengine.googleapis.com/Branch"
42
+ }
43
+ ];
44
+
45
+ // Required. Filter matching documents to purge. Only currently supported
46
+ // value is
47
+ // `*` (all items).
48
+ string filter = 2 [(google.api.field_behavior) = REQUIRED];
49
+
50
+ // Actually performs the purge. If `force` is set to false, return the
51
+ // expected purge count without deleting any documents.
52
+ bool force = 3;
53
+ }
54
+
55
+ // Response message for
56
+ // [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1beta.DocumentService.PurgeDocuments]
57
+ // method. If the long running operation is successfully done, then this message
58
+ // is returned by the google.longrunning.Operations.response field.
59
+ message PurgeDocumentsResponse {
60
+ // The total count of documents purged as a result of the operation.
61
+ int64 purge_count = 1;
62
+
63
+ // A sample of document names that will be deleted. Only populated if `force`
64
+ // is set to false. A max of 100 names will be returned and the names are
65
+ // chosen at random.
66
+ repeated string purge_sample = 2 [(google.api.resource_reference) = {
67
+ type: "discoveryengine.googleapis.com/Document"
68
+ }];
69
+ }
70
+
71
+ // Metadata related to the progress of the PurgeDocuments operation.
72
+ // This will be returned by the google.longrunning.Operation.metadata field.
73
+ message PurgeDocumentsMetadata {
74
+ // Operation create time.
75
+ google.protobuf.Timestamp create_time = 1;
76
+
77
+ // Operation last update time. If the operation is done, this is also the
78
+ // finish time.
79
+ google.protobuf.Timestamp update_time = 2;
80
+
81
+ // Count of entries that were deleted successfully.
82
+ int64 success_count = 3;
83
+
84
+ // Count of entries that encountered errors while processing.
85
+ int64 failure_count = 4;
86
+ }
@@ -382,6 +382,11 @@ message SearchRequest {
382
382
  // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
383
383
  string order_by = 8;
384
384
 
385
+ // Information about the end user.
386
+ // Highly recommended for analytics. The user_agent string in UserInfo will
387
+ // be used to deduce device_type for analytics.
388
+ UserInfo user_info = 21;
389
+
385
390
  // Facet specifications for faceted search. If empty, no facets are returned.
386
391
  //
387
392
  // A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
@@ -393,16 +398,13 @@ message SearchRequest {
393
398
 
394
399
  // Additional search parameters.
395
400
  //
396
- // For
397
- // [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1beta.IndustryVertical.SITE_SEARCH]
398
- // vertical, supported values are:
401
+ // For public website search only, supported values are:
399
402
  //
400
403
  // * `user_country_code`: string. Default empty. If set to non-empty, results
401
404
  // are restricted or boosted based on the location provided.
402
405
  // * `search_type`: double. Default empty. Enables non-webpage searching
403
406
  // depending on the value. The only valid non-default value is 1,
404
407
  // which enables image searching.
405
- // This field is ignored for other verticals.
406
408
  map<string, google.protobuf.Value> params = 11;
407
409
 
408
410
  // The query expansion specification that specifies the conditions under which
@@ -432,6 +434,29 @@ message SearchRequest {
432
434
  // The content search spec that configs the desired behavior of content
433
435
  // search.
434
436
  ContentSearchSpec content_search_spec = 24;
437
+
438
+ // Whether to turn on safe search. This is only supported for
439
+ // [ContentConfig.PUBLIC_WEBSITE][].
440
+ bool safe_search = 20;
441
+
442
+ // The user labels applied to a resource must meet the following requirements:
443
+ //
444
+ // * Each resource can have multiple labels, up to a maximum of 64.
445
+ // * Each label must be a key-value pair.
446
+ // * Keys have a minimum length of 1 character and a maximum length of 63
447
+ // characters and cannot be empty. Values can be empty and have a maximum
448
+ // length of 63 characters.
449
+ // * Keys and values can contain only lowercase letters, numeric characters,
450
+ // underscores, and dashes. All characters must use UTF-8 encoding, and
451
+ // international characters are allowed.
452
+ // * The key portion of a label must be unique. However, you can use the same
453
+ // key with multiple resources.
454
+ // * Keys must start with a lowercase letter or international character.
455
+ //
456
+ // See [Google Cloud
457
+ // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
458
+ // for more details.
459
+ map<string, string> user_labels = 22;
435
460
  }
436
461
 
437
462
  // Response message for
@@ -114,17 +114,19 @@ message UserEvent {
114
114
  // Token to attribute an API response to user action(s) to trigger the event.
115
115
  //
116
116
  // Highly recommended for user events that are the result of
117
- // [PredictionService.Predict][]. This field enables accurate attribution of
118
- // recommendation model performance.
117
+ // [RecommendationService.Recommend][google.cloud.discoveryengine.v1beta.RecommendationService.Recommend].
118
+ // This field enables accurate attribution of recommendation model
119
+ // performance.
119
120
  //
120
121
  // The value must be one of:
121
122
  //
122
123
  // * [PredictResponse.attribution_token][] for events that are the result of
123
- // [PredictionService.Predict][].
124
+ // [RecommendationService.Recommend][google.cloud.discoveryengine.v1beta.RecommendationService.Recommend].
124
125
  // * [SearchResponse.attribution_token][google.cloud.discoveryengine.v1beta.SearchResponse.attribution_token] for events that are the result of
125
126
  // [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search].
126
127
  // * [CompleteQueryResponse.attribution_token][] for events that are the
127
- // result of [SearchService.CompleteQuery][].
128
+ // result of
129
+ // [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1beta.CompletionService.CompleteQuery].
128
130
  //
129
131
  // This token enables us to accurately attribute page view or conversion
130
132
  // completion back to the event and the particular predict response containing
@@ -138,14 +140,15 @@ message UserEvent {
138
140
  // predicate from one or more fields of the documents being filtered.
139
141
  //
140
142
  // One example is for `search` events, the associated
141
- // [SearchService.SearchRequest][] may contain a filter expression in
142
- // [SearchService.SearchRequest.filter][] conforming to
143
- // https://google.aip.dev/160#filtering.
143
+ // [SearchRequest][google.cloud.discoveryengine.v1beta.SearchRequest] may
144
+ // contain a filter expression in
145
+ // [SearchRequest.filter][google.cloud.discoveryengine.v1beta.SearchRequest.filter]
146
+ // conforming to https://google.aip.dev/160#filtering.
144
147
  //
145
148
  // Similarly, for `view-item-list` events that are generated from a
146
- // [PredictionService.PredictRequest][], this field may be populated directly
147
- // from [PredictionService.PredictRequest.filter][] conforming to
148
- // https://google.aip.dev/160#filtering.
149
+ // [RecommendationService.RecommendRequest][], this field may be populated
150
+ // directly from [RecommendationService.RecommendRequest.filter][] conforming
151
+ // to https://google.aip.dev/160#filtering.
149
152
  //
150
153
  // The value must be a UTF-8 encoded string with a length limit of 1,000
151
154
  // characters. Otherwise, an INVALID_ARGUMENT error is returned.
@@ -284,9 +287,10 @@ message SearchInfo {
284
287
  //
285
288
  // At least one of
286
289
  // [search_query][google.cloud.discoveryengine.v1beta.SearchInfo.search_query]
287
- // or [page_categories][] is required for `search` events. Other event types
288
- // should not set this field. Otherwise, an INVALID_ARGUMENT error is
289
- // returned.
290
+ // or
291
+ // [PageInfo.page_category][google.cloud.discoveryengine.v1beta.PageInfo.page_category]
292
+ // is required for `search` events. Other event types should not set this
293
+ // field. Otherwise, an INVALID_ARGUMENT error is returned.
290
294
  string search_query = 1;
291
295
 
292
296
  // The order in which products are returned, if applicable.