@google-cloud/pubsub 4.3.2 → 4.3.3-otel-beta.1

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 (56) hide show
  1. package/README.md +2 -0
  2. package/build/protos/google/pubsub/v1/pubsub.proto +8 -4
  3. package/build/protos/protos.d.ts +15 -0
  4. package/build/protos/protos.js +71 -5
  5. package/build/protos/protos.json +32 -1
  6. package/build/src/iam.d.ts +11 -2
  7. package/build/src/iam.js +12 -2
  8. package/build/src/iam.js.map +1 -1
  9. package/build/src/index.d.ts +2 -0
  10. package/build/src/index.js +5 -1
  11. package/build/src/index.js.map +1 -1
  12. package/build/src/lease-manager.d.ts +2 -2
  13. package/build/src/lease-manager.js +19 -3
  14. package/build/src/lease-manager.js.map +1 -1
  15. package/build/src/message-queues.d.ts +8 -3
  16. package/build/src/message-queues.js +17 -8
  17. package/build/src/message-queues.js.map +1 -1
  18. package/build/src/publisher/flow-publisher.js +5 -0
  19. package/build/src/publisher/flow-publisher.js.map +1 -1
  20. package/build/src/publisher/index.d.ts +3 -2
  21. package/build/src/publisher/index.js +23 -45
  22. package/build/src/publisher/index.js.map +1 -1
  23. package/build/src/publisher/message-batch.d.ts +7 -1
  24. package/build/src/publisher/message-batch.js +11 -1
  25. package/build/src/publisher/message-batch.js.map +1 -1
  26. package/build/src/publisher/message-queues.js +32 -6
  27. package/build/src/publisher/message-queues.js.map +1 -1
  28. package/build/src/publisher/pubsub-message.d.ts +36 -1
  29. package/build/src/publisher/pubsub-message.js +26 -1
  30. package/build/src/publisher/pubsub-message.js.map +1 -1
  31. package/build/src/pubsub.js +0 -14
  32. package/build/src/pubsub.js.map +1 -1
  33. package/build/src/subscriber.d.ts +72 -6
  34. package/build/src/subscriber.js +179 -51
  35. package/build/src/subscriber.js.map +1 -1
  36. package/build/src/subscription.d.ts +4 -2
  37. package/build/src/subscription.js +7 -4
  38. package/build/src/subscription.js.map +1 -1
  39. package/build/src/telemetry-tracing.d.ts +222 -0
  40. package/build/src/telemetry-tracing.js +543 -0
  41. package/build/src/telemetry-tracing.js.map +1 -0
  42. package/build/src/topic.d.ts +2 -1
  43. package/build/src/topic.js +8 -4
  44. package/build/src/topic.js.map +1 -1
  45. package/build/src/v1/publisher_client.d.ts +1 -2
  46. package/build/src/v1/publisher_client.js +10 -7
  47. package/build/src/v1/publisher_client.js.map +1 -1
  48. package/build/src/v1/schema_service_client.js +10 -7
  49. package/build/src/v1/schema_service_client.js.map +1 -1
  50. package/build/src/v1/subscriber_client.js +10 -7
  51. package/build/src/v1/subscriber_client.js.map +1 -1
  52. package/package.json +6 -5
  53. package/CHANGELOG.md +0 -1487
  54. package/build/src/opentelemetry-tracing.d.ts +0 -23
  55. package/build/src/opentelemetry-tracing.js +0 -42
  56. package/build/src/opentelemetry-tracing.js.map +0 -1
package/README.md CHANGED
@@ -137,6 +137,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-pubsub/tree
137
137
  | 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) |
138
138
  | 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) |
139
139
  | 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) |
140
+ | 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) |
140
141
  | 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) |
141
142
  | 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) |
142
143
  | Delete a previously created schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/deleteSchema.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/deleteSchema.js,samples/README.md) |
@@ -184,6 +185,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-pubsub/tree
184
185
  | Test Subscription Permissions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/testSubscriptionPermissions.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/testSubscriptionPermissions.js,samples/README.md) |
185
186
  | Test Topic Permissions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/testTopicPermissions.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/testTopicPermissions.js,samples/README.md) |
186
187
  | Update Dead Letter Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/updateDeadLetterPolicy.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/updateDeadLetterPolicy.js,samples/README.md) |
