@google-cloud/pubsub 2.17.0 → 2.18.3
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 +34 -0
- package/README.md +1 -0
- package/build/protos/protos.d.ts +2 -1
- package/build/protos/protos.js +7 -0
- package/build/protos/protos.json +14 -1
- package/build/src/iam.d.ts +180 -0
- package/build/src/iam.js +11 -176
- package/build/src/iam.js.map +1 -1
- package/build/src/index.d.ts +13 -4
- package/build/src/index.js +12 -4
- package/build/src/index.js.map +1 -1
- package/build/src/lease-manager.d.ts +7 -2
- package/build/src/lease-manager.js +19 -4
- package/build/src/lease-manager.js.map +1 -1
- package/build/src/publisher/flow-control.d.ts +90 -0
- package/build/src/publisher/flow-control.js +145 -0
- package/build/src/publisher/flow-control.js.map +1 -0
- package/build/src/publisher/flow-publisher.d.ts +95 -0
- package/build/src/publisher/flow-publisher.js +133 -0
- package/build/src/publisher/flow-publisher.js.map +1 -0
- package/build/src/publisher/index.d.ts +33 -5
- package/build/src/publisher/index.js +16 -39
- package/build/src/publisher/index.js.map +1 -1
- package/build/src/publisher/message-batch.d.ts +1 -1
- package/build/src/publisher/message-batch.js +4 -3
- package/build/src/publisher/message-batch.js.map +1 -1
- package/build/src/publisher/message-queues.js.map +1 -1
- package/build/src/publisher/pubsub-message.d.ts +52 -0
- package/build/src/publisher/pubsub-message.js +56 -0
- package/build/src/publisher/pubsub-message.js.map +1 -0
- package/build/src/pubsub.d.ts +354 -4
- package/build/src/pubsub.js +28 -322
- package/build/src/pubsub.js.map +1 -1
- package/build/src/schema.d.ts +9 -4
- package/build/src/schema.js +9 -4
- package/build/src/schema.js.map +1 -1
- package/build/src/snapshot.d.ts +87 -0
- package/build/src/snapshot.js +7 -83
- package/build/src/snapshot.js.map +1 -1
- package/build/src/subscriber.d.ts +6 -0
- package/build/src/subscriber.js +6 -0
- package/build/src/subscriber.js.map +1 -1
- package/build/src/subscription.d.ts +439 -9
- package/build/src/subscription.js +38 -404
- package/build/src/subscription.js.map +1 -1
- package/build/src/topic.d.ts +481 -1
- package/build/src/topic.js +51 -430
- package/build/src/topic.js.map +1 -1
- package/build/src/util.d.ts +2 -1
- package/build/src/util.js +2 -2
- package/build/src/util.js.map +1 -1
- package/build/src/v1/publisher_client.d.ts +246 -15
- package/build/src/v1/publisher_client.js +18 -264
- package/build/src/v1/publisher_client.js.map +1 -1
- package/build/src/v1/publisher_client_config.json +1 -1
- package/build/src/v1/schema_service_client.d.ts +151 -5
- package/build/src/v1/schema_service_client.js +6 -157
- package/build/src/v1/schema_service_client.js.map +1 -1
- package/build/src/v1/subscriber_client.d.ts +536 -16
- package/build/src/v1/subscriber_client.js +14 -552
- package/build/src/v1/subscriber_client.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,40 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/@google-cloud/pubsub?activeTab=versions
|
|
6
6
|
|
|
7
|
+
### [2.18.3](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.18.2...v2.18.3) (2021-11-18)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* set only Publish to 5000ms ([#1416](https://www.github.com/googleapis/nodejs-pubsub/issues/1416)) ([1e11001](https://www.github.com/googleapis/nodejs-pubsub/commit/1e110016ea04fc41d2fa80d64a54a11fd4078c60))
|
|
13
|
+
* temporary hold-back on google-gax to avoid timeout issues caused by https://github.com/googleapis/gax-nodejs/pull/1100 ([#1431](https://www.github.com/googleapis/nodejs-pubsub/issues/1431)) ([18c6b18](https://www.github.com/googleapis/nodejs-pubsub/commit/18c6b18f621c410aca968a6bfc850e7a6ea404f4))
|
|
14
|
+
|
|
15
|
+
### [2.18.2](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.18.1...v2.18.2) (2021-11-08)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **cloud-rad:** move comments for TSDoc ([#1423](https://www.github.com/googleapis/nodejs-pubsub/issues/1423)) ([a40a23e](https://www.github.com/googleapis/nodejs-pubsub/commit/a40a23ee43c6697000996e0ff7070f41610397f5))
|
|
21
|
+
|
|
22
|
+
### [2.18.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.18.0...v2.18.1) (2021-09-27)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* deprecate maxExtension in favour of maxExtensionMinutes ([#1402](https://www.github.com/googleapis/nodejs-pubsub/issues/1402)) ([46b83ba](https://www.github.com/googleapis/nodejs-pubsub/commit/46b83ba14e954cc6bec3f03ca7c3e0bcdfb7597c))
|
|
28
|
+
|
|
29
|
+
## [2.18.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.17.0...v2.18.0) (2021-09-23)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
* add publisher side flow control ([#1359](https://www.github.com/googleapis/nodejs-pubsub/issues/1359)) ([cc0f61b](https://www.github.com/googleapis/nodejs-pubsub/commit/cc0f61b18258bae0be1a5962a93970cc15dcd304))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* update default RPC retry timeouts to match other languages ([#1399](https://www.github.com/googleapis/nodejs-pubsub/issues/1399)) ([8c1afee](https://www.github.com/googleapis/nodejs-pubsub/commit/8c1afeee26fbff84448b1a9576e4c4ef5c67f9cc))
|
|
40
|
+
|
|
7
41
|
## [2.17.0](https://www.github.com/googleapis/nodejs-pubsub/compare/v2.16.6...v2.17.0) (2021-08-25)
|
|
8
42
|
|
|
9
43
|
|
package/README.md
CHANGED
|
@@ -157,6 +157,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-pubsub/tree
|
|
|
157
157
|
| Publish Message With Custom Attributes | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishMessageWithCustomAttributes.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/publishMessageWithCustomAttributes.js,samples/README.md) |
|
|
158
158
|
| Publish Ordered Message | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishOrderedMessage.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/publishOrderedMessage.js,samples/README.md) |
|
|
159
159
|
| Publish Protobuf Messages to a Topic | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishProtobufMessages.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/publishProtobufMessages.js,samples/README.md) |
|
|
160
|
+
| Publish with flow control | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishWithFlowControl.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/publishWithFlowControl.js,samples/README.md) |
|
|
160
161
|
| Publish With Retry Settings | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/publishWithRetrySettings.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/publishWithRetrySettings.js,samples/README.md) |
|
|
161
162
|
| Quickstart | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/quickstart.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/quickstart.js,samples/README.md) |
|
|
162
163
|
| Remove Dead Letter Policy | [source code](https://github.com/googleapis/nodejs-pubsub/blob/main/samples/removeDeadLetterPolicy.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/removeDeadLetterPolicy.js,samples/README.md) |
|
package/build/protos/protos.d.ts
CHANGED
package/build/protos/protos.js
CHANGED
|
@@ -15300,6 +15300,7 @@
|
|
|
15300
15300
|
* @property {number} INPUT_ONLY=4 INPUT_ONLY value
|
|
15301
15301
|
* @property {number} IMMUTABLE=5 IMMUTABLE value
|
|
15302
15302
|
* @property {number} UNORDERED_LIST=6 UNORDERED_LIST value
|
|
15303
|
+
* @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value
|
|
15303
15304
|
*/
|
|
15304
15305
|
api.FieldBehavior = (function() {
|
|
15305
15306
|
var valuesById = {}, values = Object.create(valuesById);
|
|
@@ -15310,6 +15311,7 @@
|
|
|
15310
15311
|
values[valuesById[4] = "INPUT_ONLY"] = 4;
|
|
15311
15312
|
values[valuesById[5] = "IMMUTABLE"] = 5;
|
|
15312
15313
|
values[valuesById[6] = "UNORDERED_LIST"] = 6;
|
|
15314
|
+
values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7;
|
|
15313
15315
|
return values;
|
|
15314
15316
|
})();
|
|
15315
15317
|
|
|
@@ -21478,6 +21480,7 @@
|
|
|
21478
21480
|
case 4:
|
|
21479
21481
|
case 5:
|
|
21480
21482
|
case 6:
|
|
21483
|
+
case 7:
|
|
21481
21484
|
break;
|
|
21482
21485
|
}
|
|
21483
21486
|
}
|
|
@@ -21582,6 +21585,10 @@
|
|
|
21582
21585
|
case 6:
|
|
21583
21586
|
message[".google.api.fieldBehavior"][i] = 6;
|
|
21584
21587
|
break;
|
|
21588
|
+
case "NON_EMPTY_DEFAULT":
|
|
21589
|
+
case 7:
|
|
21590
|
+
message[".google.api.fieldBehavior"][i] = 7;
|
|
21591
|
+
break;
|
|
21585
21592
|
}
|
|
21586
21593
|
}
|
|
21587
21594
|
if (object[".google.api.resourceReference"] != null) {
|
package/build/protos/protos.json
CHANGED
|
@@ -1771,7 +1771,8 @@
|
|
|
1771
1771
|
"OUTPUT_ONLY": 3,
|
|
1772
1772
|
"INPUT_ONLY": 4,
|
|
1773
1773
|
"IMMUTABLE": 5,
|
|
1774
|
-
"UNORDERED_LIST": 6
|
|
1774
|
+
"UNORDERED_LIST": 6,
|
|
1775
|
+
"NON_EMPTY_DEFAULT": 7
|
|
1775
1776
|
}
|
|
1776
1777
|
},
|
|
1777
1778
|
"resourceReference": {
|
|
@@ -2414,6 +2415,18 @@
|
|
|
2414
2415
|
]
|
|
2415
2416
|
],
|
|
2416
2417
|
"reserved": [
|
|
2418
|
+
[
|
|
2419
|
+
4,
|
|
2420
|
+
4
|
|
2421
|
+
],
|
|
2422
|
+
[
|
|
2423
|
+
5,
|
|
2424
|
+
5
|
|
2425
|
+
],
|
|
2426
|
+
[
|
|
2427
|
+
6,
|
|
2428
|
+
6
|
|
2429
|
+
],
|
|
2417
2430
|
[
|
|
2418
2431
|
8,
|
|
2419
2432
|
8
|
package/build/src/iam.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export declare type TestIamPermissionsCallback = ResourceCallback<IamPermissions
|
|
|
62
62
|
* @see [What is Cloud IAM?]{@link https://cloud.google.com/iam/}
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
|
+
* ```
|
|
65
66
|
* const {PubSub} = require('@google-cloud/pubsub');
|
|
66
67
|
* const pubsub = new PubSub();
|
|
67
68
|
*
|
|
@@ -70,18 +71,197 @@ export declare type TestIamPermissionsCallback = ResourceCallback<IamPermissions
|
|
|
70
71
|
*
|
|
71
72
|
* const subscription = pubsub.subscription('my-subscription');
|
|
72
73
|
* // subscription.iam
|
|
74
|
+
* ```
|
|
73
75
|
*/
|
|
74
76
|
export declare class IAM {
|
|
75
77
|
pubsub: PubSub;
|
|
76
78
|
request: typeof PubSub.prototype.request;
|
|
77
79
|
id: string;
|
|
78
80
|
constructor(pubsub: PubSub, id: string);
|
|
81
|
+
/**
|
|
82
|
+
* @typedef {array} GetPolicyResponse
|
|
83
|
+
* @property {object} 0 The policy.
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* @callback GetPolicyCallback
|
|
87
|
+
* @param {?Error} err Request error, if any.
|
|
88
|
+
* @param {object} acl The policy.
|
|
89
|
+
*/
|
|
90
|
+
/**
|
|
91
|
+
* Get the IAM policy
|
|
92
|
+
*
|
|
93
|
+
* @param {object} [gaxOptions] Request configuration options, outlined
|
|
94
|
+
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
|
|
95
|
+
* @param {GetPolicyCallback} [callback] Callback function.
|
|
96
|
+
* @returns {Promise<GetPolicyResponse>}
|
|
97
|
+
*
|
|
98
|
+
* @see [Topics: getIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/getIamPolicy}
|
|
99
|
+
* @see [Subscriptions: getIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/getIamPolicy}
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```
|
|
103
|
+
* const {PubSub} = require('@google-cloud/pubsub');
|
|
104
|
+
* const pubsub = new PubSub();
|
|
105
|
+
*
|
|
106
|
+
* const topic = pubsub.topic('my-topic');
|
|
107
|
+
* const subscription = topic.subscription('my-subscription');
|
|
108
|
+
*
|
|
109
|
+
* topic.iam.getPolicy(function(err, policy, apiResponse) {});
|
|
110
|
+
*
|
|
111
|
+
* subscription.iam.getPolicy(function(err, policy, apiResponse) {});
|
|
112
|
+
*
|
|
113
|
+
* //-
|
|
114
|
+
* // If the callback is omitted, we'll return a Promise.
|
|
115
|
+
* //-
|
|
116
|
+
* topic.iam.getPolicy().then(function(data) {
|
|
117
|
+
* const policy = data[0];
|
|
118
|
+
* const apiResponse = data[1];
|
|
119
|
+
* });
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
79
122
|
getPolicy(gaxOpts?: CallOptions): Promise<GetPolicyResponse>;
|
|
80
123
|
getPolicy(callback: GetPolicyCallback): void;
|
|
81
124
|
getPolicy(gaxOpts: CallOptions, callback: GetPolicyCallback): void;
|
|
125
|
+
/**
|
|
126
|
+
* @typedef {array} SetPolicyResponse
|
|
127
|
+
* @property {object} 0 The policy.
|
|
128
|
+
*/
|
|
129
|
+
/**
|
|
130
|
+
* @callback SetPolicyCallback
|
|
131
|
+
* @param {?Error} err Request error, if any.
|
|
132
|
+
* @param {object} acl The policy.
|
|
133
|
+
*/
|
|
134
|
+
/**
|
|
135
|
+
* Set the IAM policy
|
|
136
|
+
*
|
|
137
|
+
* @throws {Error} If no policy is provided.
|
|
138
|
+
*
|
|
139
|
+
* @param {object} policy The [policy](https://cloud.google.com/pubsub/docs/reference/rest/v1/Policy).
|
|
140
|
+
* @param {array} [policy.bindings] Bindings associate members with roles.
|
|
141
|
+
* @param {Array<object>} [policy.rules] Rules to be applied to the policy.
|
|
142
|
+
* @param {string} [policy.etag] Etags are used to perform a read-modify-write.
|
|
143
|
+
* @param {object} [gaxOptions] Request configuration options, outlined
|
|
144
|
+
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
|
|
145
|
+
* @param {SetPolicyCallback} callback Callback function.
|
|
146
|
+
* @returns {Promise<SetPolicyResponse>}
|
|
147
|
+
*
|
|
148
|
+
* @see [Topics: setIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/setIamPolicy}
|
|
149
|
+
* @see [Subscriptions: setIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/setIamPolicy}
|
|
150
|
+
* @see [Policy]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/Policy}
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```
|
|
154
|
+
* const {PubSub} = require('@google-cloud/pubsub');
|
|
155
|
+
* const pubsub = new PubSub();
|
|
156
|
+
*
|
|
157
|
+
* const topic = pubsub.topic('my-topic');
|
|
158
|
+
* const subscription = topic.subscription('my-subscription');
|
|
159
|
+
*
|
|
160
|
+
* const myPolicy = {
|
|
161
|
+
* bindings: [
|
|
162
|
+
* {
|
|
163
|
+
* role: 'roles/pubsub.subscriber',
|
|
164
|
+
* members:
|
|
165
|
+
* ['serviceAccount:myotherproject@appspot.gserviceaccount.com']
|
|
166
|
+
* }
|
|
167
|
+
* ]
|
|
168
|
+
* };
|
|
169
|
+
*
|
|
170
|
+
* topic.iam.setPolicy(myPolicy, function(err, policy, apiResponse) {});
|
|
171
|
+
*
|
|
172
|
+
* subscription.iam.setPolicy(myPolicy, function(err, policy, apiResponse)
|
|
173
|
+
* {});
|
|
174
|
+
*
|
|
175
|
+
* //-
|
|
176
|
+
* // If the callback is omitted, we'll return a Promise.
|
|
177
|
+
* //-
|
|
178
|
+
* topic.iam.setPolicy(myPolicy).then(function(data) {
|
|
179
|
+
* const policy = data[0];
|
|
180
|
+
* const apiResponse = data[1];
|
|
181
|
+
* });
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
82
184
|
setPolicy(policy: Policy, gaxOpts?: CallOptions): Promise<SetPolicyResponse>;
|
|
83
185
|
setPolicy(policy: Policy, gaxOpts: CallOptions, callback: SetPolicyCallback): void;
|
|
84
186
|
setPolicy(policy: Policy, callback: SetPolicyCallback): void;
|
|
187
|
+
/**
|
|
188
|
+
* @callback TestIamPermissionsCallback
|
|
189
|
+
* @param {?Error} err Request error, if any.
|
|
190
|
+
* @param {TestIamPermissionsAPIResponse} permissions A subset of permissions that the caller is allowed.
|
|
191
|
+
* @param {PermissionsResponse} apiResponse The full API response.
|
|
192
|
+
*/
|
|
193
|
+
/**
|
|
194
|
+
* @typedef {array} TestIamPermissionsResponse
|
|
195
|
+
* @property {object[]} 0 A subset of permissions that the caller is allowed.
|
|
196
|
+
* @property {PermissionsResponse} 1 The full API response.
|
|
197
|
+
*/
|
|
198
|
+
/**
|
|
199
|
+
* @typedef {string[]} PermissionsResponse
|
|
200
|
+
* A subset of TestPermissionsRequest.permissions that the caller is allowed.
|
|
201
|
+
* @see https://cloud.google.com/pubsub/docs/reference/rpc/google.iam.v1#google.iam.v1.TestIamPermissionsRequest
|
|
202
|
+
*/
|
|
203
|
+
/**
|
|
204
|
+
* Test a set of permissions for a resource.
|
|
205
|
+
*
|
|
206
|
+
* Permissions with wildcards such as `*` or `storage.*` are not allowed.
|
|
207
|
+
*
|
|
208
|
+
* @throws {Error} If permissions are not provided.
|
|
209
|
+
*
|
|
210
|
+
* @param {string|string[]} permissions The permission(s) to test for.
|
|
211
|
+
* @param {object} [gaxOptions] Request configuration options, outlined
|
|
212
|
+
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
|
|
213
|
+
* @param {TestIamPermissionsCallback} [callback] Callback function.
|
|
214
|
+
* @returns {Promise<TestIamPermissionsResponse>}
|
|
215
|
+
*
|
|
216
|
+
* @see [Topics: testIamPermissions API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/testIamPermissions}
|
|
217
|
+
* @see [Subscriptions: testIamPermissions API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/testIamPermissions}
|
|
218
|
+
* @see [Permissions Reference]{@link https://cloud.google.com/pubsub/access_control#permissions}
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* ```
|
|
222
|
+
* const {PubSub} = require('@google-cloud/pubsub');
|
|
223
|
+
* const pubsub = new PubSub();
|
|
224
|
+
*
|
|
225
|
+
* const topic = pubsub.topic('my-topic');
|
|
226
|
+
* const subscription = topic.subscription('my-subscription');
|
|
227
|
+
*
|
|
228
|
+
* //-
|
|
229
|
+
* // Test a single permission.
|
|
230
|
+
* //-
|
|
231
|
+
* const test = 'pubsub.topics.update';
|
|
232
|
+
*
|
|
233
|
+
* topic.iam.testPermissions(test, function(err, permissions, apiResponse) {
|
|
234
|
+
* console.log(permissions);
|
|
235
|
+
* // {
|
|
236
|
+
* // "pubsub.topics.update": true
|
|
237
|
+
* // }
|
|
238
|
+
* });
|
|
239
|
+
*
|
|
240
|
+
* //-
|
|
241
|
+
* // Test several permissions at once.
|
|
242
|
+
* //-
|
|
243
|
+
* const tests = [
|
|
244
|
+
* 'pubsub.subscriptions.consume',
|
|
245
|
+
* 'pubsub.subscriptions.update'
|
|
246
|
+
* ];
|
|
247
|
+
*
|
|
248
|
+
* subscription.iam.testPermissions(tests, function(err, permissions) {
|
|
249
|
+
* console.log(permissions);
|
|
250
|
+
* // {
|
|
251
|
+
* // "pubsub.subscriptions.consume": true,
|
|
252
|
+
* // "pubsub.subscriptions.update": false
|
|
253
|
+
* // }
|
|
254
|
+
* });
|
|
255
|
+
*
|
|
256
|
+
* //-
|
|
257
|
+
* // If the callback is omitted, we'll return a Promise.
|
|
258
|
+
* //-
|
|
259
|
+
* topic.iam.testPermissions(test).then(function(data) {
|
|
260
|
+
* const permissions = data[0];
|
|
261
|
+
* const apiResponse = data[1];
|
|
262
|
+
* });
|
|
263
|
+
* ```
|
|
264
|
+
*/
|
|
85
265
|
testPermissions(permissions: string | string[], gaxOpts?: CallOptions): Promise<TestIamPermissionsResponse>;
|
|
86
266
|
testPermissions(permissions: string | string[], gaxOpts: CallOptions, callback: TestIamPermissionsCallback): void;
|
|
87
267
|
testPermissions(permissions: string | string[], callback: TestIamPermissionsCallback): void;
|
package/build/src/iam.js
CHANGED
|
@@ -19,8 +19,8 @@ exports.IAM = void 0;
|
|
|
19
19
|
/*!
|
|
20
20
|
* @module pubsub/iam
|
|
21
21
|
*/
|
|
22
|
-
const promisify_1 = require("@google-cloud/promisify");
|
|
23
22
|
const arrify = require("arrify");
|
|
23
|
+
const util_1 = require("./util");
|
|
24
24
|
/**
|
|
25
25
|
* [IAM (Identity and Access
|
|
26
26
|
* Management)](https://cloud.google.com/pubsub/access_control) allows you to
|
|
@@ -50,6 +50,7 @@ const arrify = require("arrify");
|
|
|
50
50
|
* @see [What is Cloud IAM?]{@link https://cloud.google.com/iam/}
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
|
+
* ```
|
|
53
54
|
* const {PubSub} = require('@google-cloud/pubsub');
|
|
54
55
|
* const pubsub = new PubSub();
|
|
55
56
|
*
|
|
@@ -58,6 +59,7 @@ const arrify = require("arrify");
|
|
|
58
59
|
*
|
|
59
60
|
* const subscription = pubsub.subscription('my-subscription');
|
|
60
61
|
* // subscription.iam
|
|
62
|
+
* ```
|
|
61
63
|
*/
|
|
62
64
|
class IAM {
|
|
63
65
|
constructor(pubsub, id) {
|
|
@@ -65,45 +67,6 @@ class IAM {
|
|
|
65
67
|
this.request = pubsub.request.bind(pubsub);
|
|
66
68
|
this.id = id;
|
|
67
69
|
}
|
|
68
|
-
/**
|
|
69
|
-
* @typedef {array} GetPolicyResponse
|
|
70
|
-
* @property {object} 0 The policy.
|
|
71
|
-
*/
|
|
72
|
-
/**
|
|
73
|
-
* @callback GetPolicyCallback
|
|
74
|
-
* @param {?Error} err Request error, if any.
|
|
75
|
-
* @param {object} acl The policy.
|
|
76
|
-
*/
|
|
77
|
-
/**
|
|
78
|
-
* Get the IAM policy
|
|
79
|
-
*
|
|
80
|
-
* @param {object} [gaxOptions] Request configuration options, outlined
|
|
81
|
-
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
|
|
82
|
-
* @param {GetPolicyCallback} [callback] Callback function.
|
|
83
|
-
* @returns {Promise<GetPolicyResponse>}
|
|
84
|
-
*
|
|
85
|
-
* @see [Topics: getIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/getIamPolicy}
|
|
86
|
-
* @see [Subscriptions: getIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/getIamPolicy}
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* const {PubSub} = require('@google-cloud/pubsub');
|
|
90
|
-
* const pubsub = new PubSub();
|
|
91
|
-
*
|
|
92
|
-
* const topic = pubsub.topic('my-topic');
|
|
93
|
-
* const subscription = topic.subscription('my-subscription');
|
|
94
|
-
*
|
|
95
|
-
* topic.iam.getPolicy(function(err, policy, apiResponse) {});
|
|
96
|
-
*
|
|
97
|
-
* subscription.iam.getPolicy(function(err, policy, apiResponse) {});
|
|
98
|
-
*
|
|
99
|
-
* //-
|
|
100
|
-
* // If the callback is omitted, we'll return a Promise.
|
|
101
|
-
* //-
|
|
102
|
-
* topic.iam.getPolicy().then(function(data) {
|
|
103
|
-
* const policy = data[0];
|
|
104
|
-
* const apiResponse = data[1];
|
|
105
|
-
* });
|
|
106
|
-
*/
|
|
107
70
|
getPolicy(optsOrCallback, callback) {
|
|
108
71
|
const gaxOpts = typeof optsOrCallback === 'object' ? optsOrCallback : {};
|
|
109
72
|
callback = typeof optsOrCallback === 'function' ? optsOrCallback : callback;
|
|
@@ -117,63 +80,6 @@ class IAM {
|
|
|
117
80
|
gaxOpts,
|
|
118
81
|
}, callback);
|
|
119
82
|
}
|
|
120
|
-
/**
|
|
121
|
-
* @typedef {array} SetPolicyResponse
|
|
122
|
-
* @property {object} 0 The policy.
|
|
123
|
-
*/
|
|
124
|
-
/**
|
|
125
|
-
* @callback SetPolicyCallback
|
|
126
|
-
* @param {?Error} err Request error, if any.
|
|
127
|
-
* @param {object} acl The policy.
|
|
128
|
-
*/
|
|
129
|
-
/**
|
|
130
|
-
* Set the IAM policy
|
|
131
|
-
*
|
|
132
|
-
* @throws {Error} If no policy is provided.
|
|
133
|
-
*
|
|
134
|
-
* @param {object} policy The [policy](https://cloud.google.com/pubsub/docs/reference/rest/v1/Policy).
|
|
135
|
-
* @param {array} [policy.bindings] Bindings associate members with roles.
|
|
136
|
-
* @param {Array<object>} [policy.rules] Rules to be applied to the policy.
|
|
137
|
-
* @param {string} [policy.etag] Etags are used to perform a read-modify-write.
|
|
138
|
-
* @param {object} [gaxOptions] Request configuration options, outlined
|
|
139
|
-
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
|
|
140
|
-
* @param {SetPolicyCallback} callback Callback function.
|
|
141
|
-
* @returns {Promise<SetPolicyResponse>}
|
|
142
|
-
*
|
|
143
|
-
* @see [Topics: setIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/setIamPolicy}
|
|
144
|
-
* @see [Subscriptions: setIamPolicy API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/setIamPolicy}
|
|
145
|
-
* @see [Policy]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/Policy}
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* const {PubSub} = require('@google-cloud/pubsub');
|
|
149
|
-
* const pubsub = new PubSub();
|
|
150
|
-
*
|
|
151
|
-
* const topic = pubsub.topic('my-topic');
|
|
152
|
-
* const subscription = topic.subscription('my-subscription');
|
|
153
|
-
*
|
|
154
|
-
* const myPolicy = {
|
|
155
|
-
* bindings: [
|
|
156
|
-
* {
|
|
157
|
-
* role: 'roles/pubsub.subscriber',
|
|
158
|
-
* members:
|
|
159
|
-
* ['serviceAccount:myotherproject@appspot.gserviceaccount.com']
|
|
160
|
-
* }
|
|
161
|
-
* ]
|
|
162
|
-
* };
|
|
163
|
-
*
|
|
164
|
-
* topic.iam.setPolicy(myPolicy, function(err, policy, apiResponse) {});
|
|
165
|
-
*
|
|
166
|
-
* subscription.iam.setPolicy(myPolicy, function(err, policy, apiResponse)
|
|
167
|
-
* {});
|
|
168
|
-
*
|
|
169
|
-
* //-
|
|
170
|
-
* // If the callback is omitted, we'll return a Promise.
|
|
171
|
-
* //-
|
|
172
|
-
* topic.iam.setPolicy(myPolicy).then(function(data) {
|
|
173
|
-
* const policy = data[0];
|
|
174
|
-
* const apiResponse = data[1];
|
|
175
|
-
* });
|
|
176
|
-
*/
|
|
177
83
|
setPolicy(policy, optsOrCallback, callback) {
|
|
178
84
|
if (!(typeof policy === 'object')) {
|
|
179
85
|
throw new Error('A policy object is required.');
|
|
@@ -191,82 +97,6 @@ class IAM {
|
|
|
191
97
|
gaxOpts,
|
|
192
98
|
}, callback);
|
|
193
99
|
}
|
|
194
|
-
/**
|
|
195
|
-
* @callback TestIamPermissionsCallback
|
|
196
|
-
* @param {?Error} err Request error, if any.
|
|
197
|
-
* @param {TestIamPermissionsAPIResponse} permissions A subset of permissions that the caller is allowed.
|
|
198
|
-
* @param {PermissionsResponse} apiResponse The full API response.
|
|
199
|
-
*/
|
|
200
|
-
/**
|
|
201
|
-
* @typedef {array} TestIamPermissionsResponse
|
|
202
|
-
* @property {object[]} 0 A subset of permissions that the caller is allowed.
|
|
203
|
-
* @property {PermissionsResponse} 1 The full API response.
|
|
204
|
-
*/
|
|
205
|
-
/**
|
|
206
|
-
* @typedef {string[]} PermissionsResponse
|
|
207
|
-
* A subset of TestPermissionsRequest.permissions that the caller is allowed.
|
|
208
|
-
* @see https://cloud.google.com/pubsub/docs/reference/rpc/google.iam.v1#google.iam.v1.TestIamPermissionsRequest
|
|
209
|
-
*/
|
|
210
|
-
/**
|
|
211
|
-
* Test a set of permissions for a resource.
|
|
212
|
-
*
|
|
213
|
-
* Permissions with wildcards such as `*` or `storage.*` are not allowed.
|
|
214
|
-
*
|
|
215
|
-
* @throws {Error} If permissions are not provided.
|
|
216
|
-
*
|
|
217
|
-
* @param {string|string[]} permissions The permission(s) to test for.
|
|
218
|
-
* @param {object} [gaxOptions] Request configuration options, outlined
|
|
219
|
-
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
|
|
220
|
-
* @param {TestIamPermissionsCallback} [callback] Callback function.
|
|
221
|
-
* @returns {Promise<TestIamPermissionsResponse>}
|
|
222
|
-
*
|
|
223
|
-
* @see [Topics: testIamPermissions API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/testIamPermissions}
|
|
224
|
-
* @see [Subscriptions: testIamPermissions API Documentation]{@link https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/testIamPermissions}
|
|
225
|
-
* @see [Permissions Reference]{@link https://cloud.google.com/pubsub/access_control#permissions}
|
|
226
|
-
*
|
|
227
|
-
* @example
|
|
228
|
-
* const {PubSub} = require('@google-cloud/pubsub');
|
|
229
|
-
* const pubsub = new PubSub();
|
|
230
|
-
*
|
|
231
|
-
* const topic = pubsub.topic('my-topic');
|
|
232
|
-
* const subscription = topic.subscription('my-subscription');
|
|
233
|
-
*
|
|
234
|
-
* //-
|
|
235
|
-
* // Test a single permission.
|
|
236
|
-
* //-
|
|
237
|
-
* const test = 'pubsub.topics.update';
|
|
238
|
-
*
|
|
239
|
-
* topic.iam.testPermissions(test, function(err, permissions, apiResponse) {
|
|
240
|
-
* console.log(permissions);
|
|
241
|
-
* // {
|
|
242
|
-
* // "pubsub.topics.update": true
|
|
243
|
-
* // }
|
|
244
|
-
* });
|
|
245
|
-
*
|
|
246
|
-
* //-
|
|
247
|
-
* // Test several permissions at once.
|
|
248
|
-
* //-
|
|
249
|
-
* const tests = [
|
|
250
|
-
* 'pubsub.subscriptions.consume',
|
|
251
|
-
* 'pubsub.subscriptions.update'
|
|
252
|
-
* ];
|
|
253
|
-
*
|
|
254
|
-
* subscription.iam.testPermissions(tests, function(err, permissions) {
|
|
255
|
-
* console.log(permissions);
|
|
256
|
-
* // {
|
|
257
|
-
* // "pubsub.subscriptions.consume": true,
|
|
258
|
-
* // "pubsub.subscriptions.update": false
|
|
259
|
-
* // }
|
|
260
|
-
* });
|
|
261
|
-
*
|
|
262
|
-
* //-
|
|
263
|
-
* // If the callback is omitted, we'll return a Promise.
|
|
264
|
-
* //-
|
|
265
|
-
* topic.iam.testPermissions(test).then(function(data) {
|
|
266
|
-
* const permissions = data[0];
|
|
267
|
-
* const apiResponse = data[1];
|
|
268
|
-
* });
|
|
269
|
-
*/
|
|
270
100
|
testPermissions(permissions, optsOrCallback, callback) {
|
|
271
101
|
if (!Array.isArray(permissions) && !(typeof permissions === 'string')) {
|
|
272
102
|
throw new Error('Permissions are required.');
|
|
@@ -299,8 +129,13 @@ class IAM {
|
|
|
299
129
|
exports.IAM = IAM;
|
|
300
130
|
/*! Developer Documentation
|
|
301
131
|
*
|
|
302
|
-
*
|
|
303
|
-
* that a callback is omitted.
|
|
132
|
+
* Existing async methods (except for streams) will return a Promise in the event
|
|
133
|
+
* that a callback is omitted. Future methods will not allow for a callback.
|
|
134
|
+
* (Use .then() on the returned Promise instead.)
|
|
304
135
|
*/
|
|
305
|
-
|
|
136
|
+
util_1.promisifySome(IAM, IAM.prototype, [
|
|
137
|
+
'getPolicy',
|
|
138
|
+
'setPolicy',
|
|
139
|
+
'testPermissions',
|
|
140
|
+
]);
|
|
306
141
|
//# sourceMappingURL=iam.js.map
|
package/build/src/iam.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iam.js","sourceRoot":"","sources":["../../src/iam.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;GAEG;AAEH,
|
|
1
|
+
{"version":3,"file":"iam.js","sourceRoot":"","sources":["../../src/iam.ts"],"names":[],"mappings":"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"}
|
package/build/src/index.d.ts
CHANGED
|
@@ -29,21 +29,29 @@
|
|
|
29
29
|
* @module {PubSub} @google-cloud/pubsub
|
|
30
30
|
* @alias nodejs-pubsub
|
|
31
31
|
*
|
|
32
|
-
* @example
|
|
32
|
+
* @example Install the client library with <a href="https://www.npmjs.com/">npm</a>:
|
|
33
|
+
* ```
|
|
33
34
|
* npm install @google-cloud/pubsub
|
|
34
35
|
*
|
|
35
|
-
*
|
|
36
|
+
* ```
|
|
37
|
+
* @example Import the client library
|
|
38
|
+
* ```
|
|
36
39
|
* const {PubSub} = require('@google-cloud/pubsub');
|
|
37
40
|
*
|
|
38
|
-
*
|
|
41
|
+
* ```
|
|
42
|
+
* @example Create a client that uses <a href="https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application">Application Default Credentials (ADC)</a>:
|
|
43
|
+
* ```
|
|
39
44
|
* const pubsub = new PubSub();
|
|
40
45
|
*
|
|
41
|
-
*
|
|
46
|
+
* ```
|
|
47
|
+
* @example Create a client with <a href="https://cloud.google.com/docs/authentication/production#obtaining_and_providing_service_account_credentials_manually">explicit credentials</a>:
|
|
48
|
+
* ```
|
|
42
49
|
* const pubsub = new PubSub({
|
|
43
50
|
* projectId: 'your-project-id',
|
|
44
51
|
* keyFilename: '/path/to/keyfile.json'
|
|
45
52
|
* });
|
|
46
53
|
*
|
|
54
|
+
* ```
|
|
47
55
|
* @example <caption>include:samples/quickstart.js</caption>
|
|
48
56
|
* region_tag:pubsub_quickstart_create_topic
|
|
49
57
|
* Full quickstart example:
|
|
@@ -79,6 +87,7 @@ export { Policy, GetPolicyCallback, SetPolicyCallback, SetPolicyResponse, GetPol
|
|
|
79
87
|
export { Attributes, PublishCallback, PublishOptions } from './publisher';
|
|
80
88
|
export { BatchPublishOptions } from './publisher/message-batch';
|
|
81
89
|
export { PublishError } from './publisher/publish-error';
|
|
90
|
+
export { FlowControlOptions } from './publisher/flow-control';
|
|
82
91
|
export { PageOptions, GetSnapshotsCallback, GetSnapshotsResponse, GetSubscriptionsCallback, GetSubscriptionsResponse, GetTopicsCallback, GetTopicsResponse, EmptyCallback, EmptyResponse, ExistsCallback, ExistsResponse, PubSub, ClientConfig, } from './pubsub';
|
|
83
92
|
export { CreateSnapshotCallback, CreateSnapshotResponse, SeekCallback, SeekResponse, Snapshot, } from './snapshot';
|
|
84
93
|
export { Message, SubscriberOptions } from './subscriber';
|
package/build/src/index.js
CHANGED
|
@@ -32,21 +32,29 @@ exports.protos = exports.v1 = void 0;
|
|
|
32
32
|
* @module {PubSub} @google-cloud/pubsub
|
|
33
33
|
* @alias nodejs-pubsub
|
|
34
34
|
*
|
|
35
|
-
* @example
|
|
35
|
+
* @example Install the client library with <a href="https://www.npmjs.com/">npm</a>:
|
|
36
|
+
* ```
|
|
36
37
|
* npm install @google-cloud/pubsub
|
|
37
38
|
*
|
|
38
|
-
*
|
|
39
|
+
* ```
|
|
40
|
+
* @example Import the client library
|
|
41
|
+
* ```
|
|
39
42
|
* const {PubSub} = require('@google-cloud/pubsub');
|
|
40
43
|
*
|
|
41
|
-
*
|
|
44
|
+
* ```
|
|
45
|
+
* @example Create a client that uses <a href="https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application">Application Default Credentials (ADC)</a>:
|
|
46
|
+
* ```
|
|
42
47
|
* const pubsub = new PubSub();
|
|
43
48
|
*
|
|
44
|
-
*
|
|
49
|
+
* ```
|
|
50
|
+
* @example Create a client with <a href="https://cloud.google.com/docs/authentication/production#obtaining_and_providing_service_account_credentials_manually">explicit credentials</a>:
|
|
51
|
+
* ```
|
|
45
52
|
* const pubsub = new PubSub({
|
|
46
53
|
* projectId: 'your-project-id',
|
|
47
54
|
* keyFilename: '/path/to/keyfile.json'
|
|
48
55
|
* });
|
|
49
56
|
*
|
|
57
|
+
* ```
|
|
50
58
|
* @example <caption>include:samples/quickstart.js</caption>
|
|
51
59
|
* region_tag:pubsub_quickstart_create_topic
|
|
52
60
|
* Full quickstart example:
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;GAEG;AACH;;GAEG;AAEH
|
|
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,+CAgBwB;AADtB,4GAAA,YAAY,OAAA;AAEd,iCAciB;AAFf,8FAAA,KAAK,OAAA;AAIP,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE;IAC1B,OAAO,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC;IACxC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACxB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;CAC/C;AACD,2CAA2C;AACnC,wBAAM"}
|