@twurple/api
Advanced tools
Comparing version 7.1.0-pre.0 to 7.1.0-pre.1
@@ -31,2 +31,8 @@ import { type LoggerOptions } from '@d-fischer/logger'; | ||
batchDelay?: number; | ||
/** | ||
* The port your local mock server (from the Twitch CLI) runs on. | ||
* | ||
* Do not set this if you want to use the real production Twitch API. | ||
*/ | ||
mockServerPort?: number; | ||
} | ||
@@ -41,2 +47,3 @@ /** @private */ | ||
fetchOptions?: TwitchApiCallFetchOptions; | ||
mockServerPort?: number; | ||
} | ||
@@ -43,0 +50,0 @@ /** |
@@ -41,3 +41,3 @@ "use strict"; | ||
timeFrame: 64000, | ||
doRequest: async ({ options, clientId, accessToken, authorizationType, fetchOptions, }) => await (0, api_call_1.callTwitchApiRaw)(options, clientId, accessToken, authorizationType, fetchOptions), | ||
doRequest: async ({ options, clientId, accessToken, authorizationType, fetchOptions, mockServerPort, }) => await (0, api_call_1.callTwitchApiRaw)(options, clientId, accessToken, authorizationType, fetchOptions, mockServerPort), | ||
getPartitionKey: req => { var _a; return (_a = req.userId) !== null && _a !== void 0 ? _a : null; }, | ||
@@ -44,0 +44,0 @@ })); |
@@ -164,2 +164,4 @@ import { type Response } from '@d-fischer/cross-fetch'; | ||
get _authProvider(): AuthProvider; | ||
/** @private */ | ||
get _mockServerPort(): number | undefined; | ||
private _callApiUsingInitialToken; | ||
@@ -166,0 +168,0 @@ private _callApiInternal; |
@@ -297,2 +297,6 @@ "use strict"; | ||
} | ||
/** @private */ | ||
get _mockServerPort() { | ||
return this._config.mockServerPort; | ||
} | ||
/** @internal */ | ||
@@ -331,3 +335,3 @@ get _batchDelay() { | ||
var _a, _b, _c; | ||
const { fetchOptions } = this._config; | ||
const { fetchOptions, mockServerPort } = this._config; | ||
const type = (_a = options.type) !== null && _a !== void 0 ? _a : 'helix'; | ||
@@ -354,4 +358,5 @@ this._logger.debug(`Calling ${type} API: ${(_b = options.method) !== null && _b !== void 0 ? _b : 'GET'} ${options.url}`); | ||
fetchOptions, | ||
mockServerPort, | ||
}) | ||
: await (0, api_call_1.callTwitchApiRaw)(options, clientId, accessToken, authorizationType, fetchOptions); | ||
: await (0, api_call_1.callTwitchApiRaw)(options, clientId, accessToken, authorizationType, fetchOptions, mockServerPort); | ||
if (!response.ok && response.status >= 500 && response.status < 600) { | ||
@@ -358,0 +363,0 @@ await (0, api_call_1.handleTwitchApiResponseError)(response, options); |
@@ -8,4 +8,4 @@ "use strict"; | ||
class HelixRateLimiter extends rate_limiter_1.ResponseBasedRateLimiter { | ||
async doRequest({ options, clientId, accessToken, authorizationType, fetchOptions, }) { | ||
return await (0, api_call_1.callTwitchApiRaw)(options, clientId, accessToken, authorizationType, fetchOptions); | ||
async doRequest({ options, clientId, accessToken, authorizationType, fetchOptions, mockServerPort, }) { | ||
return await (0, api_call_1.callTwitchApiRaw)(options, clientId, accessToken, authorizationType, fetchOptions, mockServerPort); | ||
} | ||
@@ -12,0 +12,0 @@ needsToRetryAfter(res) { |
{ | ||
"name": "@twurple/api", | ||
"version": "7.1.0-pre.0", | ||
"version": "7.1.0-pre.1", | ||
"publishConfig": { | ||
@@ -36,3 +36,3 @@ "access": "public" | ||
"dependencies": { | ||
"@d-fischer/cache-decorators": "^3.0.0", | ||
"@d-fischer/cache-decorators": "^4.0.0", | ||
"@d-fischer/cross-fetch": "^5.0.1", | ||
@@ -44,4 +44,4 @@ "@d-fischer/detect-node": "^3.0.1", | ||
"@d-fischer/typed-event-emitter": "^3.3.1", | ||
"@twurple/api-call": "7.1.0-pre.0", | ||
"@twurple/common": "7.1.0-pre.0", | ||
"@twurple/api-call": "7.1.0-pre.1", | ||
"@twurple/common": "7.1.0-pre.1", | ||
"retry": "^0.13.1", | ||
@@ -51,7 +51,7 @@ "tslib": "^2.0.3" | ||
"devDependencies": { | ||
"@twurple/auth": "7.1.0-pre.0", | ||
"@twurple/auth": "7.1.0-pre.1", | ||
"@types/retry": "^0.12.2" | ||
}, | ||
"peerDependencies": { | ||
"@twurple/auth": "7.1.0-pre.0" | ||
"@twurple/auth": "7.1.0-pre.1" | ||
}, | ||
@@ -58,0 +58,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1079975
29100
+ Added@d-fischer/cache-decorators@4.0.1(transitive)
+ Added@twurple/api-call@7.1.0-pre.1(transitive)
+ Added@twurple/auth@7.1.0-pre.1(transitive)
+ Added@twurple/common@7.1.0-pre.1(transitive)
- Removed@d-fischer/cache-decorators@3.0.3(transitive)
- Removed@twurple/api-call@7.1.0-pre.0(transitive)
- Removed@twurple/auth@7.1.0-pre.0(transitive)
- Removed@twurple/common@7.1.0-pre.0(transitive)
Updated@twurple/common@7.1.0-pre.1