188
+ | Update Topic Ingestion Type | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/updateTopicIngestionType.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/updateTopicIngestionType.js,samples/README.md) |
187
189
  | Update Topic Schema | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/updateTopicSchema.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/updateTopicSchema.js,samples/README.md) |
188
190
  | Validate a schema definition | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/validateSchema.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/validateSchema.js,samples/README.md) |
189
191
 
@@ -183,7 +183,7 @@ message SchemaSettings {
183
183
  message IngestionDataSourceSettings {
184
184
  // Ingestion settings for Amazon Kinesis Data Streams.
185
185
  message AwsKinesis {
186
- // Possible states for managed ingestion from Amazon Kinesis Data Streams.
186
+ // Possible states for ingestion from Amazon Kinesis Data Streams.
187
187
  enum State {
188
188
  // Default value. This value is unused.
189
189
  STATE_UNSPECIFIED = 0;
@@ -203,7 +203,7 @@ message IngestionDataSourceSettings {
203
203
  KINESIS_PERMISSION_DENIED = 2;
204
204
 
205
205
  // Permission denied encountered while publishing to the topic. This can
206
- // happen due to Pub/Sub SA has not been granted the [appropriate publish
206
+ // happen if the Pub/Sub SA has not been granted the [appropriate publish
207
207
  // permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher)
208
208
  PUBLISH_PERMISSION_DENIED = 3;
209
209
 
@@ -312,8 +312,7 @@ message Topic {
312
312
  // Output only. An output-only field indicating the state of the topic.
313
313
  State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
314
314
 
315
- // Optional. Settings for managed ingestion from a data source into this
316
- // topic.
315
+ // Optional. Settings for ingestion from a data source into this topic.
317
316
  IngestionDataSourceSettings ingestion_data_source_settings = 10
318
317
  [(google.api.field_behavior) = OPTIONAL];
319
318
  }
@@ -1198,6 +1197,11 @@ message CloudStorageConfig {
1198
1197
  // Must not end in "/".
1199
1198
  string filename_suffix = 3 [(google.api.field_behavior) = OPTIONAL];
1200
1199
 
1200
+ // Optional. User-provided format string specifying how to represent datetimes
1201
+ // in Cloud Storage filenames. See the [datetime format
1202
+ // guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names).
1203
+ string filename_datetime_format = 10 [(google.api.field_behavior) = OPTIONAL];
1204
+
1201
1205
  // Defaults to text format.
1202
1206
  oneof output_format {
1203
1207
  // Optional. If set, message data will be written to Cloud Storage in text
@@ -3733,6 +3733,9 @@ export namespace google {
3733
3733
  /** CloudStorageConfig filenameSuffix */
3734
3734
  filenameSuffix?: (string|null);
3735
3735
 
3736
+ /** CloudStorageConfig filenameDatetimeFormat */
3737
+ filenameDatetimeFormat?: (string|null);
3738
+
3736
3739
  /** CloudStorageConfig textConfig */
3737
3740
  textConfig?: (google.pubsub.v1.CloudStorageConfig.ITextConfig|null);
3738
3741
 
@@ -3767,6 +3770,9 @@ export namespace google {
3767
3770
  /** CloudStorageConfig filenameSuffix. */
3768
3771
  public filenameSuffix: string;
3769
3772
 
3773
+ /** CloudStorageConfig filenameDatetimeFormat. */
3774
+ public filenameDatetimeFormat: string;
3775
+
3770
3776
  /** CloudStorageConfig textConfig. */
3771
3777
  public textConfig?: (google.pubsub.v1.CloudStorageConfig.ITextConfig|null);
3772
3778
 
@@ -9221,6 +9227,9 @@ export namespace google {
9221
9227
 
9222
9228
  /** Publishing protoReferenceDocumentationUri */
9223
9229
  protoReferenceDocumentationUri?: (string|null);
9230
+
9231
+ /** Publishing restReferenceDocumentationUri */
9232
+ restReferenceDocumentationUri?: (string|null);
9224
9233
  }
9225
9234
 
9226
9235
  /** Represents a Publishing. */
@@ -9262,6 +9271,9 @@ export namespace google {
9262
9271
  /** Publishing protoReferenceDocumentationUri. */
9263
9272
  public protoReferenceDocumentationUri: string;
9264
9273
 
9274
+ /** Publishing restReferenceDocumentationUri. */
9275
+ public restReferenceDocumentationUri: string;
9276
+
9265
9277
  /**
9266
9278
  * Creates a new Publishing instance using the specified properties.
9267
9279
  * @param [properties] Properties to set
@@ -13479,6 +13491,9 @@ export namespace google {
13479
13491
 
13480
13492
  /** ServiceOptions .google.api.oauthScopes */
13481
13493
  ".google.api.oauthScopes"?: (string|null);
13494
+
13495
+ /** ServiceOptions .google.api.apiVersion */
13496
+ ".google.api.apiVersion"?: (string|null);
13482
13497
  }
13483
13498
 
13484
13499
  /** Represents a ServiceOptions. */
@@ -8644,6 +8644,7 @@
8644
8644
  * @property {string|null} [bucket] CloudStorageConfig bucket
8645
8645
  * @property {string|null} [filenamePrefix] CloudStorageConfig filenamePrefix
8646
8646
  * @property {string|null} [filenameSuffix] CloudStorageConfig filenameSuffix
8647
+ * @property {string|null} [filenameDatetimeFormat] CloudStorageConfig filenameDatetimeFormat
8647
8648
  * @property {google.pubsub.v1.CloudStorageConfig.ITextConfig|null} [textConfig] CloudStorageConfig textConfig
8648
8649
  * @property {google.pubsub.v1.CloudStorageConfig.IAvroConfig|null} [avroConfig] CloudStorageConfig avroConfig
8649
8650
  * @property {google.protobuf.IDuration|null} [maxDuration] CloudStorageConfig maxDuration
@@ -8690,6 +8691,14 @@
8690
8691
  */
8691
8692
  CloudStorageConfig.prototype.filenameSuffix = "";
8692
8693
 
8694
+ /**
8695
+ * CloudStorageConfig filenameDatetimeFormat.
8696
+ * @member {string} filenameDatetimeFormat
8697
+ * @memberof google.pubsub.v1.CloudStorageConfig
8698
+ * @instance
8699
+ */
8700
+ CloudStorageConfig.prototype.filenameDatetimeFormat = "";
8701
+
8693
8702
  /**
8694
8703
  * CloudStorageConfig textConfig.
8695
8704
  * @member {google.pubsub.v1.CloudStorageConfig.ITextConfig|null|undefined} textConfig
@@ -8784,6 +8793,8 @@
8784
8793
  writer.uint32(/* id 7, wireType 0 =*/56).int64(message.maxBytes);
8785
8794
  if (message.state != null && Object.hasOwnProperty.call(message, "state"))
8786
8795
  writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state);
8796
+ if (message.filenameDatetimeFormat != null && Object.hasOwnProperty.call(message, "filenameDatetimeFormat"))
8797
+ writer.uint32(/* id 10, wireType 2 =*/82).string(message.filenameDatetimeFormat);
8787
8798
  return writer;
8788
8799
  };
8789
8800
 
@@ -8830,6 +8841,10 @@
8830
8841
  message.filenameSuffix = reader.string();
8831
8842
  break;
8832
8843
  }
8844
+ case 10: {
8845
+ message.filenameDatetimeFormat = reader.string();
8846
+ break;
8847
+ }
8833
8848
  case 4: {
8834
8849
  message.textConfig = $root.google.pubsub.v1.CloudStorageConfig.TextConfig.decode(reader, reader.uint32());
8835
8850
  break;
@@ -8895,6 +8910,9 @@
8895
8910
  if (message.filenameSuffix != null && message.hasOwnProperty("filenameSuffix"))
8896
8911
  if (!$util.isString(message.filenameSuffix))
8897
8912
  return "filenameSuffix: string expected";
8913
+ if (message.filenameDatetimeFormat != null && message.hasOwnProperty("filenameDatetimeFormat"))
8914
+ if (!$util.isString(message.filenameDatetimeFormat))
8915
+ return "filenameDatetimeFormat: string expected";
8898
8916
  if (message.textConfig != null && message.hasOwnProperty("textConfig")) {
8899
8917
  properties.outputFormat = 1;
8900
8918
  {
@@ -8953,6 +8971,8 @@
8953
8971
  message.filenamePrefix = String(object.filenamePrefix);
8954
8972
  if (object.filenameSuffix != null)
8955
8973
  message.filenameSuffix = String(object.filenameSuffix);
8974
+ if (object.filenameDatetimeFormat != null)
8975
+ message.filenameDatetimeFormat = String(object.filenameDatetimeFormat);
8956
8976
  if (object.textConfig != null) {
8957
8977
  if (typeof object.textConfig !== "object")
8958
8978
  throw TypeError(".google.pubsub.v1.CloudStorageConfig.textConfig: object expected");
@@ -9032,6 +9052,7 @@
9032
9052
  } else
9033
9053
  object.maxBytes = options.longs === String ? "0" : 0;
9034
9054
  object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
9055
+ object.filenameDatetimeFormat = "";
9035
9056
  }
9036
9057
  if (message.bucket != null && message.hasOwnProperty("bucket"))
9037
9058
  object.bucket = message.bucket;
@@ -9058,6 +9079,8 @@
9058
9079
  object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes;
9059
9080
  if (message.state != null && message.hasOwnProperty("state"))
9060
9081
  object.state = options.enums === String ? $root.google.pubsub.v1.CloudStorageConfig.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.CloudStorageConfig.State[message.state] : message.state;
9082
+ if (message.filenameDatetimeFormat != null && message.hasOwnProperty("filenameDatetimeFormat"))
9083
+ object.filenameDatetimeFormat = message.filenameDatetimeFormat;
9061
9084
  return object;
9062
9085
  };
9063
9086
 
@@ -21876,6 +21899,7 @@
21876
21899
  * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization
21877
21900
  * @property {Array.<google.api.IClientLibrarySettings>|null} [librarySettings] Publishing librarySettings
21878
21901
  * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri
21902
+ * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri
21879
21903
  */
21880
21904
 
21881
21905
  /**
@@ -21976,6 +22000,14 @@
21976
22000
  */
21977
22001
  Publishing.prototype.protoReferenceDocumentationUri = "";
21978
22002
 
22003
+ /**
22004
+ * Publishing restReferenceDocumentationUri.
22005
+ * @member {string} restReferenceDocumentationUri
22006
+ * @memberof google.api.Publishing
22007
+ * @instance
22008
+ */
22009
+ Publishing.prototype.restReferenceDocumentationUri = "";
22010
+
21979
22011
  /**
21980
22012
  * Creates a new Publishing instance using the specified properties.
21981
22013
  * @function create
@@ -22023,6 +22055,8 @@
22023
22055
  $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim();
22024
22056
  if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri"))
22025
22057
  writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri);
22058
+ if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri"))
22059
+ writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri);
22026
22060
  return writer;
22027
22061
  };
22028
22062
 
@@ -22103,6 +22137,10 @@
22103
22137
  message.protoReferenceDocumentationUri = reader.string();
22104
22138
  break;
22105
22139
  }
22140
+ case 111: {
22141
+ message.restReferenceDocumentationUri = reader.string();
22142
+ break;
22143
+ }
22106
22144
  default:
22107
22145
  reader.skipType(tag & 7);
22108
22146
  break;
@@ -22195,6 +22233,9 @@
22195
22233
  if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri"))
22196
22234
  if (!$util.isString(message.protoReferenceDocumentationUri))
22197
22235
  return "protoReferenceDocumentationUri: string expected";
22236
+ if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri"))
22237
+ if (!$util.isString(message.restReferenceDocumentationUri))
22238
+ return "restReferenceDocumentationUri: string expected";
22198
22239
  return null;
22199
22240
  };
22200
22241
 
@@ -22289,6 +22330,8 @@
22289
22330
  }
22290
22331
  if (object.protoReferenceDocumentationUri != null)
22291
22332
  message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri);
22333
+ if (object.restReferenceDocumentationUri != null)
22334
+ message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri);
22292
22335
  return message;
22293
22336
  };
22294
22337
 
@@ -22318,6 +22361,7 @@
22318
22361
  object.docTagPrefix = "";
22319
22362
  object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0;
22320
22363
  object.protoReferenceDocumentationUri = "";
22364
+ object.restReferenceDocumentationUri = "";
22321
22365
  }
22322
22366
  if (message.methodSettings && message.methodSettings.length) {
22323
22367
  object.methodSettings = [];
@@ -22348,6 +22392,8 @@
22348
22392
  }
22349
22393
  if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri"))
22350
22394
  object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri;
22395
+ if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri"))
22396
+ object.restReferenceDocumentationUri = message.restReferenceDocumentationUri;
22351
22397
  return object;
22352
22398
  };
22353
22399
 
@@ -32071,12 +32117,9 @@
32071
32117
  if (message.uninterpretedOption != null && message.uninterpretedOption.length)
32072
32118
  for (var i = 0; i < message.uninterpretedOption.length; ++i)
32073
32119
  $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
32074
- if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) {
32075
- writer.uint32(/* id 1052, wireType 2 =*/8418).fork();
32120
+ if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length)
32076
32121
  for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i)
32077
- writer.int32(message[".google.api.fieldBehavior"][i]);
32078
- writer.ldelim();
32079
- }
32122
+ writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]);
32080
32123
  if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference"))
