@boostercloud/framework-common-helpers
Advanced tools
Comparing version 0.26.0 to 0.26.1-pr1023.2
@@ -1,4 +0,4 @@ | ||
export * from './promises'; | ||
export * from './retrier'; | ||
export * from './instances'; | ||
export * from './run-command'; | ||
export * from './promises' | ||
export * from './retrier' | ||
export * from './instances' | ||
export * from './run-command' |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./promises"), exports); | ||
tslib_1.__exportStar(require("./retrier"), exports); | ||
tslib_1.__exportStar(require("./instances"), exports); | ||
tslib_1.__exportStar(require("./run-command"), exports); | ||
(0, tslib_1.__exportStar)(require("./promises"), exports); | ||
(0, tslib_1.__exportStar)(require("./retrier"), exports); | ||
(0, tslib_1.__exportStar)(require("./instances"), exports); | ||
(0, tslib_1.__exportStar)(require("./run-command"), exports); |
@@ -1,3 +0,3 @@ | ||
import { Class } from '@boostercloud/framework-types'; | ||
export declare function createInstance<T>(instanceClass: Class<T>, rawObject: Record<string, any>): T; | ||
export declare function createInstances<T>(instanceClass: Class<T>, rawObjects: Array<Record<string, any>>): T[]; | ||
import { Class } from '@boostercloud/framework-types' | ||
export declare function createInstance<T>(instanceClass: Class<T>, rawObject: Record<string, any>): T | ||
export declare function createInstances<T>(instanceClass: Class<T>, rawObjects: Array<Record<string, any>>): T[] |
export declare class Promises { | ||
/** | ||
* Waits until all the passed promise-like values are settled, no matter if they were fulfilled or rejected. | ||
* If some rejected were found, an array with all the rejected promises is thrown. | ||
* If all were fulfilled, an array of PromiseFulfilledResult is returned | ||
* @param values Array of promise-like values to be wait for | ||
* @throws an array of PromiseRejectedResult with all the rejected promises, if any | ||
* | ||
* Comparison with other similar Promise methods: | ||
* - `Promise.all`: This has an "all-or-nothing" behavior. As long as one of the promises is rejected, the result is | ||
* rejected. More importantly, **it does not wait for al the promises to finish**, which could lead to undesired behaviors | ||
* - `Promise.allSettled`: This method waits for all the promises to finish and then returns an array of results. Some | ||
* of them will be fulfilled and some rejected. More importantly, **it never throws an error**, which could lead to | ||
* unexpected consequences. For example if you do "await Promise.allSettle(...)" expecting it to throw if some of them | ||
* failed, you won't get that. | ||
* | ||
* In brief, `Promises.allSettledAndFulfilled` behaves exactly the same way as `Promise.allSettle` but it throws with | ||
* an array of the failed promises, only if there are any. | ||
*/ | ||
static allSettledAndFulfilled<TValue>(values: Iterable<TValue>): ReturnType<PromiseConstructor['allSettled']>; | ||
/** | ||
* Waits until all the passed promise-like values are settled, no matter if they were fulfilled or rejected. | ||
* If some rejected were found, an array with all the rejected promises is thrown. | ||
* If all were fulfilled, an array of PromiseFulfilledResult is returned | ||
* @param values Array of promise-like values to be wait for | ||
* @throws an array of PromiseRejectedResult with all the rejected promises, if any | ||
* | ||
* Comparison with other similar Promise methods: | ||
* - `Promise.all`: This has an "all-or-nothing" behavior. As long as one of the promises is rejected, the result is | ||
* rejected. More importantly, **it does not wait for al the promises to finish**, which could lead to undesired behaviors | ||
* - `Promise.allSettled`: This method waits for all the promises to finish and then returns an array of results. Some | ||
* of them will be fulfilled and some rejected. More importantly, **it never throws an error**, which could lead to | ||
* unexpected consequences. For example if you do "await Promise.allSettle(...)" expecting it to throw if some of them | ||
* failed, you won't get that. | ||
* | ||
* In brief, `Promises.allSettledAndFulfilled` behaves exactly the same way as `Promise.allSettle` but it throws with | ||
* an array of the failed promises, only if there are any. | ||
*/ | ||
static allSettledAndFulfilled<TValue>(values: Iterable<TValue>): ReturnType<PromiseConstructor['allSettled']> | ||
} | ||
export declare class PromisesError extends Error { | ||
readonly failedReasons: Array<unknown>; | ||
constructor(rejectedResults: Array<PromiseRejectedResult>); | ||
readonly failedReasons: Array<unknown> | ||
constructor(rejectedResults: Array<PromiseRejectedResult>) | ||
} |
@@ -1,2 +0,7 @@ | ||
import { Class, Logger } from '@boostercloud/framework-types'; | ||
export declare function retryIfError<TReturn>(logger: Logger, logicToRetry: () => Promise<TReturn>, errorClassThatRetries: Class<Error>, maxRetries?: number): Promise<TReturn>; | ||
import { Class, Logger } from '@boostercloud/framework-types' | ||
export declare function retryIfError<TReturn>( | ||
logger: Logger, | ||
logicToRetry: () => Promise<TReturn>, | ||
errorClassThatRetries: Class<Error>, | ||
maxRetries?: number | ||
): Promise<TReturn> |
@@ -1,2 +0,6 @@ | ||
import { ChildProcessPromise, PromiseResult } from 'child-process-promise'; | ||
export declare function runCommand(path: string, command: string, ignoreLogs?: boolean): ChildProcessPromise<PromiseResult<string>>; | ||
import { ChildProcessPromise, PromiseResult } from 'child-process-promise' | ||
export declare function runCommand( | ||
path: string, | ||
command: string, | ||
ignoreLogs?: boolean | ||
): ChildProcessPromise<PromiseResult<string>> |
@@ -7,3 +7,3 @@ "use strict"; | ||
var _a, _b, _c, _d; | ||
const subprocess = child_process_promise_1.exec(command, { | ||
const subprocess = (0, child_process_promise_1.exec)(command, { | ||
cwd: path, | ||
@@ -10,0 +10,0 @@ maxBuffer: 1024 * 1024 * 1024, |
{ | ||
"name": "@boostercloud/framework-common-helpers", | ||
"version": "0.26.0", | ||
"version": "0.26.1-pr1023.2+6b59c26d", | ||
"description": "Contains Booster common helpers used by the core and provider packages", | ||
@@ -36,5 +36,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@boostercloud/framework-types": "^0.26.0", | ||
"@boostercloud/framework-types": "0.26.1-pr1023.2+6b59c26d", | ||
"child-process-promise": "^2.2.1", | ||
"tslib": "2.3.0" | ||
"tslib": "2.3.1" | ||
}, | ||
@@ -48,3 +48,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "e2b629a7a55ffef3765d5c684ed4c8ca75d80219" | ||
"gitHead": "6b59c26d35d38c5f5836161dd3ee91bed7e707ce" | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
20381
154
2
+ Addedtslib@2.3.1(transitive)
- Removed@boostercloud/framework-types@0.26.14(transitive)
- Removed@types/graphql@14.5.0(transitive)
- Removedgraphql@16.9.0(transitive)
- Removedtslib@2.3.0(transitive)
- Removeduuid@8.3.2(transitive)
Updated@boostercloud/framework-types@0.26.1-pr1023.2+6b59c26d
Updatedtslib@2.3.1