Socket
Socket
Sign inDemoInstall

@google-cloud/storage

Package Overview
Dependencies
Maintainers
1
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/storage - npm Package Compare versions

Comparing version 7.11.2 to 7.11.3

4

build/cjs/src/bucket.d.ts

@@ -1,5 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { ApiError, BodyResponseCallback, DecorateRequestOptions, DeleteCallback, ExistsCallback, GetConfig, MetadataCallback, ServiceObject, SetMetadataResponse } from './nodejs-common/index.js';

@@ -6,0 +2,0 @@ import { RequestResponse } from './nodejs-common/service-object.js';

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import { PathLike } from 'fs';

@@ -4,0 +2,0 @@ /**

@@ -1,5 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { BodyResponseCallback, DecorateRequestOptions, GetConfig, MetadataCallback, ServiceObject, SetMetadataResponse } from './nodejs-common/index.js';

@@ -6,0 +2,0 @@ import * as resumableUpload from './resumable-upload.js';

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import { Transform } from 'stream';

@@ -4,0 +2,0 @@ import { CRC32CValidatorGenerator, CRC32CValidator } from './crc32c.js';

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { EventEmitter } from 'events';

@@ -3,0 +2,0 @@ import * as r from 'teeny-request';

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

*/
/// <reference types="node" />
import { AuthClient, GoogleAuth, GoogleAuthOptions } from 'google-auth-library';

@@ -19,0 +18,0 @@ import { CredentialBody } from 'google-auth-library';

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import { GaxiosOptions, GaxiosPromise, GaxiosResponse } from 'gaxios';

@@ -4,0 +2,0 @@ import { GoogleAuthOptions } from 'google-auth-library';

12

build/cjs/src/resumable-upload.js

@@ -54,3 +54,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.checkUploadStatus = exports.createURI = exports.upload = exports.Upload = exports.PROTOCOL_REGEX = void 0;
exports.Upload = exports.PROTOCOL_REGEX = void 0;
exports.upload = upload;
exports.createURI = createURI;
exports.checkUploadStatus = checkUploadStatus;
const abort_controller_1 = __importDefault(require("abort-controller"));

@@ -802,3 +805,3 @@ const crypto_1 = require("crypto");

if (retryDelay <= 0) {
this.destroy(new Error(`Retry total time limit exceeded - ${resp.data}`));
this.destroy(new Error(`Retry total time limit exceeded - ${JSON.stringify(resp.data)}`));
return;

@@ -821,3 +824,3 @@ }

else {
this.destroy(new Error('Retry limit exceeded - ' + resp.data));
this.destroy(new Error(`Retry limit exceeded - ${JSON.stringify(resp.data)}`));
}

