@casual-simulation/aux-records
Advanced tools
Comparing version 3.1.27-alpha.4430491303 to 3.1.29-alpha.4800904780
@@ -108,3 +108,3 @@ import { AddressType, AuthStore, AuthUser } from './AuthStore'; | ||
} | ||
export declare type LoginRequestResult = LoginRequestSuccess | LoginRequestFailure; | ||
export type LoginRequestResult = LoginRequestSuccess | LoginRequestFailure; | ||
export interface LoginRequestSuccess { | ||
@@ -138,3 +138,3 @@ success: true; | ||
*/ | ||
errorCode: 'unacceptable_address' | 'unacceptable_address_type' | 'unacceptable_ip_address' | 'address_type_not_supported' | ServerError; | ||
errorCode: 'unacceptable_address' | 'unacceptable_address_type' | 'unacceptable_ip_address' | 'address_type_not_supported' | 'user_is_banned' | ServerError; | ||
/** | ||
@@ -144,2 +144,6 @@ * The error message for the failure. | ||
errorMessage: string; | ||
/** | ||
* The ban reason for the user. | ||
*/ | ||
banReason?: AuthUser['banReason']; | ||
} | ||
@@ -164,3 +168,3 @@ export interface CompleteLoginRequest { | ||
} | ||
export declare type CompleteLoginResult = CompleteLoginSuccess | CompleteLoginFailure; | ||
export type CompleteLoginResult = CompleteLoginSuccess | CompleteLoginFailure; | ||
export interface CompleteLoginSuccess { | ||
@@ -192,3 +196,3 @@ success: true; | ||
} | ||
export declare type ValidateSessionKeyResult = ValidateSessionKeySuccess | ValidateSessionKeyFailure; | ||
export type ValidateSessionKeyResult = ValidateSessionKeySuccess | ValidateSessionKeyFailure; | ||
export interface ValidateSessionKeySuccess { | ||
@@ -202,4 +206,5 @@ success: true; | ||
success: false; | ||
errorCode: 'unacceptable_session_key' | 'invalid_key' | 'session_expired' | ServerError; | ||
errorCode: 'unacceptable_session_key' | 'invalid_key' | 'session_expired' | 'user_is_banned' | ServerError; | ||
errorMessage: string; | ||
banReason?: AuthUser['banReason']; | ||
} | ||
@@ -220,3 +225,3 @@ export interface RevokeSessionRequest { | ||
} | ||
export declare type RevokeSessionResult = RevokeSessionSuccess | RevokeSessionFailure; | ||
export type RevokeSessionResult = RevokeSessionSuccess | RevokeSessionFailure; | ||
export interface RevokeSessionSuccess { | ||
@@ -227,3 +232,3 @@ success: true; | ||
success: false; | ||
errorCode: 'unacceptable_user_id' | 'unacceptable_session_id' | 'unacceptable_session_key' | 'invalid_key' | 'session_expired' | 'session_not_found' | 'session_already_revoked' | ServerError; | ||
errorCode: 'unacceptable_user_id' | 'unacceptable_session_id' | 'unacceptable_session_key' | 'invalid_key' | 'session_expired' | 'session_not_found' | 'session_already_revoked' | 'user_is_banned' | ServerError; | ||
errorMessage: string; | ||
@@ -241,3 +246,3 @@ } | ||
} | ||
export declare type RevokeAllSessionsResult = RevokeAllSessionsSuccess | RevokeAllSessionsFailure; | ||
export type RevokeAllSessionsResult = RevokeAllSessionsSuccess | RevokeAllSessionsFailure; | ||
export interface RevokeAllSessionsSuccess { | ||
@@ -248,3 +253,3 @@ success: true; | ||
success: false; | ||
errorCode: 'unacceptable_user_id' | 'unacceptable_session_key' | 'invalid_key' | 'session_expired' | ServerError; | ||
errorCode: 'unacceptable_user_id' | 'unacceptable_session_key' | 'invalid_key' | 'session_expired' | 'user_is_banned' | ServerError; | ||
errorMessage: string; | ||
@@ -266,3 +271,3 @@ } | ||
} | ||
export declare type ListSessionsResult = ListSessionsSuccess | ListSessionsFailure; | ||
export type ListSessionsResult = ListSessionsSuccess | ListSessionsFailure; | ||
export interface ListSessionsSuccess { | ||
@@ -277,3 +282,3 @@ success: true; | ||
success: false; | ||
errorCode: 'unacceptable_user_id' | 'unacceptable_expire_time' | 'unacceptable_session_key' | 'invalid_key' | 'session_expired' | ServerError; | ||
errorCode: 'unacceptable_user_id' | 'unacceptable_expire_time' | 'unacceptable_session_key' | 'invalid_key' | 'user_is_banned' | 'session_expired' | ServerError; | ||
errorMessage: string; | ||
@@ -328,3 +333,3 @@ } | ||
} | ||
export declare type ReplaceSessionResult = ReplaceSessionSuccess | ReplaceSessionFailure; | ||
export type ReplaceSessionResult = ReplaceSessionSuccess | ReplaceSessionFailure; | ||
export interface ReplaceSessionSuccess { | ||
@@ -363,3 +368,3 @@ success: true; | ||
} | ||
export declare type GetUserInfoResult = GetUserInfoSuccess | GetUserInfoFailure; | ||
export type GetUserInfoResult = GetUserInfoSuccess | GetUserInfoFailure; | ||
export interface GetUserInfoSuccess { | ||
@@ -426,3 +431,3 @@ success: true; | ||
} | ||
export declare type UpdateUserInfoResult = UpdateUserInfoSuccess | UpdateUserInfoFailure; | ||
export type UpdateUserInfoResult = UpdateUserInfoSuccess | UpdateUserInfoFailure; | ||
export interface UpdateUserInfoSuccess { | ||
@@ -440,3 +445,3 @@ success: true; | ||
} | ||
export declare type ListEmailRulesResult = ListEmailRulesSuccess | ListEmailRulesFailure; | ||
export type ListEmailRulesResult = ListEmailRulesSuccess | ListEmailRulesFailure; | ||
export interface ListEmailRulesSuccess { | ||
@@ -451,3 +456,3 @@ success: true; | ||
} | ||
export declare type ListSmsRulesResult = ListSmsRulesSuccess | ListSmsRulesFailure; | ||
export type ListSmsRulesResult = ListSmsRulesSuccess | ListSmsRulesFailure; | ||
export interface ListSmsRulesSuccess { | ||
@@ -454,0 +459,0 @@ success: true; |
@@ -145,2 +145,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
if (user.banTimeMs > 0) { | ||
return { | ||
success: false, | ||
errorCode: 'user_is_banned', | ||
errorMessage: 'The user has been banned.', | ||
banReason: user.banReason, | ||
}; | ||
} | ||
const requestTime = Date.now(); | ||
@@ -430,2 +438,10 @@ const requestId = fromByteArray(randomBytes(LOGIN_REQUEST_ID_BYTE_LENGTH)); | ||
} | ||
if (userInfo.banTimeMs > 0) { | ||
return { | ||
success: false, | ||
errorCode: 'user_is_banned', | ||
errorMessage: 'The user has been banned.', | ||
banReason: userInfo.banReason, | ||
}; | ||
} | ||
} | ||
@@ -715,2 +731,3 @@ return { | ||
getUserInfo(request) { | ||
var _a, _b, _c; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -753,6 +770,6 @@ if (typeof request.userId !== 'string' || request.userId === '') { | ||
if (result.subscriptionId) { | ||
sub = this._subscriptionConfig.subscriptions.find((s) => s.id === result.subscriptionId); | ||
sub = (_a = this._subscriptionConfig) === null || _a === void 0 ? void 0 : _a.subscriptions.find((s) => s.id === result.subscriptionId); | ||
} | ||
if (!sub) { | ||
sub = this._subscriptionConfig.subscriptions.find((s) => s.defaultSubscription); | ||
sub = (_b = this._subscriptionConfig) === null || _b === void 0 ? void 0 : _b.subscriptions.find((s) => s.defaultSubscription); | ||
if (sub) { | ||
@@ -763,3 +780,3 @@ console.log('[AuthController] [getUserInfo] Using default subscription for user.'); | ||
if (!sub) { | ||
sub = this._subscriptionConfig.subscriptions[0]; | ||
sub = (_c = this._subscriptionConfig) === null || _c === void 0 ? void 0 : _c.subscriptions[0]; | ||
if (sub) { | ||
@@ -766,0 +783,0 @@ console.log('[AuthController] [getUserInfo] Using first subscription for user.'); |
@@ -20,3 +20,3 @@ import { AddressType } from './AuthStore'; | ||
} | ||
export declare type SendCodeResult = SendCodeSuccess | SendCodeFailure; | ||
export type SendCodeResult = SendCodeSuccess | SendCodeFailure; | ||
export interface SendCodeSuccess { | ||
@@ -23,0 +23,0 @@ success: true; |
@@ -97,3 +97,3 @@ import { RegexRule } from './Utils'; | ||
} | ||
export declare type AddressType = 'email' | 'phone'; | ||
export type AddressType = 'email' | 'phone'; | ||
export interface AuthUser { | ||
@@ -133,2 +133,12 @@ id: string; | ||
currentLoginRequestId: string | null | undefined; | ||
/** | ||
* The Unix time in miliseconds that the user was banned. | ||
* If set to any positive number, then the user should be considered banned and unable to perform any operations. | ||
* Null/undefined if the user is not banned and allowed access into the system. | ||
*/ | ||
banTimeMs?: number | null | undefined; | ||
/** | ||
* The reason for the ban. | ||
*/ | ||
banReason?: 'terms_of_service_violation' | null | undefined; | ||
} | ||
@@ -227,3 +237,3 @@ /** | ||
} | ||
export declare type SaveNewUserResult = SaveNewUserSuccess | SaveNewUserFailure; | ||
export type SaveNewUserResult = SaveNewUserSuccess | SaveNewUserFailure; | ||
export interface SaveNewUserSuccess { | ||
@@ -237,3 +247,3 @@ success: true; | ||
} | ||
export declare type ListSessionsDataResult = ListSessionsDataSuccess | ListSessionsDataFailure; | ||
export type ListSessionsDataResult = ListSessionsDataSuccess | ListSessionsDataFailure; | ||
export interface ListSessionsDataSuccess { | ||
@@ -240,0 +250,0 @@ success: true; |
@@ -38,3 +38,3 @@ import { NotAuthorizedError, NotLoggedInError, ServerError } from './Errors'; | ||
} | ||
export declare type RecordDataResult = RecordDataSuccess | RecordDataFailure; | ||
export type RecordDataResult = RecordDataSuccess | RecordDataFailure; | ||
export interface RecordDataSuccess { | ||
@@ -50,3 +50,3 @@ success: true; | ||
} | ||
export declare type GetDataResult = GetDataSuccess | GetDataFailure; | ||
export type GetDataResult = GetDataSuccess | GetDataFailure; | ||
/** | ||
@@ -87,3 +87,3 @@ * Defines an interface that represents a successful "get data" result. | ||
} | ||
export declare type EraseDataResult = EraseDataSuccess | EraseDataFailure; | ||
export type EraseDataResult = EraseDataSuccess | EraseDataFailure; | ||
export interface EraseDataSuccess { | ||
@@ -99,3 +99,3 @@ success: true; | ||
} | ||
export declare type ListDataResult = ListDataSuccess | ListDataFailure; | ||
export type ListDataResult = ListDataSuccess | ListDataFailure; | ||
export interface ListDataSuccess { | ||
@@ -102,0 +102,0 @@ success: true; |
@@ -80,3 +80,3 @@ import { ServerError } from './Errors'; | ||
*/ | ||
export declare type UserPolicy = true | string[]; | ||
export type UserPolicy = true | string[]; | ||
/** | ||
@@ -83,0 +83,0 @@ * Determines if the given value represents a valid user policy. |
/** | ||
* Defines an error that occurs when an unspecified error occurs while creating a public record key. | ||
*/ | ||
export declare type ServerError = 'server_error'; | ||
export type ServerError = 'server_error'; | ||
/** | ||
* Defines an error that occurs when the user is not logged in but they are required to be in order to perform an action. | ||
*/ | ||
export declare type NotLoggedInError = 'not_logged_in'; | ||
export type NotLoggedInError = 'not_logged_in'; | ||
/** | ||
* Defines an error that occurs when the user does not have the right permissions to perform an action. | ||
*/ | ||
export declare type NotAuthorizedError = 'not_authorized'; | ||
export type NotAuthorizedError = 'not_authorized'; | ||
//# sourceMappingURL=Errors.d.ts.map |
@@ -31,3 +31,3 @@ import { NotLoggedInError, ServerError } from './Errors'; | ||
} | ||
export declare type AddCountResult = AddCountSuccess | AddCountFailure; | ||
export type AddCountResult = AddCountSuccess | AddCountFailure; | ||
export interface AddCountSuccess { | ||
@@ -44,3 +44,3 @@ success: true; | ||
} | ||
export declare type GetCountResult = GetCountSuccess | GetCountFailure; | ||
export type GetCountResult = GetCountSuccess | GetCountFailure; | ||
/** | ||
@@ -47,0 +47,0 @@ * Defines an interface that represents a successful "get data" result. |
@@ -50,3 +50,3 @@ import { FileRecordsStore, AddFileFailure, MarkFileRecordAsUploadedFailure, EraseFileStoreResult, GetFileNameFromUrlResult } from './FileRecordsStore'; | ||
} | ||
export declare type RecordFileResult = RecordFileSuccess | RecordFileFailure; | ||
export type RecordFileResult = RecordFileSuccess | RecordFileFailure; | ||
export interface RecordFileSuccess { | ||
@@ -82,3 +82,3 @@ success: true; | ||
} | ||
export declare type EraseFileResult = EraseFileSuccess | EraseFileFailure; | ||
export type EraseFileResult = EraseFileSuccess | EraseFileFailure; | ||
export interface EraseFileSuccess { | ||
@@ -94,3 +94,3 @@ success: true; | ||
} | ||
export declare type FileUploadedResult = FileUploadedSuccess | FileUploadedFailure; | ||
export type FileUploadedResult = FileUploadedSuccess | FileUploadedFailure; | ||
export interface FileUploadedSuccess { | ||
@@ -97,0 +97,0 @@ success: true; |
@@ -50,3 +50,3 @@ import { ServerError } from './Errors'; | ||
} | ||
export declare type GetFileRecordResult = GetFileRecordSuccess | GetFileRecordFailure; | ||
export type GetFileRecordResult = GetFileRecordSuccess | GetFileRecordFailure; | ||
export interface GetFileRecordSuccess { | ||
@@ -87,3 +87,3 @@ success: true; | ||
} | ||
export declare type MarkFileRecordAsUploadedResult = MarkFileRecordAsUploadedSuccess | MarkFileRecordAsUploadedFailure; | ||
export type MarkFileRecordAsUploadedResult = MarkFileRecordAsUploadedSuccess | MarkFileRecordAsUploadedFailure; | ||
export interface MarkFileRecordAsUploadedSuccess { | ||
@@ -131,3 +131,3 @@ success: true; | ||
} | ||
export declare type PresignFileUploadResult = PresignFileUploadSuccess | PresignFileUploadFailure; | ||
export type PresignFileUploadResult = PresignFileUploadSuccess | PresignFileUploadFailure; | ||
export interface PresignFileUploadSuccess { | ||
@@ -155,3 +155,3 @@ success: true; | ||
} | ||
export declare type AddFileResult = AddFileSuccess | AddFileFailure; | ||
export type AddFileResult = AddFileSuccess | AddFileFailure; | ||
export interface AddFileSuccess { | ||
@@ -170,3 +170,3 @@ success: true; | ||
} | ||
export declare type GetFileNameFromUrlResult = GetFileNameFromUrlSuccess | GetFileNameFromUrlFailure; | ||
export type GetFileNameFromUrlResult = GetFileNameFromUrlSuccess | GetFileNameFromUrlFailure; | ||
export interface GetFileNameFromUrlSuccess { | ||
@@ -173,0 +173,0 @@ success: true; |
@@ -19,2 +19,4 @@ export * from './AuthController'; | ||
export * from './StripeInterface'; | ||
export * from './MemoryRateLimiter'; | ||
export * from './RateLimitController'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -19,2 +19,4 @@ export * from './AuthController'; | ||
export * from './StripeInterface'; | ||
export * from './MemoryRateLimiter'; | ||
export * from './RateLimitController'; | ||
//# sourceMappingURL=index.js.map |
import { ServerError } from './Errors'; | ||
export declare type IssueMeetTokenResult = IssueMeetTokenSuccess | IssueMeetTokenFailure; | ||
export type IssueMeetTokenResult = IssueMeetTokenSuccess | IssueMeetTokenFailure; | ||
/** | ||
@@ -4,0 +4,0 @@ * Defines an interface that represents a successful "Issue meet token" result. |
{ | ||
"name": "@casual-simulation/aux-records", | ||
"version": "3.1.27-alpha.4430491303", | ||
"version": "3.1.29-alpha.4800904780", | ||
"description": "Helpers and managers used by the CasualOS records system.", | ||
@@ -40,7 +40,8 @@ "keywords": [], | ||
"dependencies": { | ||
"@casual-simulation/crypto": "^3.1.27-alpha.4430491303", | ||
"@casual-simulation/crypto": "^3.1.23", | ||
"@casual-simulation/rate-limit-redis": "^3.1.29-alpha.4800904780", | ||
"livekit-server-sdk": "1.0.2", | ||
"tweetnacl": "1.0.3" | ||
}, | ||
"gitHead": "3bec2d38f5f1d75f0e854de0535da89cbb85cd81" | ||
"gitHead": "29ead97ae86877189d4f6e3aaa863135e6f8cd82" | ||
} |
@@ -25,3 +25,3 @@ import { PublicRecordKeyPolicy, RecordsStore } from './RecordsStore'; | ||
} | ||
export declare type ValidatePublicRecordKeyResult = ValidatePublicRecordKeySuccess | ValidatePublicRecordKeyFailure; | ||
export type ValidatePublicRecordKeyResult = ValidatePublicRecordKeySuccess | ValidatePublicRecordKeyFailure; | ||
/** | ||
@@ -65,3 +65,3 @@ * Defines an interface that represents the result of a "validate public record key" operation. | ||
*/ | ||
export declare type CreatePublicRecordKeyResult = CreatePublicRecordKeySuccess | CreatePublicRecordKeyFailure; | ||
export type CreatePublicRecordKeyResult = CreatePublicRecordKeySuccess | CreatePublicRecordKeyFailure; | ||
/** | ||
@@ -109,7 +109,7 @@ * Defines an interface that represents a successful "create public record key" result. | ||
*/ | ||
export declare type UnauthorizedToCreateRecordKeyError = 'unauthorized_to_create_record_key'; | ||
export type UnauthorizedToCreateRecordKeyError = 'unauthorized_to_create_record_key'; | ||
/** | ||
* Defines an error that occurs when an invalid record key is used to | ||
*/ | ||
export declare type InvalidRecordKey = 'invalid_record_key'; | ||
export type InvalidRecordKey = 'invalid_record_key'; | ||
/** | ||
@@ -116,0 +116,0 @@ * The default policy for keys that do not have a specified record key. |
@@ -8,2 +8,3 @@ import { AuthController } from './AuthController'; | ||
import { SubscriptionController } from './SubscriptionController'; | ||
import { RateLimitController } from './RateLimitController'; | ||
/** | ||
@@ -94,3 +95,4 @@ * Defines an interface for a generic HTTP request. | ||
private _allowedAccountOrigins; | ||
constructor(allowedAccountOrigins: Set<string>, allowedApiOrigins: Set<string>, authController: AuthController, livekitController: LivekitController, recordsController: RecordsController, eventsController: EventRecordsController, dataController: DataRecordsController, manualDataController: DataRecordsController, filesController: FileRecordsController, subscriptionController: SubscriptionController); | ||
private _rateLimit; | ||
constructor(allowedAccountOrigins: Set<string>, allowedApiOrigins: Set<string>, authController: AuthController, livekitController: LivekitController, recordsController: RecordsController, eventsController: EventRecordsController, dataController: DataRecordsController, manualDataController: DataRecordsController, filesController: FileRecordsController, subscriptionController: SubscriptionController, rateLimitController: RateLimitController); | ||
/** | ||
@@ -97,0 +99,0 @@ * Handles the given request and returns the specified response. |
@@ -47,3 +47,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
export class RecordsHttpServer { | ||
constructor(allowedAccountOrigins, allowedApiOrigins, authController, livekitController, recordsController, eventsController, dataController, manualDataController, filesController, subscriptionController) { | ||
constructor(allowedAccountOrigins, allowedApiOrigins, authController, livekitController, recordsController, eventsController, dataController, manualDataController, filesController, subscriptionController, rateLimitController) { | ||
this._allowedAccountOrigins = allowedAccountOrigins; | ||
@@ -59,2 +59,3 @@ this._allowedApiOrigins = allowedApiOrigins; | ||
this._subscriptions = subscriptionController; | ||
this._rateLimit = rateLimitController; | ||
} | ||
@@ -67,2 +68,23 @@ /** | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let skipRateLimitCheck = false; | ||
if (!this._rateLimit) { | ||
skipRateLimitCheck = true; | ||
} | ||
else if (request.method == 'POST' && | ||
request.path === '/api/stripeWebhook') { | ||
skipRateLimitCheck = true; | ||
} | ||
if (!skipRateLimitCheck) { | ||
const response = yield this._rateLimit.checkRateLimit({ | ||
ipAddress: request.ipAddress, | ||
}); | ||
if (response.success === false) { | ||
if (response.errorCode === 'rate_limit_exceeded') { | ||
return formatResponse(request, returnResult(response), true); | ||
} | ||
else { | ||
console.log('[RecordsHttpServer] Rate limit check failed. Allowing request to continue.'); | ||
} | ||
} | ||
} | ||
if (request.method === 'GET' && | ||
@@ -69,0 +91,0 @@ request.path.startsWith('/api/') && |
@@ -62,3 +62,3 @@ /** | ||
*/ | ||
export declare type PublicRecordKeyPolicy = null | 'subjectfull' | 'subjectless'; | ||
export type PublicRecordKeyPolicy = null | 'subjectfull' | 'subjectless'; | ||
/** | ||
@@ -65,0 +65,0 @@ * Defines an interface for record key objects. |
@@ -63,3 +63,3 @@ import { AuthController, ValidateSessionKeyFailure } from './AuthController'; | ||
} | ||
export declare type CreateManageSubscriptionResult = CreateManageSubscriptionSuccess | CreateManageSubscriptionFailure; | ||
export type CreateManageSubscriptionResult = CreateManageSubscriptionSuccess | CreateManageSubscriptionFailure; | ||
export interface CreateManageSubscriptionSuccess { | ||
@@ -93,3 +93,3 @@ success: true; | ||
} | ||
export declare type GetSubscriptionStatusResult = GetSubscriptionStatusSuccess | GetSubscriptionStatusFailure; | ||
export type GetSubscriptionStatusResult = GetSubscriptionStatusSuccess | GetSubscriptionStatusFailure; | ||
export interface GetSubscriptionStatusSuccess { | ||
@@ -241,3 +241,3 @@ success: true; | ||
} | ||
export declare type HandleStripeWebhookResponse = HandleStripeWebhookSuccess | HandleStripeWebhookFailure; | ||
export type HandleStripeWebhookResponse = HandleStripeWebhookSuccess | HandleStripeWebhookFailure; | ||
export interface HandleStripeWebhookSuccess { | ||
@@ -244,0 +244,0 @@ success: true; |
@@ -78,3 +78,3 @@ /** | ||
success: true; | ||
}): 401 | 501 | 404 | 400 | 200 | 403 | 500 | 412; | ||
}): 401 | 501 | 404 | 400 | 200 | 403 | 500 | 412 | 429; | ||
/** | ||
@@ -90,3 +90,3 @@ * Clones the given object into a new object that only has non-null and not-undefined properties. | ||
export declare function tryParseJson(json: string): JsonParseResult; | ||
export declare type JsonParseResult = JsonParseSuccess | JsonParseFailure; | ||
export type JsonParseResult = JsonParseSuccess | JsonParseFailure; | ||
export interface JsonParseSuccess { | ||
@@ -93,0 +93,0 @@ success: true; |
@@ -300,2 +300,8 @@ import { fromByteArray, toByteArray } from 'base64-js'; | ||
} | ||
else if (response.errorCode === 'user_is_banned') { | ||
return 403; | ||
} | ||
else if (response.errorCode === 'rate_limit_exceeded') { | ||
return 429; | ||
} | ||
else { | ||
@@ -302,0 +308,0 @@ return 400; |
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
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
411691
93
7335
4