@heroku/sdk 0.11.1 → 0.12.0
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/dist/core/create-client.d.ts +7 -2
- package/dist/core/create-client.js +5 -2
- package/dist/core/extend-resource.d.ts +52 -2
- package/dist/core/extend-resource.js +27 -0
- package/dist/core/extensions-proxy.js +51 -1
- package/dist/core/heroku-sdk.js +44 -1
- package/dist/core/with-signal.d.ts +19 -0
- package/dist/core/with-signal.js +20 -0
- package/dist/resources/data/database.js +19 -6
- package/dist/resources/data/internal/resolve-pg-database.js +4 -7
- package/dist/resources/data/maintenance.js +4 -1
- package/dist/resources/data/postgres-database.js +4 -1
- package/dist/resources/data/redis/resolve-by-app.js +2 -1
- package/dist/resources/data/redis/wait-for-ready.d.ts +1 -1
- package/dist/resources/data/redis/wait-for-ready.js +3 -2
- package/dist/resources/data/transfer/capture-and-wait.js +4 -1
- package/dist/resources/data/transfer/restore-and-wait.js +4 -1
- package/dist/resources/data/transfer/wait-for-transfer.js +8 -1
- package/dist/resources/data/transfer-schedule.js +10 -3
- package/dist/resources/extensions/platform.d.ts +3 -0
- package/dist/resources/extensions/platform.js +3 -0
- package/dist/resources/platform/account.d.ts +22 -0
- package/dist/resources/platform/account.js +34 -0
- package/dist/resources/platform/add-on/create-and-wait.js +5 -1
- package/dist/resources/platform/add-on/describe.js +5 -2
- package/dist/resources/platform/add-on/destroy-and-wait.js +2 -3
- package/dist/resources/platform/add-on/list-plans.js +8 -2
- package/dist/resources/platform/add-on/resolve.js +5 -1
- package/dist/resources/platform/add-on/upgrade.js +5 -2
- package/dist/resources/platform/add-on/wait-for-provisioning.js +4 -1
- package/dist/resources/platform/add-on-attachment/resolve.js +2 -3
- package/dist/resources/platform/app/create-and-setup.d.ts +3 -4
- package/dist/resources/platform/app/create-and-setup.js +5 -5
- package/dist/resources/platform/app/diff.js +2 -3
- package/dist/resources/platform/app/index.js +9 -3
- package/dist/resources/platform/app/info.d.ts +4 -0
- package/dist/resources/platform/app/info.js +21 -7
- package/dist/resources/platform/app/transfer.js +2 -1
- package/dist/resources/platform/app/wait-for-acm-certificates.js +2 -1
- package/dist/resources/platform/container/ensure-container-stack.js +2 -1
- package/dist/resources/platform/container/release-images.js +2 -1
- package/dist/resources/platform/container/remove-process-types.js +2 -1
- package/dist/resources/platform/delinquency.d.ts +23 -0
- package/dist/resources/platform/delinquency.js +41 -0
- package/dist/resources/platform/domain/clear-custom-domains.js +2 -1
- package/dist/resources/platform/domain/create-and-wait.js +2 -1
- package/dist/resources/platform/domain/wait-for-ready.js +2 -1
- package/dist/resources/platform/dyno/exec.d.ts +12 -2
- package/dist/resources/platform/dyno/exec.js +27 -12
- package/dist/resources/platform/dyno/index.js +9 -6
- package/dist/resources/platform/dyno/list-extended.d.ts +7 -1
- package/dist/resources/platform/dyno/list-extended.js +8 -3
- package/dist/resources/platform/dyno/run.d.ts +1 -1
- package/dist/resources/platform/dyno/run.js +5 -3
- package/dist/resources/platform/dyno/wait-for-info.js +2 -1
- package/dist/resources/platform/dyno/wait-for-release.js +2 -1
- package/dist/resources/platform/log-session/index.d.ts +1 -1
- package/dist/resources/platform/log-session/index.js +12 -11
- package/dist/resources/platform/pipeline/coupling.js +5 -2
- package/dist/resources/platform/pipeline/index.d.ts +2 -2
- package/dist/resources/platform/pipeline/index.js +6 -4
- package/dist/resources/platform/pipeline/promotion.d.ts +1 -1
- package/dist/resources/platform/pipeline/promotion.js +22 -18
- package/dist/resources/platform/review-app-config/resolve-repo-name.js +4 -3
- package/dist/resources/platform/sni-endpoint/create-and-associate.js +2 -1
- package/dist/resources/platform/space/wait-for-allocated.js +2 -4
- package/dist/resources/platform/team.d.ts +22 -0
- package/dist/resources/platform/team.js +34 -0
- package/dist/resources/platform/telemetry-drain/remove-drains-for-target.js +2 -1
- package/dist/resources/platform/test-run/wait-for-state.js +2 -1
- package/dist/resources/platform/vpn-connection/wait-for-active.js +2 -1
- package/dist/utils/is-abort-error.d.ts +11 -0
- package/dist/utils/is-abort-error.js +14 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/package.json +9 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withSignal } from '../../../core/with-signal.js';
|
|
1
2
|
import { wait } from '../../../utils/wait.js';
|
|
2
3
|
const DEFAULT_INTERVAL_MS = 1000;
|
|
3
4
|
// Finite default so a stuck CI test run can't hang a caller forever.
|
|
@@ -48,7 +49,7 @@ export async function waitForState(ctx, pipelineId, testRunNumber, targetStates,
|
|
|
48
49
|
signal?.throwIfAborted();
|
|
49
50
|
// Scope the in-flight info call to the caller's signal so an abort takes
|
|
50
51
|
// effect during the API call, not just during the backoff.
|
|
51
|
-
const platform =
|
|
52
|
+
const platform = withSignal(ctx.platform, signal);
|
|
52
53
|
const deadline = Date.now() + timeoutMs;
|
|
53
54
|
while (true) {
|
|
54
55
|
signal?.throwIfAborted();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withSignal } from '../../../core/with-signal.js';
|
|
1
2
|
import { wait } from '../../../utils/wait.js';
|
|
2
3
|
const DEFAULT_INTERVAL_MS = 10 * 1000;
|
|
3
4
|
const DEFAULT_TIMEOUT_MS = 20 * 60 * 1000;
|
|
@@ -28,7 +29,7 @@ export class VpnConnectionNotReadyError extends Error {
|
|
|
28
29
|
export async function waitForActive(ctx, spaceIdentity, vpnConnectionIdentity, options = {}) {
|
|
29
30
|
const { intervalMs = DEFAULT_INTERVAL_MS, poller, signal, timeoutMs = DEFAULT_TIMEOUT_MS, } = options;
|
|
30
31
|
signal?.throwIfAborted();
|
|
31
|
-
const platform =
|
|
32
|
+
const platform = withSignal(ctx.platform, signal);
|
|
32
33
|
const deadline = Date.now() + timeoutMs;
|
|
33
34
|
let vpnConnection = await platform.vpnConnection.info(spaceIdentity, vpnConnectionIdentity);
|
|
34
35
|
poller?.onStart?.(vpnConnection);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when `error` is the standard `AbortError` raised for a cancelled
|
|
3
|
+
* request: `fetch`/`ky` reject an aborted request with a `DOMException` named
|
|
4
|
+
* `AbortError`, and `signal.throwIfAborted()` throws the same shape by default.
|
|
5
|
+
*
|
|
6
|
+
* Used so soft-failure handling (broad `.catch` defaults, retry loops) can let
|
|
7
|
+
* cancellation propagate instead of swallowing it or treating it as retryable.
|
|
8
|
+
* Pair it with `signal?.aborted` at the call site to also catch a custom-reason
|
|
9
|
+
* abort (`controller.abort(reason)`) or an `AbortSignal.timeout()` deadline.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isAbortError(error: unknown): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when `error` is the standard `AbortError` raised for a cancelled
|
|
3
|
+
* request: `fetch`/`ky` reject an aborted request with a `DOMException` named
|
|
4
|
+
* `AbortError`, and `signal.throwIfAborted()` throws the same shape by default.
|
|
5
|
+
*
|
|
6
|
+
* Used so soft-failure handling (broad `.catch` defaults, retry loops) can let
|
|
7
|
+
* cancellation propagate instead of swallowing it or treating it as retryable.
|
|
8
|
+
* Pair it with `signal?.aborted` at the call site to also catch a custom-reason
|
|
9
|
+
* abort (`controller.abort(reason)`) or an `AbortSignal.timeout()` deadline.
|
|
10
|
+
*/
|
|
11
|
+
export function isAbortError(error) {
|
|
12
|
+
return ((error instanceof Error || error instanceof DOMException)
|
|
13
|
+
&& error.name === 'AbortError');
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SDK_VERSION = "0.12.0";
|
package/dist/version.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heroku/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Heroku SDK",
|
|
5
5
|
"author": "Heroku",
|
|
6
6
|
"type": "module",
|
|
@@ -123,19 +123,24 @@
|
|
|
123
123
|
},
|
|
124
124
|
"scripts": {
|
|
125
125
|
"clean": "rimraf dist",
|
|
126
|
+
"generate:version": "node scripts/write-version.mjs",
|
|
127
|
+
"prebuild": "npm run generate:version",
|
|
126
128
|
"build": "npm run clean && tsc",
|
|
129
|
+
"prelint": "npm run generate:version",
|
|
127
130
|
"lint": "eslint .",
|
|
128
131
|
"lint:fix": "eslint . --fix",
|
|
132
|
+
"pretest": "npm run generate:version",
|
|
129
133
|
"test": "vitest run",
|
|
130
134
|
"test:watch": "vitest",
|
|
131
135
|
"test:coverage": "vitest run --coverage --coverage.reporter=text-summary --coverage.reporter=lcovonly",
|
|
136
|
+
"pretest:types": "npm run generate:version",
|
|
132
137
|
"test:types": "tsc --noEmit -p tsconfig.type-tests.json",
|
|
133
138
|
"prepare": "npm run build",
|
|
134
139
|
"example": "tsx"
|
|
135
140
|
},
|
|
136
141
|
"license": "Apache-2.0",
|
|
137
142
|
"engines": {
|
|
138
|
-
"node": ">=
|
|
143
|
+
"node": ">=22"
|
|
139
144
|
},
|
|
140
145
|
"files": [
|
|
141
146
|
"dist"
|
|
@@ -145,16 +150,16 @@
|
|
|
145
150
|
"@types/debug": "^4.1.12",
|
|
146
151
|
"@types/node": "^26.5.1",
|
|
147
152
|
"@vitest/coverage-v8": "^4.1.8",
|
|
153
|
+
"@vitest/eslint-plugin": "^1.6.0",
|
|
148
154
|
"eslint": "^9.39.4",
|
|
149
155
|
"eslint-config-oclif": "^6.0.167",
|
|
150
|
-
"@vitest/eslint-plugin": "^1.6.0",
|
|
151
156
|
"rimraf": "^6.1.3",
|
|
152
157
|
"tsx": "^4.22.4",
|
|
153
158
|
"typescript": "^6.0.2",
|
|
154
159
|
"vitest": "^4.1.4"
|
|
155
160
|
},
|
|
156
161
|
"dependencies": {
|
|
157
|
-
"@heroku/heroku-fetch": "^0.2.
|
|
162
|
+
"@heroku/heroku-fetch": "^0.2.3",
|
|
158
163
|
"@heroku/types": "^5.0.0",
|
|
159
164
|
"debug": "^4.4.0"
|
|
160
165
|
}
|