@@ -871,3 +874,2 @@ }

}
exports.upload = upload;
function createURI(cfg, callback) {

@@ -880,3 +882,2 @@ const up = new Upload(cfg);

}
exports.createURI = createURI;
/**

@@ -892,2 +893,1 @@ * Check the status of an existing resumable upload.

}
exports.checkUploadStatus = checkUploadStatus;

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import * as http from 'http';

@@ -4,0 +2,0 @@ import { Storage } from './storage.js';

@@ -1,5 +0,4 @@

/// <reference types="node" />
import { ApiError, Service, ServiceOptions } from './nodejs-common/index.js';
import { Readable } from 'stream';
import { Bucket } from './bucket.js';
import { Bucket, BucketMetadata } from './bucket.js';
import { Channel } from './channel.js';

@@ -21,5 +20,8 @@ import { File } from './file.js';

export interface CreateBucketQuery {
enableObjectRetention: boolean;
predefinedAcl?: 'authenticatedRead' | 'private' | 'projectPrivate' | 'publicRead' | 'publicReadWrite';
predefinedDefaultObjectAcl?: 'authenticatedRead' | 'bucketOwnerFullControl' | 'bucketOwnerRead' | 'private' | 'projectPrivate' | 'publicRead';
project: string;
projection?: 'full' | 'noAcl';
userProject: string;
enableObjectRetention: boolean;
}

@@ -81,26 +83,15 @@ export declare enum IdempotencyStrategy {

}
export interface CreateBucketRequest {
export interface CreateBucketRequest extends BucketMetadata {
archive?: boolean;
autoclass?: AutoclassConfig;
coldline?: boolean;
cors?: Cors[];
customPlacementConfig?: CustomPlacementConfig;
dataLocations?: string[];
dra?: boolean;
enableObjectRetention?: boolean;
hierarchicalNamespace?: {
enabled?: boolean;
};
iamConfiguration?: {
publicAccessPrevention?: string;
uniformBucketLevelAccess?: {
enabled?: boolean;
lockedTime?: string;
};
};
location?: string;
multiRegional?: boolean;
nearline?: boolean;
predefinedAcl?: 'authenticatedRead' | 'private' | 'projectPrivate' | 'publicRead' | 'publicReadWrite';
predefinedDefaultObjectAcl?: 'authenticatedRead' | 'bucketOwnerFullControl' | 'bucketOwnerRead' | 'private' | 'projectPrivate' | 'publicRead';
projection?: 'full' | 'noAcl';
regional?: boolean;
requesterPays?: boolean;
retentionPolicy?: object;
rpo?: string;

@@ -107,0 +98,0 @@ standard?: boolean;

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

* @property {boolean} [regional=false] Specify the storage class as Regional.
* @property {boolean} [requesterPays=false] **Early Access Testers Only**
* Force the use of the User Project metadata field to assign operational
* @property {boolean} [requesterPays=false] Force the use of the User Project metadata field to assign operational
* costs when an operation is made on a Bucket and its objects.

@@ -755,2 +754,14 @@ * @property {string} [rpo] For dual-region buckets, controls whether turbo

}
if (body.predefinedAcl) {
query.predefinedAcl = body.predefinedAcl;
delete body.predefinedAcl;
}
if (body.predefinedDefaultObjectAcl) {
query.predefinedDefaultObjectAcl = body.predefinedDefaultObjectAcl;
delete body.predefinedDefaultObjectAcl;
}
if (body.projection) {
query.projection = body.projection;
delete body.projection;
}
this.request({

@@ -757,0 +768,0 @@ method: 'POST',

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

*/
/// <reference types="node" />
import { Bucket, UploadOptions, UploadResponse } from './bucket.js';

@@ -19,0 +18,0 @@ import { DownloadOptions, DownloadResponse, File } from './file.js';

@@ -1,4 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import * as querystring from 'querystring';

@@ -5,0 +2,0 @@ import { PassThrough } from 'stream';

@@ -50,3 +50,16 @@ "use strict";

});
exports.PassThroughShim = exports.getModuleFormat = exports.getDirName = exports.getUserAgentString = exports.getRuntimeTrackingString = exports.formatAsUTCISO = exports.convertObjKeysToSnakeCase = exports.unicodeJSONStringify = exports.objectKeyToLowercase = exports.qsStringify = exports.encodeURI = exports.fixedEncodeURIComponent = exports.objectEntries = exports.normalize = void 0;
exports.PassThroughShim = void 0;
exports.normalize = normalize;
exports.objectEntries = objectEntries;
exports.fixedEncodeURIComponent = fixedEncodeURIComponent;
exports.encodeURI = encodeURI;
exports.qsStringify = qsStringify;
exports.objectKeyToLowercase = objectKeyToLowercase;
exports.unicodeJSONStringify = unicodeJSONStringify;
exports.convertObjKeysToSnakeCase = convertObjKeysToSnakeCase;
exports.formatAsUTCISO = formatAsUTCISO;
exports.getRuntimeTrackingString = getRuntimeTrackingString;
exports.getUserAgentString = getUserAgentString;
exports.getDirName = getDirName;
exports.getModuleFormat = getModuleFormat;
const path = __importStar(require("path"));

