Skip to content

Commit 47b83c1

Browse files
feywindrenovate-botgcf-owl-bot[bot]
authored
feat!: node 12 eos (#1774) (#1784)
* feat!: node 12 eos (#1774) - moving to googleapis * feat!: bring in typing interface for Subscription events * feat!: gax 4 updates - some of this will be regen'd, just testing * fix!(deps): update dependency google-gax to v4 (#1780) * fix!(deps): update dependency google-auth-library to v9 (#1776) Co-authored-by: Megan Potter <[email protected]> * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * build: revert incorrect owlbot change * deps!: update dependencies and kokoro files * build: samples package.json should use the new major * fix!: manually update testIam methods.. not sure why these didn't update * build: make samples always use current version; update to 4.0.0 * build: update check config * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * build: let sample tests drive npm pack --------- Co-authored-by: Mend Renovate Co-authored-by: Owl Bot
1 parent 6efeb2c commit 47b83c1

19 files changed

+43
-141
lines changed

.github/sync-repo-settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ branchProtectionRules:
99
- "ci/kokoro: System test"
1010
- docs
1111
- lint
12-
- test (12)
1312
- test (14)
1413
- test (16)
14+
- test (18)
1515
- cla/google
1616
- windows
1717
- OwlBot Post Processor

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
node: [12, 14, 16, 18]
12+
node: [14, 16, 18, 20]
1313
steps:
1414
- uses: actions/checkout@v3
1515
- uses: actions/setup-node@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ system-test/*key.json
1212
.DS_Store
1313
package-lock.json
1414
__pycache__
15+
*.tgz

.kokoro/continuous/node12/common.cfg

Lines changed: 0 additions & 24 deletions
This file was deleted.

.kokoro/continuous/node12/lint.cfg

Lines changed: 0 additions & 4 deletions
This file was deleted.

.kokoro/continuous/node12/pubsub_perf_bench.cfg

Whitespace-only changes.

.kokoro/continuous/node12/samples-test.cfg

Lines changed: 0 additions & 12 deletions
This file was deleted.

.kokoro/continuous/node12/system-test.cfg

Lines changed: 0 additions & 12 deletions
This file was deleted.

.kokoro/continuous/node12/test.cfg

Whitespace-only changes.

.kokoro/presubmit/node12/common.cfg

Lines changed: 0 additions & 24 deletions
This file was deleted.

.kokoro/presubmit/node12/samples-test.cfg

Lines changed: 0 additions & 12 deletions
This file was deleted.

.kokoro/presubmit/node12/system-test.cfg

Lines changed: 0 additions & 12 deletions
This file was deleted.

.kokoro/presubmit/node12/test.cfg

Whitespace-only changes.

package.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@google-cloud/pubsub",
33
"description": "Cloud Pub/Sub Client Library for Node.js",
4-
"version": "3.7.3",
4+
"version": "4.0.0",
55
"license": "Apache-2.0",
66
"author": "Google Inc.",
77
"engines": {
8-
"node": ">=12.0.0"
8+
"node": ">=14.0.0"
99
},
1010
"repository": "googleapis/nodejs-pubsub",
1111
"main": "./build/src/index.js",
@@ -29,7 +29,7 @@
2929
"scripts": {
3030
"presystem-test": "npm run compile",
3131
"system-test": "mocha build/system-test --timeout 600000",
32-
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
32+
"samples-test": "cd samples/ && npm install && npm test && cd ../",
3333
"test": "c8 mocha build/test --recursive",
3434
"lint": "gts check",
3535
"predocs": "npm run compile",
@@ -43,22 +43,23 @@
4343
"docs-test": "linkinator docs",
4444
"predocs-test": "npm run docs",
4545
"benchwrapper": "node bin/benchwrapper.js",
46-
"prelint": "cd samples; npm link ../; npm install",
47-
"precompile": "gts clean"
46+
"prelint": "npm run pack && cd samples; npm install",
47+
"precompile": "gts clean",
48+
"pack": "npm pack && mv google-cloud-pubsub*.tgz samples/pubsub-current.tgz"
4849
},
4950
"dependencies": {
50-
"@google-cloud/paginator": "^4.0.0",
51-
"@google-cloud/precise-date": "^3.0.0",
51+
"@google-cloud/paginator": "^4.0.1",
52+
"@google-cloud/precise-date": "^3.0.1",
5253
"@google-cloud/projectify": "^3.0.0",
53-
"@google-cloud/promisify": "^2.0.0",
54+
"@google-cloud/promisify": "^3.0.1",
5455
"@opentelemetry/api": "^1.0.0",
5556
"@opentelemetry/semantic-conventions": "~1.3.0",
5657
"@types/duplexify": "^3.6.0",
5758
"@types/long": "^4.0.0",
5859
"arrify": "^2.0.0",
5960
"extend": "^3.0.2",
60-
"google-auth-library": "^8.0.2",
61-
"google-gax": "^3.6.1",
61+
"google-auth-library": "^9.0.0",
62+
"google-gax": "^4.0.2",
6263
"heap-js": "^2.2.0",
6364
"is-stream-ended": "^0.1.4",
6465
"lodash.snakecase": "^4.1.1",
@@ -81,7 +82,8 @@
8182
"c8": "^8.0.0",
8283
"codecov": "^3.0.0",
8384
"execa": "^5.0.0",
84-
"gts": "^3.1.0",
85+
"gapic-tools": "^0.1.7",
86+
"gts": "^3.1.1",
8587
"jsdoc": "^4.0.0",
8688
"jsdoc-fresh": "^2.0.0",
8789
"jsdoc-region-tag": "^2.0.0",
@@ -95,7 +97,7 @@
9597
"sinon": "^15.0.0",
9698
"tmp": "^0.2.0",
9799
"ts-loader": "^9.0.0",
98-
"typescript": "^4.6.4",
100+
"typescript": "^5.1.6",
99101
"uuid": "^9.0.0",
100102
"webpack": "^5.0.0",
101103
"webpack-cli": "^5.0.0",

samples/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"node": ">=12.0.0"
1313
},
1414
"scripts": {
15+
"preinstall": "cd .. && npm run pack && cd samples",
1516
"test": "mocha build/system-test --timeout 600000",
1617
"pretest": "npm run compile && cp -f *.js build/",
1718
"tsc": "tsc -p .",
@@ -21,7 +22,7 @@
2122
"precompile": "npm run clean"
2223
},
2324
"dependencies": {
24-
"@google-cloud/pubsub": "^3.7.3",
25+
"@google-cloud/pubsub": "./pubsub-current.tgz",
2526
"@opentelemetry/api": "^1.0.0",
2627
"@opentelemetry/tracing": "^0.24.0",
2728
"avro-js": "^1.10.1",

src/subscription.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ import {
4242
SeekResponse,
4343
Snapshot,
4444
} from './snapshot';
45-
import {Subscriber, SubscriberOptions} from './subscriber';
45+
import {Message, Subscriber, SubscriberOptions} from './subscriber';
4646
import {Topic} from './topic';
4747
import {promisifySome} from './util';
48+
import {StatusError} from './message-stream';
49+
import {DebugMessage} from './debug';
4850

4951
export {AckError, AckResponse, AckResponses} from './subscriber';
5052

@@ -92,30 +94,26 @@ export type DetachSubscriptionResponse = EmptyResponse;
9294

9395
// JSDoc won't see these, so this is just to let you get typings
9496
// in your editor of choice.
95-
//
96-
// NOTE: These are commented out for now because we don't want to
97-
// break any existing clients that rely on not-entirely-correct
98-
// typings. We'll re-enable on the next major.
99-
/* export declare interface Subscription {
97+
export declare interface Subscription {
98+
on(event: 'message', listener: (message: Message) => void): this;
99+
on(event: 'error', listener: (error: StatusError) => void): this;
100+
on(event: 'close', listener: () => void): this;
101+
on(event: 'debug', listener: (msg: DebugMessage) => void): this;
102+
103+
// Only used internally.
100104
on(
101-
event: 'message',
102-
listener: (message: Message) => void
105+
event: 'newListener',
106+
listener: (event: string | symbol, listener: Function) => void
103107
): this;
104108
on(
105-
event: 'error',
106-
listener: (error: StatusError) => void
109+
event: 'removeListener',
110+
listener: (event: string | symbol, listener: Function) => void
107111
): this;
108-
on(event: 'close', listener: () => void): this;
109-
on(event: 'debug', listener: (msg: DebugMessage) => void); this;
110-
111-
// Only used internally.
112-
on(event: 'newListener', listener: Function): this;
113-
on(event: 'removeListener', listener: Function): this;
114112

115113
// Catch-all. If you get an error about this line, it means you're
116114
// using an unsupported event type or listener type.
117115
on(event: string, listener: void): this;
118-
} */
116+
}
119117

120118
/**
121119
* @typedef {object} ExpirationPolicy

src/v1/publisher_client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ export class PublisherClient {
15461546
IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined,
15471547
{} | null | undefined
15481548
>
1549-
): Promise<IamProtos.google.iam.v1.Policy> {
1549+
): Promise<[IamProtos.google.iam.v1.Policy]> {
15501550
return this.iamClient.getIamPolicy(request, options, callback);
15511551
}
15521552

@@ -1594,7 +1594,7 @@ export class PublisherClient {
15941594
IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined,
15951595
{} | null | undefined
15961596
>
1597-
): Promise<IamProtos.google.iam.v1.Policy> {
1597+
): Promise<[IamProtos.google.iam.v1.Policy]> {
15981598
return this.iamClient.setIamPolicy(request, options, callback);
15991599
}
16001600

@@ -1643,7 +1643,7 @@ export class PublisherClient {
16431643
IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined,
16441644
{} | null | undefined
16451645
>
1646-
): Promise<IamProtos.google.iam.v1.TestIamPermissionsResponse> {
1646+
): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> {
16471647
return this.iamClient.testIamPermissions(request, options, callback);
16481648
}
16491649

src/v1/schema_service_client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ export class SchemaServiceClient {
14941494
IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined,
14951495
{} | null | undefined
14961496
>
1497-
): Promise<IamProtos.google.iam.v1.Policy> {
1497+
): Promise<[IamProtos.google.iam.v1.Policy]> {
14981498
return this.iamClient.getIamPolicy(request, options, callback);
14991499
}
15001500

@@ -1542,7 +1542,7 @@ export class SchemaServiceClient {
15421542
IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined,
15431543
{} | null | undefined
15441544
>
1545-
): Promise<IamProtos.google.iam.v1.Policy> {
1545+
): Promise<[IamProtos.google.iam.v1.Policy]> {
15461546
return this.iamClient.setIamPolicy(request, options, callback);
15471547
}
15481548

@@ -1591,7 +1591,7 @@ export class SchemaServiceClient {
15911591
IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined,
15921592
{} | null | undefined
15931593
>
1594-
): Promise<IamProtos.google.iam.v1.TestIamPermissionsResponse> {
1594+
): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> {
15951595
return this.iamClient.testIamPermissions(request, options, callback);
15961596
}
15971597

src/v1/subscriber_client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,7 @@ export class SubscriberClient {
21592159
IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined,
21602160
{} | null | undefined
21612161
>
2162-
): Promise<IamProtos.google.iam.v1.Policy> {
2162+
): Promise<[IamProtos.google.iam.v1.Policy]> {
21632163
return this.iamClient.getIamPolicy(request, options, callback);
21642164
}
21652165

@@ -2207,7 +2207,7 @@ export class SubscriberClient {
22072207
IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined,
22082208
{} | null | undefined
22092209
>
2210-
): Promise<IamProtos.google.iam.v1.Policy> {
2210+
): Promise<[IamProtos.google.iam.v1.Policy]> {
22112211
return this.iamClient.setIamPolicy(request, options, callback);
22122212
}
22132213

@@ -2256,7 +2256,7 @@ export class SubscriberClient {
22562256
IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined,
22572257
{} | null | undefined
22582258
>
2259-
): Promise<IamProtos.google.iam.v1.TestIamPermissionsResponse> {
2259+
): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> {
22602260
return this.iamClient.testIamPermissions(request, options, callback);
22612261
}
22622262

0 commit comments

Comments
 (0)