snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s

This commit is contained in:
upstream-mirror
2026-09-16 01:21:02 +05:00
commit 30810eecd7
10161 changed files with 987110 additions and 0 deletions

View File

@@ -0,0 +1,112 @@
import type {
IRoom,
RoomType,
IUser,
IMessage,
ValueOf,
AtLeast,
ISubscription,
IOmnichannelRoom,
IUpload,
} from '@rocket.chat/core-typings';
import type { Keys as IconName } from '@rocket.chat/icons';
import type { IRouterPaths, RouteName } from '@rocket.chat/ui-contexts';
export type RoomIdentification = { rid?: IRoom['_id']; name?: string; tab?: string };
export interface IRoomTypeRouteConfig<TRouteName extends RouteName> {
name: TRouteName;
path?: IRouterPaths[TRouteName]['pattern'];
link?: (data: RoomIdentification) => Record<string, string>;
}
export const RoomSettingsEnum = {
TYPE: 'type',
NAME: 'roomName',
TOPIC: 'roomTopic',
ANNOUNCEMENT: 'roomAnnouncement',
DESCRIPTION: 'roomDescription',
READ_ONLY: 'readOnly',
REACT_WHEN_READ_ONLY: 'reactWhenReadOnly',
ARCHIVE_OR_UNARCHIVE: 'archiveOrUnarchive',
JOIN_CODE: 'joinCode',
BROADCAST: 'broadcast',
SYSTEM_MESSAGES: 'systemMessages',
E2E: 'encrypted',
} as const;
export const RoomMemberActions = {
ARCHIVE: 'archive',
IGNORE: 'ignore',
BLOCK: 'block',
MUTE: 'mute',
BAN: 'ban',
SET_AS_OWNER: 'setAsOwner',
SET_AS_LEADER: 'setAsLeader',
SET_AS_MODERATOR: 'setAsModerator',
LEAVE: 'leave',
REMOVE_USER: 'removeUser',
JOIN: 'join',
INVITE: 'invite',
} as const;
export const UiTextContext = {
HIDE_WARNING: 'hideWarning',
LEAVE_WARNING: 'leaveWarning',
} as const;
export interface IRoomTypeConfig {
identifier: string;
route?: IRoomTypeRouteConfig<RouteName>;
}
export interface IRoomTypeClientConfig extends IRoomTypeConfig {
label?: string;
}
export interface IRoomTypeClientDirectives {
config: IRoomTypeClientConfig;
allowRoomSettingChange: (room: Partial<IRoom>, setting: ValueOf<typeof RoomSettingsEnum>) => boolean;
allowMemberAction: (
room: Partial<IRoom>,
action: ValueOf<typeof RoomMemberActions>,
userId: IUser['_id'],
userSubscription?: ISubscription,
) => boolean;
roomName: (room: AtLeast<IRoom, '_id' | 'name' | 'fname' | 'prid'>) => string | undefined;
isGroupChat: (room: Partial<IRoom>) => boolean;
getUiText: (context: ValueOf<typeof UiTextContext>) => string;
getAvatarPath: (
room: Pick<IRoom, '_id' | 'name' | 'fname' | 'prid' | 'avatarETag' | 'uids' | 'usernames'> & { username?: IRoom['_id'] },
) => string;
getIcon?: (room: Partial<IRoom>) => IconName;
extractOpenRoomParams?: (routeParams: Record<string, string | null | undefined>) => { type: RoomType; reference: string };
findRoom: (identifier: string) => IRoom | undefined;
isLivechatRoom: () => boolean;
canSendMessage: (room: IRoom) => boolean;
readOnly?: (room?: IRoom, user?: AtLeast<IUser, 'username'> | null) => boolean;
}
export interface IRoomTypeServerDirectives {
config: IRoomTypeConfig;
allowRoomSettingChange: (room: IRoom, setting: ValueOf<typeof RoomSettingsEnum>) => boolean;
allowMemberAction: (room: IRoom, action: ValueOf<typeof RoomMemberActions>, userId?: IUser['_id']) => Promise<boolean>;
roomName: (room: IRoom, userId?: string) => Promise<string | undefined>;
isGroupChat: (room: IRoom) => boolean;
canBeDeleted: (hasPermission: (permissionId: string, rid?: string) => Promise<boolean> | boolean, room: IRoom) => Promise<boolean>;
preventRenaming: () => boolean;
getDiscussionType: (room?: AtLeast<IRoom, 'teamId'>) => Promise<RoomType>;
canAccessUploadedFile: (params: { rc_uid: string; rc_rid: string; rc_token: string }, file?: IUpload) => Promise<boolean>;
getNotificationDetails: (
room: IRoom,
sender: AtLeast<IUser, '_id' | 'name' | 'username'>,
notificationMessage: string,
userId: string,
) => Promise<{ title: string | undefined; text: string; name: string | undefined }>;
getMsgSender: (message: IMessage) => Promise<IUser | null>;
includeInRoomSearch: () => boolean;
includeInDashboard: () => boolean;
roomFind?: (rid: string, uid?: IUser['_id']) => Promise<IRoom | IOmnichannelRoom | null | undefined> | IRoom | undefined;
}