@@ -70,3 +83,2 @@ const querystring = __importStar(require("querystring"));

}
exports.normalize = normalize;
/**

@@ -80,3 +92,2 @@ * Flatten an object into an Array of arrays, [[key, value], ..].

}
exports.objectEntries = objectEntries;
/**

@@ -94,3 +105,2 @@ * Encode `str` with encodeURIComponent, plus these

}
exports.fixedEncodeURIComponent = fixedEncodeURIComponent;
/**

@@ -110,3 +120,2 @@ * URI encode `uri` for generating signed URLs, using fixedEncodeURIComponent.

}
exports.encodeURI = encodeURI;
/**

@@ -122,3 +131,2 @@ * Serialize an object to a URL query string using util.encodeURI(uri, true).

}
exports.qsStringify = qsStringify;
function objectKeyToLowercase(object) {

@@ -133,3 +141,2 @@ const newObj = {};

}
exports.objectKeyToLowercase = objectKeyToLowercase;
/**

@@ -143,3 +150,2 @@ * JSON encode str, with unicode \u+ representation.

}
exports.unicodeJSONStringify = unicodeJSONStringify;
/**

@@ -168,3 +174,2 @@ * Converts the given objects keys to snake_case

}
exports.convertObjKeysToSnakeCase = convertObjKeysToSnakeCase;
/**

@@ -191,3 +196,2 @@ * Formats the provided date object as a UTC ISO string.

}
exports.formatAsUTCISO = formatAsUTCISO;
/**

@@ -215,3 +219,2 @@ * Examines the runtime environment and returns the appropriate tracking string.

}
exports.getRuntimeTrackingString = getRuntimeTrackingString;
/**

@@ -227,3 +230,2 @@ * Looks at package.json and creates the user-agent string to be applied to request headers.

}
exports.getUserAgentString = getUserAgentString;
function getDirName() {

@@ -240,7 +242,5 @@ let dirToUse = '';

}
exports.getDirName = getDirName;
function getModuleFormat() {
return isEsm ? 'ESM' : 'CJS';
}
exports.getModuleFormat = getModuleFormat;
class PassThroughShim extends stream_1.PassThrough {

@@ -247,0 +247,0 @@ constructor() {

@@ -1,5 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { ApiError, BodyResponseCallback, DecorateRequestOptions, DeleteCallback, ExistsCallback, GetConfig, MetadataCallback, ServiceObject, SetMetadataResponse } from './nodejs-common/index.js';

@@ -6,0 +2,0 @@ import { RequestResponse } from './nodejs-common/service-object.js';

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import { PathLike } from 'fs';

@@ -4,0 +2,0 @@ /**

@@ -1,5 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { BodyResponseCallback, DecorateRequestOptions, GetConfig, MetadataCallback, ServiceObject, SetMetadataResponse } from './nodejs-common/index.js';

@@ -6,0 +2,0 @@ import * as resumableUpload from './resumable-upload.js';

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import { Transform } from 'stream';

@@ -4,0 +2,0 @@ import { CRC32CValidatorGenerator, CRC32CValidator } from './crc32c.js';

@@ -1,2 +0,1 @@

/// <reference types="node" />
import { EventEmitter } from 'events';

@@ -3,0 +2,0 @@ import * as r from 'teeny-request';

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

*/
/// <reference types="node" />
import { AuthClient, GoogleAuth, GoogleAuthOptions } from 'google-auth-library';

@@ -19,0 +18,0 @@ import { CredentialBody } from 'google-auth-library';

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import { GaxiosOptions, GaxiosPromise, GaxiosResponse } from 'gaxios';

@@ -4,0 +2,0 @@ import { GoogleAuthOptions } from 'google-auth-library';

@@ -772,3 +772,3 @@ // Copyright 2022 Google LLC

if (retryDelay <= 0) {
this.destroy(new Error(`Retry total time limit exceeded - ${resp.data}`));
this.destroy(new Error(`Retry total time limit exceeded - ${JSON.stringify(resp.data)}`));
return;

@@ -791,3 +791,3 @@ }

else {
this.destroy(new Error('Retry limit exceeded - ' + resp.data));
this.destroy(new Error(`Retry limit exceeded - ${JSON.stringify(resp.data)}`));
}

@@ -794,0 +794,0 @@ }

@@ -1,3 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
import * as http from 'http';

@@ -4,0 +2,0 @@ import { Storage } from './storage.js';

@@ -1,5 +0,4 @@

/// <reference types="node" />
import { ApiError, Service, ServiceOptions } from './nodejs-common/index.js';
import { Readable } from 'stream';
import { Bucket } from './bucket.js';
import { Bucket, BucketMetadata } from './bucket.js';
import { Channel } from './channel.js';

@@ -21,5 +20,8 @@ import { File } from './file.js';

