@heroku/heroku-fetch 0.1.2 → 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/dist/client/index.js +4 -1
- package/dist/types.d.ts +9 -0
- package/package.json +1 -1
package/dist/client/index.js
CHANGED
|
@@ -45,7 +45,10 @@ export class HerokuApiClient {
|
|
|
45
45
|
createAfterResponseHook(this.options.twoFactor, this.twoFactorAttempted),
|
|
46
46
|
],
|
|
47
47
|
beforeRequest: [
|
|
48
|
-
createBeforeRequestHook(() => this.getToken(),
|
|
48
|
+
createBeforeRequestHook(() => this.getToken(),
|
|
49
|
+
// A per-client override wins over the shared service default, but
|
|
50
|
+
// is still only applied when the request has no Accept of its own.
|
|
51
|
+
options.defaultAccept ?? serviceConfig.defaultAccept, options.headers, this.options.debug),
|
|
49
52
|
],
|
|
50
53
|
},
|
|
51
54
|
prefix: baseUrl,
|
package/dist/types.d.ts
CHANGED
|
@@ -23,6 +23,15 @@ export interface HerokuApiClientOptions {
|
|
|
23
23
|
baseUrl?: string;
|
|
24
24
|
/** Enable debugging */
|
|
25
25
|
debug?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Override the service's default `Accept` header for this client. Applied
|
|
28
|
+
* only when a request doesn't already carry an `Accept` (so per-call
|
|
29
|
+
* `withHeaders({Accept})` still wins); falls back to the service config's
|
|
30
|
+
* default when unset. Lets a consumer whose types/routes are generated from
|
|
31
|
+
* a specific API variant (e.g. `@heroku/sdk`, generated from `version=3.sdk`)
|
|
32
|
+
* dispatch at that variant without changing the shared service default.
|
|
33
|
+
*/
|
|
34
|
+
defaultAccept?: string;
|
|
26
35
|
/** Additional custom headers */
|
|
27
36
|
headers?: Record<string, string>;
|
|
28
37
|
/** Service region (e.g., 'eu', 'us') */
|