Skip to content

Commit

Permalink
feat!: node 12 eos (#1774) (#1784)
Browse files Browse the repository at this point in the history
* 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 <57276408+feywind@users.noreply.github.com>

* 🦉 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 <renovate@whitesourcesoftware.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 2, 2023
1 parent 6efeb2c commit 47b83c1
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .github/sync-repo-settings.yaml
Expand Up @@ -9,9 +9,9 @@ branchProtectionRules:
- "ci/kokoro: System test"
- docs
- lint
- test (12)
- test (14)
- test (16)
- test (18)
- cla/google
- windows
- OwlBot Post Processor
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14, 16, 18]
node: [14, 16, 18, 20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -12,3 +12,4 @@ system-test/*key.json
.DS_Store
package-lock.json
__pycache__
*.tgz
24 changes: 0 additions & 24 deletions .kokoro/continuous/node12/common.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/continuous/node12/lint.cfg

This file was deleted.

Empty file.
12 changes: 0 additions & 12 deletions .kokoro/continuous/node12/samples-test.cfg

This file was deleted.

12 changes: 0 additions & 12 deletions .kokoro/continuous/node12/system-test.cfg

This file was deleted.

Empty file removed .kokoro/continuous/node12/test.cfg
Empty file.
24 changes: 0 additions & 24 deletions .kokoro/presubmit/node12/common.cfg

This file was deleted.

12 changes: 0 additions & 12 deletions .kokoro/presubmit/node12/samples-test.cfg

This file was deleted.

12 changes: 0 additions & 12 deletions .kokoro/presubmit/node12/system-test.cfg

This file was deleted.

Empty file removed .kokoro/presubmit/node12/test.cfg
Empty file.
26 changes: 14 additions & 12 deletions package.json
@@ -1,11 +1,11 @@
{
"name": "@google-cloud/pubsub",
"description": "Cloud Pub/Sub Client Library for Node.js",
"version": "3.7.3",
"version": "4.0.0",
"license": "Apache-2.0",
"author": "Google Inc.",
"engines": {
"node": ">=12.0.0"
"node": ">=14.0.0"
},
"repository": "googleapis/nodejs-pubsub",
"main": "./build/src/index.js",
Expand All @@ -29,7 +29,7 @@
"scripts": {
"presystem-test": "npm run compile",
"system-test": "mocha build/system-test --timeout 600000",
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
"samples-test": "cd samples/ && npm install && npm test && cd ../",
"test": "c8 mocha build/test --recursive",
"lint": "gts check",
"predocs": "npm run compile",
Expand All @@ -43,22 +43,23 @@
"docs-test": "linkinator docs",
"predocs-test": "npm run docs",
"benchwrapper": "node bin/benchwrapper.js",
"prelint": "cd samples; npm link ../; npm install",
"precompile": "gts clean"
"prelint": "npm run pack && cd samples; npm install",
"precompile": "gts clean",
"pack": "npm pack && mv google-cloud-pubsub*.tgz samples/pubsub-current.tgz"
},
"dependencies": {
"@google-cloud/paginator": "^4.0.0",
"@google-cloud/precise-date": "^3.0.0",
"@google-cloud/paginator": "^4.0.1",
"@google-cloud/precise-date": "^3.0.1",
"@google-cloud/projectify": "^3.0.0",
"@google-cloud/promisify": "^2.0.0",
"@google-cloud/promisify": "^3.0.1",
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/semantic-conventions": "~1.3.0",
"@types/duplexify": "^3.6.0",
"@types/long": "^4.0.0",
"arrify": "^2.0.0",
"extend": "^3.0.2",
"google-auth-library": "^8.0.2",
"google-gax": "^3.6.1",
"google-auth-library": "^9.0.0",
"google-gax": "^4.0.2",
"heap-js": "^2.2.0",
"is-stream-ended": "^0.1.4",
"lodash.snakecase": "^4.1.1",
Expand All @@ -81,7 +82,8 @@
"c8": "^8.0.0",
"codecov": "^3.0.0",
"execa": "^5.0.0",
"gts": "^3.1.0",
"gapic-tools": "^0.1.7",
"gts": "^3.1.1",
"jsdoc": "^4.0.0",
"jsdoc-fresh": "^2.0.0",
"jsdoc-region-tag": "^2.0.0",
Expand All @@ -95,7 +97,7 @@
"sinon": "^15.0.0",
"tmp": "^0.2.0",
"ts-loader": "^9.0.0",
"typescript": "^4.6.4",
"typescript": "^5.1.6",
"uuid": "^9.0.0",
"webpack": "^5.0.0",
"webpack-cli": "^5.0.0",
Expand Down
3 changes: 2 additions & 1 deletion samples/package.json
Expand Up @@ -12,6 +12,7 @@
"node": ">=12.0.0"
},
"scripts": {
"preinstall": "cd .. && npm run pack && cd samples",
"test": "mocha build/system-test --timeout 600000",
"pretest": "npm run compile && cp -f *.js build/",
"tsc": "tsc -p .",
Expand All @@ -21,7 +22,7 @@
"precompile": "npm run clean"
},
"dependencies": {
"@google-cloud/pubsub": "^3.7.3",
"@google-cloud/pubsub": "./pubsub-current.tgz",
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/tracing": "^0.24.0",
"avro-js": "^1.10.1",
Expand Down
32 changes: 15 additions & 17 deletions src/subscription.ts
Expand Up @@ -42,9 +42,11 @@ import {
SeekResponse,
Snapshot,
} from './snapshot';
import {Subscriber, SubscriberOptions} from './subscriber';
import {Message, Subscriber, SubscriberOptions} from './subscriber';
import {Topic} from './topic';
import {promisifySome} from './util';
import {StatusError} from './message-stream';
import {DebugMessage} from './debug';

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

Expand Down Expand Up @@ -92,30 +94,26 @@ export type DetachSubscriptionResponse = EmptyResponse;

// JSDoc won't see these, so this is just to let you get typings
// in your editor of choice.
//
// NOTE: These are commented out for now because we don't want to
// break any existing clients that rely on not-entirely-correct
// typings. We'll re-enable on the next major.
/* export declare interface Subscription {
export declare interface Subscription {
on(event: 'message', listener: (message: Message) => void): this;
on(event: 'error', listener: (error: StatusError) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'debug', listener: (msg: DebugMessage) => void): this;

// Only used internally.
on(
event: 'message',
listener: (message: Message) => void
event: 'newListener',
listener: (event: string | symbol, listener: Function) => void
): this;
on(
event: 'error',
listener: (error: StatusError) => void
event: 'removeListener',
listener: (event: string | symbol, listener: Function) => void
): this;
on(event: 'close', listener: () => void): this;
on(event: 'debug', listener: (msg: DebugMessage) => void); this;
// Only used internally.
on(event: 'newListener', listener: Function): this;
on(event: 'removeListener', listener: Function): this;

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

/**
* @typedef {object} ExpirationPolicy
Expand Down
6 changes: 3 additions & 3 deletions src/v1/publisher_client.ts
Expand Up @@ -1546,7 +1546,7 @@ export class PublisherClient {
IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined,
{} | null | undefined
>
): Promise<IamProtos.google.iam.v1.Policy> {
): Promise<[IamProtos.google.iam.v1.Policy]> {
return this.iamClient.getIamPolicy(request, options, callback);
}

Expand Down Expand Up @@ -1594,7 +1594,7 @@ export class PublisherClient {
IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined,
{} | null | undefined
>
): Promise<IamProtos.google.iam.v1.Policy> {
): Promise<[IamProtos.google.iam.v1.Policy]> {
return this.iamClient.setIamPolicy(request, options, callback);
}

Expand Down Expand Up @@ -1643,7 +1643,7 @@ export class PublisherClient {
IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined,
{} | null | undefined
>
): Promise<IamProtos.google.iam.v1.TestIamPermissionsResponse> {
): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> {
return this.iamClient.testIamPermissions(request, options, callback);
}

Expand Down
6 changes: 3 additions & 3 deletions src/v1/schema_service_client.ts
Expand Up @@ -1494,7 +1494,7 @@ export class SchemaServiceClient {
IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined,
{} | null | undefined
>
): Promise<IamProtos.google.iam.v1.Policy> {
): Promise<[IamProtos.google.iam.v1.Policy]> {
return this.iamClient.getIamPolicy(request, options, callback);
}

Expand Down Expand Up @@ -1542,7 +1542,7 @@ export class SchemaServiceClient {
IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined,
{} | null | undefined
>
): Promise<IamProtos.google.iam.v1.Policy> {
): Promise<[IamProtos.google.iam.v1.Policy]> {
return this.iamClient.setIamPolicy(request, options, callback);
}

Expand Down Expand Up @@ -1591,7 +1591,7 @@ export class SchemaServiceClient {
IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined,
{} | null | undefined
>
): Promise<IamProtos.google.iam.v1.TestIamPermissionsResponse> {
): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> {
return this.iamClient.testIamPermissions(request, options, callback);
}

Expand Down
6 changes: 3 additions & 3 deletions src/v1/subscriber_client.ts
Expand Up @@ -2159,7 +2159,7 @@ export class SubscriberClient {
IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined,
{} | null | undefined
>
): Promise<IamProtos.google.iam.v1.Policy> {
): Promise<[IamProtos.google.iam.v1.Policy]> {
return this.iamClient.getIamPolicy(request, options, callback);
}

Expand Down Expand Up @@ -2207,7 +2207,7 @@ export class SubscriberClient {
IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined,
{} | null | undefined
>
): Promise<IamProtos.google.iam.v1.Policy> {
): Promise<[IamProtos.google.iam.v1.Policy]> {
return this.iamClient.setIamPolicy(request, options, callback);
}

Expand Down Expand Up @@ -2256,7 +2256,7 @@ export class SubscriberClient {
IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined,
{} | null | undefined
>
): Promise<IamProtos.google.iam.v1.TestIamPermissionsResponse> {
): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> {
return this.iamClient.testIamPermissions(request, options, callback);
}

Expand Down

0 comments on commit 47b83c1

Please sign in to comment.