export interface CreateBucketQuery {
enableObjectRetention: boolean;
predefinedAcl?: 'authenticatedRead' | 'private' | 'projectPrivate' | 'publicRead' | 'publicReadWrite';
predefinedDefaultObjectAcl?: 'authenticatedRead' | 'bucketOwnerFullControl' | 'bucketOwnerRead' | 'private' | 'projectPrivate' | 'publicRead';
project: string;
projection?: 'full' | 'noAcl';
userProject: string;
enableObjectRetention: boolean;
}

@@ -81,26 +83,15 @@ export declare enum IdempotencyStrategy {

}
export interface CreateBucketRequest {
export interface CreateBucketRequest extends BucketMetadata {
archive?: boolean;
autoclass?: AutoclassConfig;
coldline?: boolean;
cors?: Cors[];
customPlacementConfig?: CustomPlacementConfig;
dataLocations?: string[];
dra?: boolean;
enableObjectRetention?: boolean;
hierarchicalNamespace?: {
enabled?: boolean;
};
iamConfiguration?: {
publicAccessPrevention?: string;
uniformBucketLevelAccess?: {
enabled?: boolean;
lockedTime?: string;
};
};
location?: string;
multiRegional?: boolean;
nearline?: boolean;
predefinedAcl?: 'authenticatedRead' | 'private' | 'projectPrivate' | 'publicRead' | 'publicReadWrite';
predefinedDefaultObjectAcl?: 'authenticatedRead' | 'bucketOwnerFullControl' | 'bucketOwnerRead' | 'private' | 'projectPrivate' | 'publicRead';
projection?: 'full' | 'noAcl';
regional?: boolean;
requesterPays?: boolean;
retentionPolicy?: object;
rpo?: string;

@@ -107,0 +98,0 @@ standard?: boolean;

@@ -607,4 +607,3 @@ // Copyright 2019 Google LLC

* @property {boolean} [regional=false] Specify the storage class as Regional.
* @property {boolean} [requesterPays=false] **Early Access Testers Only**
* Force the use of the User Project metadata field to assign operational
* @property {boolean} [requesterPays=false] Force the use of the User Project metadata field to assign operational
* costs when an operation is made on a Bucket and its objects.

@@ -751,2 +750,14 @@ * @property {string} [rpo] For dual-region buckets, controls whether turbo

}
if (body.predefinedAcl) {
query.predefinedAcl = body.predefinedAcl;
delete body.predefinedAcl;
}
if (body.predefinedDefaultObjectAcl) {
query.predefinedDefaultObjectAcl = body.predefinedDefaultObjectAcl;
delete body.predefinedDefaultObjectAcl;
}
if (body.projection) {
query.projection = body.projection;
delete body.projection;
}
this.request({

@@ -753,0 +764,0 @@ method: 'POST',

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

*/
/// <reference types="node" />
import { Bucket, UploadOptions, UploadResponse } from './bucket.js';

@@ -19,0 +18,0 @@ import { DownloadOptions, DownloadResponse, File } from './file.js';

@@ -1,4 +0,1 @@

/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import * as querystring from 'querystring';

@@ -5,0 +2,0 @@ import { PassThrough } from 'stream';

{
"name": "@google-cloud/storage",
"description": "Cloud Storage Client Library for Node.js",
"version": "7.11.2",
"version": "7.11.3",
"license": "Apache-2.0",

@@ -6,0 +6,0 @@ "author": "Google Inc.",

@@ -118,2 +118,3 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost."

| Create a Dual-Region Bucket | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/createBucketWithDualRegion.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createBucketWithDualRegion.js,samples/README.md) |
| Create a hierarchical namespace enabled bucket | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/createBucketWithHierarchicalNamespace.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createBucketWithHierarchicalNamespace.js,samples/README.md) |
| Create a Bucket with object retention enabled. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/createBucketWithObjectRetention.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createBucketWithObjectRetention.js,samples/README.md) |

@@ -120,0 +121,0 @@ | Create Bucket With Storage Class and Location. | [source code](https://github.com/googleapis/nodejs-storage/blob/main/samples/createBucketWithStorageClassAndLocation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createBucketWithStorageClassAndLocation.js,samples/README.md) |

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

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

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc