@google-cloud/pubsub 3.6.0 → 3.7.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,20 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/@google-cloud/pubsub?activeTab=versions
6
6
 
7
+ ## [3.7.1](https://github.com/googleapis/nodejs-pubsub/compare/v3.7.0...v3.7.1) (2023-06-08)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * Don't crash if an already-drained/removed queue gets flushed again ([#1747](https://github.com/googleapis/nodejs-pubsub/issues/1747)) ([52ea441](https://github.com/googleapis/nodejs-pubsub/commit/52ea441fee302aa6c400b58d4ecebbc96a2ea5ea))
13
+
14
+ ## [3.7.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.6.0...v3.7.0) (2023-05-26)
15
+
16
+
17
+ ### Features
18
+
19
+ * Add push config wrapper fields ([#1730](https://github.com/googleapis/nodejs-pubsub/issues/1730)) ([a552719](https://github.com/googleapis/nodejs-pubsub/commit/a552719dfebda4c1263c352ea99bf8f9570290b7))
20
+
7
21
  ## [3.6.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.5.2...v3.6.0) (2023-05-12)
8
22
 
9
23
 
@@ -903,6 +903,19 @@ message PushConfig {
903
903
  string audience = 2;
904
904
  }
905
905
 
906
+ // The payload to the push endpoint is in the form of the JSON representation
907
+ // of a PubsubMessage
908
+ // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
909
+ message PubsubWrapper {}
910
+
911
+ // Sets the `data` field as the HTTP body for delivery.
912
+ message NoWrapper {
913
+ // When true, writes the Pub/Sub message metadata to
914
+ // `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
915
+ // Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
916
+ bool write_metadata = 1;
917
+ }
918
+
906
919
  // A URL locating the endpoint to which messages should be pushed.
907
920
  // For example, a Webhook endpoint might use `https://example.com/push`.
908
921
  string push_endpoint = 1;
@@ -940,6 +953,18 @@ message PushConfig {
940
953
  // `Authorization` header in the HTTP request for every pushed message.
941
954
  OidcToken oidc_token = 3;
942
955
  }
956
+
957
+ // The format of the delivered message to the push endpoint is defined by
958
+ // the chosen wrapper. When unset, `PubsubWrapper` is used.
959
+ oneof wrapper {
960
+ // When set, the payload to the push endpoint is in the form of the JSON
961
+ // representation of a PubsubMessage
962
+ // (https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).
963
+ PubsubWrapper pubsub_wrapper = 4;
964
+
965
+ // When set, the payload to the push endpoint is not wrapped.
966
+ NoWrapper no_wrapper = 5;
967
+ }
943
968
  }
944
969
 
945
970
  // Configuration for a BigQuery subscription.
@@ -2906,6 +2906,12 @@ export namespace google {
2906
2906
 
2907
2907
  /** PushConfig oidcToken */
2908
2908
  oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null);
2909
+
2910
+ /** PushConfig pubsubWrapper */
2911
+ pubsubWrapper?: (google.pubsub.v1.PushConfig.IPubsubWrapper|null);
2912
+
2913
+ /** PushConfig noWrapper */
2914
+ noWrapper?: (google.pubsub.v1.PushConfig.INoWrapper|null);
2909
2915
  }
2910
2916
 
2911
2917
  /** Represents a PushConfig. */
@@ -2926,9 +2932,18 @@ export namespace google {
2926
2932
  /** PushConfig oidcToken. */
2927
2933
  public oidcToken?: (google.pubsub.v1.PushConfig.IOidcToken|null);
2928
2934
 
2935
+ /** PushConfig pubsubWrapper. */
2936
+ public pubsubWrapper?: (google.pubsub.v1.PushConfig.IPubsubWrapper|null);
2937
+
2938
+ /** PushConfig noWrapper. */
2939
+ public noWrapper?: (google.pubsub.v1.PushConfig.INoWrapper|null);
2940
+
2929
2941
  /** PushConfig authenticationMethod. */
2930
2942
  public authenticationMethod?: "oidcToken";
2931
2943
 
2944
+ /** PushConfig wrapper. */
2945
+ public wrapper?: ("pubsubWrapper"|"noWrapper");
2946
+
2932
2947
  /**
2933
2948
  * Creates a new PushConfig instance using the specified properties.
2934
2949
  * @param [properties] Properties to set
@@ -3111,6 +3126,194 @@ export namespace google {
3111
3126
  */
3112
3127
  public static getTypeUrl(typeUrlPrefix?: string): string;
3113
3128
  }
