@google-cloud/pubsub 4.7.2 → 4.9.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,26 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/@google-cloud/pubsub?activeTab=versions
6
6
 
7
+ ## [4.9.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.8.0...v4.9.0) (2024-11-12)
8
+
9
+
10
+ ### Features
11
+
12
+ * Add IngestionFailureEvent to the external proto ([#1984](https://github.com/googleapis/nodejs-pubsub/issues/1984)) ([7075430](https://github.com/googleapis/nodejs-pubsub/commit/70754309fb600c54d0a573f2d49ad4c419577550))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * KiB, not MiB for ack size limits ([#1999](https://github.com/googleapis/nodejs-pubsub/issues/1999)) ([798270d](https://github.com/googleapis/nodejs-pubsub/commit/798270db9c5ef71f75c3e24e70d9592bbd068212))
18
+
19
+ ## [4.8.0](https://github.com/googleapis/nodejs-pubsub/compare/v4.7.2...v4.8.0) (2024-10-15)
20
+
21
+
22
+ ### Features
23
+
24
+ * Add ingestion Cloud Storage fields and Platform Logging fields to Topic ([#1974](https://github.com/googleapis/nodejs-pubsub/issues/1974)) ([afec9a1](https://github.com/googleapis/nodejs-pubsub/commit/afec9a1ad3f665a71f08e748623f0fdaa332d17b))
25
+ * Return listing information for subscriptions created via Analytics Hub ([afec9a1](https://github.com/googleapis/nodejs-pubsub/commit/afec9a1ad3f665a71f08e748623f0fdaa332d17b))
26
+
7
27
  ## [4.7.2](https://github.com/googleapis/nodejs-pubsub/compare/v4.7.1...v4.7.2) (2024-09-13)
8
28
 
9
29
 
package/README.md CHANGED
@@ -52,7 +52,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
52
52
  1. [Select or create a Cloud Platform project][projects].
53
53
  1. [Enable billing for your project][billing].
54
54
  1. [Enable the Google Cloud Pub/Sub API][enable_api].
55
- 1. [Set up authentication with a service account][auth] so you can access the
55
+ 1. [Set up authentication][auth] so you can access the
56
56
  API from your local workstation.
57
57
 
58
58
  ### Installing the client library
@@ -138,6 +138,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-pubsub/tree
138
138
  | Create Subscription with ordering enabled | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createSubscriptionWithOrdering.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createSubscriptionWithOrdering.js,samples/README.md) |
139
139
  | Create Subscription With Retry Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createSubscriptionWithRetryPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createSubscriptionWithRetryPolicy.js,samples/README.md) |
140
140
  | Create Topic | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopic.js,samples/README.md) |
141
+ | Create Topic With Cloud Storage Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithCloudStorageIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithCloudStorageIngestion.js,samples/README.md) |
141
142
  | Create Topic With Kinesis Ingestion | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithKinesisIngestion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithKinesisIngestion.js,samples/README.md) |
142
143
  | Create Topic With Schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithSchema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithSchema.js,samples/README.md) |
143
144
  | Create Topic With Schema Revisions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/createTopicWithSchemaRevisions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/createTopicWithSchemaRevisions.js,samples/README.md) |
@@ -165,6 +166,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-pubsub/tree
165
166
  | Listen For Messages With Custom Attributes | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenWithCustomAttributes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listenWithCustomAttributes.js,samples/README.md) |
166
167
  | Subscribe with OpenTelemetry Tracing | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/listenWithOpenTelemetryTracing.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/listenWithOpenTelemetryTracing.js,samples/README.md) |
167
168
  | Modify Push Configuration | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/modifyPushConfig.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/modifyPushConfig.js,samples/README.md) |
169
+ | Optimistic Subscribe | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/optimisticSubscribe.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/optimisticSubscribe.js,samples/README.md) |
168
170
  | Publish Avro Records to a Topic | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishAvroRecords.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishAvroRecords.js,samples/README.md) |