32081
32124
  $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim();
32082
32125
  return writer;
@@ -33922,6 +33965,7 @@
33922
33965
  * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ServiceOptions uninterpretedOption
33923
33966
  * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost
33924
33967
  * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes
33968
+ * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion
33925
33969
  */
33926
33970
 
33927
33971
  /**
@@ -33980,6 +34024,14 @@
33980
34024
  */
33981
34025
  ServiceOptions.prototype[".google.api.oauthScopes"] = "";
33982
34026
 
34027
+ /**
34028
+ * ServiceOptions .google.api.apiVersion.
34029
+ * @member {string} .google.api.apiVersion
34030
+ * @memberof google.protobuf.ServiceOptions
34031
+ * @instance
34032
+ */
34033
+ ServiceOptions.prototype[".google.api.apiVersion"] = "";
34034
+
33983
34035
  /**
33984
34036
  * Creates a new ServiceOptions instance using the specified properties.
33985
34037
  * @function create
@@ -34015,6 +34067,8 @@
34015
34067
  writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]);
34016
34068
  if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes"))
34017
34069
  writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]);
34070
+ if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion"))
34071
+ writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]);
34018
34072
  return writer;
34019
34073
  };
34020
34074
 
@@ -34071,6 +34125,10 @@
34071
34125
  message[".google.api.oauthScopes"] = reader.string();
34072
34126
  break;
34073
34127
  }
34128
+ case 525000001: {
34129
+ message[".google.api.apiVersion"] = reader.string();
34130
+ break;
34131
+ }
34074
34132
  default:
34075
34133
  reader.skipType(tag & 7);
34076
34134
  break;
@@ -34129,6 +34187,9 @@
34129
34187
  if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes"))
34130
34188
  if (!$util.isString(message[".google.api.oauthScopes"]))
34131
34189
  return ".google.api.oauthScopes: string expected";
34190
+ if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion"))
34191
+ if (!$util.isString(message[".google.api.apiVersion"]))
34192
+ return ".google.api.apiVersion: string expected";
34132
34193
  return null;
34133
34194
  };
34134
34195
 
@@ -34165,6 +34226,8 @@
34165
34226
  message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]);
34166
34227
  if (object[".google.api.oauthScopes"] != null)
34167
34228
  message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]);
34229
+ if (object[".google.api.apiVersion"] != null)
34230
+ message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]);
34168
34231
  return message;
34169
34232
  };
34170
34233
 
@@ -34188,6 +34251,7 @@
34188
34251
  object.features = null;
34189
34252
  object[".google.api.defaultHost"] = "";
34190
34253
  object[".google.api.oauthScopes"] = "";
34254
+ object[".google.api.apiVersion"] = "";
34191
34255
  }
34192
34256
  if (message.deprecated != null && message.hasOwnProperty("deprecated"))
34193
34257
  object.deprecated = message.deprecated;
@@ -34202,6 +34266,8 @@
34202
34266
  object[".google.api.defaultHost"] = message[".google.api.defaultHost"];
34203
34267
  if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes"))
34204
34268
  object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"];
34269
+ if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion"))
34270
+ object[".google.api.apiVersion"] = message[".google.api.apiVersion"];
34205
34271
  return object;
34206
34272
  };
34207
34273
 
@@ -1320,6 +1320,13 @@
1320
1320
  "(google.api.field_behavior)": "OPTIONAL"
1321
1321
  }
1322
1322
  },
1323
+ "filenameDatetimeFormat": {
1324
+ "type": "string",
1325
+ "id": 10,
1326
+ "options": {
1327
+ "(google.api.field_behavior)": "OPTIONAL"
1328
+ }
1329
+ },
1323
1330
  "textConfig": {
1324
1331
  "type": "TextConfig",
1325
1332
  "id": 4,
@@ -2589,6 +2596,11 @@
2589
2596
  "id": 1050,
2590
2597
  "extend": "google.protobuf.ServiceOptions"
2591
2598
  },
2599
+ "apiVersion": {
2600
+ "type": "string",
2601
+ "id": 525000001,
2602
+ "extend": "google.protobuf.ServiceOptions"
2603
+ },
2592
2604
  "CommonLanguageSettings": {
2593
2605
  "fields": {
2594
2606
  "referenceDocsUri": {
@@ -2697,6 +2709,10 @@
2697
2709
  "protoReferenceDocumentationUri": {
2698
2710
  "type": "string",
2699
2711
  "id": 110
2712
+ },
2713
+ "restReferenceDocumentationUri": {
2714
+ "type": "string",
2715
+ "id": 111
2700
2716
  }
2701
2717
  }
2702
2718
  },
@@ -2872,7 +2888,10 @@
2872
2888
  "rule": "repeated",
2873
2889
  "type": "google.api.FieldBehavior",
2874
2890
  "id": 1052,
2875
- "extend": "google.protobuf.FieldOptions"
2891
+ "extend": "google.protobuf.FieldOptions",
2892
+ "options": {
2893
+ "packed": false
2894
+ }
2876
2895
  },
2877
2896
  "FieldBehavior": {
2878
2897
  "values": {
@@ -4070,9 +4089,21 @@
4070
4089
  1001,
4071
4090
  1001
4072
4091
  ],
4092
+ [
4093
+ 1002,
4094
+ 1002
4095
+ ],
4096
+ [
4097
+ 9990,
4098
+ 9990
4099
+ ],
4073
4100
  [
4074
4101
  9995,
4075
4102
  9999
4103
+ ],
4104
+ [
4105
+ 10000,
4106
+ 10000
4076
4107
  ]
4077
4108
  ],
4078
4109
  "reserved": [
@@ -23,6 +23,14 @@ export type GetPolicyCallback = RequestCallback<Policy>;
23
23
  export type SetPolicyCallback = RequestCallback<Policy>;
24
24
  export type SetPolicyResponse = [Policy];
25
25
  export type GetPolicyResponse = [Policy];
26
+ /**
27
+ * Allows us to get the most up to date full name of an object.
28
+ *
29
+ * @private
30
+ */
31
+ export interface Nameable {
32
+ name: string;
33
+ }
26
34
  /**
27
35
  * Shows which IAM permissions is allowed.
28
36
  * The key to this object are the IAM permissions (string) and the values are
@@ -79,8 +87,9 @@ export type TestIamPermissionsCallback = ResourceCallback<IamPermissionsMap, Iam
79
87
  export declare class IAM {
80
88
  pubsub: PubSub;
81
89
  request: typeof PubSub.prototype.request;
82
- id: string;
83
- constructor(pubsub: PubSub, id: string);
90
+ private nameable_;
91
+ constructor(pubsub: PubSub, nameOrNameable: Nameable | string);
92
+ get id(): string;
84
93
  /**
85
94
  * @typedef {array} GetPolicyResponse
86
95
  * @property {object} 0 The policy.
package/build/src/iam.js CHANGED
@@ -62,10 +62,20 @@ const util_1 = require("./util");
62
62
  * ```
63
63
  */