3129
+
3130
+ /** Properties of a PubsubWrapper. */
3131
+ interface IPubsubWrapper {
3132
+ }
3133
+
3134
+ /** Represents a PubsubWrapper. */
3135
+ class PubsubWrapper implements IPubsubWrapper {
3136
+
3137
+ /**
3138
+ * Constructs a new PubsubWrapper.
3139
+ * @param [properties] Properties to set
3140
+ */
3141
+ constructor(properties?: google.pubsub.v1.PushConfig.IPubsubWrapper);
3142
+
3143
+ /**
3144
+ * Creates a new PubsubWrapper instance using the specified properties.
3145
+ * @param [properties] Properties to set
3146
+ * @returns PubsubWrapper instance
3147
+ */
3148
+ public static create(properties?: google.pubsub.v1.PushConfig.IPubsubWrapper): google.pubsub.v1.PushConfig.PubsubWrapper;
3149
+
3150
+ /**
3151
+ * Encodes the specified PubsubWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages.
3152
+ * @param message PubsubWrapper message or plain object to encode
3153
+ * @param [writer] Writer to encode to
3154
+ * @returns Writer
3155
+ */
3156
+ public static encode(message: google.pubsub.v1.PushConfig.IPubsubWrapper, writer?: $protobuf.Writer): $protobuf.Writer;
3157
+
3158
+ /**
3159
+ * Encodes the specified PubsubWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages.
3160
+ * @param message PubsubWrapper message or plain object to encode
3161
+ * @param [writer] Writer to encode to
3162
+ * @returns Writer
3163
+ */
3164
+ public static encodeDelimited(message: google.pubsub.v1.PushConfig.IPubsubWrapper, writer?: $protobuf.Writer): $protobuf.Writer;
3165
+
3166
+ /**
3167
+ * Decodes a PubsubWrapper message from the specified reader or buffer.
3168
+ * @param reader Reader or buffer to decode from
3169
+ * @param [length] Message length if known beforehand
3170
+ * @returns PubsubWrapper
3171
+ * @throws {Error} If the payload is not a reader or valid buffer
3172
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3173
+ */
3174
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig.PubsubWrapper;
3175
+
3176
+ /**
3177
+ * Decodes a PubsubWrapper message from the specified reader or buffer, length delimited.
3178
+ * @param reader Reader or buffer to decode from
3179
+ * @returns PubsubWrapper
3180
+ * @throws {Error} If the payload is not a reader or valid buffer
3181
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3182
+ */
3183
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig.PubsubWrapper;
3184
+
3185
+ /**
3186
+ * Verifies a PubsubWrapper message.
3187
+ * @param message Plain object to verify
3188
+ * @returns `null` if valid, otherwise the reason why it is not
3189
+ */
3190
+ public static verify(message: { [k: string]: any }): (string|null);
3191
+
3192
+ /**
3193
+ * Creates a PubsubWrapper message from a plain object. Also converts values to their respective internal types.
3194
+ * @param object Plain object
3195
+ * @returns PubsubWrapper
3196
+ */
3197
+ public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.PubsubWrapper;
3198
+
3199
+ /**
3200
+ * Creates a plain object from a PubsubWrapper message. Also converts values to other types if specified.
3201
+ * @param message PubsubWrapper
3202
+ * @param [options] Conversion options
3203
+ * @returns Plain object
3204
+ */
3205
+ public static toObject(message: google.pubsub.v1.PushConfig.PubsubWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any };
3206
+
3207
+ /**
3208
+ * Converts this PubsubWrapper to JSON.
3209
+ * @returns JSON object
3210
+ */
3211
+ public toJSON(): { [k: string]: any };
3212
+
3213
+ /**
3214
+ * Gets the default type url for PubsubWrapper
3215
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
3216
+ * @returns The default type url
3217
+ */
3218
+ public static getTypeUrl(typeUrlPrefix?: string): string;
3219
+ }
3220
+
3221
+ /** Properties of a NoWrapper. */
3222
+ interface INoWrapper {
3223
+
3224
+ /** NoWrapper writeMetadata */
3225
+ writeMetadata?: (boolean|null);
3226
+ }
3227
+
3228
+ /** Represents a NoWrapper. */
3229
+ class NoWrapper implements INoWrapper {
3230
+
3231
+ /**
3232
+ * Constructs a new NoWrapper.
3233
+ * @param [properties] Properties to set
3234
+ */
3235
+ constructor(properties?: google.pubsub.v1.PushConfig.INoWrapper);
3236
+
3237
+ /** NoWrapper writeMetadata. */
3238
+ public writeMetadata: boolean;
3239
+
3240
+ /**
3241
+ * Creates a new NoWrapper instance using the specified properties.
3242
+ * @param [properties] Properties to set
3243
+ * @returns NoWrapper instance
3244
+ */
3245
+ public static create(properties?: google.pubsub.v1.PushConfig.INoWrapper): google.pubsub.v1.PushConfig.NoWrapper;
3246
+
3247
+ /**
3248
+ * Encodes the specified NoWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages.
3249
+ * @param message NoWrapper message or plain object to encode
3250
+ * @param [writer] Writer to encode to
3251
+ * @returns Writer
3252
+ */
3253
+ public static encode(message: google.pubsub.v1.PushConfig.INoWrapper, writer?: $protobuf.Writer): $protobuf.Writer;
3254
+
3255
+ /**
3256
+ * Encodes the specified NoWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages.
3257
+ * @param message NoWrapper message or plain object to encode
3258
+ * @param [writer] Writer to encode to
3259
+ * @returns Writer
3260
+ */
3261
+ public static encodeDelimited(message: google.pubsub.v1.PushConfig.INoWrapper, writer?: $protobuf.Writer): $protobuf.Writer;
3262
+
3263
+ /**
3264
+ * Decodes a NoWrapper message from the specified reader or buffer.
3265
+ * @param reader Reader or buffer to decode from
3266
+ * @param [length] Message length if known beforehand
3267
+ * @returns NoWrapper
3268
+ * @throws {Error} If the payload is not a reader or valid buffer
3269
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3270
+ */
3271
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.pubsub.v1.PushConfig.NoWrapper;
3272
+
3273
+ /**
3274
+ * Decodes a NoWrapper message from the specified reader or buffer, length delimited.
3275
+ * @param reader Reader or buffer to decode from
3276
+ * @returns NoWrapper
3277
+ * @throws {Error} If the payload is not a reader or valid buffer
3278
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3279
+ */
3280
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.pubsub.v1.PushConfig.NoWrapper;
3281
+
3282
+ /**
3283
+ * Verifies a NoWrapper message.
3284
+ * @param message Plain object to verify
3285
+ * @returns `null` if valid, otherwise the reason why it is not
3286
+ */
3287
+ public static verify(message: { [k: string]: any }): (string|null);
3288
+
3289
+ /**
3290
+ * Creates a NoWrapper message from a plain object. Also converts values to their respective internal types.
3291
+ * @param object Plain object
3292
+ * @returns NoWrapper
3293
+ */
3294
+ public static fromObject(object: { [k: string]: any }): google.pubsub.v1.PushConfig.NoWrapper;
3295
+
3296
+ /**
3297
+ * Creates a plain object from a NoWrapper message. Also converts values to other types if specified.
3298
+ * @param message NoWrapper
3299
+ * @param [options] Conversion options
3300
+ * @returns Plain object
3301
+ */
3302
+ public static toObject(message: google.pubsub.v1.PushConfig.NoWrapper, options?: $protobuf.IConversionOptions): { [k: string]: any };
3303
+
3304
+ /**
3305
+ * Converts this NoWrapper to JSON.
3306
+ * @returns JSON object
3307
+ */
3308
+ public toJSON(): { [k: string]: any };
3309
+
3310
+ /**
3311
+ * Gets the default type url for NoWrapper
3312
+ * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
3313
+ * @returns The default type url
3314
+ */
3315
+ public static getTypeUrl(typeUrlPrefix?: string): string;
3316
+ }
3114
3317
  }
