New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@google-cloud/pubsub

Package Overview
Dependencies
Maintainers
1
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/pubsub - npm Package Compare versions

Comparing version 2.0.0-beta.0 to 2.0.0

6

build/src/iam.js

@@ -80,3 +80,3 @@ "use strict";

* @param {object} [gaxOptions] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {GetPolicyCallback} [callback] Callback function.

@@ -139,3 +139,3 @@ * @returns {Promise<GetPolicyResponse>}

* @param {object} [gaxOptions] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {SetPolicyCallback} callback Callback function.

@@ -220,3 +220,3 @@ * @returns {Promise<SetPolicyResponse>}

* @param {object} [gaxOptions] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {TestIamPermissionsCallback} [callback] Callback function.

@@ -223,0 +223,0 @@ * @returns {Promise<TestIamPermissionsResponse>}

@@ -93,6 +93,5 @@ "use strict";

console.info('gRPC logging set to verbose');
// eslint-disable-next-line
const { setLogger, setLogVerbosity, logVerbosity } = require('@grpc/grpc-js');
setLogger(console);
setLogVerbosity(logVerbosity.DEBUG);
const grpc = require('google-gax').grpc;
grpc.setLogger(console);
grpc.setLogVerbosity(grpc.logVerbosity.DEBUG);
}

@@ -99,0 +98,0 @@ const protos = require("../protos/protos");

