@google-cloud/pubsub 3.2.1 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/@google-cloud/pubsub?activeTab=versions
6
6
 
7
+ ## [3.3.0](https://github.com/googleapis/nodejs-pubsub/compare/v3.2.1...v3.3.0) (2023-01-23)
8
+
9
+
10
+ ### Features
11
+
12
+ * Add schema evolution methods and fields ([#1672](https://github.com/googleapis/nodejs-pubsub/issues/1672)) ([7a5bc29](https://github.com/googleapis/nodejs-pubsub/commit/7a5bc29e8a39e5c1991a5eae4200a5045f21997d))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * Remove redundant .then() ([#1671](https://github.com/googleapis/nodejs-pubsub/issues/1671)) ([108edc3](https://github.com/googleapis/nodejs-pubsub/commit/108edc3cd2d3d512e2a9777a68541dae1f6aba23))
18
+
7
19
  ## [3.2.1](https://github.com/googleapis/nodejs-pubsub/compare/v3.2.0...v3.2.1) (2022-11-04)
8
20
 
9
21
 
@@ -157,6 +157,16 @@ message SchemaSettings {
157
157
 
158
158
  // The encoding of messages validated against `schema`.
159
159
  Encoding encoding = 2;
160
+
161
+ // The minimum (inclusive) revision allowed for validating messages. If empty
162
+ // or not present, allow any revision to be validated against last_revision or
163
+ // any revision created before.
164
+ string first_revision_id = 3;
165
+
166
+ // The maximum (inclusive) revision allowed for validating messages. If empty
167
+ // or not present, allow any revision to be validated against first_revision
168
+ // or any revision created after.
169
+ string last_revision_id = 4;
160
170
  }
161
171
 
162
172
  // A topic resource.
@@ -795,8 +805,8 @@ message Subscription {
795
805
  google.protobuf.Duration topic_message_retention_duration = 17
796
806
  [(google.api.field_behavior) = OUTPUT_ONLY];
797
807
 
798
- // Output only. An output-only field indicating whether or not the subscription can receive
799
- // messages.
808
+ // Output only. An output-only field indicating whether or not the
809
+ // subscription can receive messages.
800
810
  State state = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
801
811
  }
802
812
 
@@ -969,8 +979,8 @@ message BigQueryConfig {
969
979
  // subscription's backlog.
970
980
  bool drop_unknown_fields = 4;
971
981
 
972
- // Output only. An output-only field that indicates whether or not the subscription can
973
- // receive messages.
982
+ // Output only. An output-only field that indicates whether or not the
983
+ // subscription can receive messages.
974
984
  State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
975
985
  }
976
986
 
@@ -1252,25 +1262,25 @@ message StreamingPullResponse {
1252
1262
  // previously received message.
1253
1263
  message AcknowledgeConfirmation {
1254
1264
  // Successfully processed acknowledgement IDs.
1255
- repeated string ack_ids = 1 [ctype = CORD];
1265
+ repeated string ack_ids = 1;
1256
1266
 
1257
1267
  // List of acknowledgement IDs that were malformed or whose acknowledgement
1258
1268
  // deadline has expired.
1259
- repeated string invalid_ack_ids = 2 [ctype = CORD];
1269
+ repeated string invalid_ack_ids = 2;
1260
1270
 
1261
1271
  // List of acknowledgement IDs that were out of order.
1262
- repeated string unordered_ack_ids = 3 [ctype = CORD];
1272
+ repeated string unordered_ack_ids = 3;
1263
1273
  }
1264
1274
 
1265
1275
  // Acknowledgement IDs sent in one or more previous requests to modify the
1266
1276
  // deadline for a specific message.
1267
1277
  message ModifyAckDeadlineConfirmation {
1268
1278
  // Successfully processed acknowledgement IDs.
1269
- repeated string ack_ids = 1 [ctype = CORD];
1279
+ repeated string ack_ids = 1;
1270
1280
 
1271
1281
  // List of acknowledgement IDs that were malformed or whose acknowledgement
1272
1282
  // deadline has expired.
1273
- repeated string invalid_ack_ids = 2 [ctype = CORD];
1283
+ repeated string invalid_ack_ids = 2;
1274
1284
  }
1275
1285
 
1276
1286
  // Subscription properties sent as part of the response.
@@ -1,4 +1,4 @@
1
- // Copyright 2021 Google LLC
1
+ // Copyright 2022 Google LLC
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@ import "google/api/client.proto";
21
21
  import "google/api/field_behavior.proto";
22
22
  import "google/api/resource.proto";
23
23
  import "google/protobuf/empty.proto";
24
+ import "google/protobuf/timestamp.proto";
24
25
 
25
26
  option cc_enable_arenas = true;
26
27
  option csharp_namespace = "Google.Cloud.PubSub.V1";
@@ -63,6 +64,41 @@ service SchemaService {
63
64
  option (google.api.method_signature) = "parent";
64
65
  }
65
66
 
67
+ // Lists all schema revisions for the named schema.
68
+ rpc ListSchemaRevisions(ListSchemaRevisionsRequest)
69
+ returns (ListSchemaRevisionsResponse) {
70
+ option (google.api.http) = {
71
+ get: "/v1/{name=projects/*/schemas/*}:listRevisions"
72
+ };
73
+ option (google.api.method_signature) = "name";
74
+ }
75
+
76
+ // Commits a new schema revision to an existing schema.
77
+ rpc CommitSchema(CommitSchemaRequest) returns (Schema) {
78
+ option (google.api.http) = {
79
+ post: "/v1/{name=projects/*/schemas/*}:commit"
80
+ body: "*"
81
+ };
82
+ option (google.api.method_signature) = "name,schema";
83
+ }
84
+
85
+ // Creates a new schema revision that is a copy of the provided revision_id.
86
+ rpc RollbackSchema(RollbackSchemaRequest) returns (Schema) {
87
+ option (google.api.http) = {
88
+ post: "/v1/{name=projects/*/schemas/*}:rollback"
89
+ body: "*"
90
+ };
91
+ option (google.api.method_signature) = "name,revision_id";
92
+ }
93
+
94
+ // Deletes a specific schema revision.
95
+ rpc DeleteSchemaRevision(DeleteSchemaRevisionRequest) returns (Schema) {
96
+ option (google.api.http) = {
97
+ delete: "/v1/{name=projects/*/schemas/*}:deleteRevision"
98
+ };
99
+ option (google.api.method_signature) = "name,revision_id";
100
+ }
101
+
66
102
  // Deletes a schema.
67
103
  rpc DeleteSchema(DeleteSchemaRequest) returns (google.protobuf.Empty) {
68
104
  option (google.api.http) = {
@@ -120,6 +156,29 @@ message Schema {
120
156
  // the full definition of the schema that is a valid schema definition of
121
157
  // the type specified in `type`.
122
158
  string definition = 3;
159
+
160
+ // Output only. Immutable. The revision ID of the schema.
161
+ string revision_id = 4 [
162
+ (google.api.field_behavior) = IMMUTABLE,
163
+ (google.api.field_behavior) = OUTPUT_ONLY
164
+ ];
165
+
166
+ // Output only. The timestamp that the revision was created.
167
+ google.protobuf.Timestamp revision_create_time = 6
168
+ [(google.api.field_behavior) = OUTPUT_ONLY];
169
+ }
170
+
171
+ // View of Schema object fields to be returned by GetSchema and ListSchemas.
172
+ enum SchemaView {
173
+ // The default / unset value.
174
+ // The API will default to the BASIC view.
175
+ SCHEMA_VIEW_UNSPECIFIED = 0;
176
+
177
+ // Include the name and type of the schema, but not the definition.
178
+ BASIC = 1;
179
+
180
+ // Include all Schema object fields.
181
+ FULL = 2;
123
182
  }
124
183
 
125
184
  // Request for the CreateSchema method.
@@ -148,19 +207,6 @@ message CreateSchemaRequest {
148
207
  string schema_id = 3;
149
208
  }
150
209
 
151
- // View of Schema object fields to be returned by GetSchema and ListSchemas.
152
- enum SchemaView {
153
- // The default / unset value.
154
- // The API will default to the BASIC view.
155
- SCHEMA_VIEW_UNSPECIFIED = 0;
156
-
157
- // Include the name and type of the schema, but not the definition.
158
- BASIC = 1;
159
-
160
- // Include all Schema object fields.
161
- FULL = 2;
162
- }
163
-
164
210
  // Request for the GetSchema method.
165
211
  message GetSchemaRequest {
166
212
  // Required. The name of the schema to get.
@@ -171,8 +217,7 @@ message GetSchemaRequest {
171
217
  ];
172
218
 
173
219
  // The set of fields to return in the response. If not set, returns a Schema
174
- // with `name` and `type`, but not `definition`. Set to `FULL` to retrieve all
175
- // fields.
220
+ // with all fields filled out. Set to `BASIC` to omit the `definition`.
176
221
  SchemaView view = 2;
177
222
  }
178
223
 
@@ -211,6 +256,83 @@ message ListSchemasResponse {
211
256
  string next_page_token = 2;
212
257
  }
213
258
 
259
+ // Request for the `ListSchemaRevisions` method.
260
+ message ListSchemaRevisionsRequest {
261
+ // Required. The name of the schema to list revisions for.
262
+ string name = 1 [
263
+ (google.api.field_behavior) = REQUIRED,
264
+ (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" }
265
+ ];
266
+
267
+ // The set of Schema fields to return in the response. If not set, returns
268
+ // Schemas with `name` and `type`, but not `definition`. Set to `FULL` to
269
+ // retrieve all fields.
270
+ SchemaView view = 2;
271
+
272
+ // The maximum number of revisions to return per page.
273
+ int32 page_size = 3;
274
+
275
+ // The page token, received from a previous ListSchemaRevisions call.
276
+ // Provide this to retrieve the subsequent page.
277
+ string page_token = 4;
278
+ }
279
+
280
+ // Response for the `ListSchemaRevisions` method.
281
+ message ListSchemaRevisionsResponse {
282
+ // The revisions of the schema.
283
+ repeated Schema schemas = 1;
284
+
285
+ // A token that can be sent as `page_token` to retrieve the next page.
286
+ // If this field is empty, there are no subsequent pages.
287
+ string next_page_token = 2;
288
+ }
289
+
290
+ // Request for CommitSchema method.
291
+ message CommitSchemaRequest {
292
+ // Required. The name of the schema we are revising.
293
+ // Format is `projects/{project}/schemas/{schema}`.
294
+ string name = 1 [
295
+ (google.api.field_behavior) = REQUIRED,
296
+ (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" }
297
+ ];
298
+
299
+ // Required. The schema revision to commit.
300
+ Schema schema = 2 [(google.api.field_behavior) = REQUIRED];
301
+ }
302
+
303
+ // Request for the `RollbackSchema` method.
304
+ message RollbackSchemaRequest {
305
+ // Required. The schema being rolled back with revision id.
306
+ string name = 1 [
307
+ (google.api.field_behavior) = REQUIRED,
308
+ (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" }
309
+ ];
310
+
311
+ // Required. The revision ID to roll back to.
312
+ // It must be a revision of the same schema.
313
+ //
314
+ // Example: c7cfa2a8
315
+ string revision_id = 2 [(google.api.field_behavior) = REQUIRED];
316
+ }
317
+
318
+ // Request for the `DeleteSchemaRevision` method.
319
+ message DeleteSchemaRevisionRequest {
320
+ // Required. The name of the schema revision to be deleted, with a revision ID
321
+ // explicitly included.
322
+ //
323
+ // Example: projects/123/schemas/my-schema@c7cfa2a8
324
+ string name = 1 [
325
+ (google.api.field_behavior) = REQUIRED,
326
+ (google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" }
327
+ ];
328
+
329
+ // Required. The revision ID to roll back to.
330
+ // It must be a revision of the same schema.
331
+ //
332
+ // Example: c7cfa2a8
333
+ string revision_id = 2 [(google.api.field_behavior) = REQUIRED];
334
+ }
335
+
214
336
  // Request for the `DeleteSchema` method.
215
337
  message DeleteSchemaRequest {
216
338
  // Required. Name of the schema to delete.