64
64
  class IAM {
65
- constructor(pubsub, id) {
65
+ constructor(pubsub, nameOrNameable) {
66
66
  this.pubsub = pubsub;
67
67
  this.request = pubsub.request.bind(pubsub);
68
- this.id = id;
68
+ if (typeof nameOrNameable === 'string') {
69
+ this.nameable_ = {
70
+ name: nameOrNameable,
71
+ };
72
+ }
73
+ else {
74
+ this.nameable_ = nameOrNameable;
75
+ }
76
+ }
77
+ get id() {
78
+ return this.nameable_.name;
69
79
  }
70
80
  getPolicy(optsOrCallback, callback) {
71
81
  const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {};
@@ -1 +1 @@
1
- {"version":3,"file":"iam.js","sourceRoot":"","sources":["../../src/iam.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;GAEG;AAEH,iCAAkC;AAIlC,iCAAqC;AA8BrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAa,GAAG;IAKd,YAAY,MAAc,EAAE,EAAU;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,CAAC,EAAE,GAAG,EAAE,CA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IAAI,EAAE,IAAK,CAAC,CAAC;gBAC5B,OAAO;YACT,CAAC;YAED,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAK,CAAC,WAAY,CAAC,CAAC;YACxD,MAAM,cAAc,GAClB,WACD,CAAC,MAAM,CACN,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE;gBAClB,GAAG,CAAC,UAAU,CAAC,GAAG,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;gBAChE,OAAO,GAAG,CAAC;YACb,CAAC,EACD,EAA8B,CAC/B,CAAC;YACF,QAAS,CAAC,IAAI,EAAE,cAAc,EAAE,IAAK,CAAC,CAAC;QACzC,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AA5TD,kBA4TC;AAED;;;;;GAKG;AACH,IAAA,oBAAa,EAAC,GAAG,EAAE,GAAG,CAAC,SAAS,EAAE;IAChC,WAAW;IACX,WAAW;IACX,iBAAiB;CAClB,CAAC,CAAC"}
@@ -98,3 +98,5 @@ export { Duration, TotalOfUnit, DurationLike } from './temporal';
98
98
  export { DebugMessage } from './debug';
99
99
  import * as protos from '../protos/protos';
100
100
  export { protos };
101
+ import { legacyExports } from './telemetry-tracing';
102
+ export { legacyExports as openTelemetry };
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.protos = exports.DebugMessage = exports.Duration = exports.Topic = exports.AckResponses = exports.AckError = exports.Subscription = exports.Encodings = exports.SchemaViews = exports.SchemaTypes = exports.Schema = exports.Message = exports.Snapshot = exports.PubSub = exports.PublishError = exports.IAM = exports.v1 = void 0;
18
+ exports.openTelemetry = exports.protos = exports.DebugMessage = exports.Duration = exports.Topic = exports.AckResponses = exports.AckError = exports.Subscription = exports.Encodings = exports.SchemaViews = exports.SchemaTypes = exports.Schema = exports.Message = exports.Snapshot = exports.PubSub = exports.PublishError = exports.IAM = exports.v1 = void 0;
19
19
  /**
20
20
  * @namespace google.pubsub.v1
21
21
  */
@@ -118,4 +118,8 @@ if (process.env.DEBUG_GRPC) {
118
118
  }
119
119
  const protos = require("../protos/protos");
120
120
  exports.protos = protos;
121
+ // Deprecated; please see the updated OpenTelemetry sample
122
+ // for an example of how to use telemetry in this library.
123
+ const telemetry_tracing_1 = require("./telemetry-tracing");
124
+ Object.defineProperty(exports, "openTelemetry", { enumerable: true, get: function () { return telemetry_tracing_1.legacyExports; } });
121
125
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;GAEG;AACH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;;;;;;;;;;GAWG;AAEH;;;;;;;;;;;GAWG;AACH,2BAA2B;AACnB,gBAAE;AAEV,6BAUe;AADb,0FAAA,GAAG,OAAA;AAIL,2DAAuD;AAA/C,6GAAA,YAAY,OAAA;AAEpB,mCAckB;AAFhB,gGAAA,MAAM,OAAA;AAGR,uCAMoB;AADlB,oGAAA,QAAQ,OAAA;AAEV,2CAAwD;AAAhD,qGAAA,OAAO,OAAA;AACf,mCAYkB;AAXhB,gGAAA,MAAM,OAAA;AAIN,qGAAA,WAAW,OAAA;AAIX,qGAAA,WAAW,OAAA;AACX,mGAAA,SAAS,OAAA;AAGX,+CAmBwB;AAJtB,4GAAA,YAAY,OAAA;AACZ,wGAAA,QAAQ,OAAA;AAER,4GAAA,YAAY,OAAA;AAEd,iCAciB;AAFf,8FAAA,KAAK,OAAA;AAGP,uCAA+D;AAAvD,oGAAA,QAAQ,OAAA;AAChB,iCAAqC;AAA7B,qGAAA,YAAY,OAAA;AAEpB,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;IAC3B,OAAO,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,O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IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AACD,2CAA2C;AACnC,wBAAM;AAEd,0DAA0D;AAC1D,0DAA0D;AAC1D,2DAAkD;AACzB,8FADjB,iCAAa,OACiB"}
@@ -81,10 +81,10 @@ export declare class LeaseManager extends EventEmitter {
81
81
  */
82
82
  add(message: Message): void;
83
83
  /**
84
- * Removes ALL messages from inventory.
84
+ * Removes ALL messages from inventory, and returns the ones removed.
85
85
  * @private
86
86
  */
87
- clear(): void;
87
+ clear(): Message[];
88
88
  /**
89
89
  * Indicates if we're at or over capacity.
90
90
  *
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.LeaseManager = void 0;
19
19
  const events_1 = require("events");
20
20
  const default_options_1 = require("./default-options");
21
+ const temporal_1 = require("./temporal");
21
22
  /**
22
23
  * @typedef {object} FlowControlOptions
23
24
  * @property {boolean} [allowExcessMessages=true] PubSub delivers messages in
@@ -83,6 +84,7 @@ class LeaseManager extends events_1.EventEmitter {
83
84
  const wasFull = this.isFull();
84
85
  this._messages.add(message);
85
86
  this.bytes += message.length;
87
+ message.subSpans.flowStart();
86
88
  if (allowExcessMessages || !wasFull) {
87
89
  this._dispense(message);
88
90
  }
@@ -98,18 +100,20 @@ class LeaseManager extends events_1.EventEmitter {
98
100
  }
99
101
  }
100
102
  /**
101
- * Removes ALL messages from inventory.
103
+ * Removes ALL messages from inventory, and returns the ones removed.
102
104
  * @private
103
105
  */
104
106
  clear() {
105
107
  const wasFull = this.isFull();
106
108
  this._pending = [];
109
+ const remaining = Array.from(this._messages);
107
110
  this._messages.clear();
108
111
  this.bytes = 0;
109
112
  if (wasFull) {
110
113
  process.nextTick(() => this.emit('free'));
111
114
  }
112
115
  this._cancelExtension();
116
+ return remaining;
113
117
  }
114
118
  /**
115
119
  * Indicates if we're at or over capacity.
@@ -204,7 +208,11 @@ class LeaseManager extends events_1.EventEmitter {
204
208
  */
205
209
  _dispense(message) {
206
210
  if (this._subscriber.isOpen) {
207
- process.nextTick(() => this._subscriber.emit('message', message));
211
+ message.subSpans.flowEnd();
212
+ process.nextTick(() => {
213
+ message.subSpans.processingStart(this._subscriber.name);
214
+ this._subscriber.emit('message', message);
215
+ });
208
216
  }
209
217
  }
210
218
  /**
@@ -219,16 +227,24 @@ class LeaseManager extends events_1.EventEmitter {
219
227
  // Lifespan here is in minutes.
220
228
  const lifespan = (Date.now() - message.received) / (60 * 1000);
221
229
  if (lifespan < this._options.maxExtensionMinutes) {
230
+ const deadlineDuration = temporal_1.Duration.from({ seconds: deadline });
231
+ message.subSpans.modAckStart(deadlineDuration, false);
222
232
  if (this._subscriber.isExactlyOnceDelivery) {
223
- message.modAckWithResponse(deadline).catch(e => {
233
+ message
234
+ .modAckWithResponse(deadline)
235
+ .catch(e => {
224
236
  // In the case of a permanent failure (temporary failures are retried),
225
237
  // we need to stop trying to lease-manage the message.
226
238
  message.ackFailed(e);
227
239
  this.remove(message);
240
+ })
241
+ .finally(() => {
242
+ message.subSpans.modAckEnd();
228
243
  });
229
244
  }
230
245
  else {
231
246
  message.modAck(deadline);
247
+ message.subSpans.modAckStart(deadlineDuration, false);
232
248
  }
233
249
  }
234
250
  else {