@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
@@ -18,6 +18,7 @@ export declare class PublisherClient {
18
18
  private _defaults;
19
19
  private _universeDomain;
20
20
  private _servicePath;
21
+ private _log;
21
22
  auth: gax.GoogleAuth;
22
23
  descriptors: Descriptors;
23
24
  warn: (code: string, message: string, warnType?: string) => void;
@@ -53,7 +54,7 @@ export declare class PublisherClient {
53
54
  * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
54
55
  * the environment variable GCLOUD_PROJECT for your project ID. If your
55
56
  * app is running in an environment which supports
56
- * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
57
+ * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
57
58
  * your project ID will be detected automatically.
58
59
  * @param {string} [options.apiEndpoint] - The domain name of the
59
60
  * API remote host.
@@ -160,12 +161,17 @@ export declare class PublisherClient {
160
161
  * Output only. An output-only field indicating the state of the topic.
161
162
  * @param {google.pubsub.v1.IngestionDataSourceSettings} [request.ingestionDataSourceSettings]
162
163
  * Optional. Settings for ingestion from a data source into this topic.
164
+ * @param {number[]} [request.messageTransforms]
165
+ * Optional. Transforms to be applied to messages published to the topic.
166
+ * Transforms are applied in the order specified.
163
167
  * @param {object} [options]
164
168
  * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
165
169
  * @returns {Promise} - The promise which resolves to an array.
166
170
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}.
167
171
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
168
172
  * for more details and examples.
173
+ * @example <caption>include:samples/generated/v1/publisher.create_topic.js</caption>
174
+ * region_tag:pubsub_v1_generated_Publisher_CreateTopic_async
169
175
  */
170
176
  createTopic(request?: protos.google.pubsub.v1.ITopic, options?: CallOptions): Promise<[
171
177
  protos.google.pubsub.v1.ITopic,
@@ -194,6 +200,8 @@ export declare class PublisherClient {
194
200
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}.
195
201
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
196
202
  * for more details and examples.
203
+ * @example <caption>include:samples/generated/v1/publisher.update_topic.js</caption>
204
+ * region_tag:pubsub_v1_generated_Publisher_UpdateTopic_async
197
205
  */
198
206
  updateTopic(request?: protos.google.pubsub.v1.IUpdateTopicRequest, options?: CallOptions): Promise<[
199
207
  protos.google.pubsub.v1.ITopic,
@@ -219,6 +227,8 @@ export declare class PublisherClient {
219
227
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.PublishResponse|PublishResponse}.
220
228
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
221
229
  * for more details and examples.
230
+ * @example <caption>include:samples/generated/v1/publisher.publish.js</caption>
231
+ * region_tag:pubsub_v1_generated_Publisher_Publish_async
222
232
  */
223
233
  publish(request?: protos.google.pubsub.v1.IPublishRequest, options?: CallOptions): Promise<[
224
234
  protos.google.pubsub.v1.IPublishResponse,
@@ -241,6 +251,8 @@ export declare class PublisherClient {
241
251
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.Topic|Topic}.
242
252
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
243
253
  * for more details and examples.
254
+ * @example <caption>include:samples/generated/v1/publisher.get_topic.js</caption>
255
+ * region_tag:pubsub_v1_generated_Publisher_GetTopic_async
244
256
  */
245
257
  getTopic(request?: protos.google.pubsub.v1.IGetTopicRequest, options?: CallOptions): Promise<[
246
258
  protos.google.pubsub.v1.ITopic,
@@ -267,6 +279,8 @@ export declare class PublisherClient {
267
279
  * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
268
280
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
269
281
  * for more details and examples.
282
+ * @example <caption>include:samples/generated/v1/publisher.delete_topic.js</caption>
283
+ * region_tag:pubsub_v1_generated_Publisher_DeleteTopic_async
270
284
  */
271
285
  deleteTopic(request?: protos.google.pubsub.v1.IDeleteTopicRequest, options?: CallOptions): Promise<[
272
286
  protos.google.protobuf.IEmpty,
@@ -292,6 +306,8 @@ export declare class PublisherClient {
292
306
  * The first element of the array is an object representing {@link protos.google.pubsub.v1.DetachSubscriptionResponse|DetachSubscriptionResponse}.
293
307
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
294
308
  * for more details and examples.
309
+ * @example <caption>include:samples/generated/v1/publisher.detach_subscription.js</caption>
310
+ * region_tag:pubsub_v1_generated_Publisher_DetachSubscription_async
295
311
  */
296
312
  detachSubscription(request?: protos.google.pubsub.v1.IDetachSubscriptionRequest, options?: CallOptions): Promise<[
297
313
  protos.google.pubsub.v1.IDetachSubscriptionResponse,
@@ -334,7 +350,7 @@ export declare class PublisherClient {
334
350
  listTopics(request: protos.google.pubsub.v1.IListTopicsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicsRequest, protos.google.pubsub.v1.IListTopicsResponse | null | undefined, protos.google.pubsub.v1.ITopic>): void;
335
351
  listTopics(request: protos.google.pubsub.v1.IListTopicsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicsRequest, protos.google.pubsub.v1.IListTopicsResponse | null | undefined, protos.google.pubsub.v1.ITopic>): void;
336
352
  /**
337
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
353
+ * Equivalent to `listTopics`, but returns a NodeJS Stream object.
338
354
  * @param {Object} request
339
355
  * The request object that will be sent.
340
356
  * @param {string} request.project
@@ -382,6 +398,8 @@ export declare class PublisherClient {
382
398
  * so you can stop the iteration when you don't need more results.
383
399
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
384
400
  * for more details and examples.
401
+ * @example <caption>include:samples/generated/v1/publisher.list_topics.js</caption>
402
+ * region_tag:pubsub_v1_generated_Publisher_ListTopics_async
385
403
  */
386
404
  listTopicsAsync(request?: protos.google.pubsub.v1.IListTopicsRequest, options?: CallOptions): AsyncIterable<protos.google.pubsub.v1.ITopic>;
387
405
  /**
@@ -418,7 +436,7 @@ export declare class PublisherClient {
418
436
  listTopicSubscriptions(request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicSubscriptionsRequest, protos.google.pubsub.v1.IListTopicSubscriptionsResponse | null | undefined, string>): void;
419
437
  listTopicSubscriptions(request: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicSubscriptionsRequest, protos.google.pubsub.v1.IListTopicSubscriptionsResponse | null | undefined, string>): void;
420
438
  /**
421
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
439
+ * Equivalent to `listTopicSubscriptions`, but returns a NodeJS Stream object.
422
440
  * @param {Object} request
423
441
  * The request object that will be sent.
424
442
  * @param {string} request.topic
@@ -466,6 +484,8 @@ export declare class PublisherClient {
466
484
  * so you can stop the iteration when you don't need more results.
467
485
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
468
486
  * for more details and examples.
487
+ * @example <caption>include:samples/generated/v1/publisher.list_topic_subscriptions.js</caption>
488
+ * region_tag:pubsub_v1_generated_Publisher_ListTopicSubscriptions_async
469
489
  */
470
490
  listTopicSubscriptionsAsync(request?: protos.google.pubsub.v1.IListTopicSubscriptionsRequest, options?: CallOptions): AsyncIterable<string>;
471
491
  /**
@@ -506,7 +526,7 @@ export declare class PublisherClient {
506
526
  listTopicSnapshots(request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicSnapshotsRequest, protos.google.pubsub.v1.IListTopicSnapshotsResponse | null | undefined, string>): void;
507
527
  listTopicSnapshots(request: protos.google.pubsub.v1.IListTopicSnapshotsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListTopicSnapshotsRequest, protos.google.pubsub.v1.IListTopicSnapshotsResponse | null | undefined, string>): void;
508
528
  /**
509
- * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
529
+ * Equivalent to `listTopicSnapshots`, but returns a NodeJS Stream object.
510
530
  * @param {Object} request
511
531
  * The request object that will be sent.
512
532
  * @param {string} request.topic
@@ -554,6 +574,8 @@ export declare class PublisherClient {
554
574
  * so you can stop the iteration when you don't need more results.
555
575
  * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
556
576
  * for more details and examples.
577
+ * @example <caption>include:samples/generated/v1/publisher.list_topic_snapshots.js</caption>
578
+ * region_tag:pubsub_v1_generated_Publisher_ListTopicSnapshots_async
557
579
  */
558
580
  listTopicSnapshotsAsync(request?: protos.google.pubsub.v1.IListTopicSnapshotsRequest, options?: CallOptions): AsyncIterable<string>;
559
581
  /**