@google-cloud/pubsub 4.10.0 → 5.0.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 (74) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +5 -2
  3. package/build/protos/protos.d.ts +6 -6
  4. package/build/protos/protos.js +423 -141
  5. package/build/protos/protos.json +39 -18
  6. package/build/src/debug.js +2 -0
  7. package/build/src/debug.js.map +1 -1
  8. package/build/src/default-options.d.ts +2 -2
  9. package/build/src/default-options.js +3 -3
  10. package/build/src/default-options.js.map +1 -1
  11. package/build/src/exponential-retry.js +4 -1
  12. package/build/src/exponential-retry.js.map +1 -1
  13. package/build/src/histogram.js +3 -0
  14. package/build/src/histogram.js.map +1 -1
  15. package/build/src/iam.js +3 -0
  16. package/build/src/iam.js.map +1 -1
  17. package/build/src/index.d.ts +0 -2
  18. package/build/src/index.js +1 -5
  19. package/build/src/index.js.map +1 -1
  20. package/build/src/lease-manager.d.ts +0 -3
  21. package/build/src/lease-manager.js +14 -19
  22. package/build/src/lease-manager.js.map +1 -1
  23. package/build/src/message-queues.js +31 -23
  24. package/build/src/message-queues.js.map +1 -1
  25. package/build/src/message-stream.js +13 -4
  26. package/build/src/message-stream.js.map +1 -1
  27. package/build/src/publisher/flow-control.js +4 -1
  28. package/build/src/publisher/flow-control.js.map +1 -1
  29. package/build/src/publisher/flow-publisher.js +5 -2
  30. package/build/src/publisher/flow-publisher.js.map +1 -1
  31. package/build/src/publisher/index.d.ts +0 -2
  32. package/build/src/publisher/index.js +11 -8
  33. package/build/src/publisher/index.js.map +1 -1
  34. package/build/src/publisher/message-batch.d.ts +0 -11
  35. package/build/src/publisher/message-batch.js +13 -1
  36. package/build/src/publisher/message-batch.js.map +1 -1
  37. package/build/src/publisher/message-queues.js +10 -3
  38. package/build/src/publisher/message-queues.js.map +1 -1
  39. package/build/src/publisher/publish-error.js +5 -0
  40. package/build/src/publisher/publish-error.js.map +1 -1
  41. package/build/src/publisher/pubsub-message.d.ts +0 -68
  42. package/build/src/pubsub.js +14 -5
  43. package/build/src/pubsub.js.map +1 -1
  44. package/build/src/schema.js +3 -0
  45. package/build/src/schema.js.map +1 -1
  46. package/build/src/snapshot.js +3 -0
  47. package/build/src/snapshot.js.map +1 -1
  48. package/build/src/subscriber.d.ts +11 -15
  49. package/build/src/subscriber.js +84 -26
  50. package/build/src/subscriber.js.map +1 -1
  51. package/build/src/subscription.js +11 -2
  52. package/build/src/subscription.js.map +1 -1
  53. package/build/src/telemetry-tracing.d.ts +2 -220
  54. package/build/src/telemetry-tracing.js +39 -111
  55. package/build/src/telemetry-tracing.js.map +1 -1
  56. package/build/src/temporal.js +8 -8
  57. package/build/src/temporal.js.map +1 -1
  58. package/build/src/topic.js +8 -1
  59. package/build/src/topic.js.map +1 -1
  60. package/build/src/util.js +3 -2
  61. package/build/src/util.js.map +1 -1
  62. package/build/src/v1/publisher_client.d.ts +26 -4
  63. package/build/src/v1/publisher_client.js +232 -90
  64. package/build/src/v1/publisher_client.js.map +1 -1
  65. package/build/src/v1/publisher_proto_list.json +4 -0
  66. package/build/src/v1/schema_service_client.d.ts +24 -3
  67. package/build/src/v1/schema_service_client.js +235 -75
  68. package/build/src/v1/schema_service_client.js.map +1 -1
  69. package/build/src/v1/schema_service_proto_list.json +4 -0
  70. package/build/src/v1/subscriber_client.d.ts +39 -3
  71. package/build/src/v1/subscriber_client.js +327 -97
  72. package/build/src/v1/subscriber_client.js.map +1 -1
  73. package/build/src/v1/subscriber_proto_list.json +4 -0
  74. package/package.json +43 -45