@@ -17,4 +17,3 @@ /*!

/// <reference types="node" />
import { CallOptions } from 'google-gax';
import { Metadata, ServiceError, status } from '@grpc/grpc-js';
import { CallOptions, grpc } from 'google-gax';
import defer = require('p-defer');

@@ -36,8 +35,8 @@ import { Message, Subscriber } from './subscriber';

*/
export declare class BatchError extends Error implements ServiceError {
export declare class BatchError extends Error implements grpc.ServiceError {
ackIds: string[];
code: status;
code: grpc.status;
details: string;
metadata: Metadata;
constructor(err: ServiceError, ackIds: string[], rpc: string);
metadata: grpc.Metadata;
constructor(err: grpc.ServiceError, ackIds: string[], rpc: string);
}

@@ -44,0 +43,0 @@ /**

@@ -17,3 +17,3 @@ /*!

/// <reference types="node" />
import { Metadata, ServiceError, status, StatusObject } from '@grpc/grpc-js';
import { grpc } from 'google-gax';
import { PassThrough } from 'stream';

@@ -28,7 +28,7 @@ import { Subscriber } from './subscriber';

*/
export declare class StatusError extends Error implements ServiceError {
code: status;
export declare class StatusError extends Error implements grpc.ServiceError {
code: grpc.status;
details: string;
metadata: Metadata;
constructor(status: StatusObject);
metadata: grpc.Metadata;
constructor(status: grpc.StatusObject);
}

@@ -42,6 +42,6 @@ /**

*/
export declare class ChannelError extends Error implements ServiceError {
code: status;
export declare class ChannelError extends Error implements grpc.ServiceError {
code: grpc.status;
details: string;
metadata: Metadata;
metadata: grpc.Metadata;
constructor(err: Error);

@@ -48,0 +48,0 @@ }

@@ -19,3 +19,3 @@ "use strict";

const promisify_1 = require("@google-cloud/promisify");
const grpc_js_1 = require("@grpc/grpc-js");
const google_gax_1 = require("google-gax");
const isStreamEnded = require("is-stream-ended");

@@ -68,6 +68,6 @@ const stream_1 = require("stream");

this.code = err.message.includes('deadline')
? grpc_js_1.status.DEADLINE_EXCEEDED
: grpc_js_1.status.UNKNOWN;
? google_gax_1.grpc.status.DEADLINE_EXCEEDED
: google_gax_1.grpc.status.UNKNOWN;
this.details = err.message;
this.metadata = new grpc_js_1.Metadata();
this.metadata = new google_gax_1.grpc.Metadata();
}

@@ -74,0 +74,0 @@ }

@@ -16,3 +16,3 @@ /*!

*/
import { ServiceError, Metadata, status } from '@grpc/grpc-js';
import { grpc } from 'google-gax';
/**

@@ -24,9 +24,9 @@ * Exception to be thrown during failed ordered publish.

*/
export declare class PublishError extends Error implements ServiceError {
code: status;
export declare class PublishError extends Error implements grpc.ServiceError {
code: grpc.status;
details: string;
metadata: Metadata;
metadata: grpc.Metadata;
orderingKey: string;
error: ServiceError;
constructor(key: string, err: ServiceError);
error: grpc.ServiceError;
constructor(key: string, err: grpc.ServiceError);
}
"use strict";
/*!
* Copyright 2019 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });

@@ -28,3 +13,3 @@ /**

/**
* The gRPC status code.
* The gRPC grpc.status code.
*

@@ -36,3 +21,3 @@ * @name PublishError#code

/**
* The gRPC status details.
* The gRPC grpc.status details.
*

@@ -44,5 +29,5 @@ * @name PublishError#details

/**
* The gRPC metadata object.
* The gRPC grpc.Metadata object.
*
* @name PublishError#metadata
* @name PublishError#grpc.Metadata
* @type {object}

@@ -49,0 +34,0 @@ */

@@ -19,3 +19,2 @@ /*!

import * as gax from 'google-gax';
import { ServiceError, ChannelCredentials } from '@grpc/grpc-js';
import { Snapshot } from './snapshot';

@@ -33,3 +32,3 @@ import { Subscription, SubscriptionOptions, CreateSubscriptionOptions, CreateSubscriptionCallback, CreateSubscriptionResponse } from './subscription';

port?: string | number;
sslCreds?: ChannelCredentials;
sslCreds?: gax.grpc.ChannelCredentials;
}

@@ -66,10 +65,10 @@ export interface PageOptions {

export interface ResourceCallback<Resource, Response> {
(err: ServiceError | null, resource?: Resource | null, response?: Response | null): void;
(err: gax.grpc.ServiceError | null, resource?: Resource | null, response?: Response | null): void;
}
export declare type RequestCallback<T, R = void> = R extends void ? NormalCallback<T> : PagedCallback<T, R>;
export interface NormalCallback<TResponse> {
(err: ServiceError | null, res?: TResponse | null): void;
(err: gax.grpc.ServiceError | null, res?: TResponse | null): void;
}
export interface PagedCallback<Item, Response> {
(err: ServiceError | null, results?: Item[] | null, nextQuery?: {} | null, response?: Response | null): void;
(err: gax.grpc.ServiceError | null, results?: Item[] | null, nextQuery?: {} | null, response?: Response | null): void;
}

@@ -76,0 +75,0 @@ export declare type PagedResponse<Item, Response> = [Item[]] | [Item[], {} | null, Response];

@@ -23,4 +23,3 @@ "use strict";

const google_auth_library_1 = require("google-auth-library");
// eslint-disable-next-line node/no-extraneous-import
const grpc = require("@grpc/grpc-js");
const gax = require("google-gax");
// eslint-disable-next-line @typescript-eslint/no-var-requires

@@ -182,3 +181,3 @@ const PKG = require('../../package.json');

* @property {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @property {number|google.protobuf.Duration} [messageRetentionDuration] Set

@@ -294,3 +293,3 @@ * this to override the default duration of 7 days. This value is expected

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {CreateTopicCallback} [callback] Callback function.

@@ -351,3 +350,3 @@ * @returns {Promise<CreateTopicResponse>}

}
const grpcInstance = this.options.grpc || grpc;
const grpcInstance = this.options.grpc || gax.grpc;
const baseUrl = apiEndpoint || process.env.PUBSUB_EMULATOR_HOST;

@@ -375,3 +374,3 @@ const leadingProtocol = new RegExp('^https*://');

* @property {object} [options.gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @property {number} [options.pageSize] Maximum number of results to return.

@@ -450,3 +449,3 @@ * @property {string} [options.pageToken] Page token.

* @property {object} [options.gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @property {number} [options.pageSize] Maximum number of results to return.

@@ -542,3 +541,3 @@ * @property {string} [options.pageToken] Page token.

* @property {object} [options.gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @property {number} [options.pageSize] Maximum number of results to return.

@@ -545,0 +544,0 @@ * @property {string} [options.pageToken] Page token.

@@ -16,7 +16,7 @@ /*!

*/
import { StatusObject, status } from '@grpc/grpc-js';
import { grpc } from 'google-gax';
/*!
* retryable status codes
* retryable grpc.status codes
*/
export declare const RETRY_CODES: status[];
export declare const RETRY_CODES: grpc.status[];
/**

@@ -41,3 +41,3 @@ * Used to track pull requests and determine if additional requests should be

/**
* Determines if a request status should be retried.
* Determines if a request grpc.status should be retried.
*

@@ -51,6 +51,6 @@ * Deadlines behave kind of unexpectedly on streams, rather than using it as

* @private
* @param {object} status The request status.
* @param {object} grpc.status The request grpc.status.
* @returns {boolean}
*/
retry(err: StatusObject): boolean;
retry(err: grpc.StatusObject): boolean;
}

@@ -18,13 +18,12 @@ "use strict";

*/
// eslint-disable-next-line node/no-extraneous-import
const grpc_js_1 = require("@grpc/grpc-js");
const google_gax_1 = require("google-gax");
/*!
* retryable status codes
* retryable grpc.status codes
*/
exports.RETRY_CODES = [
grpc_js_1.status.DEADLINE_EXCEEDED,
grpc_js_1.status.RESOURCE_EXHAUSTED,
grpc_js_1.status.ABORTED,
grpc_js_1.status.INTERNAL,
grpc_js_1.status.UNAVAILABLE,
google_gax_1.grpc.status.DEADLINE_EXCEEDED,
google_gax_1.grpc.status.RESOURCE_EXHAUSTED,
google_gax_1.grpc.status.ABORTED,
google_gax_1.grpc.status.INTERNAL,
google_gax_1.grpc.status.UNAVAILABLE,
];

@@ -57,3 +56,3 @@ /**

/**
* Determines if a request status should be retried.
* Determines if a request grpc.status should be retried.
*

@@ -67,7 +66,8 @@ * Deadlines behave kind of unexpectedly on streams, rather than using it as

* @private
* @param {object} status The request status.
* @param {object} grpc.status The request grpc.status.
* @returns {boolean}
*/
retry(err) {
if (err.code === grpc_js_1.status.OK || err.code === grpc_js_1.status.DEADLINE_EXCEEDED) {
if (err.code === google_gax_1.grpc.status.OK ||
err.code === google_gax_1.grpc.status.DEADLINE_EXCEEDED) {
this.failures = 0;

@@ -78,3 +78,3 @@ }

}
if (err.code === grpc_js_1.status.UNAVAILABLE &&
if (err.code === google_gax_1.grpc.status.UNAVAILABLE &&
err.details &&

@@ -81,0 +81,0 @@ err.details.match(/Server shutdownNow invoked/)) {

@@ -302,3 +302,3 @@ "use strict";

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {CreateSnapshotCallback} [callback] Callback function.

@@ -362,3 +362,3 @@ * @returns {Promise<CreateSnapshotResponse>}

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {function} [callback] The callback function.

@@ -460,3 +460,3 @@ * @param {?error} callback.err An error returned while making this

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {boolean} [gaxOpts.autoCreate=false] Automatically create the

@@ -516,3 +516,3 @@ * subscription if it does not already exist.

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {GetSubscriptionMetadataCallback} [callback] Callback function.

@@ -580,3 +580,3 @@ * @returns {Promise<GetSubscriptionMetadataResponse>}

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {ModifyPushConfigCallback} [callback] Callback function.

@@ -671,3 +671,3 @@ * @returns {Promise<ModifyPushConfigResponse>}

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {SeekCallback} [callback] Callback function.

@@ -734,3 +734,3 @@ * @returns {Promise<SeekResponse>}

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {SetSubscriptionMetadataCallback} [callback] Callback function.

@@ -737,0 +737,0 @@ * @returns {Promise<SetSubscriptionMetadataResponse>}

@@ -121,3 +121,3 @@ "use strict";

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {CreateTopicCallback} [callback] Callback function.

@@ -199,3 +199,3 @@ * @returns {Promise<CreateTopicResponse>}

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {function} [callback] The callback function.

@@ -292,3 +292,3 @@ * @param {?error} callback.err An error returned while making this

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {boolean} [gaxOpts.autoCreate=false] Automatically create the topic

@@ -349,3 +349,3 @@ * does not already exist.

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {GetTopicMetadataCallback} [callback] Callback function.

@@ -645,3 +645,3 @@ * @returns {Promise<GetTopicMetadataResponse>}

* @param {object} [gaxOpts] Request configuration options, outlined
* here: https://googleapis.github.io/gax-nodejs/CallSettings.html.
* here: https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html.
* @param {SetTopicMetadataCallback} [callback] Callback function.

@@ -648,0 +648,0 @@ * @returns {Promise<SetTopicMetadataResponse>}

@@ -7,2 +7,36 @@ # Changelog

## [2.0.0](https://www.github.com/googleapis/nodejs-pubsub/compare/vv1.7.1...v2.0.0) (2020-05-20)
Please note that Node 8 is no longer supported, and Node 10 is the new minimum version of the runtime.
### ⚠ BREAKING CHANGES
* Please note that Node 8 is no longer supported, and Node 10 is the new minimum version of the runtime.
* drop support for custom promises (#970)
* convert to typescript (#923)
* **deps:** update dependency @google-cloud/projectify to v2 (#929)
### Bug Fixes
* **docs:** link to correct gaxOptions docs ([#999](https://www.github.com/googleapis/nodejs-pubsub/issues/999)) ([312e318](https://www.github.com/googleapis/nodejs-pubsub/commit/312e318ceb36eafbeb487ede7e5dbf9ccd5dfb81))
* regen protos and tests, formatting ([#991](https://www.github.com/googleapis/nodejs-pubsub/issues/991)) ([e350b97](https://www.github.com/googleapis/nodejs-pubsub/commit/e350b97ad19e49e5fe52d5eeb1ad67c8bb6ddf33))
* remove eslint, update gax, fix generated protos, run the generator ([#955](https://www.github.com/googleapis/nodejs-pubsub/issues/955)) ([544a061](https://www.github.com/googleapis/nodejs-pubsub/commit/544a061b1b6d7fdc4051486c2b8ae5d14e1ec141))
* remove unused dependencies ([#998](https://www.github.com/googleapis/nodejs-pubsub/issues/998)) ([7b242a3](https://www.github.com/googleapis/nodejs-pubsub/commit/7b242a36212e0871b3918621fe9a5f51d1e6b733))
* **close:** ensure in-flight messages are drained ([#952](https://www.github.com/googleapis/nodejs-pubsub/issues/952)) ([93a2bd7](https://www.github.com/googleapis/nodejs-pubsub/commit/93a2bd726660b134fbd3e12335bfde29d13a2b78))
* **deps:** update dependency @google-cloud/paginator to v3 ([#931](https://www.github.com/googleapis/nodejs-pubsub/issues/931)) ([b621854](https://www.github.com/googleapis/nodejs-pubsub/commit/b62185426b7f958ee41a1cff429bc5fb70635b4a))
* **deps:** update dependency @google-cloud/precise-date to v2 ([#934](https://www.github.com/googleapis/nodejs-pubsub/issues/934)) ([72b8d78](https://www.github.com/googleapis/nodejs-pubsub/commit/72b8d781ed3cbf9049101b9c2675f211fb3924ba))
* **deps:** update dependency @google-cloud/projectify to v2 ([#929](https://www.github.com/googleapis/nodejs-pubsub/issues/929)) ([45d9880](https://www.github.com/googleapis/nodejs-pubsub/commit/45d988077d2db2fddbb4d22aac43c7f8a77e4dcc))
* **deps:** update dependency @google-cloud/promisify to v2 ([#928](https://www.github.com/googleapis/nodejs-pubsub/issues/928)) ([3819877](https://www.github.com/googleapis/nodejs-pubsub/commit/3819877752d39cd042364bdd9ed01ff230aeed0b))
* **deps:** update dependency google-auth-library to v6 ([#935](https://www.github.com/googleapis/nodejs-pubsub/issues/935)) ([73fc887](https://www.github.com/googleapis/nodejs-pubsub/commit/73fc887c662b526690167286d2d5afda0cccad1b))
### Build System
* convert to typescript ([#923](https://www.github.com/googleapis/nodejs-pubsub/issues/923)) ([2fc68ba](https://www.github.com/googleapis/nodejs-pubsub/commit/2fc68baff0cc2013468da7ef3dc8d547d4745989))
### Miscellaneous Chores
* drop support for custom promises ([#970](https://www.github.com/googleapis/nodejs-pubsub/issues/970)) ([df462d3](https://www.github.com/googleapis/nodejs-pubsub/commit/df462d3dec4f733cb309eb6413aad382424e2125))
### [1.7.1](https://www.github.com/googleapis/nodejs-pubsub/compare/v1.7.0...v1.7.1) (2020-04-06)

@@ -9,0 +43,0 @@

{
"name": "@google-cloud/pubsub",
"description": "Cloud Pub/Sub Client Library for Node.js",
"version": "2.0.0-beta.0",
"version": "2.0.0",
"license": "Apache-2.0",

@@ -34,3 +34,3 @@ "author": "Google Inc.",

"test": "c8 mocha build/test",
"lint": "gts fix",
"lint": "gts check",
"predocs": "npm run compile",

@@ -47,3 +47,4 @@ "docs": "jsdoc -c .jsdoc.js",

"benchwrapper": "node bin/benchwrapper.js",
"prelint": "cd samples; npm link ../; npm install"
"prelint": "cd samples; npm link ../; npm install",
"precompile": "gts clean"
},

@@ -58,3 +59,2 @@ "dependencies": {

"arrify": "^2.0.0",
"async-each": "^1.0.1",
"extend": "^3.0.2",

@@ -69,3 +69,3 @@ "google-auth-library": "^6.0.0",

"devDependencies": {
"@grpc/proto-loader": "^0.5.2",
"@grpc/proto-loader": "^0.5.4",
"@types/execa": "^0.9.0",

@@ -80,8 +80,7 @@ "@types/extend": "^3.0.0",

"@types/sinon": "^9.0.0",
"@types/tmp": "^0.1.0",
"@types/uuid": "^7.0.0",
"@types/tmp": "^0.2.0",
"@types/uuid": "^8.0.0",
"c8": "^7.0.0",
"codecov": "^3.0.0",
"execa": "^4.0.0",
"grpc": "^1.24.0",
"gts": "^2.0.0",

@@ -92,3 +91,2 @@ "jsdoc": "^3.6.2",

"linkinator": "^2.0.0",
"mkdirp": "^1.0.0",
"mocha": "^7.0.0",

@@ -100,6 +98,6 @@ "mv": "^2.1.1",

"sinon": "^9.0.0",
"tmp": "^0.1.0",
"tmp": "^0.2.0",
"ts-loader": "^7.0.0",
"typescript": "3.6.4",
"uuid": "^7.0.0",
"uuid": "^8.0.0",
"webpack": "^4.42.0",

@@ -106,0 +104,0 @@ "webpack-cli": "^3.3.11",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc