@google-cloud/storage
Advanced tools
Comparing version 5.13.2 to 5.14.0
@@ -153,2 +153,6 @@ /// <reference types="node" /> | ||
} | ||
export declare enum AvailableServiceObjectMethods { | ||
setMetadata = 0, | ||
delete = 1 | ||
} | ||
export interface GetNotificationsOptions { | ||
@@ -455,2 +459,3 @@ userProject?: string; | ||
signer?: URLSigner; | ||
private instanceRetryValue?; | ||
constructor(storage: Storage, name: string, options?: BucketOptions); | ||
@@ -575,2 +580,3 @@ addLifecycleRule(rule: LifecycleRule, options?: AddLifecycleRuleOptions): Promise<SetBucketMetadataResponse>; | ||
getId(): string; | ||
disableAutoRetryConditionallyIdempotent_(coreOpts: any, methodType: AvailableServiceObjectMethods): void; | ||
} | ||
@@ -577,0 +583,0 @@ /** |
@@ -6,3 +6,3 @@ /// <reference types="node" /> | ||
import { PreconditionOptions, Storage } from './storage'; | ||
import { Bucket } from './bucket'; | ||
import { AvailableServiceObjectMethods, Bucket } from './bucket'; | ||
import { Acl } from './acl'; | ||
@@ -250,2 +250,3 @@ import { GetSignedUrlResponse, GetSignedUrlCallback, URLSigner, Query } from './signer'; | ||
private encryptionKeyInterceptor?; | ||
private instanceRetryValue?; | ||
/** | ||
@@ -764,2 +765,3 @@ * Cloud Storage uses access control lists (ACLs) to manage object and | ||
startSimpleUpload_(dup: Duplexify, options?: CreateWriteStreamOptions): void; | ||
disableAutoRetryConditionallyIdempotent_(coreOpts: any, methodType: AvailableServiceObjectMethods): void; | ||
} | ||
@@ -766,0 +768,0 @@ /** |
@@ -22,2 +22,7 @@ /// <reference types="node" /> | ||
} | ||
export declare enum IdempotencyStrategy { | ||
RetryAlways = 0, | ||
RetryConditional = 1, | ||
RetryNever = 2 | ||
} | ||
export interface RetryOptions { | ||
@@ -30,2 +35,3 @@ retryDelayMultiplier?: number; | ||
retryableErrorFn?: (err: ApiError) => boolean; | ||
idempotencyStrategy?: IdempotencyStrategy; | ||
} | ||
@@ -345,2 +351,7 @@ export interface PreconditionOptions { | ||
* error should be retried and false otherwise. | ||
* @property {enum} [retryOptions.idempotencyStrategy=IdempotencyStrategy.RetryConditional] Enumeration | ||
* controls how conditionally idempotent operations are retried. Possible values are: RetryAlways - | ||
* will respect other retry settings and attempt to retry conditionally idempotent operations. RetryConditional - | ||
* will retry conditionally idempotent operations if the correct preconditions are set. RetryNever - never | ||
* retry a conditionally idempotent operation. | ||
* @property {string} [userAgent] The value to be prepended to the User-Agent | ||
@@ -347,0 +358,0 @@ * header in API requests. |
@@ -16,3 +16,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Storage = exports.PROTOCOL_REGEX = void 0; | ||
exports.Storage = exports.PROTOCOL_REGEX = exports.IdempotencyStrategy = void 0; | ||
const common_1 = require("@google-cloud/common"); | ||
@@ -27,2 +27,8 @@ const paginator_1 = require("@google-cloud/paginator"); | ||
const hmacKey_1 = require("./hmacKey"); | ||
var IdempotencyStrategy; | ||
(function (IdempotencyStrategy) { | ||
IdempotencyStrategy[IdempotencyStrategy["RetryAlways"] = 0] = "RetryAlways"; | ||
IdempotencyStrategy[IdempotencyStrategy["RetryConditional"] = 1] = "RetryConditional"; | ||
IdempotencyStrategy[IdempotencyStrategy["RetryNever"] = 2] = "RetryNever"; | ||
})(IdempotencyStrategy = exports.IdempotencyStrategy || (exports.IdempotencyStrategy = {})); | ||
exports.PROTOCOL_REGEX = /^(\w*):\/\//; | ||
@@ -66,2 +72,9 @@ /** | ||
/** | ||
* Default behavior: Retry conditionally idempotent operations if correct preconditions are set. | ||
* | ||
* @const {enum} | ||
* @private | ||
*/ | ||
const IDEMPOTENCY_STRATEGY_DEFAULT = IdempotencyStrategy.RetryConditional; | ||
/** | ||
* Returns true if the API request should be retried, given the error that was | ||
@@ -265,2 +278,7 @@ * given the first time the request was attempted. | ||
* error should be retried and false otherwise. | ||
* @property {enum} [retryOptions.idempotencyStrategy=IdempotencyStrategy.RetryConditional] Enumeration | ||
* controls how conditionally idempotent operations are retried. Possible values are: RetryAlways - | ||
* will respect other retry settings and attempt to retry conditionally idempotent operations. RetryConditional - | ||
* will retry conditionally idempotent operations if the correct preconditions are set. RetryNever - never | ||
* retry a conditionally idempotent operation. | ||
* @property {string} [userAgent] The value to be prepended to the User-Agent | ||
@@ -290,3 +308,3 @@ * header in API requests. | ||
constructor(options = {}) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; | ||
let apiEndpoint = 'https://storage.googleapis.com'; | ||
@@ -337,2 +355,4 @@ let customEndpoint = false; | ||
retryableErrorFn: ((_l = options.retryOptions) === null || _l === void 0 ? void 0 : _l.retryableErrorFn) ? (_m = options.retryOptions) === null || _m === void 0 ? void 0 : _m.retryableErrorFn : RETRYABLE_ERR_FN_DEFAULT, | ||
idempotencyStrategy: ((_o = options.retryOptions) === null || _o === void 0 ? void 0 : _o.idempotencyStrategy) !== undefined | ||
? (_p = options.retryOptions) === null || _p === void 0 ? void 0 : _p.idempotencyStrategy : IDEMPOTENCY_STRATEGY_DEFAULT, | ||
}, | ||
@@ -339,0 +359,0 @@ baseUrl, |
{ | ||
"name": "@google-cloud/storage", | ||
"description": "Cloud Storage Client Library for Node.js", | ||
"version": "5.13.2", | ||
"version": "5.14.0", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "author": "Google Inc.", |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
609785
12084