View File

@@ -0,0 +1,3 @@
declare module 'atlassian-crowd-patched' {
export = any;
}

View File

@@ -0,0 +1,8 @@
// The Meteor bundler resolves npm requires by physical path and doesn't support
// package `exports` subpaths, so runtime code must keep importing the real file
// 'csv-parse/lib/sync'. That path isn't in csv-parse's exports map, which newer
// TypeScript resolution modes enforce — bridge the types to the exports-declared
// entry point.
declare module 'csv-parse/lib/sync' {
export * from 'csv-parse/sync';
}

View File

@@ -0,0 +1,7 @@
import 'express-session';
declare module 'express-session' {
interface SessionData {
loginClient?: string;
}
}

View File

@@ -0,0 +1,17 @@
import 'express';
import type { IUser } from '@rocket.chat/core-typings';
declare module 'express' {
interface Request {
userId?: string;
user?: IUser;
unauthorized?: boolean;
}
}
declare global {
namespace Express {
// eslint-disable-next-line @typescript-eslint/no-empty-interface -- merges with Passport's Express.User
interface User extends IUser {}
}
}

View File

@@ -0,0 +1,29 @@
import type { Server } from 'net';
declare global {
interface Navigator {
/** @deprecated */
readonly userLanguage?: string;
}
const __meteor_runtime_config__: {
ROOT_URL_PATH_PREFIX: string;
ROOT_URL: string;
};
interface Window {
defaultUserLanguage?: () => string;
DISABLE_ANIMATION?: boolean;
ServiceConfiguration?: unknown;
__meteor_runtime_config__: {
ROOT_URL_PATH_PREFIX: string;
ROOT_URL: string;
};
}
namespace NodeJS {
interface Process {
emit(event: 'message', message: any, sendHandle?: Server | Socket): boolean;
}
}
}

View File

@@ -0,0 +1,4 @@
declare module 'ldap-escape' {
export function filter(strings: TemplateStringsArray, ...values: string[]): string;
export function dn(strings: TemplateStringsArray, ...values: string[]): string;
}

View File

@@ -0,0 +1,70 @@
declare module 'meteor/accounts-base' {
import type { Meteor } from 'meteor/meteor';
namespace Accounts {
const storageLocation: Window['localStorage'];
function _expireTokens(oldestValidDate?: Date, userId?: string): Promise<void>;
function _bcryptRounds(): number;
function _getLoginToken(connectionId: string): string | undefined;
function insertUserDoc(options: Record<string, any>, user: Record<string, any>): string;
function _generateStampedLoginToken(): { token: string; when: Date };
function _insertLoginToken(userId: string, token: { token: string; when: Date }): Promise<void>;
function _runLoginHandlers<T>(methodInvocation: T, loginRequest: Record<string, any>): Promise<LoginMethodResult>;
function registerLoginHandler(name: string, handler: (options: any) => undefined | object): void;
function _setAccountData(connectionId: string, key: string, token: string): void;
function _checkPasswordAsync(user: Meteor.User, password: Password): Promise<{ userId: string; error?: any }>;
function updateOrCreateUserFromExternalService(
serviceName: string,
serviceData: Record<string, unknown>,
options: Record<string, unknown>,
): Promise<Record<string, unknown> | undefined>;
function addAutopublishFields(options: Record<string, unknown>): void;
function _clearAllLoginTokens(userId: string | null): void;
function config(options: { clientStorage: 'session' | 'local' }): void;
class ConfigError extends Error {}
class LoginCancelledError extends Error {
public static readonly numericError: number;
}
const _accountData: Record<string, any>;
interface AccountsServerOptions {
ambiguousErrorMessages?: boolean;
restrictCreationByEmailDomain?: string | (() => string);
forbidClientAccountCreation?: boolean | undefined;
}
export const _options: AccountsServerOptions;
namespace oauth {
function credentialRequestCompleteHandler(
callback?: (error?: globalThis.Error | Meteor.Error | Meteor.TypedError) => void,
totpCode?: string,
): (credentialTokenOrError?: string | globalThis.Error | Meteor.Error | Meteor.TypedError) => void;
function registerService(name: string): void;
function serviceNames(): string[];
}
const connection: {
userId(): string | null;
};
}
}