3115
3318
 
3116
3319
  /** Properties of a BigQueryConfig. */
@@ -6571,6 +6571,8 @@
6571
6571
  * @property {string|null} [pushEndpoint] PushConfig pushEndpoint
6572
6572
  * @property {Object.<string,string>|null} [attributes] PushConfig attributes
6573
6573
  * @property {google.pubsub.v1.PushConfig.IOidcToken|null} [oidcToken] PushConfig oidcToken
6574
+ * @property {google.pubsub.v1.PushConfig.IPubsubWrapper|null} [pubsubWrapper] PushConfig pubsubWrapper
6575
+ * @property {google.pubsub.v1.PushConfig.INoWrapper|null} [noWrapper] PushConfig noWrapper
6574
6576
  */
6575
6577
 
6576
6578
  /**
@@ -6613,6 +6615,22 @@
6613
6615
  */
6614
6616
  PushConfig.prototype.oidcToken = null;
6615
6617
 
6618
+ /**
6619
+ * PushConfig pubsubWrapper.
6620
+ * @member {google.pubsub.v1.PushConfig.IPubsubWrapper|null|undefined} pubsubWrapper
6621
+ * @memberof google.pubsub.v1.PushConfig
6622
+ * @instance
6623
+ */
6624
+ PushConfig.prototype.pubsubWrapper = null;
6625
+
6626
+ /**
6627
+ * PushConfig noWrapper.
6628
+ * @member {google.pubsub.v1.PushConfig.INoWrapper|null|undefined} noWrapper
6629
+ * @memberof google.pubsub.v1.PushConfig
6630
+ * @instance
6631
+ */
6632
+ PushConfig.prototype.noWrapper = null;
6633
+
6616
6634
  // OneOf field names bound to virtual getters and setters
6617
6635
  var $oneOfFields;
6618
6636
 
@@ -6627,6 +6645,17 @@
6627
6645
  set: $util.oneOfSetter($oneOfFields)
6628
6646
  });
6629
6647
 
