polarity-integration-utils 0.1.0 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/es/helpers/async/parallelLimit.js +1 -1
- package/dist/es/helpers/time/sleep.js +1 -1
- package/dist/es/requests/createRequestWithDefaults.js +2 -2
- package/dist/es/requests/createRequestsInParallel.js +1 -1
- package/dist/lib/helpers/async/parallelLimit.js +1 -1
- package/dist/lib/helpers/time/sleep.js +1 -1
- package/dist/lib/requests/createRequestWithDefaults.js +2 -2
- package/dist/lib/requests/createRequestsInParallel.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -6,4 +6,28 @@ This library is intended for use in development of Polarity Integrations.
|
|
|
6
6
|
|
|
7
7
|
## Contribution Instructions
|
|
8
8
|
|
|
9
|
-
> NOTE: Don't forget to add your implementations to the `./test/index.test.js` to ensure your implementation is accessible from the main index.js
|
|
9
|
+
> NOTE: Don't forget to add your implementations to the `./test/index.test.js` to ensure your implementation is accessible from the main index.js
|
|
10
|
+
|
|
11
|
+
### Continuous Integration
|
|
12
|
+
|
|
13
|
+
All pull requests run the **build → lint → test** pipeline via GitHub Actions. Ensure local runs are green before opening a PR.
|
|
14
|
+
|
|
15
|
+
#### PR Checks
|
|
16
|
+
|
|
17
|
+
Pull requests targeting `develop`, `main`, or any `support/*` branch trigger the shared build workflow which runs linting, tests with coverage, and uploads results to Codecov.
|
|
18
|
+
|
|
19
|
+
#### Release (main branch)
|
|
20
|
+
|
|
21
|
+
Pushes to `main` trigger the full release workflow:
|
|
22
|
+
|
|
23
|
+
1. **Build & test** — runs the shared build pipeline.
|
|
24
|
+
2. **Release** — creates a GitHub Release tagged with the package version (e.g., `v3.1.6`), marks it as the latest release, and publishes to npm under the `latest` dist-tag.
|
|
25
|
+
3. **Deploy docs** — after a successful release, builds TypeDoc documentation and deploys to GitHub Pages.
|
|
26
|
+
|
|
27
|
+
#### Release (support branches)
|
|
28
|
+
|
|
29
|
+
Pushes to `support/*` branches (e.g., `support/1.0`, `support/2.0`) trigger the same release workflow with the following differences:
|
|
30
|
+
|
|
31
|
+
- **Docs are not deployed** — only `main` publishes documentation to GitHub Pages.
|
|
32
|
+
- **GitHub Release is not marked as latest** — the release is still created with the full version tag (e.g., `v2.0.9`) but will not appear as the "Latest" release in the GitHub UI.
|
|
33
|
+
- **npm publish uses a version-specific dist-tag** — instead of `latest`, support branches publish under `v{major}-latest` (e.g., `v2-latest`, `v1-latest`). This ensures `npm install polarity-integration-utils` continues to resolve to the current major version while older versions remain installable via their dist-tag (e.g., `npm install polarity-integration-utils@v2-latest`).
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const parallelLimit = (
|
|
12
|
+
const parallelLimit = (tasksQueue_1, simultaneousTaskRunningLimit_1, ...args_1) => __awaiter(void 0, [tasksQueue_1, simultaneousTaskRunningLimit_1, ...args_1], void 0, function* (tasksQueue, simultaneousTaskRunningLimit, returnErrors = false) {
|
|
13
13
|
const results = [];
|
|
14
14
|
const runTasks = (tasksIterator) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
15
|
for (const [index, task] of tasksIterator) {
|
|
@@ -9,5 +9,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const sleep = (
|
|
12
|
+
const sleep = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (ms = 2000) { return new Promise((r) => setTimeout(r, ms)); });
|
|
13
13
|
exports.default = sleep;
|
|
@@ -25,8 +25,8 @@ function _setupLimiter(options) {
|
|
|
25
25
|
limiter = new bottleneck_1.default({
|
|
26
26
|
maxConcurrent: options.maxConcurrentRequests
|
|
27
27
|
? Number.parseInt(options.maxConcurrentRequests, 10)
|
|
28
|
-
: 10,
|
|
29
|
-
highWater: 50,
|
|
28
|
+
: 10, // no more than 5 lookups can be running at single time
|
|
29
|
+
highWater: 50, // no more than 50 lookups can be queued up
|
|
30
30
|
strategy: bottleneck_1.default.strategy.OVERFLOW,
|
|
31
31
|
minTime: options.minimumMillisecondsRequestWillTake
|
|
32
32
|
? Number.parseInt(options.minimumMillisecondsRequestWillTake, 10)
|
|
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const fp_1 = require("lodash/fp");
|
|
27
27
|
const helpers_1 = __importDefault(require("../helpers"));
|
|
28
|
-
const createRequestsInParallel = (requestWithDefaults) => (
|
|
28
|
+
const createRequestsInParallel = (requestWithDefaults) => (allRequestsOptions_1, ...args_1) => __awaiter(void 0, [allRequestsOptions_1, ...args_1], void 0, function* (allRequestsOptions, responseGetPath = 'body', possibleSimultaneousRequests = 10, returnErrors = false) {
|
|
29
29
|
const unexecutedRequestFunctions = (0, fp_1.map)((_a) => {
|
|
30
30
|
var { entity } = _a, requestOptions = __rest(_a, ["entity"]);
|
|
31
31
|
return () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const parallelLimit = (
|
|
12
|
+
const parallelLimit = (tasksQueue_1, simultaneousTaskRunningLimit_1, ...args_1) => __awaiter(void 0, [tasksQueue_1, simultaneousTaskRunningLimit_1, ...args_1], void 0, function* (tasksQueue, simultaneousTaskRunningLimit, returnErrors = false) {
|
|
13
13
|
const results = [];
|
|
14
14
|
const runTasks = (tasksIterator) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
15
|
for (const [index, task] of tasksIterator) {
|
|
@@ -9,5 +9,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const sleep = (
|
|
12
|
+
const sleep = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (ms = 2000) { return new Promise((r) => setTimeout(r, ms)); });
|
|
13
13
|
exports.default = sleep;
|
|
@@ -25,8 +25,8 @@ function _setupLimiter(options) {
|
|
|
25
25
|
limiter = new bottleneck_1.default({
|
|
26
26
|
maxConcurrent: options.maxConcurrentRequests
|
|
27
27
|
? Number.parseInt(options.maxConcurrentRequests, 10)
|
|
28
|
-
: 10,
|
|
29
|
-
highWater: 50,
|
|
28
|
+
: 10, // no more than 5 lookups can be running at single time
|
|
29
|
+
highWater: 50, // no more than 50 lookups can be queued up
|
|
30
30
|
strategy: bottleneck_1.default.strategy.OVERFLOW,
|
|
31
31
|
minTime: options.minimumMillisecondsRequestWillTake
|
|
32
32
|
? Number.parseInt(options.minimumMillisecondsRequestWillTake, 10)
|
|
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const fp_1 = require("lodash/fp");
|
|
27
27
|
const helpers_1 = __importDefault(require("../helpers"));
|
|
28
|
-
const createRequestsInParallel = (requestWithDefaults) => (
|
|
28
|
+
const createRequestsInParallel = (requestWithDefaults) => (allRequestsOptions_1, ...args_1) => __awaiter(void 0, [allRequestsOptions_1, ...args_1], void 0, function* (allRequestsOptions, responseGetPath = 'body', possibleSimultaneousRequests = 10, returnErrors = false) {
|
|
29
29
|
const unexecutedRequestFunctions = (0, fp_1.map)((_a) => {
|
|
30
30
|
var { entity } = _a, requestOptions = __rest(_a, ["entity"]);
|
|
31
31
|
return () => __awaiter(void 0, void 0, void 0, function* () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polarity-integration-utils",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "A utility library for building Polarity Integrations",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -15,18 +15,18 @@
|
|
|
15
15
|
"build:lib": "tsc -p tsconfig.build.json --outDir dist/lib",
|
|
16
16
|
"build": "npm run clean && npm run build:lib && npm run build:es",
|
|
17
17
|
"prepublishOnly": "npm run ci && npm run build",
|
|
18
|
-
"fullPublish": "npm run prepublishOnly && npm publish"
|
|
18
|
+
"fullPublish": "npm install && npm run prepublishOnly && npm publish"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/
|
|
22
|
+
"url": "git+https://github.com/polarityio/polarity-integration-utils.git"
|
|
23
23
|
},
|
|
24
24
|
"author": "Polarity IO <support@polarity.io>",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"bugs": {
|
|
27
|
-
"url": "https://github.com/
|
|
27
|
+
"url": "https://github.com/polarityio/polarity-integration-utils/issues"
|
|
28
28
|
},
|
|
29
|
-
"homepage": "https://github.com/
|
|
29
|
+
"homepage": "https://github.com/polarityio/polarity-integration-utils#readme",
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/jest": "^24.0.14",
|
|
32
32
|
"nock": "^13.3.1",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"bottleneck": "^2.19.5",
|
|
38
|
-
"lodash": "^4.
|
|
39
|
-
"postman-request": "^2.88.1-postman.
|
|
38
|
+
"lodash": "^4.18.1",
|
|
39
|
+
"postman-request": "^2.88.1-postman.48"
|
|
40
40
|
},
|
|
41
41
|
"sideEffects": false
|
|
42
42
|
}
|