View File

@@ -0,0 +1,7 @@
import 'meteor/check';
declare module 'meteor/check' {
namespace Match {
function Where<T, U extends T>(condition: (val: T) => val is U): Matcher<U>;
}
}

View File

@@ -0,0 +1,24 @@
declare module 'meteor/ddp-common' {
namespace DDPCommon {
function stringifyDDP(msg: EJSONable): string;
function parseDDP(msg: string): EJSONable;
class MethodInvocation {
constructor(options: {
connection: {
id: string;
close: () => void;
clientAddress: string;
httpHeaders: Record<string, any>;
};
isSimulation?: boolean;
userId?: string;
});
}
class Heartbeat {
_seenPacket: boolean;
messageReceived(): void;
}
}
}

View File

@@ -0,0 +1,10 @@
declare module 'meteor/ddp-rate-limiter' {
namespace DDPRateLimiter {
function _increment(number: DDPRateLimiter.Matcher): void;
function _check(number: DDPRateLimiter.Matcher): {
allowed: boolean;
timeToReset: number;
};
function getErrorMessage(result: { allowed: boolean }): string;
}
}

View File

@@ -0,0 +1,9 @@
import type { DDPCommon } from 'meteor/ddp-common';
declare module 'meteor/ddp' {
namespace DDP {
const _CurrentInvocation: {
withValue(invocation: DDPCommon.MethodInvocation, func: () => Promise<any>): Promise<any>;
};
}
}

View File

@@ -0,0 +1,15 @@
import 'meteor/ejson';
declare module 'meteor/ejson' {
namespace EJSON {
function stringify(
val: EJSONableProperty,
options?: {
indent?: boolean | number | string | undefined;
canonical?: boolean | undefined;
},
): string;
function parse<T>(str: string): EJSONableProperty & T;
}
}

View File

@@ -0,0 +1,3 @@
declare module 'meteor/facebook-oauth' {
export const Facebook: any;
}

View File

@@ -0,0 +1,5 @@
declare module 'meteor/facts-base' {
namespace Facts {
function incrementServerFact(pkg: 'pkg' | 'fact', fact: string | number, increment: number): void;
}
}

View File

@@ -0,0 +1,3 @@
declare module 'meteor/google-oauth' {
export const Google: any;
}

View File

@@ -0,0 +1,54 @@
import 'meteor/http';
import type { Meteor } from 'meteor/meteor';
declare module 'meteor/http' {
namespace HTTP {
interface HTTPRequest {
content?: string | undefined;
data?: any;
query?: string | undefined;
params?: { [id: string]: string } | undefined;
auth?: string | undefined;
headers?: { [id: string]: string } | undefined;
timeout?: number | undefined;
followRedirects?: boolean | undefined;
}
interface HTTPResponse {
statusCode?: number | undefined;
headers?: { [id: string]: string } | undefined;
content?: string | undefined;
data?: any;
}
type AsyncCallback = (error: Meteor.Error | null, result?: HTTPResponse) => void;
function del(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: AsyncCallback): HTTP.HTTPResponse;
function get(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: AsyncCallback): HTTP.HTTPResponse;
function post(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: AsyncCallback): HTTP.HTTPResponse;
function put(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: AsyncCallback): HTTP.HTTPResponse;
function call(method: string, url: string, options?: HTTP.HTTPRequest, asyncCallback?: AsyncCallback): HTTP.HTTPResponse;
function call(
method: string,
url: string,
options?: {
content?: string;
data?: object;
query?: string;
params?: object;
auth?: string;
headers?: object;
timeout?: number;
followRedirects?: boolean;
npmRequestOptions?: object;
beforeSend?: (xhr: XMLHttpRequest) => void;
},
asyncCallback?: AsyncCallback,
): HTTP.HTTPResponse;
}
}