6648
+ /**
6649
+ * PushConfig wrapper.
6650
+ * @member {"pubsubWrapper"|"noWrapper"|undefined} wrapper
6651
+ * @memberof google.pubsub.v1.PushConfig
6652
+ * @instance
6653
+ */
6654
+ Object.defineProperty(PushConfig.prototype, "wrapper", {
6655
+ get: $util.oneOfGetter($oneOfFields = ["pubsubWrapper", "noWrapper"]),
6656
+ set: $util.oneOfSetter($oneOfFields)
6657
+ });
6658
+
6630
6659
  /**
6631
6660
  * Creates a new PushConfig instance using the specified properties.
6632
6661
  * @function create
@@ -6658,6 +6687,10 @@
6658
6687
  writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.attributes[keys[i]]).ldelim();
6659
6688
  if (message.oidcToken != null && Object.hasOwnProperty.call(message, "oidcToken"))
6660
6689
  $root.google.pubsub.v1.PushConfig.OidcToken.encode(message.oidcToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
6690
+ if (message.pubsubWrapper != null && Object.hasOwnProperty.call(message, "pubsubWrapper"))
6691
+ $root.google.pubsub.v1.PushConfig.PubsubWrapper.encode(message.pubsubWrapper, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
6692
+ if (message.noWrapper != null && Object.hasOwnProperty.call(message, "noWrapper"))
6693
+ $root.google.pubsub.v1.PushConfig.NoWrapper.encode(message.noWrapper, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
6661
6694
  return writer;
6662
6695
  };
6663
6696
 
@@ -6723,6 +6756,14 @@
6723
6756
  message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.decode(reader, reader.uint32());
6724
6757
  break;
6725
6758
  }
6759
+ case 4: {
6760
+ message.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.decode(reader, reader.uint32());
6761
+ break;
6762
+ }
6763
+ case 5: {
6764
+ message.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.decode(reader, reader.uint32());
6765
+ break;
6766
+ }
6726
6767
  default:
6727
6768
  reader.skipType(tag & 7);
6728
6769
  break;
@@ -6778,6 +6819,24 @@
6778
6819
  return "oidcToken." + error;
6779
6820
  }
6780
6821
  }
6822
+ if (message.pubsubWrapper != null && message.hasOwnProperty("pubsubWrapper")) {
6823
+ properties.wrapper = 1;
6824
+ {
6825
+ var error = $root.google.pubsub.v1.PushConfig.PubsubWrapper.verify(message.pubsubWrapper);
6826
+ if (error)
6827
+ return "pubsubWrapper." + error;
6828
+ }
6829
+ }
6830
+ if (message.noWrapper != null && message.hasOwnProperty("noWrapper")) {
6831
+ if (properties.wrapper === 1)
6832
+ return "wrapper: multiple values";
6833
+ properties.wrapper = 1;
6834
+ {
6835
+ var error = $root.google.pubsub.v1.PushConfig.NoWrapper.verify(message.noWrapper);
6836
+ if (error)
6837
+ return "noWrapper." + error;
6838
+ }
6839
+ }
6781
6840
  return null;
6782
6841
  };
6783
6842
 
@@ -6807,6 +6866,16 @@
6807
6866
  throw TypeError(".google.pubsub.v1.PushConfig.oidcToken: object expected");
6808
6867
  message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.fromObject(object.oidcToken);
6809
6868
  }
6869
+ if (object.pubsubWrapper != null) {
6870
+ if (typeof object.pubsubWrapper !== "object")
6871
+ throw TypeError(".google.pubsub.v1.PushConfig.pubsubWrapper: object expected");
6872
+ message.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.fromObject(object.pubsubWrapper);
6873
+ }
6874
+ if (object.noWrapper != null) {
6875
+ if (typeof object.noWrapper !== "object")
6876
+ throw TypeError(".google.pubsub.v1.PushConfig.noWrapper: object expected");
6877
+ message.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.fromObject(object.noWrapper);
6878
+ }
6810
6879
  return message;
6811
6880
  };
6812
6881
 
@@ -6840,6 +6909,16 @@
6840
6909
  if (options.oneofs)
6841
6910
  object.authenticationMethod = "oidcToken";
6842
6911
  }
6912
+ if (message.pubsubWrapper != null && message.hasOwnProperty("pubsubWrapper")) {
6913
+ object.pubsubWrapper = $root.google.pubsub.v1.PushConfig.PubsubWrapper.toObject(message.pubsubWrapper, options);
6914
+ if (options.oneofs)
6915
+ object.wrapper = "pubsubWrapper";
6916
+ }
6917
+ if (message.noWrapper != null && message.hasOwnProperty("noWrapper")) {
6918
+ object.noWrapper = $root.google.pubsub.v1.PushConfig.NoWrapper.toObject(message.noWrapper, options);
6919
+ if (options.oneofs)
6920
+ object.wrapper = "noWrapper";
6921
+ }
6843
6922
  return object;
6844
6923
  };
6845
6924
 
@@ -7096,6 +7175,384 @@
7096
7175
  return OidcToken;
7097
7176
  })();
7098
7177
 
7178
+ PushConfig.PubsubWrapper = (function() {
7179
+
7180
+ /**
7181
+ * Properties of a PubsubWrapper.
7182
+ * @memberof google.pubsub.v1.PushConfig
7183
+ * @interface IPubsubWrapper
7184
+ */
7185
+
7186
+ /**
7187
+ * Constructs a new PubsubWrapper.
7188
+ * @memberof google.pubsub.v1.PushConfig
7189
+ * @classdesc Represents a PubsubWrapper.
7190
+ * @implements IPubsubWrapper
7191
+ * @constructor
7192
+ * @param {google.pubsub.v1.PushConfig.IPubsubWrapper=} [properties] Properties to set
7193
+ */
7194
+ function PubsubWrapper(properties) {
7195
+ if (properties)
7196
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
7197
+ if (properties[keys[i]] != null)
7198
+ this[keys[i]] = properties[keys[i]];
7199
+ }
7200
+
7201
+ /**
7202
+ * Creates a new PubsubWrapper instance using the specified properties.
7203
+ * @function create
7204
+ * @memberof google.pubsub.v1.PushConfig.PubsubWrapper
7205
+ * @static
7206
+ * @param {google.pubsub.v1.PushConfig.IPubsubWrapper=} [properties] Properties to set
7207
+ * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper instance
7208
+ */
7209
+ PubsubWrapper.create = function create(properties) {
7210
+ return new PubsubWrapper(properties);
7211
+ };
7212
+
7213
+ /**
7214
+ * Encodes the specified PubsubWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages.
7215
+ * @function encode
7216
+ * @memberof google.pubsub.v1.PushConfig.PubsubWrapper
7217
+ * @static
7218
+ * @param {google.pubsub.v1.PushConfig.IPubsubWrapper} message PubsubWrapper message or plain object to encode
7219
+ * @param {$protobuf.Writer} [writer] Writer to encode to
7220
+ * @returns {$protobuf.Writer} Writer
7221
+ */
7222
+ PubsubWrapper.encode = function encode(message, writer) {
7223
+ if (!writer)
7224
+ writer = $Writer.create();
7225
+ return writer;
7226
+ };
7227
+
7228
+ /**
7229
+ * Encodes the specified PubsubWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.PubsubWrapper.verify|verify} messages.
7230
+ * @function encodeDelimited
7231
+ * @memberof google.pubsub.v1.PushConfig.PubsubWrapper
7232
+ * @static
7233
+ * @param {google.pubsub.v1.PushConfig.IPubsubWrapper} message PubsubWrapper message or plain object to encode
7234
+ * @param {$protobuf.Writer} [writer] Writer to encode to
7235
+ * @returns {$protobuf.Writer} Writer
7236
+ */
7237
+ PubsubWrapper.encodeDelimited = function encodeDelimited(message, writer) {
7238
+ return this.encode(message, writer).ldelim();
7239
+ };
7240
+
7241
+ /**
7242
+ * Decodes a PubsubWrapper message from the specified reader or buffer.
7243
+ * @function decode
7244
+ * @memberof google.pubsub.v1.PushConfig.PubsubWrapper
7245
+ * @static
7246
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7247
+ * @param {number} [length] Message length if known beforehand
7248
+ * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper
7249
+ * @throws {Error} If the payload is not a reader or valid buffer
7250
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
7251
+ */
7252
+ PubsubWrapper.decode = function decode(reader, length) {
7253
+ if (!(reader instanceof $Reader))
7254
+ reader = $Reader.create(reader);
7255
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig.PubsubWrapper();
7256
+ while (reader.pos < end) {
7257
+ var tag = reader.uint32();
7258
+ switch (tag >>> 3) {
7259
+ default:
7260
+ reader.skipType(tag & 7);
7261
+ break;
7262
+ }
7263
+ }
7264
+ return message;
7265
+ };
7266
+
7267
+ /**
7268
+ * Decodes a PubsubWrapper message from the specified reader or buffer, length delimited.
7269
+ * @function decodeDelimited
7270
+ * @memberof google.pubsub.v1.PushConfig.PubsubWrapper
7271
+ * @static
7272
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7273
+ * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper
7274
+ * @throws {Error} If the payload is not a reader or valid buffer
7275
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
7276
+ */
7277
+ PubsubWrapper.decodeDelimited = function decodeDelimited(reader) {
7278
+ if (!(reader instanceof $Reader))
7279
+ reader = new $Reader(reader);
7280
+ return this.decode(reader, reader.uint32());
7281
+ };
7282
+
7283
+ /**
7284
+ * Verifies a PubsubWrapper message.
7285
+ * @function verify
7286
+ * @memberof google.pubsub.v1.PushConfig.PubsubWrapper
7287
+ * @static
7288
+ * @param {Object.<string,*>} message Plain object to verify
7289
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
7290
+ */
7291
+ PubsubWrapper.verify = function verify(message) {
7292
+ if (typeof message !== "object" || message === null)
7293
+ return "object expected";
7294
+ return null;
7295
+ };
7296
+
7297
+ /**
7298
+ * Creates a PubsubWrapper message from a plain object. Also converts values to their respective internal types.
7299
+ * @function fromObject
7300
+ * @memberof google.pubsub.v1.PushConfig.PubsubWrapper
7301
+ * @static
7302
+ * @param {Object.<string,*>} object Plain object
7303
+ * @returns {google.pubsub.v1.PushConfig.PubsubWrapper} PubsubWrapper
7304
+ */
7305
+ PubsubWrapper.fromObject = function fromObject(object) {
7306
+ if (object instanceof $root.google.pubsub.v1.PushConfig.PubsubWrapper)
7307
+ return object;
7308
+ return new $root.google.pubsub.v1.PushConfig.PubsubWrapper();
7309
+ };
7310
+
7311
+ /**
7312
+ * Creates a plain object from a PubsubWrapper message. Also converts values to other types if specified.
7313
+ * @function toObject
7314
+ * @memberof google.pubsub.v1.PushConfig.PubsubWrapper
7315
+ * @static
7316
+ * @param {google.pubsub.v1.PushConfig.PubsubWrapper} message PubsubWrapper
7317
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
7318
+ * @returns {Object.<string,*>} Plain object
7319
+ */
7320
+ PubsubWrapper.toObject = function toObject() {
7321
+ return {};
7322
+ };
7323
+
7324
+ /**
7325
+ * Converts this PubsubWrapper to JSON.
7326
+ * @function toJSON
7327
+ * @memberof google.pubsub.v1.PushConfig.PubsubWrapper
7328
+ * @instance
7329
+ * @returns {Object.<string,*>} JSON object
7330
+ */
7331
+ PubsubWrapper.prototype.toJSON = function toJSON() {
7332
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
7333
+ };
7334
+
7335
+ /**
7336
+ * Gets the default type url for PubsubWrapper
7337
+ * @function getTypeUrl
7338
+ * @memberof google.pubsub.v1.PushConfig.PubsubWrapper
7339
+ * @static
7340
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
7341
+ * @returns {string} The default type url
7342
+ */
7343
+ PubsubWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
7344
+ if (typeUrlPrefix === undefined) {
7345
+ typeUrlPrefix = "type.googleapis.com";
7346
+ }
7347
+ return typeUrlPrefix + "/google.pubsub.v1.PushConfig.PubsubWrapper";
7348
+ };
7349
+
7350
+ return PubsubWrapper;
7351
+ })();
7352
+
7353
+ PushConfig.NoWrapper = (function() {
7354
+
7355
+ /**
7356
+ * Properties of a NoWrapper.
7357
+ * @memberof google.pubsub.v1.PushConfig
7358
+ * @interface INoWrapper
7359
+ * @property {boolean|null} [writeMetadata] NoWrapper writeMetadata
7360
+ */
7361
+
7362
+ /**
7363
+ * Constructs a new NoWrapper.
7364
+ * @memberof google.pubsub.v1.PushConfig
7365
+ * @classdesc Represents a NoWrapper.
7366
+ * @implements INoWrapper
7367
+ * @constructor
7368
+ * @param {google.pubsub.v1.PushConfig.INoWrapper=} [properties] Properties to set
7369
+ */
7370
+ function NoWrapper(properties) {
7371
+ if (properties)
7372
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
7373
+ if (properties[keys[i]] != null)
7374
+ this[keys[i]] = properties[keys[i]];
7375
+ }
7376
+
7377
+ /**
7378
+ * NoWrapper writeMetadata.
7379
+ * @member {boolean} writeMetadata
7380
+ * @memberof google.pubsub.v1.PushConfig.NoWrapper
7381
+ * @instance
7382
+ */
7383
+ NoWrapper.prototype.writeMetadata = false;
7384
+
7385
+ /**
7386
+ * Creates a new NoWrapper instance using the specified properties.
7387
+ * @function create
7388
+ * @memberof google.pubsub.v1.PushConfig.NoWrapper
7389
+ * @static
7390
+ * @param {google.pubsub.v1.PushConfig.INoWrapper=} [properties] Properties to set
7391
+ * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper instance
7392
+ */
7393
+ NoWrapper.create = function create(properties) {
7394
+ return new NoWrapper(properties);
7395
+ };
7396
+
7397
+ /**
7398
+ * Encodes the specified NoWrapper message. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages.
7399
+ * @function encode
7400
+ * @memberof google.pubsub.v1.PushConfig.NoWrapper
7401
+ * @static
7402
+ * @param {google.pubsub.v1.PushConfig.INoWrapper} message NoWrapper message or plain object to encode
7403
+ * @param {$protobuf.Writer} [writer] Writer to encode to
7404
+ * @returns {$protobuf.Writer} Writer
7405
+ */
7406
+ NoWrapper.encode = function encode(message, writer) {
7407
+ if (!writer)
7408
+ writer = $Writer.create();
7409
+ if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata"))
7410
+ writer.uint32(/* id 1, wireType 0 =*/8).bool(message.writeMetadata);
7411
+ return writer;
7412
+ };
7413
+
7414
+ /**
7415
+ * Encodes the specified NoWrapper message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.NoWrapper.verify|verify} messages.
7416
+ * @function encodeDelimited
7417
+ * @memberof google.pubsub.v1.PushConfig.NoWrapper
7418
+ * @static
7419
+ * @param {google.pubsub.v1.PushConfig.INoWrapper} message NoWrapper message or plain object to encode
7420
+ * @param {$protobuf.Writer} [writer] Writer to encode to
7421
+ * @returns {$protobuf.Writer} Writer
7422
+ */
7423
+ NoWrapper.encodeDelimited = function encodeDelimited(message, writer) {
7424
+ return this.encode(message, writer).ldelim();
7425
+ };
7426
+
7427
+ /**
7428
+ * Decodes a NoWrapper message from the specified reader or buffer.
7429
+ * @function decode
7430
+ * @memberof google.pubsub.v1.PushConfig.NoWrapper
7431
+ * @static
7432
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7433
+ * @param {number} [length] Message length if known beforehand
7434
+ * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper
7435
+ * @throws {Error} If the payload is not a reader or valid buffer
7436
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
7437
+ */
7438
+ NoWrapper.decode = function decode(reader, length) {
7439
+ if (!(reader instanceof $Reader))
7440
+ reader = $Reader.create(reader);
7441
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig.NoWrapper();
7442
+ while (reader.pos < end) {
7443
+ var tag = reader.uint32();
7444
+ switch (tag >>> 3) {
7445
+ case 1: {
7446
+ message.writeMetadata = reader.bool();
7447
+ break;
7448
+ }
7449
+ default:
7450
+ reader.skipType(tag & 7);
7451
+ break;
7452
+ }
7453
+ }
7454
+ return message;
7455
+ };
7456
+
7457
+ /**
7458
+ * Decodes a NoWrapper message from the specified reader or buffer, length delimited.
7459
+ * @function decodeDelimited
7460
+ * @memberof google.pubsub.v1.PushConfig.NoWrapper
7461
+ * @static
7462
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7463
+ * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper
7464
+ * @throws {Error} If the payload is not a reader or valid buffer
7465
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
7466
+ */
7467
+ NoWrapper.decodeDelimited = function decodeDelimited(reader) {
7468
+ if (!(reader instanceof $Reader))
7469
+ reader = new $Reader(reader);
7470
+ return this.decode(reader, reader.uint32());
7471
+ };
7472
+
7473
+ /**
7474
+ * Verifies a NoWrapper message.
7475
+ * @function verify
7476
+ * @memberof google.pubsub.v1.PushConfig.NoWrapper
7477
+ * @static
7478
+ * @param {Object.<string,*>} message Plain object to verify
7479
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
7480
+ */
7481
+ NoWrapper.verify = function verify(message) {
7482
+ if (typeof message !== "object" || message === null)
7483
+ return "object expected";
7484
+ if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata"))
7485
+ if (typeof message.writeMetadata !== "boolean")
7486
+ return "writeMetadata: boolean expected";
7487
+ return null;
7488
+ };
7489
+
7490
+ /**
7491
+ * Creates a NoWrapper message from a plain object. Also converts values to their respective internal types.
7492
+ * @function fromObject
7493
+ * @memberof google.pubsub.v1.PushConfig.NoWrapper
7494
+ * @static
7495
+ * @param {Object.<string,*>} object Plain object
7496
+ * @returns {google.pubsub.v1.PushConfig.NoWrapper} NoWrapper
7497
+ */
7498
+ NoWrapper.fromObject = function fromObject(object) {
7499
+ if (object instanceof $root.google.pubsub.v1.PushConfig.NoWrapper)
7500
+ return object;
7501
+ var message = new $root.google.pubsub.v1.PushConfig.NoWrapper();
7502
+ if (object.writeMetadata != null)
7503
+ message.writeMetadata = Boolean(object.writeMetadata);
7504
+ return message;
7505
+ };
7506
+
7507
+ /**
7508
+ * Creates a plain object from a NoWrapper message. Also converts values to other types if specified.
7509
+ * @function toObject
7510
+ * @memberof google.pubsub.v1.PushConfig.NoWrapper
7511
+ * @static
7512
+ * @param {google.pubsub.v1.PushConfig.NoWrapper} message NoWrapper
7513
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
7514
+ * @returns {Object.<string,*>} Plain object
7515
+ */
7516
+ NoWrapper.toObject = function toObject(message, options) {
7517
+ if (!options)
7518
+ options = {};
7519
+ var object = {};
7520
+ if (options.defaults)
7521
+ object.writeMetadata = false;
7522
+ if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata"))
7523
+ object.writeMetadata = message.writeMetadata;
7524
+ return object;
7525
+ };
7526
+
7527
+ /**
7528
+ * Converts this NoWrapper to JSON.
7529
+ * @function toJSON
7530
+ * @memberof google.pubsub.v1.PushConfig.NoWrapper
7531
+ * @instance
7532
+ * @returns {Object.<string,*>} JSON object
7533
+ */
7534
+ NoWrapper.prototype.toJSON = function toJSON() {
7535
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
7536
+ };
7537
+
7538
+ /**
7539
+ * Gets the default type url for NoWrapper
7540
+ * @function getTypeUrl
7541
+ * @memberof google.pubsub.v1.PushConfig.NoWrapper
7542
+ * @static
7543
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
7544
+ * @returns {string} The default type url
7545
+ */
7546
+ NoWrapper.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
7547
+ if (typeUrlPrefix === undefined) {
7548
+ typeUrlPrefix = "type.googleapis.com";
7549
+ }
7550
+ return typeUrlPrefix + "/google.pubsub.v1.PushConfig.NoWrapper";
7551
+ };
7552
+
7553
+ return NoWrapper;
7554
+ })();
7555
+
7099
7556
  return PushConfig;