169
171
  | Publish Batched Messages | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishBatchedMessages.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishBatchedMessages.js,samples/README.md) |
170
172
  | Publish Message | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishMessage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/publishMessage.js,samples/README.md) |
@@ -259,4 +261,4 @@ See [LICENSE](https://github.com/googleapis/nodejs-pubsub/blob/main/LICENSE)
259
261
  [projects]: https://console.cloud.google.com/project
260
262
  [billing]: https://support.google.com/cloud/answer/6293499#enable-billing
261
263
  [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=pubsub.googleapis.com
262
- [auth]: https://cloud.google.com/docs/authentication/getting-started
264
+ [auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
@@ -237,10 +237,188 @@ message IngestionDataSourceSettings {
237
237
  string gcp_service_account = 5 [(google.api.field_behavior) = REQUIRED];
238
238
  }
239
239
 
240
+ // Ingestion settings for Cloud Storage.
241
+ message CloudStorage {
242
+ // Possible states for ingestion from Cloud Storage.
243
+ enum State {
244
+ // Default value. This value is unused.
245
+ STATE_UNSPECIFIED = 0;
246
+
247
+ // Ingestion is active.
248
+ ACTIVE = 1;
249
+
250
+ // Permission denied encountered while calling the Cloud Storage API. This
251
+ // can happen if the Pub/Sub SA has not been granted the
252
+ // [appropriate
253
+ // permissions](https://cloud.google.com/storage/docs/access-control/iam-permissions):
254
+ // - storage.objects.list: to list the objects in a bucket.
255
+ // - storage.objects.get: to read the objects in a bucket.
256
+ // - storage.buckets.get: to verify the bucket exists.
257
+ CLOUD_STORAGE_PERMISSION_DENIED = 2;
258
+
259
+ // Permission denied encountered while publishing to the topic. This can
260
+ // happen if the Pub/Sub SA has not been granted the [appropriate publish
261
+ // permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher)
262
+ PUBLISH_PERMISSION_DENIED = 3;
263
+
264
+ // The provided Cloud Storage bucket doesn't exist.
265
+ BUCKET_NOT_FOUND = 4;
266
+
267
+ // The Cloud Storage bucket has too many objects, ingestion will be
268
+ // paused.
269
+ TOO_MANY_OBJECTS = 5;
270
+ }
271
+
272
+ // Configuration for reading Cloud Storage data in text format. Each line of
273
+ // text as specified by the delimiter will be set to the `data` field of a
274
+ // Pub/Sub message.
275
+ message TextFormat {
276
+ // Optional. When unset, '\n' is used.
277
+ optional string delimiter = 1 [(google.api.field_behavior) = OPTIONAL];
278
+ }
279
+
280
+ // Configuration for reading Cloud Storage data in Avro binary format. The
281
+ // bytes of each object will be set to the `data` field of a Pub/Sub
282
+ // message.
283
+ message AvroFormat {}
284
+
285
+ // Configuration for reading Cloud Storage data written via [Cloud Storage
286
+ // subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). The
287
+ // data and attributes fields of the originally exported Pub/Sub message
288
+ // will be restored when publishing.
289
+ message PubSubAvroFormat {}
290
+
291
+ // Output only. An output-only field that indicates the state of the Cloud
292
+ // Storage ingestion source.
293
+ State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
294
+
295
+ // Optional. Cloud Storage bucket. The bucket name must be without any
296
+ // prefix like "gs://". See the [bucket naming requirements]
297
+ // (https://cloud.google.com/storage/docs/buckets#naming).
298
+ string bucket = 2 [(google.api.field_behavior) = OPTIONAL];
299
+
300
+ // Defaults to text format.
301
+ oneof input_format {
302
+ // Optional. Data from Cloud Storage will be interpreted as text.
303
+ TextFormat text_format = 3 [(google.api.field_behavior) = OPTIONAL];
304
+
305
+ // Optional. Data from Cloud Storage will be interpreted in Avro format.
306
+ AvroFormat avro_format = 4 [(google.api.field_behavior) = OPTIONAL];
307
+
308
+ // Optional. It will be assumed data from Cloud Storage was written via
309
+ // [Cloud Storage
310
+ // subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage).
311
+ PubSubAvroFormat pubsub_avro_format = 5
312
+ [(google.api.field_behavior) = OPTIONAL];
313
+ }
314
+
315
+ // Optional. Only objects with a larger or equal creation timestamp will be
316
+ // ingested.
317
+ google.protobuf.Timestamp minimum_object_create_time = 6
318
+ [(google.api.field_behavior) = OPTIONAL];
319
+
320
+ // Optional. Glob pattern used to match objects that will be ingested. If
321
+ // unset, all objects will be ingested. See the [supported
322
+ // patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob).
323
+ string match_glob = 9 [(google.api.field_behavior) = OPTIONAL];
324
+ }
325
+
240
326
  // Only one source type can have settings set.
241
327
  oneof source {
242
328
  // Optional. Amazon Kinesis Data Streams.
243
329
  AwsKinesis aws_kinesis = 1 [(google.api.field_behavior) = OPTIONAL];
330
+
331
+ // Optional. Cloud Storage.
332
+ CloudStorage cloud_storage = 2 [(google.api.field_behavior) = OPTIONAL];
333
+ }
334
+
335
+ // Optional. Platform Logs settings. If unset, no Platform Logs will be
336
+ // generated.
337
+ PlatformLogsSettings platform_logs_settings = 4
338
+ [(google.api.field_behavior) = OPTIONAL];
339
+ }
340
+
341
+ // Settings for Platform Logs produced by Pub/Sub.
342
+ message PlatformLogsSettings {
343
+ // Severity levels of Platform Logs.
344
+ enum Severity {
345
+ // Default value. Logs level is unspecified. Logs will be disabled.
346
+ SEVERITY_UNSPECIFIED = 0;
347
+
348
+ // Logs will be disabled.
349
+ DISABLED = 1;
350
+
351
+ // Debug logs and higher-severity logs will be written.
352
+ DEBUG = 2;
353
+
354
+ // Info logs and higher-severity logs will be written.
355
+ INFO = 3;
356
+
357
+ // Warning logs and higher-severity logs will be written.
358
+ WARNING = 4;
359
+
360
+ // Only error logs will be written.
361
+ ERROR = 5;
362
+ }
363
+
364
+ // Optional. The minimum severity level of Platform Logs that will be written.
365
+ Severity severity = 1 [(google.api.field_behavior) = OPTIONAL];
366
+ }
367
+
368
+ // Payload of the Platform Log entry sent when a failure is encountered while
369
+ // ingesting.
370
+ message IngestionFailureEvent {
371
+ // Specifies the reason why some data may have been left out of
372
+ // the desired Pub/Sub message due to the API message limits
373
+ // (https://cloud.google.com/pubsub/quotas#resource_limits). For example,
374
+ // when the number of attributes is larger than 100, the number of
375
+ // attributes is truncated to 100 to respect the limit on the attribute count.
376
+ // Other attribute limits are treated similarly. When the size of the desired
377
+ // message would've been larger than 10MB, the message won't be published at
378
+ // all, and ingestion of the subsequent messages will proceed as normal.
379
+ message ApiViolationReason {}
380
+
381
+ // Set when an Avro file is unsupported or its format is not valid. When this
382
+ // occurs, one or more Avro objects won't be ingested.
383
+ message AvroFailureReason {}
384
+
385
+ // Failure when ingesting from a Cloud Storage source.
386
+ message CloudStorageFailure {
387
+ // Optional. Name of the Cloud Storage bucket used for ingestion.
388
+ string bucket = 1 [(google.api.field_behavior) = OPTIONAL];
389
+
390
+ // Optional. Name of the Cloud Storage object which contained the section
391
+ // that couldn't be ingested.
392
+ string object_name = 2 [(google.api.field_behavior) = OPTIONAL];
393
+
394
+ // Optional. Generation of the Cloud Storage object which contained the
395
+ // section that couldn't be ingested.
396
+ int64 object_generation = 3 [(google.api.field_behavior) = OPTIONAL];
397
+
398
+ // Reason why ingestion failed for the specified object.
399
+ oneof reason {
400
+ // Optional. Failure encountered when parsing an Avro file.
401
+ AvroFailureReason avro_failure_reason = 5
402
+ [(google.api.field_behavior) = OPTIONAL];
403
+
404
+ // Optional. The Pub/Sub API limits prevented the desired message from
405
+ // being published.
406
+ ApiViolationReason api_violation_reason = 6
407
+ [(google.api.field_behavior) = OPTIONAL];
408
+ }
409
+ }
410
+
411
+ // Required. Name of the import topic. Format is:
412
+ // projects/{project_name}/topics/{topic_name}.
413
+ string topic = 1 [(google.api.field_behavior) = REQUIRED];
414
+
415
+ // Required. Error details explaining why ingestion to Pub/Sub has failed.
416
+ string error_message = 2 [(google.api.field_behavior) = REQUIRED];
417
+
418
+ oneof failure {
419
+ // Optional. Failure when ingesting from Cloud Storage.
420
+ CloudStorageFailure cloud_storage_failure = 3
421
+ [(google.api.field_behavior) = OPTIONAL];
244
422
  }
245
423
  }
246
424
 
@@ -774,6 +952,20 @@ message Subscription {
774
952
  RESOURCE_ERROR = 2;
775
953
  }
776
954
 
955
+ // Information about an associated Analytics Hub subscription
956
+ // (https://cloud.google.com/bigquery/docs/analytics-hub-manage-subscriptions).
957
+ message AnalyticsHubSubscriptionInfo {
958
+ // Optional. The name of the associated Analytics Hub listing resource.
959
+ // Pattern:
960
+ // "projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}"
961
+ string listing = 1 [(google.api.field_behavior) = OPTIONAL];
962
+
963
+ // Optional. The name of the associated Analytics Hub subscription resource.
964
+ // Pattern:
965
+ // "projects/{project}/locations/{location}/subscriptions/{subscription}"
966
+ string subscription = 2 [(google.api.field_behavior) = OPTIONAL];
967
+ }
968
+
777
969
  // Required. The name of the subscription. It must have the format
778
970
  // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
779
971
  // start with a letter, and contain only letters (`[A-Za-z]`), numbers
@@ -837,7 +1029,7 @@ message Subscription {
837
1029
  // backlog, from the moment a message is published. If `retain_acked_messages`
838
1030
  // is true, then this also configures the retention of acknowledged messages,
839
1031
  // and thus configures how far back in time a `Seek` can be done. Defaults to
840
- // 7 days. Cannot be more than 7 days or less than 10 minutes.
1032
+ // 7 days. Cannot be more than 31 days or less than 10 minutes.
841
1033
  google.protobuf.Duration message_retention_duration = 8
842
1034
  [(google.api.field_behavior) = OPTIONAL];
843
1035
 
@@ -922,6 +1114,11 @@ message Subscription {
922
1114
  // Output only. An output-only field indicating whether or not the
923
1115
  // subscription can receive messages.
924
1116
  State state = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
1117
+
1118
+ // Output only. Information about the associated Analytics Hub subscription.
1119
+ // Only set if the subscritpion is created by Analytics Hub.
1120
+ AnalyticsHubSubscriptionInfo analytics_hub_subscription_info = 23
1121
+ [(google.api.field_behavior) = OUTPUT_ONLY];
925
1122
  }
926
1123
 
927
1124
  // A policy that specifies how Pub/Sub retries message delivery.