View File

@@ -0,0 +1,3 @@
declare module 'meteor/meteor-developer-oauth' {
export const MeteorDeveloperAccounts: any;
}

View File

@@ -0,0 +1,197 @@
import 'meteor/meteor';
import type { IUser } from '@rocket.chat/core-typings';
import type { ServerMethods } from '@rocket.chat/ddp-client';
import type { DDPCommon, IStreamerConstructor, IStreamer } from 'meteor/ddp-common';
type StringifyBuffers<T extends unknown[]> = {
[P in keyof T]: T[P] extends Buffer ? string : T[P];
};
declare global {
namespace Assets {
function getBinaryAsync(assetPath: string): Promise<Uint8Array | undefined>;
function getTextAsync(assetPath: string): Promise<string | undefined>;
}
}
declare module 'meteor/meteor' {
namespace Meteor {
const Streamer: IStreamerConstructor & IStreamer;
namespace StreamerCentral {
const instances: {
[name: string]: IStreamer;
};
function on(name: string, callback: (...args: any[]) => void): void;
}
interface ErrorStatic {
new (error: string | number, reason?: string, details?: any): Error;
}
interface Error extends globalThis.Error {
error: string | number;
reason?: string;
}
interface Device {
isDesktop(): boolean;
isPhone(): boolean;
}
const server: {
sessions: Map<string, { userId: string; heartbeat: DDPCommon.Heartbeat; connectionHandle: Meteor.Connection }>;
publish_handlers: {
meteor_autoupdate_clientVersions(): void;
};
};
const runAsUser: <T>(userId: string, scope: () => T) => T;
function userAsync(): Promise<IUser | null>;
interface MethodThisType {
twoFactorChecked: boolean | undefined;
}
interface IDDPMessage {
msg: 'method';
method: string;
params: EJSON[];
id: string;
}
interface IDDPUpdatedMessage {
msg: 'updated';
methods: string[];
}
interface IDDPStream {
eventCallbacks: {
message: Array<(data: string) => void>;
reset: Array<() => void>;
disconnect: Array<() => void>;
};
socket?: {
onmessage: (data: { type: string; data: string }) => void;
_didMessage: (data: string) => void;
send: (data: string) => void;
};
_launchConnectionAsync?: () => void;
on: {
(key: 'message', callback: (data: string) => void): void;
(key: 'reset', callback: () => void): void;
(key: 'disconnect', callback: () => void): void;
};
disconnect(options?: { _permanent?: boolean; _error?: unknown }): void;
currentStatus: {
status: string;
connected: boolean;
retryCount: number;
retryTime?: number;
reason?: string;
};
statusListeners?: { changed(): void };
forEachCallback(name: string, cb: (callback: (...args: unknown[]) => void) => void): void;
send(data: string): void;
status(): IDDPStream['currentStatus'];
statusChanged(): void;
reconnect(options?: unknown): void;
disconnect(options?: { _permanent?: boolean; _error?: unknown }): void;
_lostConnection(error?: unknown): void;
}
interface IMeteorConnection {
httpHeaders: Record<string, any>;
referer: string;
clientAddress: string;
_send(message: IDDPMessage): void;
_methodInvokers: Record<string, any>;
_subsBeingRevived: Record<string, unknown>;
_methodsBlockingQuiescence: Record<string, unknown>;
_messagesBufferedUntilQuiescence: unknown[];
_outstandingMethodBlocks: unknown[];
_livedata_data(message: IDDPUpdatedMessage): void;
_stream: IDDPStream | undefined;
// Updated: onMessage is now inside _streamHandlers
_streamHandlers: {
onMessage(message: string): void;
onReset(): void;
};
status(): {
connected: boolean;
retryCount?: number;
retryTime?: number;
status: 'connected' | 'connecting' | 'failed' | 'waiting' | 'offline';
reconnect: () => void;
};
subscribe(
id: string,
name: string,
...args: [
...unknown,
callbacks?: {
onReady?: (...args: any[]) => void;
onStop?: (error?: Error) => void;
onError?: (error: Error) => void;
},
]
): SubscriptionHandle;
call(methodName: string, ...args: [...unknown, callback?: (error: Error | null, result: unknown) => void]): void;
setUserId(uid: string | null): void;
}
const connection: IMeteorConnection;
function _relativeToSiteRootUrl(path: string): string;
const _localStorage: Window['localStorage'];
function methods<TServerMethods extends ServerMethods>(methods: {
[TMethodName in keyof TServerMethods]?: (
this: MethodThisType,
...args: StringifyBuffers<Parameters<TServerMethods[TMethodName]>>
) => ReturnType<TServerMethods[TMethodName]> | Promise<ReturnType<TServerMethods[TMethodName]>>;
}): void;
const AppCache:
| {
config: (config: { onlineOnly: string[] }) => void;
}
| undefined;
function _isPromise(obj: unknown): obj is Promise<unknown>;
function _runFresh(func: () => void): void;
class _SynchronousQueue {
queueTask(arg0: () => void): void;
drain(): unknown;
}
interface UserServices {
totp?: {
enabled: boolean;
hashedBackup: string[];
secret: string;
tempSecret?: string;
};
}
}
// eslint-disable-next-line no-var
var Meteor: {
[key: `loginWith${string}`]: any;
};
}