7100
7557
  })();
7101
7558
 
@@ -916,6 +916,12 @@
916
916
  "oneof": [
917
917
  "oidcToken"
918
918
  ]
919
+ },
920
+ "wrapper": {
921
+ "oneof": [
922
+ "pubsubWrapper",
923
+ "noWrapper"
924
+ ]
919
925
  }
920
926
  },
921
927
  "fields": {
@@ -931,6 +937,14 @@
931
937
  "oidcToken": {
932
938
  "type": "OidcToken",
933
939
  "id": 3
940
+ },
941
+ "pubsubWrapper": {
942
+ "type": "PubsubWrapper",
943
+ "id": 4
944
+ },
945
+ "noWrapper": {
946
+ "type": "NoWrapper",
947
+ "id": 5
934
948
  }
935
949
  },
936
950
  "nested": {
@@ -945,6 +959,17 @@
945
959
  "id": 2
946
960
  }
947
961
  }
962
+ },
963
+ "PubsubWrapper": {
964
+ "fields": {}
965
+ },
966
+ "NoWrapper": {
967
+ "fields": {
968
+ "writeMetadata": {
969
+ "type": "bool",
970
+ "id": 1
971
+ }
972
+ }
948
973
  }
949
974
  }
950
975
  },
@@ -292,6 +292,13 @@ class OrderedQueue extends MessageQueue {
292
292
  * @fires OrderedQueue#drain
293
293
  */
294
294
  async publish() {
295
+ // If there's nothing to flush, don't try, just short-circuit to the drain event.
296
+ // This can happen if we get a publish() call after already being drained, in
297
+ // the case that topic.flush() pulls a reference to us before we get deleted.
298
+ if (!this.batches.length) {
299
+ this.emit('drain');
300
+ return;
301
+ }
295
302
  this.inFlight = true;
296
303
  if (this.pending) {
297
304
  clearTimeout(this.pending);
@@ -1 +1 @@
1
- {"version":3,"file":"message-queues.js","sourceRoot":"","sources":["../../../src/publisher/message-queues.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,mCAAoC;AAEpC,mDAAkE;AAClE,mDAA6C;AAI7C,+BAA+B;AAE/B;;;;;;GAMG;AACH,MAAsB,YAAa,SAAQ,qBAAY;IAKrD,YAAY,SAAoB;QAC9B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAS,CAAC;IACnD,CAAC;IAED;;;;;;;;OAQG;IACH,aAAa;QACX,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAS,CAAC;IACxD,CAAC;IA4BD;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CACZ,QAAyB,EACzB,SAA4B;QAE5B,MAAM,EAAC,KAAK,EAAE,QAAQ,EAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QACzC,MAAM,OAAO,GAAG;YACd,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,QAAQ;SACT,CAAC;QACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YACzB,OAAO;SACR;QAED,MAAM,eAAe,GAAG,CAAA,KAAK,CAAC,OAA0C,CAAA,CAAC;QACzE,MAAM,OAAO,GAAG,IAAA,gBAAS,EAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC;gBACzB,MAAM,EAAE,iBAAiB;gBACzB,MAAM,EAAE,SAAS;gBACjB,OAAO;gBACP,OAAO,EAAE,QAAQ,CAAC,OAAQ;aAC3B,CAAC,CAAC;YAEH,IAAI,IAAI,EAAE;gBACR,M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,CAAC;SAChC;gBAAS;YACR,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;SACvB;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACvB,IAAI,CAAC,gBAAgB,EAAE,CAAC;SACzB;aAAM;YACL,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACpB;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,KAAK,CAAC;QAElB,mEAAmE;QACnE,wEAAwE;QACxE,wEAAwE;QACxE,YAAY;QACZ,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE;YACpB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;gBACxB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACpB;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnLD,oCAmLC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@google-cloud/pubsub",
3
3
  "description": "Cloud Pub/Sub Client Library for Node.js",
4
- "version": "3.6.0",
4
+ "version": "3.7.1",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Google Inc.",
7
7
  "engines": {
@@ -85,7 +85,7 @@
85
85
  "jsdoc": "^4.0.0",
86
86
  "jsdoc-fresh": "^2.0.0",
87
87
  "jsdoc-region-tag": "^2.0.0",
88
- "linkinator": "^4.0.0",
88
+ "linkinator": "^5.0.0",
89
89
  "mocha": "^9.2.2",
90
90
  "mv": "^2.1.1",
91
91
  "ncp": "^2.0.0",