@@ -19,6 +19,7 @@ export declare class SubscriberClient {
19
19
  private _defaults;
20
20
  private _universeDomain;
21
21
  private _servicePath;
22
+ private _log;
22
23
  auth: gax.GoogleAuth;
23
24
  descriptors: Descriptors;
24
25
  warn: (code: string, message: string, warnType?: string) => void;
@@ -54,7 +55,7 @@ export declare class SubscriberClient {
54
55
  * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
55
56
  * the environment variable GCLOUD_PROJECT for your project ID. If your
56
57
  * app is running in an environment which supports
57
- * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
58
+ * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
58
59
  * your project ID will be detected automatically.
59
60
  * @param {string} [options.apiEndpoint] - The domain name of the
60
61
  * API remote host.
@@ -257,12 +258,17 @@ export declare class SubscriberClient {
257
258
  * @param {google.pubsub.v1.Subscription.AnalyticsHubSubscriptionInfo} request.analyticsHubSubscriptionInfo
258
259
  * Output only. Information about the associated Analytics Hub subscription.
259
260
  * Only set if the subscritpion is created by Analytics Hub.
261
+ * @param {number[]} [request.messageTransforms]
262
+ * Optional. Transforms to be applied to messages before they are delivered to
263
+ * subscribers. Transforms are applied in the order specified.
260
264
  * @param {object} [options]
261
265
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
262
266
  * @returns {Promise} - The promise which resolves to an array.
263
267
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}.
264
268
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
265
269
  * for more details and examples.
270
+ * @example <caption>include:samples/generated/v1/subscriber.create_subscription.js</caption>
271
+ * region_tag:pubsub_v1_generated_Subscriber_CreateSubscription_async
266
272
  */
267
273
  createSubscription(request?: protos.google.pubsub.v1.ISubscription, options?: CallOptions): Promise<[
268
274
  protos.google.pubsub.v1.ISubscription,
@@ -285,6 +291,8 @@ export declare class SubscriberClient {
285
291
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}.
286
292
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
287
293
  * for more details and examples.
294
+ * @example <caption>include:samples/generated/v1/subscriber.get_subscription.js</caption>
295
+ * region_tag:pubsub_v1_generated_Subscriber_GetSubscription_async
288
296
  */
289
297
  getSubscription(request?: protos.google.pubsub.v1.IGetSubscriptionRequest, options?: CallOptions): Promise<[
290
298
  protos.google.pubsub.v1.ISubscription,
@@ -311,6 +319,8 @@ export declare class SubscriberClient {
311
319
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.Subscription|Subscription}.
312
320
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
313
321
  * for more details and examples.
322
+ * @example <caption>include:samples/generated/v1/subscriber.update_subscription.js</caption>
323
+ * region_tag:pubsub_v1_generated_Subscriber_UpdateSubscription_async
314
324
  */
315
325
  updateSubscription(request?: protos.google.pubsub.v1.IUpdateSubscriptionRequest, options?: CallOptions): Promise<[
316
326
  protos.google.pubsub.v1.ISubscription,
@@ -337,6 +347,8 @@ export declare class SubscriberClient {
337
347
  * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
338
348
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
339
349
  * for more details and examples.
350
+ * @example <caption>include:samples/generated/v1/subscriber.delete_subscription.js</caption>
351
+ * region_tag:pubsub_v1_generated_Subscriber_DeleteSubscription_async
340
352
  */
341
353
  deleteSubscription(request?: protos.google.pubsub.v1.IDeleteSubscriptionRequest, options?: CallOptions): Promise<[
342
354
  protos.google.protobuf.IEmpty,
@@ -375,6 +387,8 @@ export declare class SubscriberClient {
375
387
  * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
376
388
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
377
389
  * for more details and examples.
390
+ * @example <caption>include:samples/generated/v1/subscriber.modify_ack_deadline.js</caption>
391
+ * region_tag:pubsub_v1_generated_Subscriber_ModifyAckDeadline_async
378
392
  */
379
393
  modifyAckDeadline(request?: protos.google.pubsub.v1.IModifyAckDeadlineRequest, options?: CallOptions): Promise<[
380
394
  protos.google.protobuf.IEmpty,
@@ -407,6 +421,8 @@ export declare class SubscriberClient {
407
421
  * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
408
422
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
409
423
  * for more details and examples.
424
+ * @example <caption>include:samples/generated/v1/subscriber.acknowledge.js</caption>
425
+ * region_tag:pubsub_v1_generated_Subscriber_Acknowledge_async
410
426
  */
411
427
  acknowledge(request?: protos.google.pubsub.v1.IAcknowledgeRequest, options?: CallOptions): Promise<[
412
428
  protos.google.protobuf.IEmpty,
@@ -441,6 +457,8 @@ export declare class SubscriberClient {
441
457
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.PullResponse|PullResponse}.
442
458
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
443
459
  * for more details and examples.
460
+ * @example <caption>include:samples/generated/v1/subscriber.pull.js</caption>
461
+ * region_tag:pubsub_v1_generated_Subscriber_Pull_async
444
462
  */
445
463
  pull(request?: protos.google.pubsub.v1.IPullRequest, options?: CallOptions): Promise<[
446
464
  protos.google.pubsub.v1.IPullResponse,
@@ -475,6 +493,8 @@ export declare class SubscriberClient {
475
493
  * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
476
494
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
477
495
  * for more details and examples.
496
+ * @example <caption>include:samples/generated/v1/subscriber.modify_push_config.js</caption>
497
+ * region_tag:pubsub_v1_generated_Subscriber_ModifyPushConfig_async
478
498
  */
479
499
  modifyPushConfig(request?: protos.google.pubsub.v1.IModifyPushConfigRequest, options?: CallOptions): Promise<[
480
500
  protos.google.protobuf.IEmpty,
@@ -501,6 +521,8 @@ export declare class SubscriberClient {
501
521
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}.
502
522
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
503
523
  * for more details and examples.
524
+ * @example <caption>include:samples/generated/v1/subscriber.get_snapshot.js</caption>
525
+ * region_tag:pubsub_v1_generated_Subscriber_GetSnapshot_async
504
526
  */
505
527
  getSnapshot(request?: protos.google.pubsub.v1.IGetSnapshotRequest, options?: CallOptions): Promise<[
506
528
  protos.google.pubsub.v1.ISnapshot,
@@ -555,6 +577,8 @@ export declare class SubscriberClient {
555
577
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}.
556
578
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
557
579
  * for more details and examples.
580
+ * @example <caption>include:samples/generated/v1/subscriber.create_snapshot.js</caption>
581
+ * region_tag:pubsub_v1_generated_Subscriber_CreateSnapshot_async
558
582
  */
559
583
  createSnapshot(request?: protos.google.pubsub.v1.ICreateSnapshotRequest, options?: CallOptions): Promise<[
560
584
  protos.google.pubsub.v1.ISnapshot,
@@ -584,6 +608,8 @@ export declare class SubscriberClient {
584
608
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.Snapshot|Snapshot}.
585
609
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
586
610
  * for more details and examples.
611
+ * @example <caption>include:samples/generated/v1/subscriber.update_snapshot.js</caption>
612
+ * region_tag:pubsub_v1_generated_Subscriber_UpdateSnapshot_async
587
613
  */
588
614
  updateSnapshot(request?: protos.google.pubsub.v1.IUpdateSnapshotRequest, options?: CallOptions): Promise<[
589
615
  protos.google.pubsub.v1.ISnapshot,
@@ -614,6 +640,8 @@ export declare class SubscriberClient {
614
640
  * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
615
641
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
616
642
  * for more details and examples.
643
+ * @example <caption>include:samples/generated/v1/subscriber.delete_snapshot.js</caption>
644
+ * region_tag:pubsub_v1_generated_Subscriber_DeleteSnapshot_async
617
645
  */
618
646
  deleteSnapshot(request?: protos.google.pubsub.v1.IDeleteSnapshotRequest, options?: CallOptions): Promise<[
619
647
  protos.google.protobuf.IEmpty,
@@ -657,6 +685,8 @@ export declare class SubscriberClient {
657
685
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.SeekResponse|SeekResponse}.
658
686
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
659
687
  * for more details and examples.
688
+ * @example <caption>include:samples/generated/v1/subscriber.seek.js</caption>
689
+ * region_tag:pubsub_v1_generated_Subscriber_Seek_async
660
690
  */
661
691
  seek(request?: protos.google.pubsub.v1.ISeekRequest, options?: CallOptions): Promise<[
662
692
  protos.google.pubsub.v1.ISeekResponse,
@@ -682,6 +712,8 @@ export declare class SubscriberClient {
682
712
  * will emit objects representing {@link protos.google.pubsub.v1.StreamingPullResponse|StreamingPullResponse} on 'data' event asynchronously.
683
713
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation }
684
714
  * for more details and examples.
715
+ * @example <caption>include:samples/generated/v1/subscriber.streaming_pull.js</caption>
716
+ * region_tag:pubsub_v1_generated_Subscriber_StreamingPull_async
685
717
  */
686
718
  streamingPull(options?: CallOptions): gax.CancellableStream;
687
719
  /**
@@ -718,7 +750,7 @@ export declare class SubscriberClient {
718
750
  listSubscriptions(request: protos.google.pubsub.v1.IListSubscriptionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListSubscriptionsRequest, protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, protos.google.pubsub.v1.ISubscription>): void;
719
751
  listSubscriptions(request: protos.google.pubsub.v1.IListSubscriptionsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListSubscriptionsRequest, protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, protos.google.pubsub.v1.ISubscription>): void;
720
752
  /**
721
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
753
+ * Equivalent to `listSubscriptions`, but returns a NodeJS Stream object.
722
754
  * @param {Object} request
723
755
  * The request object that will be sent.
724
756
  * @param {string} request.project
@@ -766,6 +798,8 @@ export declare class SubscriberClient {
766
798
  * so you can stop the iteration when you don't need more results.
767
799
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
768
800
  * for more details and examples.
801
+ * @example <caption>include:samples/generated/v1/subscriber.list_subscriptions.js</caption>
802
+ * region_tag:pubsub_v1_generated_Subscriber_ListSubscriptions_async
769
803
  */
770
804
  listSubscriptionsAsync(request?: protos.google.pubsub.v1.IListSubscriptionsRequest, options?: CallOptions): AsyncIterable<protos.google.pubsub.v1.ISubscription>;
771
805
  /**
@@ -806,7 +840,7 @@ export declare class SubscriberClient {
806
840
  listSnapshots(request: protos.google.pubsub.v1.IListSnapshotsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListSnapshotsRequest, protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, protos.google.pubsub.v1.ISnapshot>): void;
807
841
  listSnapshots(request: protos.google.pubsub.v1.IListSnapshotsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListSnapshotsRequest, protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, protos.google.pubsub.v1.ISnapshot>): void;
808
842
  /**
809
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
843
+ * Equivalent to `listSnapshots`, but returns a NodeJS Stream object.
810
844
  * @param {Object} request
811
845
  * The request object that will be sent.
812
846
  * @param {string} request.project
@@ -854,6 +888,8 @@ export declare class SubscriberClient {
854
888
  * so you can stop the iteration when you don't need more results.
855
889
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
856
890
  * for more details and examples.
891
+ * @example <caption>include:samples/generated/v1/subscriber.list_snapshots.js</caption>
892
+ * region_tag:pubsub_v1_generated_Subscriber_ListSnapshots_async
857
893
  */
858
894
  listSnapshotsAsync(request?: protos.google.pubsub.v1.IListSnapshotsRequest, options?: CallOptions): AsyncIterable<protos.google.pubsub.v1.ISnapshot>;
859
895
  /**