View File

@@ -0,0 +1,6 @@
declare module 'meteor/meteorhacks:inject-initial' {
namespace Inject {
function rawBody(key: string, value: string): void;
function rawModHtml(key: string, value: (html: string) => string): void;
}
}

View File

@@ -0,0 +1,44 @@
import type * as mongodb from 'mongodb';
declare module 'meteor/mongo' {
interface RemoteCollectionDriver {
mongo: MongoConnection;
}
interface OplogHandle {
stop(): void;
onOplogEntry(trigger: Record<string, any>, callback: (notification: unknown) => void): void;
onSkippedEntries(callback: () => void): void;
waitUntilCaughtUp(): void;
_defineTooFarBehind(value: number): void;
_entryQueue?: unknown[];
}
interface MongoConnection {
db: mongodb.Db;
client: mongodb.MongoClient;
_oplogHandle: OplogHandle;
rawCollection(name: string): mongodb.Collection;
}
namespace MongoInternals {
function defaultRemoteCollectionDriver(): RemoteCollectionDriver;
class ConnectionClass {}
function Connection(): ConnectionClass;
}
namespace Mongo {
interface CollectionStatic {
new <T>(
name: string | null,
options?: {
connection?: object | null;
idGeneration?: string;
transform?: (<T>(doc: T) => T) | null;
},
): Collection<T>;
}
}
}

View File

@@ -0,0 +1,4 @@
declare module 'meteor/npm-mongo' {
// The npm-mongo Meteor package re-exports the mongodb driver under this name.
export * as NpmModuleMongodb from 'mongodb';
}

View File

@@ -0,0 +1,54 @@
declare module 'meteor/oauth' {
import type { IRocketChatRecord } from '@rocket.chat/core-typings';
import type { Meteor } from 'meteor/meteor';
import type { Mongo } from 'meteor/mongo';
// These functions may only be used on the client's Mongo.Collection
type MeteorServerMongoCollection<T extends MongoNpmModule.Document, U = T> = Omit<
Mongo.Collection<T, U>,
'remove' | 'findOne' | 'insert' | 'update' | 'upsert'
>;
interface IOauthCredentials extends IRocketChatRecord {
key: string;
credentialSecret: string;
credential:
| {
error: Error;
}
| string;
}
namespace OAuth {
function _retrievePendingCredential(key: string, ...args: string[]): Promise<string | Error | void>;
function openSecret(secret: string): string;
function retrieveCredential(credentialToken: string, credentialSecret: string);
function _retrieveCredentialSecret(credentialToken: string): string | null;
// luckily we don't have any reference to this collection on the client code, so let's type it according to what can be used on the server
const _pendingCredentials: MeteorServerMongoCollection<IOauthCredentials>;
const _storageTokenPrefix: string;
function launchLogin(options: {
loginService: string;
loginStyle: string;
loginUrl: string;
credentialRequestCompleteCallback?: (credentialTokenOrError?: string | Error) => void;
credentialToken: string;
popupOptions?: {
width?: number;
height?: number;
};
}): void;
function _stateParam(loginStyle: string, credentialToken: string, redirectUrl?: string): string;
function _redirectUri(
serviceName: string,
config: { loginStyle?: string },
params?: Record<string, any>,
absoluteUrlOptions?: Record<string, any>,
): string;
function _loginStyle(serviceName: string, config: { loginStyle?: string }, options?: Meteor.LoginWithExternalServiceOptions): string;
}
}

View File

@@ -0,0 +1,14 @@
declare module 'meteor/ostrio:cookies' {
class Cookies {
constructor(opts?: {
TTL?: number | false;
auto?: boolean;
handler?: (cookies: Cookies) => void;
runOnServer?: boolean;
allowQueryStringCookies?: boolean;
allowedCordovaOrigins?: RegExp | boolean;
});
get(key: string, _tmp?: string): string | undefined;
}
}

View File

@@ -0,0 +1,25 @@
declare module 'meteor/rate-limit' {
type RateLimiterOptionsToCheck = {
IPAddr: string;
route: string;
};
type RateLimiterCheckResult = {
allowed: boolean;
timeToReset: number;
numInvocationsLeft: number;
};
class RateLimiter {
public check(input: RateLimiterOptionsToCheck): Promise<RateLimiterCheckResult>;
public increment(input: RateLimiterOptionsToCheck);
public addRule(
rule: { IPAddr: (input: any) => any; route: string },
numRequestsAllowed: number,
intervalTime: number,
callback?: () => void,
): void;
}
}

View File

@@ -0,0 +1,5 @@
declare module 'meteor/routepolicy' {
class RoutePolicy {
static declare(urlPrefix: string, type: string): void;
}
}

View File

@@ -0,0 +1,14 @@
declare module 'meteor/service-configuration' {
interface Configuration {
appId: string;
secret: string;
service: string;
buttonLabelText?: string;
buttonLabelColor?: string;
buttonColor?: string;
clientConfig: unknown;
clientId?: string;
}
}

View File

@@ -0,0 +1,5 @@
declare module 'meteor/tracker' {
namespace Tracker {
function nonreactive<T>(func: () => T): T;
}
}

View File

@@ -0,0 +1,3 @@
declare module 'meteor/twitter-oauth' {
export const Twitter: any;
}

View File

@@ -0,0 +1,5 @@
declare module 'meteor/url' {
const URL: typeof window.URL & {
_constructUrl(url: string, query?: string, paramsForUrl?: Record<string, string>): string;
};
}

View File

@@ -0,0 +1,15 @@
declare module 'meteor/webapp' {
import type { IncomingMessage } from 'node:http';
import type { UrlWithParsedQuery } from 'node:url';
import type * as express from 'express';
namespace WebApp {
// Present in Meteor 3's generated types but missing from @types/meteor.
const rawHandlers: express.Application;
function setInlineScriptsAllowed(allowed: boolean): Promise<void>;
function categorizeRequest(req: IncomingMessage): { arch: string; path: string; url: UrlWithParsedQuery } & Record<string, unknown>;
}
}

View File

@@ -0,0 +1,5 @@
import 'xml-encryption';
declare module 'xml-encryption' {
export function decrypt(xml: Element, options: DecryptOptions, callback: (err: Error, result: any) => void): string;
}

View File

@@ -0,0 +1,48 @@
type TypeNumber =
| 1
| 2
| 3
| 4
| 5
| 6
| 7
| 8
| 9
| 10
| 11
| 12
| 13
| 14
| 15
| 16
| 17
| 18
| 19
| 20
| 21
| 22
| 23
| 24
| 25
| 26
| 27
| 28
| 29
| 30
| 31
| 32
| 33
| 34
| 35
| 36
| 37
| 38
| 39;
interface Params {
size?: number;
errorCorrectLevel?: 'L' | 'M' | 'Q' | 'H';
typeNumber?: TypeNumber;
}
declare module 'yaqrcode' {
export default function qrcode(source: string, params?: Params): string;
}