feat: complete Ancestor quote bot with production-ready Docker support
This commit is contained in:
8
.env
8
.env
@@ -1,3 +1,9 @@
|
||||
# Matrix Ancestor Quote Bot Configuration
|
||||
|
||||
# IMPORTANT: Replace these values with your own!
|
||||
MATRIX_HOME_SERVER=https://matrix.org
|
||||
MATRIX_ACCESS_TOKEN=YOUR_ACCESS_TOKEN_HERE
|
||||
MATRIX_ACCESS_TOKEN=your_real_access_token_here
|
||||
BOT_COMMAND=!quote
|
||||
DEBUG=false
|
||||
|
||||
# If you want debug logging, set DEBUG=true
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Matrix Ancestor Quote Bot Configuration
|
||||
|
||||
# Replace these values with your own:
|
||||
# IMPORTANT: Replace these values with your own!
|
||||
MATRIX_HOME_SERVER=https://matrix.org
|
||||
MATRIX_ACCESS_TOKEN=your_access_token_here
|
||||
MATRIX_ACCESS_TOKEN=your_real_access_token_here
|
||||
BOT_COMMAND=!quote
|
||||
|
||||
# Optional: Enable debug logging (set to false in production)
|
||||
# If you want debug logging, set DEBUG=true
|
||||
DEBUG=false
|
||||
|
||||
10
Dockerfile
10
Dockerfile
@@ -1,18 +1,10 @@
|
||||
FROM node:18-alpine
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files first for better layer caching
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies (including dotenv)
|
||||
RUN npm install
|
||||
|
||||
# Copy application source code
|
||||
COPY . .
|
||||
|
||||
# Expose port if needed (optional, Matrix uses websocket)
|
||||
# EXPOSE 3000
|
||||
|
||||
# Run the bot (dotenv will auto-load from /app/.env or environment variables)
|
||||
CMD ["node", "index.js"]
|
||||
|
||||
38
README.md
38
README.md
@@ -1,4 +1,4 @@
|
||||
# Ancestor Quote Bot 🎃
|
||||
# 🎃 Ancestor Quote Bot
|
||||
|
||||
A Matrix chatbot that responds to `!quote` commands with random quotes from Darkest Dungeons.
|
||||
|
||||
@@ -7,7 +7,7 @@ A Matrix chatbot that responds to `!quote` commands with random quotes from Dark
|
||||
```bash
|
||||
# 1. Update .env file (create from template)
|
||||
cp .env.example .env
|
||||
# Edit .env with your MATRIX_ACCESS_TOKEN and MATRIX_HOME_SERVER
|
||||
nano .env # Edit MATRIX_ACCESS_TOKEN and MATRIX_HOME_SERVER
|
||||
|
||||
# 2. Build Docker image
|
||||
docker build -t ancestor-quote-bot .
|
||||
@@ -15,13 +15,13 @@ docker build -t ancestor-quote-bot .
|
||||
# 3. Run the bot
|
||||
docker run --rm \
|
||||
-e MATRIX_HOME_SERVER=https://matrix.org \
|
||||
-e MATRIX_ACCESS_TOKEN=your_token_here \
|
||||
-e MATRIX_ACCESS_TOKEN=your_access_token_here \
|
||||
ancestor-quote-bot
|
||||
```
|
||||
|
||||
## Deployment Options
|
||||
|
||||
### Option 1: Pass env vars via `docker run` (Recommended for Docker)
|
||||
### Option A: Pass env vars via `docker run` (Recommended)
|
||||
```bash
|
||||
docker run --rm \
|
||||
-e MATRIX_HOME_SERVER=https://matrix.org \
|
||||
@@ -30,22 +30,13 @@ docker run --rm \
|
||||
ancestor-quote-bot
|
||||
```
|
||||
|
||||
### Option 2: Mount .env file directly
|
||||
### Option B: Mount .env file directly
|
||||
```bash
|
||||
docker run --rm \
|
||||
-v $(pwd)/.env:/app/.env \
|
||||
ancestor-quote-bot
|
||||
```
|
||||
|
||||
### Option 3: Use docker-compose.yml (Production)
|
||||
```bash
|
||||
docker compose up -d
|
||||
# Or with custom env:
|
||||
docker compose up -d \
|
||||
-e MATRIX_HOME_SERVER=https://matrix.org \
|
||||
-e MATRIX_ACCESS_TOKEN=your_access_token_here
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
| Variable | Description | Default |
|
||||
@@ -54,15 +45,30 @@ docker compose up -d \
|
||||
| `MATRIX_ACCESS_TOKEN` | Bot access token for authentication | REQUIRED |
|
||||
| `BOT_COMMAND` | Command trigger to request a quote | !quote |
|
||||
|
||||
## Getting an Access Token
|
||||
|
||||
1. Go to [Matrix Registration API](https://matrix.org/docs/projects/registration/matrix-registration-api)
|
||||
2. Or use your Matrix admin panel to create a bot account
|
||||
3. Get the access token from your Matrix settings
|
||||
|
||||
## How It Works
|
||||
|
||||
1. The bot connects to your Matrix homeserver using the provided access token
|
||||
2. Once joined to a room, it listens for messages containing the trigger command
|
||||
3. When triggered, it selects a random quote from `quotes.json` and replies instantly
|
||||
|
||||
## Getting an Access Token
|
||||
## Usage
|
||||
|
||||
Use [this](https://matrix.org/docs/projects/registration/matrix-registration-api) or your Matrix admin panel to register a bot account.
|
||||
```bash
|
||||
# Invite the bot to a room:
|
||||
# @ancestor-quote-bot:matrix.org (or your custom username)
|
||||
|
||||
# In any Matrix room, type:
|
||||
!quote
|
||||
|
||||
# Bot responds with:
|
||||
"Dispatch this thug in brutal fashion, that all may hear of your arrival!"
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
||||
116
index.js
116
index.js
@@ -4,75 +4,79 @@ import fs from 'fs';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
console.log('🚀 Starting Ancestor Quote Bot...\n');
|
||||
|
||||
const client = new MatrixClient({
|
||||
accessToken: process.env.MATRIX_ACCESS_TOKEN,
|
||||
matrix_homeserver: {
|
||||
baseUrl: process.env.MATRIX_HOME_SERVER,
|
||||
},
|
||||
baseUrl: process.env.MATRIX_HOME_SERVER,
|
||||
});
|
||||
|
||||
function loadQuotes() {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
const quotesFile = './quotes.json';
|
||||
if (fs.existsSync(quotesFile)) {
|
||||
try {
|
||||
resolve(JSON.parse(fs.readFileSync(quotesFile, 'utf8')));
|
||||
} catch (err) {
|
||||
resolve([]);
|
||||
}
|
||||
} else {
|
||||
resolve([]);
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
try {
|
||||
const quotesFile = './quotes.json';
|
||||
if (fs.existsSync(quotesFile)) {
|
||||
return JSON.parse(fs.readFileSync(quotesFile, 'utf8'));
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error loading quotes:', err.message);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
loadQuotes().then((quotes) => {
|
||||
(async () => {
|
||||
const quotes = loadQuotes();
|
||||
|
||||
if (quotes.length === 0) {
|
||||
console.error('No quotes found! Please ensure quotes.json is present.');
|
||||
console.error('❌ No quotes found! Please ensure quotes.json is present.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log('Bot initialized successfully');
|
||||
console.log(`✅ Loaded ${quotes.length} Ancestor quotes`);
|
||||
|
||||
let joinedRooms = new Set();
|
||||
try {
|
||||
await client.startClient();
|
||||
console.log('✅ Client initialized\n');
|
||||
|
||||
let joinedRooms = new Set();
|
||||
let lastSentMessage = null;
|
||||
|
||||
client.on('RoomMember#joined', (member) => {
|
||||
const room = member.room;
|
||||
if (!joinedRooms.has(room.roomId)) {
|
||||
joinedRooms.add(room.roomId);
|
||||
console.log(`Joined room: ${room.roomId}`);
|
||||
|
||||
room.on('EventMessage', async (event) => {
|
||||
const messageContent = event.getContent();
|
||||
client.on('RoomMember#joined', (member) => {
|
||||
const room = member.room;
|
||||
if (!joinedRooms.has(room.roomId)) {
|
||||
joinedRooms.add(room.roomId);
|
||||
console.log(`✅ Joined: ${room.roomId}`);
|
||||
|
||||
if (!messageContent || !messageContent.body) return;
|
||||
|
||||
const body = messageContent.body.toLowerCase();
|
||||
const botCommand = (process.env.BOT_COMMAND || '!quote').toLowerCase();
|
||||
|
||||
if (body.includes(botCommand)) {
|
||||
const randomQuote = quotes[Math.floor(Math.random() * quotes.length)];
|
||||
try {
|
||||
await room.sendMessage(randomQuote);
|
||||
console.log(`Sent quote to ${room.roomId}`);
|
||||
} catch (err) {
|
||||
console.error('Failed to send message:', err.message);
|
||||
room.on('EventMessage', async (event) => {
|
||||
const content = event.getContent();
|
||||
if (!content || !content.body) return;
|
||||
|
||||
const body = content.body.toLowerCase();
|
||||
const cmd = (process.env.BOT_COMMAND || '!quote').toLowerCase();
|
||||
|
||||
if (body.includes(cmd)) {
|
||||
if (!lastSentMessage || Date.now() - lastSentMessage > 300) {
|
||||
const quote = quotes[Math.floor(Math.random() * quotes.length)];
|
||||
await room.sendMessage(quote);
|
||||
console.log(`🎃 Quote: ${quote}`);
|
||||
lastSentMessage = Date.now();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
room.on('RoomMember#left', () => {
|
||||
joinedRooms.delete(room.roomId);
|
||||
console.log(`Left room: ${room.roomId}`);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Keep process alive with periodic heartbeat
|
||||
setInterval(() => {}, 1000 * 60); // Heartbeat every minute
|
||||
console.log('Bot is running. Press Ctrl+C to exit.');
|
||||
}).catch(err => {
|
||||
console.error('Failed to load quotes:', err.message);
|
||||
});
|
||||
room.on('RoomMember#left', () => {
|
||||
joinedRooms.delete(room.roomId);
|
||||
console.log(`ℹ️ Left: ${room.roomId}`);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
console.log('🤖 Bot is running!');
|
||||
console.log(' Invite to a Matrix room and type !quote to get an Ancestor quote.\n');
|
||||
|
||||
} catch (err) {
|
||||
console.error('Fatal error:', err.message);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
setInterval(() => {}, 60000);
|
||||
})();
|
||||
|
||||
163
node_modules/.package-lock.json
generated
vendored
163
node_modules/.package-lock.json
generated
vendored
@@ -1,22 +1,25 @@
|
||||
{
|
||||
"name": "ancestor-bot",
|
||||
"name": "ancestor-quote-bot",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "8.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-8.0.5.tgz",
|
||||
"integrity": "sha512-7NK+Lz3spQ52XsUGTxIEVU4jYN2/dIaX8sTxRFAUtYmttYZnVh3aehiihv+/Gb7+duMNHl2OrFcBQRyOHScxpg==",
|
||||
"license": "MIT"
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz",
|
||||
"integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@matrix-org/matrix-sdk-crypto-wasm": {
|
||||
"version": "18.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-18.8.0.tgz",
|
||||
"integrity": "sha512-J+bYzUqtkYSrIUbDT8Razf9F1gzlpC94qeC5LQlr9QmjrzyaErwlV9v7S+gtSOeDvJCdfP8ebEDaANHiVLCYQg==",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-1.3.0.tgz",
|
||||
"integrity": "sha512-vQ5PVppKu1PY7xy7QDw+RJLYLGFKhJyxLqjXHr0uEUJwfvz2IH2njTLXzrz77dOo9qacxJ9/YNOTe0Hl+98N0A==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/events": {
|
||||
@@ -25,6 +28,12 @@
|
||||
"integrity": "sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/retry": {
|
||||
"version": "0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz",
|
||||
"integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/another-json": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/another-json/-/another-json-0.2.0.tgz",
|
||||
@@ -32,33 +41,36 @@
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/base-x": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.1.tgz",
|
||||
"integrity": "sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.1.tgz",
|
||||
"integrity": "sha512-uAZ8x6r6S3aUM9rbHGVOIsR15U/ZSc82b3ymnCPsT45Gk1DDvhDPdIgB5MrhirZWt+5K0EEPQH985kNqZgNPFw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/bs58": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz",
|
||||
"integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==",
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz",
|
||||
"integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"base-x": "^5.0.0"
|
||||
"base-x": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/content-type": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz",
|
||||
"integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
|
||||
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/crypto-js": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz",
|
||||
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==",
|
||||
"deprecated": "Active development of CryptoJS has been discontinued. This library is no longer maintained.",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "17.4.2",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz",
|
||||
@@ -80,17 +92,11 @@
|
||||
"node": ">=0.8.x"
|
||||
}
|
||||
},
|
||||
"node_modules/is-network-error": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/is-network-error/-/is-network-error-1.3.2.tgz",
|
||||
"integrity": "sha512-PhBY86zaxNZUuWP6h13Vu5oFe0XY6/UlKzQnYFELzGVHygP3MxmvTfYSG7GN3aIab/iWudSMgjSnG9Dq+nHrgA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
"node_modules/jwt-decode": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz",
|
||||
"integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/loglevel": {
|
||||
"version": "1.9.2",
|
||||
@@ -112,25 +118,28 @@
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/matrix-js-sdk": {
|
||||
"version": "42.3.0",
|
||||
"resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-42.3.0.tgz",
|
||||
"integrity": "sha512-jXXFLlaA25zQ2oxXCgbAEubGC8KpF8OabSf387W0RXfkwqhNXEbU+veeUaZMT+bCbyE5nDxkN3iBy038VbntQg==",
|
||||
"version": "27.1.0",
|
||||
"resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-27.1.0.tgz",
|
||||
"integrity": "sha512-ge1P1iNit0demKA11YzXt4QdsBHObrPdIVdecutFX7OwOBat6BC1F6AxsvPZQPDqnT5oelJt55ym4U7i8G9IRg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^8.0.0",
|
||||
"@matrix-org/matrix-sdk-crypto-wasm": "^18.4.0",
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@matrix-org/matrix-sdk-crypto-wasm": "^1.1.0",
|
||||
"another-json": "^0.2.0",
|
||||
"bs58": "^6.0.0",
|
||||
"content-type": "^2.0.0",
|
||||
"loglevel": "^1.9.2",
|
||||
"bs58": "^5.0.0",
|
||||
"content-type": "^1.0.4",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"loglevel": "^1.7.1",
|
||||
"matrix-events-sdk": "0.0.1",
|
||||
"matrix-widget-api": "^1.18.0",
|
||||
"p-retry": "8",
|
||||
"sdp-transform": "^3.0.0",
|
||||
"unhomoglyph": "^1.0.6"
|
||||
"matrix-widget-api": "^1.3.1",
|
||||
"oidc-client-ts": "^2.2.4",
|
||||
"p-retry": "4",
|
||||
"sdp-transform": "^2.14.1",
|
||||
"unhomoglyph": "^1.0.6",
|
||||
"uuid": "9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.0.0"
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/matrix-widget-api": {
|
||||
@@ -143,25 +152,45 @@
|
||||
"events": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/p-retry": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/p-retry/-/p-retry-8.0.1.tgz",
|
||||
"integrity": "sha512-NAigyu8hfvJe7MsS18mnc4is0MZtau3QMdBklaJKK23oBQb6occO3UPM3vHmTckW8KhfyjMZaUOqdTFEYliHgg==",
|
||||
"license": "MIT",
|
||||
"node_modules/oidc-client-ts": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/oidc-client-ts/-/oidc-client-ts-2.5.0.tgz",
|
||||
"integrity": "sha512-JZ/Sp+AoML4sBWCn8ShAjnIMKx3GXwU/8sQY2btRPOUS8kBZltC2dFqOdN5Mimc4g7oVGSTC/bVDBviYcuud9g==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"is-network-error": "^1.3.0"
|
||||
"crypto-js": "^4.2.0",
|
||||
"jwt-decode": "^3.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
"node": ">=12.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/p-retry": {
|
||||
"version": "4.6.2",
|
||||
"resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz",
|
||||
"integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/retry": "0.12.0",
|
||||
"retry": "^0.13.1"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/retry": {
|
||||
"version": "0.13.1",
|
||||
"resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz",
|
||||
"integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/sdp-transform": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-3.0.0.tgz",
|
||||
"integrity": "sha512-gfYVRGxjHkGF2NPeUWHw5u6T/KGFtS5/drPms73gaSuMaVHKCY3lpLnGDfswVQO0kddeePoti09AwhYP4zA8dQ==",
|
||||
"version": "2.15.0",
|
||||
"resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.15.0.tgz",
|
||||
"integrity": "sha512-KrOH82c/W+GYQ0LHqtr3caRpM3ITglq3ljGUIb8LTki7ByacJZ9z+piSGiwZDsRyhQbYBOBJgr2k6X4BZXi3Kw==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"sdp-verify": "checker.js"
|
||||
@@ -172,6 +201,20 @@
|
||||
"resolved": "https://registry.npmjs.org/unhomoglyph/-/unhomoglyph-1.0.6.tgz",
|
||||
"integrity": "sha512-7uvcWI3hWshSADBu4JpnyYbTVc7YlhF5GDW/oPD5AxIxl34k4wXR3WDkPnzLxkN32LiTCTKMQLtKVZiwki3zGg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
|
||||
"integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
|
||||
"deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1557
node_modules/@babel/runtime/package.json
generated
vendored
1557
node_modules/@babel/runtime/package.json
generated
vendored
File diff suppressed because it is too large
Load Diff
80
node_modules/@matrix-org/matrix-sdk-crypto-wasm/README.md
generated
vendored
80
node_modules/@matrix-org/matrix-sdk-crypto-wasm/README.md
generated
vendored
@@ -22,102 +22,66 @@ Encryption](https://en.wikipedia.org/wiki/End-to-end_encryption)) for
|
||||
or:
|
||||
|
||||
```
|
||||
pnpm add @matrix-org/matrix-sdk-crypto-wasm
|
||||
yarn add @matrix-org/matrix-sdk-crypto-wasm
|
||||
```
|
||||
|
||||
2. Import the library into your project and initialise it.
|
||||
|
||||
On Web platforms, the library must be initialised by calling `initAsync`
|
||||
before it can be used, else it will throw an error. This is also recommended
|
||||
on other platforms, as it allows the WebAssembly module to be loaded
|
||||
asynchronously.
|
||||
It is recommended that you use a dynamic import, particularly in a Web
|
||||
environment, because the WASM artifiact is large:
|
||||
|
||||
```javascript
|
||||
import { initAsync, Tracing, LoggerLevel, OlmMachine, UserId, DeviceId } from "@matrix-org/matrix-sdk-crypto-wasm";
|
||||
|
||||
async function loadCrypto(userId, deviceId) {
|
||||
// Do this before any other calls to the library
|
||||
await initAsync();
|
||||
const matrixSdkCrypto = await import("@matrix-org/matrix-sdk-crypto-wasm");
|
||||
await matrixSdkCrypto.initAsync();
|
||||
|
||||
// Optional: enable tracing in the rust-sdk
|
||||
new Tracing(LoggerLevel.Trace).turnOn();
|
||||
new matrixSdkCrypto.Tracing(matrixSdkCrypto.LoggerLevel.Trace).turnOn();
|
||||
|
||||
// Create a new OlmMachine
|
||||
//
|
||||
// The following will use an in-memory store. It is recommended to use
|
||||
// indexedDB where that is available.
|
||||
// See https://matrix-org.github.io/matrix-sdk-crypto-wasm/classes/OlmMachine.html#initialize
|
||||
const olmMachine = await OlmMachine.initialize(new UserId(userId), new DeviceId(deviceId));
|
||||
// See https://matrix-org.github.io/matrix-rust-sdk-crypto-wasm/classes/OlmMachine.html#initialize
|
||||
const olmMachine = await matrixSdkCrypto.OlmMachine.initialize(
|
||||
new RustSdkCryptoJs.UserId(userId),
|
||||
new RustSdkCryptoJs.DeviceId(deviceId),
|
||||
);
|
||||
|
||||
return olmMachine;
|
||||
}
|
||||
```
|
||||
|
||||
See the [API documentation](https://matrix-org.github.io/matrix-sdk-crypto-wasm/) for more information.
|
||||
|
||||
3. Build your project.
|
||||
|
||||
The packaging of this library aims to "just work" the same as any plain-javascript project would: it includes
|
||||
separate entry points for Node.js-like environments (which read the WASM file via
|
||||
[`fs.readFile()`](https://nodejs.org/api/fs.html#fsreadfilepath-options-callback)) and web-like environments (which
|
||||
download the WASM file with [`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch)). There are
|
||||
both CommonJS and ES Module entry points for each environment; an appropriate entrypoint should be selected
|
||||
automatically.
|
||||
|
||||
If your environment supports the experimental [ES Module Integration Proposal for WebAssembly](https://github.com/WebAssembly/esm-integration),
|
||||
you can instead use that, by setting the `matrix-org:wasm-esm` custom [export condition](https://nodejs.org/api/packages.html#conditional-exports).
|
||||
This is only supported when the library is imported as an ES Module. For example:
|
||||
|
||||
- In Webpack, set [`experiments.asyncWebAssembly`](https://webpack.js.org/configuration/experiments/#experiments)
|
||||
to `true` and [`resolve.conditionNames`](https://webpack.js.org/configuration/resolve/#resolveconditionnames)
|
||||
to `["matrix-org:wasm-esm", "..."]` (the `"..."` preserves default condition names).
|
||||
- In Node.js, invoke with commandline arguments [`--experimental-wasm-modules`](https://nodejs.org/api/esm.html#wasm-modules)
|
||||
[`--conditions=wasm-esm`](https://nodejs.org/api/cli.html#-c-condition---conditionscondition).
|
||||
|
||||
## Building matrix-sdk-crypto-wasm
|
||||
## Building
|
||||
|
||||
These WebAssembly bindings are written in [Rust]. To build them, you
|
||||
need to install the Rust compiler, see [the Install Rust
|
||||
Page](https://www.rust-lang.org/tools/install). Then, the workflow is
|
||||
pretty classical by using [pnpm](https://pnpm.io), see [the Downloading and installing
|
||||
pretty classical by using [yarn](https://yarnpkg.com/), see [the Downloading and installing
|
||||
Node.js and npm
|
||||
Page](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) and [installing pnpm](https://pnpm.io/installation).
|
||||
Page](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) and [installing yarn](https://classic.yarnpkg.com/lang/en/docs/install).
|
||||
|
||||
Once the Rust compiler, Node.js and pnpm are installed, you can run the
|
||||
Once the Rust compiler, Node.js and yarn are installed, you can run the
|
||||
following commands:
|
||||
|
||||
```sh
|
||||
$ pnpm install
|
||||
$ pnpm build # or 'pnpm build:dev' to make an unoptimised build
|
||||
$ pnpm test
|
||||
$ yarn install
|
||||
$ yarn build # or 'yarn build:dev' to make an unoptimised build
|
||||
$ yarn test
|
||||
```
|
||||
|
||||
The compiled output should be generated in the `pkg/` directory.
|
||||
|
||||
## Local development with matrix-rust-sdk
|
||||
|
||||
To build based on a local `matrix-rust-sdk`, add something like this to your
|
||||
`.cargo/config` file:
|
||||
|
||||
```
|
||||
[patch.'https://github.com/matrix-org/matrix-rust-sdk']
|
||||
matrix-sdk-base = { path = "../matrix-rust-sdk/crates/matrix-sdk-base" }
|
||||
matrix-sdk-common = { path = "../matrix-rust-sdk/crates/matrix-sdk-common" }
|
||||
matrix-sdk-crypto = { path = "../matrix-rust-sdk/crates/matrix-sdk-crypto" }
|
||||
matrix-sdk-indexeddb = { path = "../matrix-rust-sdk/crates/matrix-sdk-indexeddb" }
|
||||
matrix-sdk-qrcode = { path = "../matrix-rust-sdk/crates/matrix-sdk-qrcode" }
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
[The documentation can be found
|
||||
online](https://matrix-org.github.io/matrix-sdk-crypto-wasm/).
|
||||
online](https://matrix-org.github.io/matrix-rust-sdk-crypto-wasm/).
|
||||
|
||||
To generate the documentation locally, please run the following
|
||||
command:
|
||||
|
||||
```sh
|
||||
$ pnpm doc
|
||||
$ yarn doc
|
||||
```
|
||||
|
||||
The documentation is generated in the `./docs` directory.
|
||||
@@ -128,7 +92,3 @@ The documentation is generated in the `./docs` directory.
|
||||
[Matrix]: https://matrix.org/
|
||||
[Rust]: https://www.rust-lang.org/
|
||||
[npm]: https://www.npmjs.com/
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you! See the [contributing](CONTRIBUTING.md) doc for more info.
|
||||
|
||||
77
node_modules/@matrix-org/matrix-sdk-crypto-wasm/index-wasm-esm.mjs
generated
vendored
77
node_modules/@matrix-org/matrix-sdk-crypto-wasm/index-wasm-esm.mjs
generated
vendored
@@ -1,77 +0,0 @@
|
||||
// Copyright 2024 The Matrix.org Foundation C.I.C.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// @ts-check
|
||||
|
||||
/**
|
||||
* This is the entry point for ESM environments which support the ES Module Integration Proposal for WebAssembly [1].
|
||||
*
|
||||
* [1]: https://github.com/webassembly/esm-integration
|
||||
*/
|
||||
|
||||
import * as bindings from "./pkg/matrix_sdk_crypto_wasm_bg.js";
|
||||
|
||||
// Although we could simply instantiate the WASM at import time with a top-level `await`,
|
||||
// we avoid that, to make it easier for callers to delay loading the WASM (and instead
|
||||
// wait until `initAsync` is called). (Also, Safari 14 doesn't support top-level `await`.)
|
||||
//
|
||||
// However, having done so, there is no way to synchronously load the WASM if the user ends
|
||||
// up using the bindings before calling `initAsync` (unlike under Node.js), so we just throw
|
||||
// an error.
|
||||
bindings.__wbg_set_wasm(
|
||||
new Proxy(
|
||||
{},
|
||||
{
|
||||
get() {
|
||||
throw new Error(
|
||||
"@matrix-org/matrix-sdk-crypto-wasm was used before it was initialized. Call `initAsync` first.",
|
||||
);
|
||||
},
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Stores a promise of the `loadModuleAsync` call
|
||||
* @type {Promise<void> | null}
|
||||
*/
|
||||
let modPromise = null;
|
||||
|
||||
/**
|
||||
* Loads and instantiates the WASM module asynchronously
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function loadModuleAsync() {
|
||||
/** @type {typeof import("./pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts")} */
|
||||
// @ts-expect-error TSC can't find the definitions file, for some reason.
|
||||
const wasm = await import("./pkg/matrix_sdk_crypto_wasm_bg.wasm");
|
||||
bindings.__wbg_set_wasm(wasm);
|
||||
wasm.__wbindgen_start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the WebAssembly module in the background, if it has not already been loaded.
|
||||
*
|
||||
* Returns a promise which will resolve once the other methods are ready.
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export async function initAsync() {
|
||||
if (!modPromise) modPromise = loadModuleAsync();
|
||||
await modPromise;
|
||||
}
|
||||
|
||||
// Re-export everything from the generated javascript wrappers
|
||||
export * from "./pkg/matrix_sdk_crypto_wasm_bg.js";
|
||||
81
node_modules/@matrix-org/matrix-sdk-crypto-wasm/index.cjs
generated
vendored
81
node_modules/@matrix-org/matrix-sdk-crypto-wasm/index.cjs
generated
vendored
@@ -1,81 +0,0 @@
|
||||
// Copyright 2024 The Matrix.org Foundation C.I.C.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// @ts-check
|
||||
|
||||
/**
|
||||
* This is the entrypoint on non-node CommonJS environments.
|
||||
* `asyncLoad` will load the WASM module using a `fetch` call.
|
||||
*/
|
||||
|
||||
const bindings = require("./pkg/matrix_sdk_crypto_wasm_bg.cjs");
|
||||
|
||||
const defaultURL = require.resolve("./pkg/matrix_sdk_crypto_wasm_bg.wasm");
|
||||
|
||||
// We want to throw an error if the user tries to use the bindings before
|
||||
// calling `initAsync`.
|
||||
bindings.__wbg_set_wasm(
|
||||
new Proxy(
|
||||
{},
|
||||
{
|
||||
get() {
|
||||
throw new Error(
|
||||
"@matrix-org/matrix-sdk-crypto-wasm was used before it was initialized. Call `initAsync` first.",
|
||||
);
|
||||
},
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Stores a promise of the `loadModule` call
|
||||
* @type {Promise<void> | null}
|
||||
*/
|
||||
let modPromise = null;
|
||||
|
||||
/**
|
||||
* Loads and instantiates the WASM module asynchronously
|
||||
*
|
||||
* @param {URL | string} url - The URL to fetch the WebAssembly module from
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function loadModuleAsync(url) {
|
||||
const { instance } = await WebAssembly.instantiateStreaming(fetch(url), {
|
||||
// @ts-expect-error: The bindings don't exactly match the 'ExportValue' type
|
||||
"./matrix_sdk_crypto_wasm_bg.js": bindings,
|
||||
});
|
||||
|
||||
bindings.__wbg_set_wasm(instance.exports);
|
||||
// @ts-expect-error: Typescript doesn't know what the module exports are
|
||||
instance.exports.__wbindgen_start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the WebAssembly module in the background, if it has not already been loaded.
|
||||
*
|
||||
* Returns a promise which will resolve once the other methods are ready.
|
||||
*
|
||||
* @param {URL | string} [url] - The URL to fetch the WebAssembly module from. If not provided, a default URL will be used.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function initAsync(url = defaultURL) {
|
||||
if (!modPromise) modPromise = loadModuleAsync(url);
|
||||
await modPromise;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
// Re-export everything from the generated javascript wrappers
|
||||
...bindings,
|
||||
initAsync,
|
||||
};
|
||||
49
node_modules/@matrix-org/matrix-sdk-crypto-wasm/index.d.ts
generated
vendored
49
node_modules/@matrix-org/matrix-sdk-crypto-wasm/index.d.ts
generated
vendored
@@ -1,49 +0,0 @@
|
||||
// Copyright 2024 The Matrix.org Foundation C.I.C.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*
|
||||
* Re-export all the type definitions that wasm-bindgen generated for us.
|
||||
*
|
||||
* We do this by referring to a non-existent "matrix_sdk_crypto_wasm.js" file. This works because TSC will automatically
|
||||
* transform this into the correct name "matrix_sdk_crypto_wasm.d.ts" [1].
|
||||
*
|
||||
* Other alternatives don't work:
|
||||
*
|
||||
* - `export * from "./pkg/matrix_sdk_crypto_wasm.d.ts"`: You're not allowed to `import from "<foo>.d.ts"`
|
||||
* without `import type`, because normally, that would mean you don't get the runtime definitions that are in
|
||||
* "<foo>.js". This lint rule even applies to ".d.ts" files, which is arguably overzealous, but there you have it.
|
||||
*
|
||||
* - `export type * from "./pkg/matrix_sdk_crypto_wasm.d.ts"`: Doing this means you can't call the constructors on any
|
||||
* of the exported types: `new RoomId(...)` gives a build error.
|
||||
*
|
||||
* - `export * from "./pkg/matrix_sdk_crypto_wasm"`: This works in *some* environments, but in others, typescript
|
||||
* complains [2]. We could maybe get around this by mandating a `moduleResolution` setting of `bundler` or so, but
|
||||
* that is restrictive on our downstreams.
|
||||
*
|
||||
* A final alternative would be just to cat `matrix_sdk_crypto_wasm.d.ts` in here as part of the build script, but
|
||||
* for now at least we're trying to avoid too much file manipulation.
|
||||
*
|
||||
* [1]: https://www.typescriptlang.org/docs/handbook/modules/reference.html#file-extension-substitution
|
||||
* [2]: https://www.typescriptlang.org/docs/handbook/modules/reference.html#extensionless-relative-paths
|
||||
*/
|
||||
export * from "./pkg/matrix_sdk_crypto_wasm.js";
|
||||
|
||||
/**
|
||||
* Load the WebAssembly module in the background, if it has not already been loaded.
|
||||
*
|
||||
* Returns a promise which will resolve once the other methods are ready.
|
||||
* @param {URL | string} [url] - The URL to fetch the WebAssembly module from. If not provided, a default URL will be used.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export declare function initAsync(url?: URL | string): Promise<void>;
|
||||
83
node_modules/@matrix-org/matrix-sdk-crypto-wasm/index.mjs
generated
vendored
83
node_modules/@matrix-org/matrix-sdk-crypto-wasm/index.mjs
generated
vendored
@@ -1,83 +0,0 @@
|
||||
// Copyright 2024 The Matrix.org Foundation C.I.C.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// @ts-check
|
||||
|
||||
/**
|
||||
* This is the entrypoint on non-node ESM environments.
|
||||
* `asyncLoad` will load the WASM module using a `fetch` call.
|
||||
*/
|
||||
|
||||
import * as bindings from "./pkg/matrix_sdk_crypto_wasm_bg.js";
|
||||
|
||||
const defaultURL = new URL("./pkg/matrix_sdk_crypto_wasm_bg.wasm", import.meta.url);
|
||||
|
||||
// Although we could simply instantiate the WASM at import time with a top-level `await`,
|
||||
// we avoid that, to make it easier for callers to delay loading the WASM (and instead
|
||||
// wait until `initAsync` is called). (Also, Safari 14 doesn't support top-level `await`.)
|
||||
//
|
||||
// However, having done so, there is no way to synchronously load the WASM if the user ends
|
||||
// up using the bindings before calling `initAsync` (unlike under Node.js), so we just throw
|
||||
// an error.
|
||||
bindings.__wbg_set_wasm(
|
||||
new Proxy(
|
||||
{},
|
||||
{
|
||||
get() {
|
||||
throw new Error(
|
||||
"@matrix-org/matrix-sdk-crypto-wasm was used before it was initialized. Call `initAsync` first.",
|
||||
);
|
||||
},
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Stores a promise of the `loadModuleAsync` call
|
||||
* @type {Promise<void> | null}
|
||||
*/
|
||||
let modPromise = null;
|
||||
|
||||
/**
|
||||
* Loads and instantiates the WASM module asynchronously
|
||||
*
|
||||
* @param {URL | string} url - The URL to fetch the WebAssembly module from
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function loadModuleAsync(url) {
|
||||
const { instance } = await WebAssembly.instantiateStreaming(fetch(url), {
|
||||
// @ts-expect-error: The bindings don't exactly match the 'ExportValue' type
|
||||
"./matrix_sdk_crypto_wasm_bg.js": bindings,
|
||||
});
|
||||
|
||||
bindings.__wbg_set_wasm(instance.exports);
|
||||
// @ts-expect-error: Typescript doesn't know what the module exports are
|
||||
instance.exports.__wbindgen_start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the WebAssembly module in the background, if it has not already been loaded.
|
||||
*
|
||||
* Returns a promise which will resolve once the other methods are ready.
|
||||
*
|
||||
* @param {URL | string} [url] - The URL to fetch the WebAssembly module from. If not provided, a default URL will be used.
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export async function initAsync(url = defaultURL) {
|
||||
if (!modPromise) modPromise = loadModuleAsync(url);
|
||||
await modPromise;
|
||||
}
|
||||
|
||||
// Re-export everything from the generated javascript wrappers
|
||||
export * from "./pkg/matrix_sdk_crypto_wasm_bg.js";
|
||||
128
node_modules/@matrix-org/matrix-sdk-crypto-wasm/node.cjs
generated
vendored
128
node_modules/@matrix-org/matrix-sdk-crypto-wasm/node.cjs
generated
vendored
@@ -1,128 +0,0 @@
|
||||
// Copyright 2024 The Matrix.org Foundation C.I.C.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// @ts-check
|
||||
|
||||
/**
|
||||
* This is the entrypoint on node-compatible CommonJS environments.
|
||||
* `asyncLoad` will use `fs.readFile` to load the WASM module.
|
||||
*/
|
||||
|
||||
const { readFileSync } = require("node:fs");
|
||||
const { readFile } = require("node:fs/promises");
|
||||
const path = require("node:path");
|
||||
const bindings = require("./pkg/matrix_sdk_crypto_wasm_bg.cjs");
|
||||
|
||||
const filename = path.join(__dirname, "pkg/matrix_sdk_crypto_wasm_bg.wasm");
|
||||
|
||||
// In node environments, we want to automatically load the WASM module
|
||||
// synchronously if the consumer did not call `initAsync`. To do so, we install
|
||||
// a `Proxy` that will intercept calls to the WASM module.
|
||||
bindings.__wbg_set_wasm(
|
||||
new Proxy(
|
||||
{},
|
||||
{
|
||||
get(_target, prop) {
|
||||
const instance = loadModuleSync();
|
||||
// @ts-expect-error: This results in an `any` type, which is fine
|
||||
return instance[prop];
|
||||
},
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Stores a promise which resolves to the WebAssembly module
|
||||
* @type {Promise<WebAssembly.Module> | null}
|
||||
*/
|
||||
let modPromise = null;
|
||||
|
||||
/**
|
||||
* Tracks whether the module has been instantiated or not
|
||||
* @type {boolean}
|
||||
*/
|
||||
let initialised = false;
|
||||
|
||||
/**
|
||||
* Loads and instantiates the WASM module synchronously
|
||||
*
|
||||
* It will throw if there is an attempt to load the module asynchronously running
|
||||
*
|
||||
* @returns {typeof import("./pkg/matrix_sdk_crypto_wasm_bg.wasm.d", { with: { "resolution-mode": "require" } })}
|
||||
*/
|
||||
function loadModuleSync() {
|
||||
if (modPromise) throw new Error("The WASM module is being loaded asynchronously but hasn't finished");
|
||||
const bytes = readFileSync(filename);
|
||||
const mod = new WebAssembly.Module(bytes);
|
||||
|
||||
const instance = new WebAssembly.Instance(mod, {
|
||||
// @ts-expect-error: The bindings don't exactly match the 'ExportValue' type
|
||||
"./matrix_sdk_crypto_wasm_bg.js": bindings,
|
||||
});
|
||||
|
||||
initInstance(instance);
|
||||
|
||||
// @ts-expect-error: Typescript doesn't know what the instance exports exactly
|
||||
return instance.exports;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads and instantiates the WASM module asynchronously
|
||||
*
|
||||
* @returns {Promise<typeof import("./pkg/matrix_sdk_crypto_wasm_bg.wasm.d", { with: { "resolution-mode": "require" } })>}
|
||||
*/
|
||||
async function loadModuleAsync() {
|
||||
const bytes = await readFile(filename);
|
||||
const { instance } = await WebAssembly.instantiate(bytes, {
|
||||
// @ts-expect-error: The bindings don't exactly match the 'ExportValue' type
|
||||
"./matrix_sdk_crypto_wasm_bg.js": bindings,
|
||||
});
|
||||
|
||||
initInstance(instance);
|
||||
|
||||
// @ts-expect-error: Typescript doesn't know what the instance exports exactly
|
||||
return instance.exports;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the WASM module and returns the exports from the WASM module.
|
||||
*
|
||||
* @param {WebAssembly.Instance} instance
|
||||
*/
|
||||
function initInstance(instance) {
|
||||
if (initialised) throw new Error("initInstance called twice");
|
||||
bindings.__wbg_set_wasm(instance.exports);
|
||||
// @ts-expect-error: Typescript doesn't know what the instance exports exactly
|
||||
instance.exports.__wbindgen_start();
|
||||
initialised = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the WebAssembly module in the background, if it has not already been loaded.
|
||||
*
|
||||
* Returns a promise which will resolve once the other methods are ready.
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function initAsync() {
|
||||
if (initialised) return;
|
||||
if (!modPromise) modPromise = loadModuleAsync();
|
||||
await modPromise;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
// Re-export everything from the generated javascript wrappers
|
||||
...bindings,
|
||||
initAsync,
|
||||
};
|
||||
125
node_modules/@matrix-org/matrix-sdk-crypto-wasm/node.mjs
generated
vendored
125
node_modules/@matrix-org/matrix-sdk-crypto-wasm/node.mjs
generated
vendored
@@ -1,125 +0,0 @@
|
||||
// Copyright 2024 The Matrix.org Foundation C.I.C.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// @ts-check
|
||||
|
||||
/**
|
||||
* This is the entrypoint on node-compatible ESM environments.
|
||||
* `asyncLoad` will use `fs.readFile` to load the WASM module.
|
||||
*/
|
||||
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import * as bindings from "./pkg/matrix_sdk_crypto_wasm_bg.js";
|
||||
|
||||
const filename = fileURLToPath(new URL("./pkg/matrix_sdk_crypto_wasm_bg.wasm", import.meta.url));
|
||||
|
||||
// In node environments, we want to automatically load the WASM module
|
||||
// synchronously if the consumer did not call `initAsync`. To do so, we install
|
||||
// a `Proxy` that will intercept calls to the WASM module.
|
||||
bindings.__wbg_set_wasm(
|
||||
new Proxy(
|
||||
{},
|
||||
{
|
||||
get(_target, prop) {
|
||||
const instance = loadModuleSync();
|
||||
// @ts-expect-error: This results in an `any` type, which is fine
|
||||
return instance[prop];
|
||||
},
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Stores a promise which resolves to the WebAssembly module
|
||||
* @type {Promise<WebAssembly.Module> | null}
|
||||
*/
|
||||
let modPromise = null;
|
||||
|
||||
/**
|
||||
* Tracks whether the module has been instantiated or not
|
||||
* @type {boolean}
|
||||
*/
|
||||
let initialised = false;
|
||||
|
||||
/**
|
||||
* Loads and instantiates the WASM module synchronously
|
||||
*
|
||||
* It will throw if there is an attempt to load the module asynchronously running
|
||||
*
|
||||
* @returns {typeof import("./pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts")}
|
||||
*/
|
||||
function loadModuleSync() {
|
||||
if (modPromise) throw new Error("The WASM module is being loaded asynchronously but hasn't finished");
|
||||
const bytes = readFileSync(filename);
|
||||
const mod = new WebAssembly.Module(bytes);
|
||||
|
||||
const instance = new WebAssembly.Instance(mod, {
|
||||
// @ts-expect-error: The bindings don't exactly match the 'ExportValue' type
|
||||
"./matrix_sdk_crypto_wasm_bg.js": bindings,
|
||||
});
|
||||
|
||||
initInstance(instance);
|
||||
|
||||
// @ts-expect-error: Typescript doesn't know what the module exports are
|
||||
return instance.exports;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads and instantiates the WASM module asynchronously
|
||||
*
|
||||
* @returns {Promise<typeof import("./pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts")>}
|
||||
*/
|
||||
async function loadModuleAsync() {
|
||||
const bytes = await readFile(filename);
|
||||
const { instance } = await WebAssembly.instantiate(bytes, {
|
||||
// @ts-expect-error: The bindings don't exactly match the 'ExportValue' type
|
||||
"./matrix_sdk_crypto_wasm_bg.js": bindings,
|
||||
});
|
||||
|
||||
initInstance(instance);
|
||||
|
||||
// @ts-expect-error: Typescript doesn't know what the module exports are
|
||||
return instance.exports;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the WASM module and returns the exports from the WASM module.
|
||||
*
|
||||
* @param {WebAssembly.Instance} instance
|
||||
*/
|
||||
function initInstance(instance) {
|
||||
if (initialised) throw new Error("initInstance called twice");
|
||||
bindings.__wbg_set_wasm(instance.exports);
|
||||
// @ts-expect-error: Typescript doesn't know what the module exports are
|
||||
instance.exports.__wbindgen_start();
|
||||
initialised = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the WebAssembly module in the background, if it has not already been loaded.
|
||||
*
|
||||
* Returns a promise which will resolve once the other methods are ready.
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export async function initAsync() {
|
||||
if (initialised) return;
|
||||
if (!modPromise) modPromise = loadModuleAsync();
|
||||
await modPromise;
|
||||
}
|
||||
|
||||
// Re-export everything from the generated javascript wrappers
|
||||
export * from "./pkg/matrix_sdk_crypto_wasm_bg.js";
|
||||
76
node_modules/@matrix-org/matrix-sdk-crypto-wasm/package.json
generated
vendored
76
node_modules/@matrix-org/matrix-sdk-crypto-wasm/package.json
generated
vendored
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@matrix-org/matrix-sdk-crypto-wasm",
|
||||
"version": "18.8.0",
|
||||
"homepage": "https://github.com/matrix-org/matrix-sdk-crypto-wasm",
|
||||
"version": "1.3.0",
|
||||
"homepage": "https://github.com/matrix-org/matrix-rust-sdk-wasm",
|
||||
"description": "WebAssembly bindings of the matrix-sdk-crypto encryption library",
|
||||
"license": "Apache-2.0",
|
||||
"collaborators": [
|
||||
@@ -9,7 +9,7 @@
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/matrix-org/matrix-sdk-crypto-wasm"
|
||||
"url": "https://github.com/matrix-org/matrix-rust-sdk-wasm"
|
||||
},
|
||||
"keywords": [
|
||||
"matrix",
|
||||
@@ -18,71 +18,33 @@
|
||||
"ruma",
|
||||
"nio"
|
||||
],
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"matrix-org:wasm-esm": {
|
||||
"types": "./index.d.ts",
|
||||
"default": "./index-wasm-esm.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./index.d.ts",
|
||||
"node": "./node.cjs",
|
||||
"default": "./index.cjs"
|
||||
},
|
||||
"import": {
|
||||
"types": "./index.d.ts",
|
||||
"node": "./node.mjs",
|
||||
"default": "./index.mjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"main": "pkg/matrix_sdk_crypto_wasm.js",
|
||||
"types": "pkg/matrix_sdk_crypto_wasm.d.ts",
|
||||
"files": [
|
||||
"index.mjs",
|
||||
"index.cjs",
|
||||
"index-wasm-esm.mjs",
|
||||
"index.d.ts",
|
||||
"node.mjs",
|
||||
"node.cjs",
|
||||
"pkg/matrix_sdk_crypto_wasm.d.ts",
|
||||
"pkg/matrix_sdk_crypto_wasm_bg.js",
|
||||
"pkg/matrix_sdk_crypto_wasm_bg.cjs",
|
||||
"pkg/matrix_sdk_crypto_wasm_bg.wasm.js",
|
||||
"pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts",
|
||||
"pkg/matrix_sdk_crypto_wasm_bg.wasm"
|
||||
"pkg/matrix_sdk_crypto_wasm.js",
|
||||
"pkg/matrix_sdk_crypto_wasm.d.ts"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.28.6",
|
||||
"@babel/core": "^7.29.0",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.28.6",
|
||||
"@babel/preset-env": "^7.29.0",
|
||||
"@babel/preset-typescript": "^7.28.5",
|
||||
"@tsconfig/node18": "^18.2.6",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^18.19.130",
|
||||
"babel-jest": "^29.7.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.57.1",
|
||||
"fake-indexeddb": "^4.0.2",
|
||||
"jest": "^28.1.3",
|
||||
"prettier": "^2.8.8",
|
||||
"typedoc": "^0.27.9",
|
||||
"typescript": "5.7.2",
|
||||
"wasm-pack": "~0.13.1",
|
||||
"fake-indexeddb": "^4.0",
|
||||
"jest": "^28.1.0",
|
||||
"prettier": "^2.8.3",
|
||||
"typedoc": "^0.22.17",
|
||||
"typescript": "4.7",
|
||||
"wasm-pack": "^0.10.2",
|
||||
"yargs-parser": "~21.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
"node": ">= 10"
|
||||
},
|
||||
"packageManager": "pnpm@10.30.3+sha512.c961d1e0a2d8e354ecaa5166b822516668b7f44cb5bd95122d590dd81922f606f5473b6d23ec4a5be05e7fcd18e8488d47d978bbe981872f1145d06e9a740017",
|
||||
"scripts": {
|
||||
"lint": "pnpm lint:eslint && pnpm lint:prettier && pnpm lint:types",
|
||||
"lint:eslint": "eslint --max-warnings 0 tests",
|
||||
"lint:prettier": "prettier --check .",
|
||||
"lint:types": "tsc --noEmit",
|
||||
"lint": "prettier --check .",
|
||||
"build": "WASM_PACK_ARGS=--release ./scripts/build.sh",
|
||||
"build:dev": "WASM_PACK_ARGS=--dev ./scripts/build.sh",
|
||||
"test": "jest --verbose && pnpm wasm-pack test --node",
|
||||
"doc": "typedoc --treatWarningsAsErrors --tsconfig .",
|
||||
"prepack": "pnpm build && pnpm run test"
|
||||
"test": "jest --verbose",
|
||||
"doc": "typedoc --tsconfig .",
|
||||
"prepack": "npm run build && npm run test"
|
||||
}
|
||||
}
|
||||
|
||||
8195
node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm.d.ts
generated
vendored
8195
node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
12809
node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs
generated
vendored
12809
node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs
generated
vendored
File diff suppressed because it is too large
Load Diff
12182
node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js
generated
vendored
12182
node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js
generated
vendored
File diff suppressed because it is too large
Load Diff
BIN
node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm
generated
vendored
BIN
node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm
generated
vendored
Binary file not shown.
1098
node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts
generated
vendored
1098
node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
3
node_modules/base-x/README.md
generated
vendored
3
node_modules/base-x/README.md
generated
vendored
@@ -16,8 +16,7 @@ Base58
|
||||
|
||||
``` javascript
|
||||
var BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
|
||||
import basex from 'base-x'
|
||||
var bs58 = basex(BASE58)
|
||||
var bs58 = require('base-x')(BASE58)
|
||||
|
||||
var decoded = bs58.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr')
|
||||
|
||||
|
||||
28
node_modules/base-x/package.json
generated
vendored
28
node_modules/base-x/package.json
generated
vendored
@@ -1,8 +1,7 @@
|
||||
{
|
||||
"name": "base-x",
|
||||
"version": "5.0.1",
|
||||
"version": "4.0.1",
|
||||
"description": "Fast base encoding / decoding of any given alphabet",
|
||||
"type": "module",
|
||||
"keywords": [
|
||||
"base-x",
|
||||
"base58",
|
||||
@@ -24,35 +23,24 @@
|
||||
"files": [
|
||||
"src"
|
||||
],
|
||||
"main": "src/cjs/index.cjs",
|
||||
"module": "src/esm/index.js",
|
||||
"types": "src/cjs/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": "./src/cjs/index.cjs",
|
||||
"import": "./src/esm/index.js",
|
||||
"types": "./src/cjs/index.d.ts"
|
||||
}
|
||||
},
|
||||
"main": "src/index.js",
|
||||
"types": "src/index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cryptocoinjs/base-x.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json; npm run standard -- --fix",
|
||||
"clean": "rimraf src",
|
||||
"postbuild": "find src/cjs -type f -name \"*.js\" -exec bash -c 'mv \"$0\" \"${0%.js}.cjs\"' {} \\;",
|
||||
"build": "tsc -p ./tsconfig.json ; standard --fix",
|
||||
"gitdiff": "npm run build && git diff --exit-code",
|
||||
"prepublish": "npm run gitdiff",
|
||||
"standard": "standard --ignore test",
|
||||
"standard": "standard",
|
||||
"test": "npm run unit && npm run standard",
|
||||
"unit": "tape test/*.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "12.0.10",
|
||||
"rimraf": "^3.0.2",
|
||||
"standard": "^17.1.0",
|
||||
"tape": "^5.3.0",
|
||||
"typescript": "^5.4.5"
|
||||
"standard": "^10.0.3",
|
||||
"tape": "^4.5.1",
|
||||
"typescript": "3.5.2"
|
||||
}
|
||||
}
|
||||
|
||||
126
node_modules/base-x/src/cjs/index.cjs
generated
vendored
126
node_modules/base-x/src/cjs/index.cjs
generated
vendored
@@ -1,126 +0,0 @@
|
||||
'use strict'
|
||||
// base-x encoding / decoding
|
||||
// Copyright (c) 2018 base-x contributors
|
||||
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||
Object.defineProperty(exports, '__esModule', { value: true })
|
||||
function base (ALPHABET) {
|
||||
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
||||
const BASE_MAP = new Uint8Array(256)
|
||||
for (let j = 0; j < BASE_MAP.length; j++) {
|
||||
BASE_MAP[j] = 255
|
||||
}
|
||||
for (let i = 0; i < ALPHABET.length; i++) {
|
||||
const x = ALPHABET.charAt(i)
|
||||
const xc = x.charCodeAt(0)
|
||||
if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
|
||||
BASE_MAP[xc] = i
|
||||
}
|
||||
const BASE = ALPHABET.length
|
||||
const LEADER = ALPHABET.charAt(0)
|
||||
const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up
|
||||
const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up
|
||||
function encode (source) {
|
||||
// eslint-disable-next-line no-empty
|
||||
if (source instanceof Uint8Array) { } else if (ArrayBuffer.isView(source)) {
|
||||
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)
|
||||
} else if (Array.isArray(source)) {
|
||||
source = Uint8Array.from(source)
|
||||
}
|
||||
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
|
||||
if (source.length === 0) { return '' }
|
||||
// Skip & count leading zeroes.
|
||||
let zeroes = 0
|
||||
let length = 0
|
||||
let pbegin = 0
|
||||
const pend = source.length
|
||||
while (pbegin !== pend && source[pbegin] === 0) {
|
||||
pbegin++
|
||||
zeroes++
|
||||
}
|
||||
// Allocate enough space in big-endian base58 representation.
|
||||
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0
|
||||
const b58 = new Uint8Array(size)
|
||||
// Process the bytes.
|
||||
while (pbegin !== pend) {
|
||||
let carry = source[pbegin]
|
||||
// Apply "b58 = b58 * 256 + ch".
|
||||
let i = 0
|
||||
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
||||
carry += (256 * b58[it1]) >>> 0
|
||||
b58[it1] = (carry % BASE) >>> 0
|
||||
carry = (carry / BASE) >>> 0
|
||||
}
|
||||
if (carry !== 0) { throw new Error('Non-zero carry') }
|
||||
length = i
|
||||
pbegin++
|
||||
}
|
||||
// Skip leading zeroes in base58 result.
|
||||
let it2 = size - length
|
||||
while (it2 !== size && b58[it2] === 0) {
|
||||
it2++
|
||||
}
|
||||
// Translate the result into a string.
|
||||
let str = LEADER.repeat(zeroes)
|
||||
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }
|
||||
return str
|
||||
}
|
||||
function decodeUnsafe (source) {
|
||||
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
||||
if (source.length === 0) { return new Uint8Array() }
|
||||
let psz = 0
|
||||
// Skip and count leading '1's.
|
||||
let zeroes = 0
|
||||
let length = 0
|
||||
while (source[psz] === LEADER) {
|
||||
zeroes++
|
||||
psz++
|
||||
}
|
||||
// Allocate enough space in big-endian base256 representation.
|
||||
const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.
|
||||
const b256 = new Uint8Array(size)
|
||||
// Process the characters.
|
||||
while (psz < source.length) {
|
||||
// Find code of next character
|
||||
const charCode = source.charCodeAt(psz)
|
||||
// Base map can not be indexed using char code
|
||||
if (charCode > 255) { return }
|
||||
// Decode character
|
||||
let carry = BASE_MAP[charCode]
|
||||
// Invalid character
|
||||
if (carry === 255) { return }
|
||||
let i = 0
|
||||
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
||||
carry += (BASE * b256[it3]) >>> 0
|
||||
b256[it3] = (carry % 256) >>> 0
|
||||
carry = (carry / 256) >>> 0
|
||||
}
|
||||
if (carry !== 0) { throw new Error('Non-zero carry') }
|
||||
length = i
|
||||
psz++
|
||||
}
|
||||
// Skip leading zeroes in b256.
|
||||
let it4 = size - length
|
||||
while (it4 !== size && b256[it4] === 0) {
|
||||
it4++
|
||||
}
|
||||
const vch = new Uint8Array(zeroes + (size - it4))
|
||||
let j = zeroes
|
||||
while (it4 !== size) {
|
||||
vch[j++] = b256[it4++]
|
||||
}
|
||||
return vch
|
||||
}
|
||||
function decode (string) {
|
||||
const buffer = decodeUnsafe(string)
|
||||
if (buffer) { return buffer }
|
||||
throw new Error('Non-base' + BASE + ' character')
|
||||
}
|
||||
return {
|
||||
encode,
|
||||
decodeUnsafe,
|
||||
decode
|
||||
}
|
||||
}
|
||||
exports.default = base
|
||||
9
node_modules/base-x/src/cjs/index.d.ts
generated
vendored
9
node_modules/base-x/src/cjs/index.d.ts
generated
vendored
@@ -1,9 +0,0 @@
|
||||
declare function base(ALPHABET: string): base.BaseConverter;
|
||||
export default base;
|
||||
declare namespace base {
|
||||
interface BaseConverter {
|
||||
encode(buffer: Uint8Array | number[]): string;
|
||||
decodeUnsafe(string: string): Uint8Array | undefined;
|
||||
decode(string: string): Uint8Array;
|
||||
}
|
||||
}
|
||||
124
node_modules/base-x/src/esm/index.js
generated
vendored
124
node_modules/base-x/src/esm/index.js
generated
vendored
@@ -1,124 +0,0 @@
|
||||
// base-x encoding / decoding
|
||||
// Copyright (c) 2018 base-x contributors
|
||||
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||
function base (ALPHABET) {
|
||||
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
||||
const BASE_MAP = new Uint8Array(256)
|
||||
for (let j = 0; j < BASE_MAP.length; j++) {
|
||||
BASE_MAP[j] = 255
|
||||
}
|
||||
for (let i = 0; i < ALPHABET.length; i++) {
|
||||
const x = ALPHABET.charAt(i)
|
||||
const xc = x.charCodeAt(0)
|
||||
if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
|
||||
BASE_MAP[xc] = i
|
||||
}
|
||||
const BASE = ALPHABET.length
|
||||
const LEADER = ALPHABET.charAt(0)
|
||||
const FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up
|
||||
const iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up
|
||||
function encode (source) {
|
||||
// eslint-disable-next-line no-empty
|
||||
if (source instanceof Uint8Array) { } else if (ArrayBuffer.isView(source)) {
|
||||
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength)
|
||||
} else if (Array.isArray(source)) {
|
||||
source = Uint8Array.from(source)
|
||||
}
|
||||
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
|
||||
if (source.length === 0) { return '' }
|
||||
// Skip & count leading zeroes.
|
||||
let zeroes = 0
|
||||
let length = 0
|
||||
let pbegin = 0
|
||||
const pend = source.length
|
||||
while (pbegin !== pend && source[pbegin] === 0) {
|
||||
pbegin++
|
||||
zeroes++
|
||||
}
|
||||
// Allocate enough space in big-endian base58 representation.
|
||||
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0
|
||||
const b58 = new Uint8Array(size)
|
||||
// Process the bytes.
|
||||
while (pbegin !== pend) {
|
||||
let carry = source[pbegin]
|
||||
// Apply "b58 = b58 * 256 + ch".
|
||||
let i = 0
|
||||
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
||||
carry += (256 * b58[it1]) >>> 0
|
||||
b58[it1] = (carry % BASE) >>> 0
|
||||
carry = (carry / BASE) >>> 0
|
||||
}
|
||||
if (carry !== 0) { throw new Error('Non-zero carry') }
|
||||
length = i
|
||||
pbegin++
|
||||
}
|
||||
// Skip leading zeroes in base58 result.
|
||||
let it2 = size - length
|
||||
while (it2 !== size && b58[it2] === 0) {
|
||||
it2++
|
||||
}
|
||||
// Translate the result into a string.
|
||||
let str = LEADER.repeat(zeroes)
|
||||
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }
|
||||
return str
|
||||
}
|
||||
function decodeUnsafe (source) {
|
||||
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
||||
if (source.length === 0) { return new Uint8Array() }
|
||||
let psz = 0
|
||||
// Skip and count leading '1's.
|
||||
let zeroes = 0
|
||||
let length = 0
|
||||
while (source[psz] === LEADER) {
|
||||
zeroes++
|
||||
psz++
|
||||
}
|
||||
// Allocate enough space in big-endian base256 representation.
|
||||
const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.
|
||||
const b256 = new Uint8Array(size)
|
||||
// Process the characters.
|
||||
while (psz < source.length) {
|
||||
// Find code of next character
|
||||
const charCode = source.charCodeAt(psz)
|
||||
// Base map can not be indexed using char code
|
||||
if (charCode > 255) { return }
|
||||
// Decode character
|
||||
let carry = BASE_MAP[charCode]
|
||||
// Invalid character
|
||||
if (carry === 255) { return }
|
||||
let i = 0
|
||||
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
||||
carry += (BASE * b256[it3]) >>> 0
|
||||
b256[it3] = (carry % 256) >>> 0
|
||||
carry = (carry / 256) >>> 0
|
||||
}
|
||||
if (carry !== 0) { throw new Error('Non-zero carry') }
|
||||
length = i
|
||||
psz++
|
||||
}
|
||||
// Skip leading zeroes in b256.
|
||||
let it4 = size - length
|
||||
while (it4 !== size && b256[it4] === 0) {
|
||||
it4++
|
||||
}
|
||||
const vch = new Uint8Array(zeroes + (size - it4))
|
||||
let j = zeroes
|
||||
while (it4 !== size) {
|
||||
vch[j++] = b256[it4++]
|
||||
}
|
||||
return vch
|
||||
}
|
||||
function decode (string) {
|
||||
const buffer = decodeUnsafe(string)
|
||||
if (buffer) { return buffer }
|
||||
throw new Error('Non-base' + BASE + ' character')
|
||||
}
|
||||
return {
|
||||
encode,
|
||||
decodeUnsafe,
|
||||
decode
|
||||
}
|
||||
}
|
||||
export default base
|
||||
6
node_modules/bs58/README.md
generated
vendored
6
node_modules/bs58/README.md
generated
vendored
@@ -24,7 +24,7 @@ API
|
||||
**example**:
|
||||
|
||||
```js
|
||||
import bs58 from 'bs58'
|
||||
const bs58 = require('bs58')
|
||||
|
||||
const bytes = Uint8Array.from([
|
||||
0, 60, 23, 110, 101, 155, 234,
|
||||
@@ -45,7 +45,7 @@ console.log(address)
|
||||
**example**:
|
||||
|
||||
```js
|
||||
import bs58 from 'bs58'
|
||||
const bs58 = require('bs58')
|
||||
|
||||
const address = '16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS'
|
||||
const bytes = bs58.decode(address)
|
||||
@@ -65,7 +65,7 @@ npm install -g browserify
|
||||
then run:
|
||||
|
||||
```bash
|
||||
browserify node_modules/bs58/cjs/index.cjs -o bs58.bundle.js --standalone bs58
|
||||
browserify node_modules/bs58/index.js -o bs58.bundle.js --standalone bs58
|
||||
```
|
||||
|
||||
Hack / Test
|
||||
|
||||
33
node_modules/bs58/package.json
generated
vendored
33
node_modules/bs58/package.json
generated
vendored
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "bs58",
|
||||
"version": "6.0.0",
|
||||
"type": "module",
|
||||
"version": "5.0.0",
|
||||
"description": "Base 58 encoding / decoding",
|
||||
"keywords": [
|
||||
"base58",
|
||||
@@ -16,39 +15,25 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.8",
|
||||
"rimraf": "^5.0.7",
|
||||
"tape": "^5.3.0",
|
||||
"ts-standard": "^12.0.2",
|
||||
"typescript": "^5.5.2"
|
||||
"standard": "^16.0.4",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"repository": {
|
||||
"url": "https://github.com/cryptocoinjs/bs58",
|
||||
"type": "git"
|
||||
},
|
||||
"files": [
|
||||
"src"
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"main": "src/cjs/index.cjs",
|
||||
"module": "src/esm/index.js",
|
||||
"types": "src/cjs/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./src/esm/index.js",
|
||||
"require": "./src/cjs/index.cjs",
|
||||
"types": "./src/cjs/index.d.ts"
|
||||
}
|
||||
},
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"scripts": {
|
||||
"build": "npm run clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json",
|
||||
"clean": "rimraf src",
|
||||
"gitdiff": "npm run build && git diff --exit-code",
|
||||
"postbuild": "find src/cjs -type f -name \"*.js\" -exec bash -c 'mv \"$0\" \"${0%.js}.cjs\"' {} \\;",
|
||||
"standard": "ts-standard --ignore src --ignore test",
|
||||
"standard": "standard",
|
||||
"test": "npm run standard && npm run unit",
|
||||
"unit": "tape test/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"base-x": "^5.0.0"
|
||||
"base-x": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
8
node_modules/bs58/src/cjs/index.cjs
generated
vendored
8
node_modules/bs58/src/cjs/index.cjs
generated
vendored
@@ -1,8 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var base_x_1 = __importDefault(require("base-x"));
|
||||
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
||||
exports.default = (0, base_x_1.default)(ALPHABET);
|
||||
3
node_modules/bs58/src/cjs/index.d.ts
generated
vendored
3
node_modules/bs58/src/cjs/index.d.ts
generated
vendored
@@ -1,3 +0,0 @@
|
||||
import basex from 'base-x';
|
||||
declare const _default: basex.BaseConverter;
|
||||
export default _default;
|
||||
3
node_modules/bs58/src/esm/index.js
generated
vendored
3
node_modules/bs58/src/esm/index.js
generated
vendored
@@ -1,3 +0,0 @@
|
||||
import basex from 'base-x';
|
||||
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
||||
export default basex(ALPHABET);
|
||||
91
node_modules/content-type/README.md
generated
vendored
91
node_modules/content-type/README.md
generated
vendored
@@ -1,57 +1,81 @@
|
||||
# content-type
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![NPM downloads][downloads-image]][downloads-url]
|
||||
[![Build status][build-image]][build-url]
|
||||
[![Build coverage][coverage-image]][coverage-url]
|
||||
[![License][license-image]][license-url]
|
||||
[![NPM Version][npm-version-image]][npm-url]
|
||||
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||
[![Node.js Version][node-image]][node-url]
|
||||
[![Build Status][ci-image]][ci-url]
|
||||
[![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
Create and parse HTTP `Content-Type` header.
|
||||
Create and parse HTTP Content-Type header according to RFC 7231
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install content-type
|
||||
$ npm install content-type
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
const contentType = require("content-type");
|
||||
var contentType = require('content-type')
|
||||
```
|
||||
|
||||
### contentType.parse(string, options?)
|
||||
### contentType.parse(string)
|
||||
|
||||
```js
|
||||
const obj = contentType.parse("image/svg+xml; charset=utf-8");
|
||||
var obj = contentType.parse('image/svg+xml; charset=utf-8')
|
||||
```
|
||||
|
||||
Parse a `Content-Type` header. This will return an object with the following properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):
|
||||
Parse a `Content-Type` header. This will return an object with the following
|
||||
properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):
|
||||
|
||||
- `type`: The media type. Example: `'image/svg+xml'`.
|
||||
- `parameters`: An object of the parameters in the media type (parameter name is always lower case). Example: `{charset: 'utf-8'}`.
|
||||
- `type`: The media type (the type and subtype, always lower case).
|
||||
Example: `'image/svg+xml'`
|
||||
|
||||
The parser is lenient and does not error. You should validate `type` and `parameters` before trusting them.
|
||||
- `parameters`: An object of the parameters in the media type (name of parameter
|
||||
always lower case). Example: `{charset: 'utf-8'}`
|
||||
|
||||
#### Options
|
||||
Throws a `TypeError` if the string is missing or invalid.
|
||||
|
||||
- `parameters` (default: `true`): Set to `false` to skip parameters.
|
||||
- `comma` (default: `false`): Set to `true` to stop on a comma. This can be used to parse the media range in an `Accept` header.
|
||||
- `start` (default: `0`): Set index to start parsing from.
|
||||
### contentType.parse(req)
|
||||
|
||||
```js
|
||||
var obj = contentType.parse(req)
|
||||
```
|
||||
|
||||
Parse the `Content-Type` header from the given `req`. Short-cut for
|
||||
`contentType.parse(req.headers['content-type'])`.
|
||||
|
||||
Throws a `TypeError` if the `Content-Type` header is missing or invalid.
|
||||
|
||||
### contentType.parse(res)
|
||||
|
||||
```js
|
||||
var obj = contentType.parse(res)
|
||||
```
|
||||
|
||||
Parse the `Content-Type` header set on the given `res`. Short-cut for
|
||||
`contentType.parse(res.getHeader('content-type'))`.
|
||||
|
||||
Throws a `TypeError` if the `Content-Type` header is missing or invalid.
|
||||
|
||||
### contentType.format(obj)
|
||||
|
||||
```js
|
||||
const str = contentType.format({
|
||||
type: "image/svg+xml",
|
||||
parameters: { charset: "utf-8" },
|
||||
});
|
||||
var str = contentType.format({
|
||||
type: 'image/svg+xml',
|
||||
parameters: { charset: 'utf-8' }
|
||||
})
|
||||
```
|
||||
|
||||
Format an object into a `Content-Type` header. This will return a string of the content type for the given object with the following properties (examples are shown that produce the string `'image/svg+xml; charset=utf-8'`):
|
||||
Format an object into a `Content-Type` header. This will return a string of the
|
||||
content type for the given object with the following properties (examples are
|
||||
shown that produce the string `'image/svg+xml; charset=utf-8'`):
|
||||
|
||||
- `type`: The media type. Example: `'image/svg+xml'`.
|
||||
- `parameters`: An optional object of the parameters in the media type. Example: `{charset: 'utf-8'}`.
|
||||
- `type`: The media type (will be lower-cased). Example: `'image/svg+xml'`
|
||||
|
||||
- `parameters`: An object of the parameters in the media type (name of the
|
||||
parameter will be lower-cased). Example: `{charset: 'utf-8'}`
|
||||
|
||||
Throws a `TypeError` if the object contains an invalid type or parameter names.
|
||||
|
||||
@@ -59,13 +83,12 @@ Throws a `TypeError` if the object contains an invalid type or parameter names.
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/content-type
|
||||
[ci-image]: https://badgen.net/github/checks/jshttp/content-type/master?label=ci
|
||||
[ci-url]: https://github.com/jshttp/content-type/actions/workflows/ci.yml
|
||||
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/content-type/master
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/content-type?branch=master
|
||||
[node-image]: https://badgen.net/npm/node/content-type
|
||||
[node-url]: https://nodejs.org/en/download
|
||||
[npm-downloads-image]: https://badgen.net/npm/dm/content-type
|
||||
[npm-url]: https://npmjs.org/package/content-type
|
||||
[downloads-image]: https://img.shields.io/npm/dm/content-type
|
||||
[downloads-url]: https://npmjs.org/package/content-type
|
||||
[build-image]: https://img.shields.io/github/actions/workflow/status/jshttp/content-type/ci.yml?branch=master
|
||||
[build-url]: https://github.com/jshttp/content-type/actions/workflows/ci.yml?query=branch%3Amaster
|
||||
[coverage-image]: https://img.shields.io/codecov/c/gh/jshttp/content-type
|
||||
[coverage-url]: https://codecov.io/gh/jshttp/content-type
|
||||
[license-image]: http://img.shields.io/npm/l/content-type.svg?style=flat
|
||||
[license-url]: LICENSE
|
||||
[npm-version-image]: https://badgen.net/npm/v/content-type
|
||||
|
||||
46
node_modules/content-type/dist/index.d.ts
generated
vendored
46
node_modules/content-type/dist/index.d.ts
generated
vendored
@@ -1,46 +0,0 @@
|
||||
/*!
|
||||
* content-type
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
/**
|
||||
* The content type object contains a type string and optional parameters.
|
||||
*/
|
||||
export interface ContentType {
|
||||
type: string;
|
||||
index: number;
|
||||
parameters: Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* Format an object into a `Content-Type` header.
|
||||
*/
|
||||
export declare function format(obj: Partial<ContentType>): string;
|
||||
/**
|
||||
* Options for parsing a `Content-Type` header.
|
||||
*/
|
||||
export interface ParseOptions {
|
||||
/**
|
||||
* Exit early on the first semicolon, returning only the type.
|
||||
* This is useful for parsing the MIME from `Content-Type` headers.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
parameters?: boolean;
|
||||
/**
|
||||
* Exits early on a comma, returning the first value and parameters.
|
||||
* This is useful for parsing `Accept` headers.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
comma?: boolean;
|
||||
/**
|
||||
* The index to start parsing from.
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
start?: number;
|
||||
}
|
||||
/**
|
||||
* Parse a `Content-Type` header.
|
||||
*/
|
||||
export declare function parse(header: string, options?: ParseOptions): ContentType;
|
||||
176
node_modules/content-type/dist/index.js
generated
vendored
176
node_modules/content-type/dist/index.js
generated
vendored
@@ -1,176 +0,0 @@
|
||||
"use strict";
|
||||
/*!
|
||||
* content-type
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.format = format;
|
||||
exports.parse = parse;
|
||||
const TEXT_REGEXP = /^[\u0009\u0020-\u007e\u0080-\u00ff]*$/;
|
||||
const TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
||||
/**
|
||||
* RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4
|
||||
*/
|
||||
const QUOTE_REGEXP = /[\\"]/g;
|
||||
/**
|
||||
* RegExp to match type in RFC 9110 sec 8.3.1
|
||||
*
|
||||
* media-type = type "/" subtype
|
||||
* type = token
|
||||
* subtype = token
|
||||
*/
|
||||
const TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
||||
/**
|
||||
* Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`.
|
||||
*/
|
||||
const NullObject = /* @__PURE__ */ (() => {
|
||||
const C = function () { };
|
||||
C.prototype = Object.create(null);
|
||||
return C;
|
||||
})();
|
||||
/**
|
||||
* Format an object into a `Content-Type` header.
|
||||
*/
|
||||
function format(obj) {
|
||||
const { type, parameters } = obj;
|
||||
if (!type || !TYPE_REGEXP.test(type)) {
|
||||
throw new TypeError(`Invalid type: ${type}`);
|
||||
}
|
||||
let result = type;
|
||||
if (parameters) {
|
||||
for (const param of Object.keys(parameters)) {
|
||||
if (!TOKEN_REGEXP.test(param)) {
|
||||
throw new TypeError(`Invalid parameter name: ${param}`);
|
||||
}
|
||||
result += `; ${param}=${qstring(parameters[param])}`;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Parse a `Content-Type` header.
|
||||
*/
|
||||
function parse(header, options) {
|
||||
const stopChar = options?.comma === true ? COMMA : 65536; // Sentinel for "no stop char".
|
||||
const len = header.length;
|
||||
let index = skipOWS(header, options?.start ?? 0, len);
|
||||
const valueStart = index;
|
||||
index = skipValue(header, index, len, stopChar);
|
||||
const valueEnd = trailingOWS(header, valueStart, index);
|
||||
const type = header.slice(valueStart, valueEnd).toLowerCase();
|
||||
if (options?.parameters === false) {
|
||||
return { type, index, parameters: new NullObject() };
|
||||
}
|
||||
return parseParameters(header, type, index, len, stopChar);
|
||||
}
|
||||
const SP = 32; // " "
|
||||
const HTAB = 9; // "\t"
|
||||
const SEMI = 59; // ";"
|
||||
const EQ = 61; // "="
|
||||
const DQUOTE = 34; // '"'
|
||||
const BSLASH = 92; // "\\"
|
||||
const COMMA = 44; // ","
|
||||
/**
|
||||
* Parses the parameters of a `Content-Type` header starting at the given index.
|
||||
*/
|
||||
function parseParameters(header, type, index, len, stopChar) {
|
||||
const parameters = new NullObject();
|
||||
parameter: while (index < len) {
|
||||
if (header.charCodeAt(index) === stopChar)
|
||||
break;
|
||||
index = skipOWS(header, index + 1 /* Skip over ; */, len);
|
||||
const keyStart = index;
|
||||
while (index < len) {
|
||||
const code = header.charCodeAt(index);
|
||||
if (code === stopChar)
|
||||
break parameter;
|
||||
if (code === SEMI)
|
||||
continue parameter;
|
||||
if (code === EQ) {
|
||||
const keyEnd = trailingOWS(header, keyStart, index);
|
||||
const key = header.slice(keyStart, keyEnd).toLowerCase();
|
||||
index = skipOWS(header, index + 1, len);
|
||||
if (index < len && header.charCodeAt(index) === DQUOTE) {
|
||||
index++;
|
||||
let value = "";
|
||||
while (index < len) {
|
||||
const code = header.charCodeAt(index++);
|
||||
if (code === DQUOTE) {
|
||||
index = skipValue(header, index, len, stopChar);
|
||||
if (parameters[key] === undefined)
|
||||
parameters[key] = value;
|
||||
break;
|
||||
}
|
||||
if (code === BSLASH && index < len) {
|
||||
value += header[index++];
|
||||
continue;
|
||||
}
|
||||
value += String.fromCharCode(code);
|
||||
}
|
||||
continue parameter;
|
||||
}
|
||||
const valueStart = index;
|
||||
index = skipValue(header, index, len, stopChar);
|
||||
if (parameters[key] === undefined) {
|
||||
const valueEnd = trailingOWS(header, valueStart, index);
|
||||
parameters[key] = header.slice(valueStart, valueEnd);
|
||||
}
|
||||
continue parameter;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
return { type, index, parameters };
|
||||
}
|
||||
/**
|
||||
* Skip over characters until a semicolon or other exit character.
|
||||
*/
|
||||
function skipValue(str, index, len, stopChar) {
|
||||
while (index < len) {
|
||||
const code = str.charCodeAt(index);
|
||||
if (code === SEMI || code === stopChar)
|
||||
break;
|
||||
index++;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
/**
|
||||
* Skip optional whitespace (OWS) in an HTTP header value.
|
||||
*
|
||||
* OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t").
|
||||
*/
|
||||
function skipOWS(header, index, len) {
|
||||
while (index < len) {
|
||||
const char = header.charCodeAt(index);
|
||||
if (char !== SP && char !== HTAB)
|
||||
break;
|
||||
index++;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
/**
|
||||
* Trim optional whitespace (OWS) from the end of a substring.
|
||||
*
|
||||
* OWS is defined in RFC 9110 sec 5.6.3 as SP (" ") or HTAB ("\t").
|
||||
*/
|
||||
function trailingOWS(header, start, end) {
|
||||
while (end > start) {
|
||||
const char = header.charCodeAt(end - 1);
|
||||
if (char !== SP && char !== HTAB)
|
||||
break;
|
||||
end--;
|
||||
}
|
||||
return end;
|
||||
}
|
||||
/**
|
||||
* Serialize a parameter value.
|
||||
*/
|
||||
function qstring(str) {
|
||||
if (TOKEN_REGEXP.test(str))
|
||||
return str;
|
||||
if (TEXT_REGEXP.test(str))
|
||||
return `"${str.replace(QUOTE_REGEXP, "\\$&")}"`;
|
||||
throw new TypeError(`Invalid parameter value: ${str}`);
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/content-type/dist/index.js.map
generated
vendored
1
node_modules/content-type/dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
62
node_modules/content-type/package.json
generated
vendored
62
node_modules/content-type/package.json
generated
vendored
@@ -1,52 +1,42 @@
|
||||
{
|
||||
"name": "content-type",
|
||||
"version": "2.1.0",
|
||||
"description": "Create and parse HTTP Content-Type header",
|
||||
"version": "1.0.5",
|
||||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"content-type",
|
||||
"http",
|
||||
"req",
|
||||
"res",
|
||||
"rfc7231",
|
||||
"rfc9110"
|
||||
"rfc7231"
|
||||
],
|
||||
"repository": "jshttp/content-type",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"type": "commonjs",
|
||||
"exports": "./dist/index.js",
|
||||
"main": "./dist/index.js",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist/"
|
||||
],
|
||||
"scripts": {
|
||||
"bench": "vitest bench",
|
||||
"build": "ts-scripts build",
|
||||
"format": "ts-scripts format",
|
||||
"prepare": "ts-scripts install && npm run build",
|
||||
"specs": "ts-scripts specs",
|
||||
"test": "ts-scripts test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@borderless/ts-scripts": "^0.15.0",
|
||||
"@vitest/coverage-v8": "^3.0.5",
|
||||
"typescript": "^5.7.3",
|
||||
"vitest": "^3.2.4"
|
||||
"deep-equal": "1.0.1",
|
||||
"eslint": "8.32.0",
|
||||
"eslint-config-standard": "15.0.1",
|
||||
"eslint-plugin-import": "2.27.5",
|
||||
"eslint-plugin-node": "11.1.0",
|
||||
"eslint-plugin-promise": "6.1.1",
|
||||
"eslint-plugin-standard": "4.1.0",
|
||||
"mocha": "10.2.0",
|
||||
"nyc": "15.1.0"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"HISTORY.md",
|
||||
"README.md",
|
||||
"index.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"ts-scripts": {
|
||||
"dist": [
|
||||
"dist"
|
||||
],
|
||||
"project": [
|
||||
"tsconfig.build.json"
|
||||
]
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"test": "mocha --reporter spec --check-leaks --bail test/",
|
||||
"test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
|
||||
"test-cov": "nyc --reporter=html --reporter=text npm test",
|
||||
"version": "node scripts/version-history.js && git add HISTORY.md"
|
||||
}
|
||||
}
|
||||
|
||||
26
node_modules/is-network-error/index.d.ts
generated
vendored
26
node_modules/is-network-error/index.d.ts
generated
vendored
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
Check if an error is a [Fetch network error](https://developer.mozilla.org/en-US/docs/Web/API/fetch#exceptions)
|
||||
|
||||
@return Returns `true` if the given value is a Fetch network error, otherwise `false`.
|
||||
|
||||
@example
|
||||
```
|
||||
import isNetworkError from 'is-network-error';
|
||||
|
||||
async function getUnicorns() {
|
||||
try {
|
||||
const response = await fetch('unicorns.json');
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
if (isNetworkError(error)) {
|
||||
return localStorage.getItem('…');
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(await getUnicorns());
|
||||
```
|
||||
*/
|
||||
export default function isNetworkError(value: unknown): value is TypeError;
|
||||
47
node_modules/is-network-error/index.js
generated
vendored
47
node_modules/is-network-error/index.js
generated
vendored
@@ -1,47 +0,0 @@
|
||||
const objectToString = Object.prototype.toString;
|
||||
|
||||
const isError = value => objectToString.call(value) === '[object Error]';
|
||||
|
||||
const errorMessages = new Set([
|
||||
'network error', // Chrome
|
||||
'NetworkError when attempting to fetch resource.', // Firefox
|
||||
'The Internet connection appears to be offline.', // Safari 16
|
||||
'Network request failed', // `cross-fetch`
|
||||
'fetch failed', // Undici (Node.js)
|
||||
'terminated', // Undici (Node.js)
|
||||
' A network error occurred.', // Bun (WebKit)
|
||||
'Network connection lost', // Cloudflare Workers (fetch)
|
||||
]);
|
||||
|
||||
export default function isNetworkError(error) {
|
||||
const isValid = error
|
||||
&& isError(error)
|
||||
&& error.name === 'TypeError'
|
||||
&& typeof error.message === 'string';
|
||||
|
||||
if (!isValid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const {message, stack} = error;
|
||||
|
||||
// Safari 17+ has generic message but no stack for network errors
|
||||
if (message === 'Load failed' || (message.startsWith('Load failed (') && message.endsWith(')'))) {
|
||||
return stack === undefined
|
||||
// Sentry adds its own stack trace to the fetch error, so also check for that
|
||||
|| '__sentry_captured__' in error;
|
||||
}
|
||||
|
||||
// Deno network errors start with specific text
|
||||
if (message.startsWith('error sending request for url')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Chrome: exact "Failed to fetch" or with hostname: "Failed to fetch (example.com)"
|
||||
if (message === 'Failed to fetch' || (message.startsWith('Failed to fetch (') && message.endsWith(')'))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Standard network error messages
|
||||
return errorMessages.has(message);
|
||||
}
|
||||
9
node_modules/is-network-error/license
generated
vendored
9
node_modules/is-network-error/license
generated
vendored
@@ -1,9 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
43
node_modules/is-network-error/package.json
generated
vendored
43
node_modules/is-network-error/package.json
generated
vendored
@@ -1,43 +0,0 @@
|
||||
{
|
||||
"name": "is-network-error",
|
||||
"version": "1.3.2",
|
||||
"description": "Check if a value is a Fetch network error",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/is-network-error",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"types": "./index.d.ts",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"network",
|
||||
"error",
|
||||
"fetch",
|
||||
"whatwg",
|
||||
"detect",
|
||||
"check",
|
||||
"typeerror"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^5.3.1",
|
||||
"tsd": "^0.29.0",
|
||||
"xo": "^0.56.0"
|
||||
}
|
||||
}
|
||||
44
node_modules/is-network-error/readme.md
generated
vendored
44
node_modules/is-network-error/readme.md
generated
vendored
@@ -1,44 +0,0 @@
|
||||
# is-network-error
|
||||
|
||||
> Check if a value is a [Fetch network error](https://developer.mozilla.org/en-US/docs/Web/API/fetch#exceptions)
|
||||
|
||||
This can be useful when you want to do something specific when a network error happens without catching other Fetch-related errors.
|
||||
|
||||
Unfortunately, Fetch network errors are [not standardized](https://github.com/whatwg/fetch/issues/526) and differ among implementations. This package handles the differences across Node.js, Bun, Deno, and browsers.
|
||||
|
||||
For instance, [`p-retry`](https://github.com/sindresorhus/p-retry) uses this package to retry on network errors.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install is-network-error
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import isNetworkError from 'is-network-error';
|
||||
|
||||
async function getUnicorns() {
|
||||
try {
|
||||
const response = await fetch('unicorns.json');
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
if (isNetworkError(error)) {
|
||||
return localStorage.getItem('…');
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(await getUnicorns());
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `isNetworkError(value: unknown): value is TypeError`
|
||||
|
||||
Returns `true` if the given value is a Fetch network error, otherwise `false`.
|
||||
|
||||
This function acts as a type guard, narrowing the type to `TypeError` when it returns `true`.
|
||||
1280
node_modules/matrix-js-sdk/CHANGELOG.md
generated
vendored
1280
node_modules/matrix-js-sdk/CHANGELOG.md
generated
vendored
File diff suppressed because it is too large
Load Diff
361
node_modules/matrix-js-sdk/README.md
generated
vendored
361
node_modules/matrix-js-sdk/README.md
generated
vendored
@@ -11,24 +11,6 @@
|
||||
This is the [Matrix](https://matrix.org) Client-Server SDK for JavaScript and TypeScript. This SDK can be run in a
|
||||
browser or in Node.js.
|
||||
|
||||
---
|
||||
|
||||
<picture>
|
||||
<source srcset="contrib/element-logo-light.png" media="(prefers-color-scheme: dark)">
|
||||
<source srcset="contrib/element-logo-dark.png" media="(prefers-color-scheme: light)">
|
||||
<img src="contrib/element-logo-fallback.png" alt="Element logo">
|
||||
</picture>
|
||||
|
||||
<br>
|
||||
|
||||
Development and maintenance is proudly sponsored by [Element](https://element.io). Element uses the SDK in their flagship [web](https://github.com/element-hq/element-web) and [desktop](https://github.com/element-hq/element-desktop) clients.
|
||||
|
||||
The SDK is also the basis for multiple Matrix projects and we welcome contributions from all.
|
||||
|
||||
---
|
||||
|
||||
#### Minimum Matrix server version: v1.1
|
||||
|
||||
The Matrix specification is constantly evolving - while this SDK aims for maximum backwards compatibility, it only
|
||||
guarantees that a feature will be supported for at least 4 spec releases. For example, if a feature the js-sdk supports
|
||||
is removed in v1.4 then the feature is _eligible_ for removal from the SDK when v1.8 is released. This SDK has no
|
||||
@@ -37,14 +19,32 @@ endpoints from before Matrix 1.1, for example.
|
||||
|
||||
# Quickstart
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Servers may require or use authenticated endpoints for media (images, files, avatars, etc). See the
|
||||
> [Authenticated Media](#authenticated-media) section for information on how to enable support for this.
|
||||
## In a browser
|
||||
|
||||
Using `pnpm` instead of `npm` is recommended. Please see the pnpm [install
|
||||
guide](https://pnpm.io/installation#using-corepack) if you do not have it already.
|
||||
### Note, the browserify build has been deprecated. Please use a bundler like webpack or vite instead.
|
||||
|
||||
`pnpm add matrix-js-sdk`
|
||||
Download the browser version from
|
||||
https://github.com/matrix-org/matrix-js-sdk/releases/latest and add that as a
|
||||
`<script>` to your page. There will be a global variable `matrixcs`
|
||||
attached to `window` through which you can access the SDK. See below for how to
|
||||
include libolm to enable end-to-end-encryption.
|
||||
|
||||
The browser bundle supports recent versions of browsers. Typically this is ES2015
|
||||
or `> 0.5%, last 2 versions, Firefox ESR, not dead` if using
|
||||
[browserlists](https://github.com/browserslist/browserslist).
|
||||
|
||||
Please check [the working browser example](examples/browser) for more information.
|
||||
|
||||
## In Node.js
|
||||
|
||||
Ensure you have the latest LTS version of Node.js installed.
|
||||
This library relies on `fetch` which is available in Node from v18.0.0 - it should work fine also with polyfills.
|
||||
If you wish to use a ponyfill or adapter of some sort then pass it as `fetchFn` to the MatrixClient constructor options.
|
||||
|
||||
Using `yarn` instead of `npm` is recommended. Please see the Yarn [install guide](https://classic.yarnpkg.com/en/docs/install)
|
||||
if you do not have it already.
|
||||
|
||||
`yarn add matrix-js-sdk`
|
||||
|
||||
```javascript
|
||||
import * as sdk from "matrix-js-sdk";
|
||||
@@ -54,8 +54,10 @@ client.publicRooms(function (err, data) {
|
||||
});
|
||||
```
|
||||
|
||||
See [below](#end-to-end-encryption-support) for how to enable end-to-end-encryption, or check
|
||||
[the Node.js terminal app](https://github.com/matrix-org/matrix-js-sdk/tree/develop/examples/node) for a more complex example.
|
||||
See below for how to include libolm to enable end-to-end-encryption. Please check
|
||||
[the Node.js terminal app](examples/node) for a more complex example.
|
||||
|
||||
You can also use the sdk with [Deno](https://deno.land/) (`import npm:matrix-js-sdk`) but its not officialy supported.
|
||||
|
||||
To start the client:
|
||||
|
||||
@@ -66,7 +68,7 @@ await client.startClient({ initialSyncLimit: 10 });
|
||||
You can perform a call to `/sync` to get the current state of the client:
|
||||
|
||||
```javascript
|
||||
client.once(ClientEvent.sync, function (state, prevState, res) {
|
||||
client.once("sync", function (state, prevState, res) {
|
||||
if (state === "PREPARED") {
|
||||
console.log("prepared");
|
||||
} else {
|
||||
@@ -91,7 +93,7 @@ client.sendEvent("roomId", "m.room.message", content, "", (err, res) => {
|
||||
To listen for message events:
|
||||
|
||||
```javascript
|
||||
client.on(RoomEvent.Timeline, function (event, room, toStartOfTimeline) {
|
||||
client.on("Room.timeline", function (event, room, toStartOfTimeline) {
|
||||
if (event.getType() !== "m.room.message") {
|
||||
return; // only use messages
|
||||
}
|
||||
@@ -109,83 +111,55 @@ Object.keys(client.store.rooms).forEach((roomId) => {
|
||||
});
|
||||
```
|
||||
|
||||
## Authenticated media
|
||||
|
||||
Servers supporting [MSC3916](https://github.com/matrix-org/matrix-spec-proposals/pull/3916) (Matrix 1.11) will require clients, like
|
||||
yours, to include an `Authorization` header when `/download`ing or `/thumbnail`ing media. For NodeJS environments this
|
||||
may be as easy as the following code snippet, though web browsers may need to use [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API)
|
||||
to append the header when using the endpoints in `<img />` elements and similar.
|
||||
|
||||
```javascript
|
||||
const downloadUrl = client.mxcUrlToHttp(
|
||||
/*mxcUrl=*/ "mxc://example.org/abc123", // the MXC URI to download/thumbnail, typically from an event or profile
|
||||
/*width=*/ undefined, // part of the thumbnail API. Use as required.
|
||||
/*height=*/ undefined, // part of the thumbnail API. Use as required.
|
||||
/*resizeMethod=*/ undefined, // part of the thumbnail API. Use as required.
|
||||
/*allowDirectLinks=*/ false, // should generally be left `false`.
|
||||
/*allowRedirects=*/ true, // implied supported with authentication
|
||||
/*useAuthentication=*/ true, // the flag we're after in this example
|
||||
);
|
||||
const img = await fetch(downloadUrl, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${client.getAccessToken()}`,
|
||||
},
|
||||
});
|
||||
// Do something with `img`.
|
||||
```
|
||||
|
||||
> [!WARNING]
|
||||
> In future the js-sdk will _only_ return authentication-required URLs, mandating population of the `Authorization` header.
|
||||
|
||||
## What does this SDK do?
|
||||
|
||||
This SDK provides a full object model around the Matrix Client-Server API and emits
|
||||
events for incoming data and state changes. Aside from wrapping the HTTP API, it:
|
||||
|
||||
- Handles syncing (via `/sync`)
|
||||
- Handles the generation of "friendly" room and member names.
|
||||
- Handles historical `RoomMember` information (e.g. display names).
|
||||
- Manages room member state across multiple events (e.g. it handles typing, power
|
||||
levels and membership changes).
|
||||
- Exposes high-level objects like `Rooms`, `RoomState`, `RoomMembers` and `Users`
|
||||
which can be listened to for things like name changes, new messages, membership
|
||||
changes, presence changes, and more.
|
||||
- Handle "local echo" of messages sent using the SDK. This means that messages
|
||||
that have just been sent will appear in the timeline as 'sending', until it
|
||||
completes. This is beneficial because it prevents there being a gap between
|
||||
hitting the send button and having the "remote echo" arrive.
|
||||
- Mark messages which failed to send as not sent.
|
||||
- Automatically retry requests to send messages due to network errors.
|
||||
- Automatically retry requests to send messages due to rate limiting errors.
|
||||
- Handle queueing of messages.
|
||||
- Handles pagination.
|
||||
- Handle assigning push actions for events.
|
||||
- Handles room initial sync on accepting invites.
|
||||
- Handles WebRTC calling.
|
||||
- Handles syncing (via `/initialSync` and `/events`)
|
||||
- Handles the generation of "friendly" room and member names.
|
||||
- Handles historical `RoomMember` information (e.g. display names).
|
||||
- Manages room member state across multiple events (e.g. it handles typing, power
|
||||
levels and membership changes).
|
||||
- Exposes high-level objects like `Rooms`, `RoomState`, `RoomMembers` and `Users`
|
||||
which can be listened to for things like name changes, new messages, membership
|
||||
changes, presence changes, and more.
|
||||
- Handle "local echo" of messages sent using the SDK. This means that messages
|
||||
that have just been sent will appear in the timeline as 'sending', until it
|
||||
completes. This is beneficial because it prevents there being a gap between
|
||||
hitting the send button and having the "remote echo" arrive.
|
||||
- Mark messages which failed to send as not sent.
|
||||
- Automatically retry requests to send messages due to network errors.
|
||||
- Automatically retry requests to send messages due to rate limiting errors.
|
||||
- Handle queueing of messages.
|
||||
- Handles pagination.
|
||||
- Handle assigning push actions for events.
|
||||
- Handles room initial sync on accepting invites.
|
||||
- Handles WebRTC calling.
|
||||
|
||||
Later versions of the SDK will:
|
||||
|
||||
- Expose a `RoomSummary` which would be suitable for a recents page.
|
||||
- Provide different pluggable storage layers (e.g. local storage, database-backed)
|
||||
|
||||
# Usage
|
||||
|
||||
## Supported platforms
|
||||
## Conventions
|
||||
|
||||
`matrix-js-sdk` can be used in either Node.js applications (ensure you have the latest LTS version of Node.js installed),
|
||||
or in browser applications, via a bundler such as Webpack or Vite.
|
||||
### Emitted events
|
||||
|
||||
You can also use the sdk with [Deno](https://deno.land/) (`import npm:matrix-js-sdk`) but its not officially supported.
|
||||
|
||||
## Emitted events
|
||||
|
||||
The SDK raises notifications to the application using
|
||||
[`EventEmitter`s](https://nodejs.org/api/events.html#class-eventemitter). The `MatrixClient` itself
|
||||
implements `EventEmitter`, as do many of the high-level abstractions such as `Room` and `RoomMember`.
|
||||
The SDK will emit events using an `EventEmitter`. It also
|
||||
emits object models (e.g. `Rooms`, `RoomMembers`) when they
|
||||
are updated.
|
||||
|
||||
```javascript
|
||||
// Listen for low-level MatrixEvents
|
||||
client.on(ClientEvent.Event, function (event) {
|
||||
client.on("event", function (event) {
|
||||
console.log(event.getType());
|
||||
});
|
||||
|
||||
// Listen for typing changes
|
||||
client.on(RoomMemberEvent.Typing, function (event, member) {
|
||||
client.on("RoomMember.typing", function (event, member) {
|
||||
if (member.typing) {
|
||||
console.log(member.name + " is typing...");
|
||||
} else {
|
||||
@@ -197,23 +171,41 @@ client.on(RoomMemberEvent.Typing, function (event, member) {
|
||||
client.startClient();
|
||||
```
|
||||
|
||||
## Entry points
|
||||
### Promises and Callbacks
|
||||
|
||||
As well as the primary entry point (`matrix-js-sdk`), there are several other entry points which may be useful:
|
||||
Most of the methods in the SDK are asynchronous: they do not directly return a
|
||||
result, but instead return a [Promise](http://documentup.com/kriskowal/q/)
|
||||
which will be fulfilled in the future.
|
||||
|
||||
| Entry point | Description |
|
||||
| ------------------------------ | --------------------------------------------------------------------------------------------------- |
|
||||
| `matrix-js-sdk` | Primary entry point. High-level functionality, and lots of historical clutter in need of a cleanup. |
|
||||
| `matrix-js-sdk/lib/crypto-api` | Cryptography functionality. |
|
||||
| `matrix-js-sdk/lib/types` | Low-level types, reflecting data structures defined in the Matrix spec. |
|
||||
| `matrix-js-sdk/lib/testing` | Test utilities, which may be useful in test code but should not be used in production code. |
|
||||
| `matrix-js-sdk/lib/rendezvous` | Utilities around MSC4108 QR code login and rendezvous servers. |
|
||||
| `matrix-js-sdk/lib/utils/*.js` | A set of modules exporting standalone functions (and their types). |
|
||||
The typical usage is something like:
|
||||
|
||||
```javascript
|
||||
matrixClient.someMethod(arg1, arg2).then(function(result) {
|
||||
...
|
||||
});
|
||||
```
|
||||
|
||||
Alternatively, if you have a Node.js-style `callback(err, result)` function,
|
||||
you can pass the result of the promise into it with something like:
|
||||
|
||||
```javascript
|
||||
matrixClient.someMethod(arg1, arg2).nodeify(callback);
|
||||
```
|
||||
|
||||
The main thing to note is that it is problematic to discard the result of a
|
||||
promise-returning function, as that will cause exceptions to go unobserved.
|
||||
|
||||
Methods which return a promise show this in their documentation.
|
||||
|
||||
Many methods in the SDK support _both_ Node.js-style callbacks _and_ Promises,
|
||||
via an optional `callback` argument. The callback support is now deprecated:
|
||||
new methods do not include a `callback` argument, and in the future it may be
|
||||
removed from existing methods.
|
||||
|
||||
## Examples
|
||||
|
||||
This section provides some useful code snippets which demonstrate the
|
||||
core functionality of the SDK. These examples assume the SDK is set up like this:
|
||||
core functionality of the SDK. These examples assume the SDK is setup like this:
|
||||
|
||||
```javascript
|
||||
import * as sdk from "matrix-js-sdk";
|
||||
@@ -229,10 +221,10 @@ const matrixClient = sdk.createClient({
|
||||
### Automatically join rooms when invited
|
||||
|
||||
```javascript
|
||||
matrixClient.on(RoomEvent.MyMembership, function (room, membership, prevMembership) {
|
||||
if (membership === KnownMembership.Invite) {
|
||||
matrixClient.joinRoom(room.roomId).then(function () {
|
||||
console.log("Auto-joined %s", room.roomId);
|
||||
matrixClient.on("RoomMember.membership", function (event, member) {
|
||||
if (member.membership === "invite" && member.userId === myUserId) {
|
||||
matrixClient.joinRoom(member.roomId).then(function () {
|
||||
console.log("Auto-joined %s", member.roomId);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -243,7 +235,7 @@ matrixClient.startClient();
|
||||
### Print out messages for all rooms
|
||||
|
||||
```javascript
|
||||
matrixClient.on(RoomEvent.Timeline, function (event, room, toStartOfTimeline) {
|
||||
matrixClient.on("Room.timeline", function (event, room, toStartOfTimeline) {
|
||||
if (toStartOfTimeline) {
|
||||
return; // don't print paginated results
|
||||
}
|
||||
@@ -275,7 +267,7 @@ Output:
|
||||
### Print out membership lists whenever they are changed
|
||||
|
||||
```javascript
|
||||
matrixClient.on(RoomStateEvent.Members, function (event, state, member) {
|
||||
matrixClient.on("RoomState.members", function (event, state, member) {
|
||||
const room = matrixClient.getRoom(state.roomId);
|
||||
if (!room) {
|
||||
return;
|
||||
@@ -311,8 +303,8 @@ This SDK uses [Typedoc](https://typedoc.org/guides/doccomments) doc comments. Yo
|
||||
host the API reference from the source files like this:
|
||||
|
||||
```
|
||||
$ pnpm gendoc
|
||||
$ cd docs
|
||||
$ yarn gendoc
|
||||
$ cd _docs
|
||||
$ python -m http.server 8005
|
||||
```
|
||||
|
||||
@@ -320,131 +312,41 @@ Then visit `http://localhost:8005` to see the API docs.
|
||||
|
||||
# End-to-end encryption support
|
||||
|
||||
`matrix-js-sdk`'s end-to-end encryption support is based on the [WebAssembly bindings](https://github.com/matrix-org/matrix-rust-sdk-crypto-wasm) of the Rust [matrix-sdk-crypto](https://github.com/matrix-org/matrix-rust-sdk/tree/main/crates/matrix-sdk-crypto) library.
|
||||
The SDK supports end-to-end encryption via the Olm and Megolm protocols, using
|
||||
[libolm](https://gitlab.matrix.org/matrix-org/olm). It is left up to the
|
||||
application to make libolm available, via the `Olm` global.
|
||||
|
||||
## Initialization
|
||||
It is also necessary to call `await matrixClient.initCrypto()` after creating a new
|
||||
`MatrixClient` (but **before** calling `matrixClient.startClient()`) to
|
||||
initialise the crypto layer.
|
||||
|
||||
To initialize the end-to-end encryption support in the matrix client:
|
||||
If the `Olm` global is not available, the SDK will show a warning, as shown
|
||||
below; `initCrypto()` will also fail.
|
||||
|
||||
```javascript
|
||||
// Create a new matrix client
|
||||
const matrixClient = sdk.createClient({
|
||||
baseUrl: "http://localhost:8008",
|
||||
accessToken: myAccessToken,
|
||||
userId: myUserId,
|
||||
});
|
||||
|
||||
// Initialize to enable end-to-end encryption support.
|
||||
await matrixClient.initRustCrypto();
|
||||
```
|
||||
Unable to load crypto module: crypto will be disabled: Error: global.Olm is not defined
|
||||
```
|
||||
|
||||
Note that by default it will attempt to use the Indexed DB provided by the browser as a crypto store. If running outside the browser, you will need to pass [an options object](https://matrix-org.github.io/matrix-js-sdk/classes/matrix.MatrixClient.html#initrustcrypto) which includes `useIndexedDB: false`, to use an ephemeral in-memory store instead. Note that without a persistent store, you'll need to create a new device on the server side (with [`MatrixClient.loginRequest`](https://matrix-org.github.io/matrix-js-sdk/classes/matrix.MatrixClient.html#loginrequest)) each time your application starts.
|
||||
If the crypto layer is not (successfully) initialised, the SDK will continue to
|
||||
work for unencrypted rooms, but it will not support the E2E parts of the Matrix
|
||||
specification.
|
||||
|
||||
After calling `initRustCrypto`, you can obtain a reference to the [`CryptoApi`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto-api.CryptoApi.html) interface, which is the main entry point for end-to-end encryption, by calling [`MatrixClient.getCrypto`](https://matrix-org.github.io/matrix-js-sdk/classes/matrix.MatrixClient.html#getCrypto).
|
||||
To provide the Olm library in a browser application:
|
||||
|
||||
**WARNING**: the cryptography stack is not thread-safe. Having multiple `MatrixClient` instances connected to the same Indexed DB will cause data corruption and decryption failures. The application layer is responsible for ensuring that only one `MatrixClient` issue is instantiated at a time.
|
||||
- download the transpiled libolm (from https://packages.matrix.org/npm/olm/).
|
||||
- load `olm.js` as a `<script>` _before_ `browser-matrix.js`.
|
||||
|
||||
## Secret storage
|
||||
To provide the Olm library in a node.js application:
|
||||
|
||||
You should normally set up [secret storage](https://spec.matrix.org/v1.12/client-server-api/#secret-storage) before using the end-to-end encryption. To do this, call [`CryptoApi.bootstrapSecretStorage`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoApi.html#bootstrapSecretStorage).
|
||||
`bootstrapSecretStorage` can be called unconditionally: it will only set up the secret storage if it is not already set up (unless you use the `setupNewSecretStorage` parameter).
|
||||
- `yarn add https://packages.matrix.org/npm/olm/olm-3.1.4.tgz`
|
||||
(replace the URL with the latest version you want to use from
|
||||
https://packages.matrix.org/npm/olm/)
|
||||
- `global.Olm = require('olm');` _before_ loading `matrix-js-sdk`.
|
||||
|
||||
```javascript
|
||||
const matrixClient = sdk.createClient({
|
||||
...,
|
||||
cryptoCallbacks: {
|
||||
getSecretStorageKey: async (keys) => {
|
||||
// This function should prompt the user to enter their secret storage key.
|
||||
return mySecretStorageKeys;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
matrixClient.getCrypto().bootstrapSecretStorage({
|
||||
// This function will be called if a new secret storage key (aka recovery key) is needed.
|
||||
// You should prompt the user to save the key somewhere, because they will need it to unlock secret storage in future.
|
||||
createSecretStorageKey: async () => {
|
||||
return mySecretStorageKey;
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
The example above will create a new secret storage key if secret storage was not previously set up.
|
||||
The secret storage data will be encrypted using the secret storage key returned in [`createSecretStorageKey`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CreateSecretStorageOpts.html#createSecretStorageKey).
|
||||
|
||||
We recommend that you prompt the user to re-enter this key when [`CryptoCallbacks.getSecretStorageKey`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoCallbacks.html#getSecretStorageKey) is called (when the secret storage access is needed).
|
||||
|
||||
## Set up cross-signing
|
||||
|
||||
To set up cross-signing to verify devices and other users, call
|
||||
[`CryptoApi.bootstrapCrossSigning`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoApi.html#bootstrapCrossSigning):
|
||||
|
||||
```javascript
|
||||
matrixClient.getCrypto().bootstrapCrossSigning({
|
||||
authUploadDeviceSigningKeys: async (makeRequest) => {
|
||||
return makeRequest(authDict);
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
The [`authUploadDeviceSigningKeys`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.BootstrapCrossSigningOpts.html#authUploadDeviceSigningKeys)
|
||||
callback is required in order to upload newly-generated public cross-signing keys to the server.
|
||||
|
||||
## Key backup
|
||||
|
||||
If the user doesn't already have a [key backup](https://spec.matrix.org/v1.12/client-server-api/#server-side-key-backups) you should create one:
|
||||
|
||||
```javascript
|
||||
// Check if we have a key backup.
|
||||
// If checkKeyBackupAndEnable returns null, there is no key backup.
|
||||
const hasKeyBackup = (await matrixClient.getCrypto().checkKeyBackupAndEnable()) !== null;
|
||||
|
||||
// Create the key backup
|
||||
await matrixClient.getCrypto().resetKeyBackup();
|
||||
```
|
||||
|
||||
## Verify a new device
|
||||
|
||||
Once the cross-signing is set up on one of your devices, you can verify another device with two methods:
|
||||
|
||||
1. Use `CryptoApi.bootstrapCrossSigning`.
|
||||
|
||||
`bootstrapCrossSigning` will call the [CryptoCallbacks.getSecretStorageKey](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoCallbacks.html#getSecretStorageKey) callback. The device is verified with the private cross-signing keys fetched from the secret storage.
|
||||
|
||||
2. Request an interactive verification against existing devices, by calling [CryptoApi.requestOwnUserVerification](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoApi.html#requestOwnUserVerification).
|
||||
|
||||
## Migrating from the legacy crypto stack to Rust crypto
|
||||
|
||||
If your application previously used the legacy crypto stack, (i.e, it called `MatrixClient.initLegacyCrypto()`), you will
|
||||
need to migrate existing devices to the Rust crypto stack.
|
||||
|
||||
This migration happens automatically when you call `initRustCrypto()` instead of `initLegacyCrypto()`,
|
||||
but you need to provide the legacy [`cryptoStore`](https://matrix-org.github.io/matrix-js-sdk/interfaces/matrix.ICreateClientOpts.html#cryptoStore) and [`pickleKey`](https://matrix-org.github.io/matrix-js-sdk/interfaces/matrix.ICreateClientOpts.html#pickleKey) to [`createClient`](https://matrix-org.github.io/matrix-js-sdk/functions/matrix.createClient.html):
|
||||
|
||||
```javascript
|
||||
// You should provide the legacy crypto store and the pickle key to the matrix client in order to migrate the data.
|
||||
const matrixClient = sdk.createClient({
|
||||
cryptoStore: myCryptoStore,
|
||||
pickleKey: myPickleKey,
|
||||
baseUrl: "http://localhost:8008",
|
||||
accessToken: myAccessToken,
|
||||
userId: myUserId,
|
||||
});
|
||||
|
||||
// The migration will be done automatically when you call `initRustCrypto`.
|
||||
await matrixClient.initRustCrypto();
|
||||
```
|
||||
|
||||
To follow the migration progress, you can listen to the [`CryptoEvent.LegacyCryptoStoreMigrationProgress`](https://matrix-org.github.io/matrix-js-sdk/enums/crypto_api.CryptoEvent.html#LegacyCryptoStoreMigrationProgress) event:
|
||||
|
||||
```javascript
|
||||
// When progress === total === -1, the migration is finished.
|
||||
matrixClient.on(CryptoEvent.LegacyCryptoStoreMigrationProgress, (progress, total) => {
|
||||
...
|
||||
});
|
||||
```
|
||||
|
||||
The Rust crypto stack is not supported in a lot of deprecated methods of [`MatrixClient`](https://matrix-org.github.io/matrix-js-sdk/classes/matrix.MatrixClient.html). If you use them, you should migrate to the [`CryptoApi`](https://matrix-org.github.io/matrix-js-sdk/interfaces/crypto_api.CryptoApi.html). Also, the legacy `MatrixClient.crypto` object is not available any more: you should use `MatrixClient.getCrypto()` instead.
|
||||
If you want to package Olm as dependency for your node.js application, you can
|
||||
use `yarn add https://packages.matrix.org/npm/olm/olm-3.1.4.tgz`. If your
|
||||
application also works without e2e crypto enabled, add `--optional` to mark it
|
||||
as an optional dependency.
|
||||
|
||||
# Contributing
|
||||
|
||||
@@ -454,25 +356,28 @@ want to use this SDK, skip this section._
|
||||
First, you need to pull in the right build tools:
|
||||
|
||||
```
|
||||
$ pnpm install
|
||||
$ yarn install
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
To build a browser version from scratch when developing:
|
||||
To build a browser version from scratch when developing::
|
||||
|
||||
```
|
||||
$ pnpm build
|
||||
$ yarn build
|
||||
```
|
||||
|
||||
To run tests:
|
||||
To run tests (Jest):
|
||||
|
||||
```
|
||||
$ pnpm test
|
||||
$ yarn test
|
||||
```
|
||||
|
||||
> **Note**
|
||||
> The `sync-browserify.spec.ts` requires a browser build (`yarn build`) in order to pass
|
||||
|
||||
To run linting:
|
||||
|
||||
```
|
||||
$ pnpm lint
|
||||
$ yarn lint
|
||||
```
|
||||
|
||||
14
node_modules/matrix-js-sdk/lib/@types/AESEncryptedSecretStoragePayload.d.ts
generated
vendored
14
node_modules/matrix-js-sdk/lib/@types/AESEncryptedSecretStoragePayload.d.ts
generated
vendored
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* An AES-encrypted secret storage payload.
|
||||
* See https://spec.matrix.org/v1.11/client-server-api/#msecret_storagev1aes-hmac-sha2-1
|
||||
*/
|
||||
export interface AESEncryptedSecretStoragePayload {
|
||||
[key: string]: any;
|
||||
/** the initialization vector in base64 */
|
||||
iv: string;
|
||||
/** the ciphertext in base64 */
|
||||
ciphertext: string;
|
||||
/** the HMAC in base64 */
|
||||
mac: string;
|
||||
}
|
||||
//# sourceMappingURL=AESEncryptedSecretStoragePayload.d.ts.map
|
||||
1
node_modules/matrix-js-sdk/lib/@types/AESEncryptedSecretStoragePayload.d.ts.map
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/AESEncryptedSecretStoragePayload.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"AESEncryptedSecretStoragePayload.d.ts","sourceRoot":"","sources":["../../src/@types/AESEncryptedSecretStoragePayload.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC7C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAC;CACf"}
|
||||
3
node_modules/matrix-js-sdk/lib/@types/AESEncryptedSecretStoragePayload.js
generated
vendored
3
node_modules/matrix-js-sdk/lib/@types/AESEncryptedSecretStoragePayload.js
generated
vendored
@@ -1,3 +0,0 @@
|
||||
export {};
|
||||
export {};
|
||||
//# sourceMappingURL=AESEncryptedSecretStoragePayload.js.map
|
||||
1
node_modules/matrix-js-sdk/lib/@types/AESEncryptedSecretStoragePayload.js.map
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/AESEncryptedSecretStoragePayload.js.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"AESEncryptedSecretStoragePayload.js","names":[],"sources":["../../src/@types/AESEncryptedSecretStoragePayload.ts"],"sourcesContent":["/*\n * Copyright 2024 The Matrix.org Foundation C.I.C.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * An AES-encrypted secret storage payload.\n * See https://spec.matrix.org/v1.11/client-server-api/#msecret_storagev1aes-hmac-sha2-1\n */\nexport interface AESEncryptedSecretStoragePayload {\n [key: string]: any; // extensible\n /** the initialization vector in base64 */\n iv: string;\n /** the ciphertext in base64 */\n ciphertext: string;\n /** the HMAC in base64 */\n mac: string;\n}\n"],"mappings":"","ignoreList":[]}
|
||||
7
node_modules/matrix-js-sdk/lib/@types/IIdentityServerProvider.js
generated
vendored
7
node_modules/matrix-js-sdk/lib/@types/IIdentityServerProvider.js
generated
vendored
@@ -1,3 +1,6 @@
|
||||
export {};
|
||||
export {};
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
//# sourceMappingURL=IIdentityServerProvider.js.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/IIdentityServerProvider.js.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/IIdentityServerProvider.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"IIdentityServerProvider.js","names":[],"sources":["../../src/@types/IIdentityServerProvider.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nexport interface IIdentityServerProvider {\n /**\n * Gets an access token for use against the identity server,\n * for the associated client.\n * @returns Promise which resolves to the access token.\n */\n getAccessToken(): Promise<string | null>;\n}\n"],"mappings":"","ignoreList":[]}
|
||||
{"version":3,"file":"IIdentityServerProvider.js","names":[],"sources":["../../src/@types/IIdentityServerProvider.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nexport interface IIdentityServerProvider {\n /**\n * Gets an access token for use against the identity server,\n * for the associated client.\n * @returns Promise which resolves to the access token.\n */\n getAccessToken(): Promise<string | null>;\n}\n"],"mappings":""}
|
||||
2
node_modules/matrix-js-sdk/lib/@types/PushRules.d.ts.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/PushRules.d.ts.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"PushRules.d.ts","sourceRoot":"","sources":["../../src/@types/PushRules.ts"],"names":[],"mappings":"AAgBA,oBAAY,kBAAkB;IAC1B,UAAU,gBAAgB;IAC1B,MAAM,WAAW;IACjB,QAAQ,aAAa;CACxB;AAED,oBAAY,SAAS;IACjB,SAAS,cAAc;IACvB,KAAK,UAAU;CAClB;AAED,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,IAAI;IACxC,SAAS,EAAE,CAAC,CAAC;IACb,KAAK,CAAC,EAAE,CAAC,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAExD,MAAM,MAAM,MAAM,GAAG,cAAc,GAAG,UAAU,CAAC;AAEjD,oBAAY,iBAAiB;IACzB,WAAW,OAAO;IAClB,QAAQ,MAAM;IACd,WAAW,MAAM;IACjB,kBAAkB,OAAO;IACzB,eAAe,OAAO;CACzB;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,kBAAkB,CAAC;AAEzD,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,SAAS,iBAAiB,GAAG,iBAAiB,CAAC,WAAW,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AM,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACjD,IAAI,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE;QACJ,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,qBAAqB,EAAE,MAAM,CAAC;IAC9B,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,4BAA4B,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,8BAA8B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,8BAA8B,CAAC;IAC/F,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
||||
39
node_modules/matrix-js-sdk/lib/@types/PushRules.js
generated
vendored
39
node_modules/matrix-js-sdk/lib/@types/PushRules.js
generated
vendored
@@ -1,3 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.TweakName = exports.RuleId = exports.PushRuleKind = exports.PushRuleActionName = exports.DMMemberCountCondition = exports.ConditionOperator = exports.ConditionKind = void 0;
|
||||
exports.isDmMemberCountCondition = isDmMemberCountCondition;
|
||||
/*
|
||||
Copyright 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
@@ -13,19 +20,22 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
export let PushRuleActionName = /*#__PURE__*/function (PushRuleActionName) {
|
||||
// allow camelcase as these are things that go onto the wire
|
||||
/* eslint-disable camelcase */
|
||||
let PushRuleActionName = /*#__PURE__*/function (PushRuleActionName) {
|
||||
PushRuleActionName["DontNotify"] = "dont_notify";
|
||||
PushRuleActionName["Notify"] = "notify";
|
||||
PushRuleActionName["Coalesce"] = "coalesce";
|
||||
return PushRuleActionName;
|
||||
}({});
|
||||
export let TweakName = /*#__PURE__*/function (TweakName) {
|
||||
exports.PushRuleActionName = PushRuleActionName;
|
||||
let TweakName = /*#__PURE__*/function (TweakName) {
|
||||
TweakName["Highlight"] = "highlight";
|
||||
TweakName["Sound"] = "sound";
|
||||
return TweakName;
|
||||
}({});
|
||||
export let ConditionOperator = /*#__PURE__*/function (ConditionOperator) {
|
||||
exports.TweakName = TweakName;
|
||||
let ConditionOperator = /*#__PURE__*/function (ConditionOperator) {
|
||||
ConditionOperator["ExactEquals"] = "==";
|
||||
ConditionOperator["LessThan"] = "<";
|
||||
ConditionOperator["GreaterThan"] = ">";
|
||||
@@ -33,11 +43,13 @@ export let ConditionOperator = /*#__PURE__*/function (ConditionOperator) {
|
||||
ConditionOperator["LessThanOrEqual"] = "<=";
|
||||
return ConditionOperator;
|
||||
}({});
|
||||
export const DMMemberCountCondition = "2";
|
||||
export function isDmMemberCountCondition(condition) {
|
||||
exports.ConditionOperator = ConditionOperator;
|
||||
const DMMemberCountCondition = "2";
|
||||
exports.DMMemberCountCondition = DMMemberCountCondition;
|
||||
function isDmMemberCountCondition(condition) {
|
||||
return condition === "==2" || condition === "2";
|
||||
}
|
||||
export let ConditionKind = /*#__PURE__*/function (ConditionKind) {
|
||||
let ConditionKind = /*#__PURE__*/function (ConditionKind) {
|
||||
ConditionKind["EventMatch"] = "event_match";
|
||||
ConditionKind["EventPropertyIs"] = "event_property_is";
|
||||
ConditionKind["EventPropertyContains"] = "event_property_contains";
|
||||
@@ -47,12 +59,10 @@ export let ConditionKind = /*#__PURE__*/function (ConditionKind) {
|
||||
ConditionKind["CallStarted"] = "call_started";
|
||||
ConditionKind["CallStartedPrefix"] = "org.matrix.msc3914.call_started";
|
||||
return ConditionKind;
|
||||
}({});
|
||||
|
||||
// XXX: custom conditions are possible but always fail, and break the typescript discriminated union so ignore them here
|
||||
}({}); // XXX: custom conditions are possible but always fail, and break the typescript discriminated union so ignore them here
|
||||
// IPushRuleCondition<Exclude<string, ConditionKind>> unfortunately does not resolve this at the time of writing.
|
||||
|
||||
export let PushRuleKind = /*#__PURE__*/function (PushRuleKind) {
|
||||
exports.ConditionKind = ConditionKind;
|
||||
let PushRuleKind = /*#__PURE__*/function (PushRuleKind) {
|
||||
PushRuleKind["Override"] = "override";
|
||||
PushRuleKind["ContentSpecific"] = "content";
|
||||
PushRuleKind["RoomSpecific"] = "room";
|
||||
@@ -60,7 +70,8 @@ export let PushRuleKind = /*#__PURE__*/function (PushRuleKind) {
|
||||
PushRuleKind["Underride"] = "underride";
|
||||
return PushRuleKind;
|
||||
}({});
|
||||
export let RuleId = /*#__PURE__*/function (RuleId) {
|
||||
exports.PushRuleKind = PushRuleKind;
|
||||
let RuleId = /*#__PURE__*/function (RuleId) {
|
||||
RuleId["Master"] = ".m.rule.master";
|
||||
RuleId["IsUserMention"] = ".m.rule.is_user_mention";
|
||||
RuleId["IsRoomMention"] = ".m.rule.is_room_mention";
|
||||
@@ -86,4 +97,6 @@ export let RuleId = /*#__PURE__*/function (RuleId) {
|
||||
RuleId["PollEndOneToOneUnstable"] = ".org.matrix.msc3930.rule.poll_end_one_to_one";
|
||||
return RuleId;
|
||||
}({});
|
||||
/* eslint-enable camelcase */
|
||||
exports.RuleId = RuleId;
|
||||
//# sourceMappingURL=PushRules.js.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/PushRules.js.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/PushRules.js.map
generated
vendored
File diff suppressed because one or more lines are too long
1
node_modules/matrix-js-sdk/lib/@types/another-json.d.js
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/another-json.d.js
generated
vendored
@@ -0,0 +1 @@
|
||||
"use strict";
|
||||
2
node_modules/matrix-js-sdk/lib/@types/another-json.d.js.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/another-json.d.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"another-json.d.js","names":[],"sources":["../../src/@types/another-json.d.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\ndeclare module \"another-json\" {\n export function stringify(o: object): string;\n}\n"],"mappings":"","ignoreList":[]}
|
||||
{"version":3,"file":"another-json.d.js","names":[],"sources":["../../src/@types/another-json.d.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\ndeclare module \"another-json\" {\n export function stringify(o: object): string;\n}\n"],"mappings":""}
|
||||
25
node_modules/matrix-js-sdk/lib/@types/auth.d.ts
generated
vendored
25
node_modules/matrix-js-sdk/lib/@types/auth.d.ts
generated
vendored
@@ -1,5 +1,5 @@
|
||||
import { UnstableValue } from "../NamespacedValue.ts";
|
||||
import { type IClientWellKnown } from "../client.ts";
|
||||
import { UnstableValue } from "../NamespacedValue";
|
||||
import { IClientWellKnown } from "../client";
|
||||
/**
|
||||
* Represents a response to the CSAPI `/refresh` endpoint.
|
||||
*/
|
||||
@@ -21,15 +21,15 @@ export interface ILoginFlow {
|
||||
export interface IPasswordFlow extends ILoginFlow {
|
||||
type: "m.login.password";
|
||||
}
|
||||
export declare const OAUTH_AWARE_PREFERRED_FLOW_FIELD: UnstableValue<"oauth_aware_preferred", "org.matrix.msc3824.delegated_oidc_compatibility">;
|
||||
export declare const DELEGATED_OIDC_COMPATIBILITY: UnstableValue<"delegated_oidc_compatibility", "org.matrix.msc3824.delegated_oidc_compatibility">;
|
||||
/**
|
||||
* Representation of SSO flow as per https://spec.matrix.org/v1.3/client-server-api/#client-login-via-sso
|
||||
*/
|
||||
export interface ISSOFlow extends ILoginFlow {
|
||||
type: "m.login.sso" | "m.login.cas";
|
||||
identity_providers?: IIdentityProvider[];
|
||||
[OAUTH_AWARE_PREFERRED_FLOW_FIELD.name]?: boolean;
|
||||
[OAUTH_AWARE_PREFERRED_FLOW_FIELD.altName]?: boolean;
|
||||
[DELEGATED_OIDC_COMPATIBILITY.name]?: boolean;
|
||||
[DELEGATED_OIDC_COMPATIBILITY.altName]?: boolean;
|
||||
}
|
||||
export declare enum IdentityProviderBrand {
|
||||
Gitlab = "gitlab",
|
||||
@@ -106,6 +106,11 @@ export interface LoginRequest {
|
||||
* The login type being used.
|
||||
*/
|
||||
type: "m.login.password" | "m.login.token" | string;
|
||||
/**
|
||||
* Third-party identifier for the user.
|
||||
* @deprecated in favour of `identifier`.
|
||||
*/
|
||||
address?: string;
|
||||
/**
|
||||
* ID of the client device.
|
||||
* If this does not correspond to a known client device, a new device will be created.
|
||||
@@ -192,13 +197,21 @@ export interface LoginResponse {
|
||||
home_server?: string;
|
||||
}
|
||||
/**
|
||||
* The result of a successful `m.login.token` issuance request as per https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv1loginget_token
|
||||
* The result of a successful [MSC3882](https://github.com/matrix-org/matrix-spec-proposals/pull/3882)
|
||||
* `m.login.token` issuance request.
|
||||
* Note that this is UNSTABLE and subject to breaking changes without notice.
|
||||
*/
|
||||
export interface LoginTokenPostResponse {
|
||||
/**
|
||||
* The token to use with `m.login.token` to authenticate.
|
||||
*/
|
||||
login_token: string;
|
||||
/**
|
||||
* Expiration in seconds.
|
||||
*
|
||||
* @deprecated this is only provided for compatibility with original revision of the MSC.
|
||||
*/
|
||||
expires_in: number;
|
||||
/**
|
||||
* Expiration in milliseconds.
|
||||
*/
|
||||
|
||||
2
node_modules/matrix-js-sdk/lib/@types/auth.d.ts.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/auth.d.ts.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/@types/auth.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,SAAS,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,aAAa,GAAG,UAAU,CAAC;AAE9D,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC7C,IAAI,EAAE,kBAAkB,CAAC;CAC5B;AAED,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E,OAAO,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAGD,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC1B;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACzB"}
|
||||
36
node_modules/matrix-js-sdk/lib/@types/auth.js
generated
vendored
36
node_modules/matrix-js-sdk/lib/@types/auth.js
generated
vendored
@@ -1,3 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.SSOAction = exports.IdentityProviderBrand = exports.DELEGATED_OIDC_COMPATIBILITY = void 0;
|
||||
var _NamespacedValue = require("../NamespacedValue");
|
||||
/*
|
||||
Copyright 2022 The Matrix.org Foundation C.I.C.
|
||||
|
||||
@@ -14,23 +21,26 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { UnstableValue } from "../NamespacedValue.js";
|
||||
// disable lint because these are wire responses
|
||||
/* eslint-disable camelcase */
|
||||
|
||||
/**
|
||||
* Represents a response to the CSAPI `/refresh` endpoint.
|
||||
*/
|
||||
|
||||
/* eslint-enable camelcase */
|
||||
|
||||
/**
|
||||
* Response to GET login flows as per https://spec.matrix.org/v1.3/client-server-api/#get_matrixclientv3login
|
||||
*/
|
||||
|
||||
export const OAUTH_AWARE_PREFERRED_FLOW_FIELD = new UnstableValue("oauth_aware_preferred", "org.matrix.msc3824.delegated_oidc_compatibility");
|
||||
const DELEGATED_OIDC_COMPATIBILITY = new _NamespacedValue.UnstableValue("delegated_oidc_compatibility", "org.matrix.msc3824.delegated_oidc_compatibility");
|
||||
|
||||
/**
|
||||
* Representation of SSO flow as per https://spec.matrix.org/v1.3/client-server-api/#client-login-via-sso
|
||||
*/
|
||||
|
||||
export let IdentityProviderBrand = /*#__PURE__*/function (IdentityProviderBrand) {
|
||||
exports.DELEGATED_OIDC_COMPATIBILITY = DELEGATED_OIDC_COMPATIBILITY;
|
||||
let IdentityProviderBrand = /*#__PURE__*/function (IdentityProviderBrand) {
|
||||
IdentityProviderBrand["Gitlab"] = "gitlab";
|
||||
IdentityProviderBrand["Github"] = "github";
|
||||
IdentityProviderBrand["Apple"] = "apple";
|
||||
@@ -39,27 +49,23 @@ export let IdentityProviderBrand = /*#__PURE__*/function (IdentityProviderBrand)
|
||||
IdentityProviderBrand["Twitter"] = "twitter";
|
||||
return IdentityProviderBrand;
|
||||
}({});
|
||||
export let SSOAction = /*#__PURE__*/function (SSOAction) {
|
||||
/** The user intends to login to an existing account */
|
||||
exports.IdentityProviderBrand = IdentityProviderBrand;
|
||||
let SSOAction = /*#__PURE__*/function (SSOAction) {
|
||||
SSOAction["LOGIN"] = "login";
|
||||
/** The user intends to register for a new account */
|
||||
SSOAction["REGISTER"] = "register";
|
||||
return SSOAction;
|
||||
}({});
|
||||
|
||||
/**
|
||||
* A client can identify a user using their Matrix ID.
|
||||
* This can either be the fully qualified Matrix user ID, or just the localpart of the user ID.
|
||||
* @see https://spec.matrix.org/v1.7/client-server-api/#matrix-user-id
|
||||
*/
|
||||
|
||||
/**
|
||||
* A client can identify a user using a 3PID associated with the user’s account on the homeserver,
|
||||
* where the 3PID was previously associated using the /account/3pid API.
|
||||
* See the 3PID Types Appendix for a list of Third-party ID media.
|
||||
* @see https://spec.matrix.org/v1.7/client-server-api/#third-party-id
|
||||
*/
|
||||
|
||||
/**
|
||||
* A client can identify a user using a phone number associated with the user’s account,
|
||||
* where the phone number was previously associated using the /account/3pid API.
|
||||
@@ -71,26 +77,24 @@ export let SSOAction = /*#__PURE__*/function (SSOAction) {
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.7/client-server-api/#phone-number
|
||||
*/
|
||||
|
||||
/**
|
||||
* User Identifiers usable for login & user-interactive authentication.
|
||||
*
|
||||
* Extensibly allows more than Matrix specified identifiers.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Request body for POST /login request
|
||||
* @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3login
|
||||
*/
|
||||
|
||||
// Export for backwards compatibility
|
||||
|
||||
/**
|
||||
* Response body for POST /login request
|
||||
* @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3login
|
||||
*/
|
||||
|
||||
/**
|
||||
* The result of a successful `m.login.token` issuance request as per https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv1loginget_token
|
||||
* The result of a successful [MSC3882](https://github.com/matrix-org/matrix-spec-proposals/pull/3882)
|
||||
* `m.login.token` issuance request.
|
||||
* Note that this is UNSTABLE and subject to breaking changes without notice.
|
||||
*/
|
||||
exports.SSOAction = SSOAction;
|
||||
//# sourceMappingURL=auth.js.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/auth.js.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/auth.js.map
generated
vendored
File diff suppressed because one or more lines are too long
8
node_modules/matrix-js-sdk/lib/@types/beacon.d.ts
generated
vendored
8
node_modules/matrix-js-sdk/lib/@types/beacon.d.ts
generated
vendored
@@ -1,6 +1,6 @@
|
||||
import { type RelatesToRelationship, type REFERENCE_RELATION } from "./extensible_events.ts";
|
||||
import { UnstableValue } from "../NamespacedValue.ts";
|
||||
import { type MAssetEvent, type MLocationEvent, type MTimestampEvent } from "./location.ts";
|
||||
import { RelatesToRelationship, REFERENCE_RELATION } from "./extensible_events";
|
||||
import { UnstableValue } from "../NamespacedValue";
|
||||
import { MAssetEvent, MLocationEvent, MTimestampEvent } from "./location";
|
||||
/**
|
||||
* Beacon info and beacon event types as described in MSC3672
|
||||
* https://github.com/matrix-org/matrix-spec-proposals/pull/3672
|
||||
@@ -12,7 +12,7 @@ import { type MAssetEvent, type MLocationEvent, type MTimestampEvent } from "./l
|
||||
* 2. a user can have an arbitrary number of beacon_info events
|
||||
*
|
||||
* 1. is achieved by setting the state_key to the owners mxid.
|
||||
* Event keys in room state are a combination of `typestate_key`.
|
||||
* Event keys in room state are a combination of `type` + `state_key`.
|
||||
* To achieve an arbitrary number of only owner-writable state events
|
||||
* we introduce a variable suffix to the event type
|
||||
*
|
||||
|
||||
2
node_modules/matrix-js-sdk/lib/@types/beacon.d.ts.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/beacon.d.ts.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"beacon.d.ts","sourceRoot":"","sources":["../../src/@types/beacon.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5F;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa,kEAAuE,CAAC;AAClG,eAAO,MAAM,QAAQ,wDAA6D,CAAC;AAEnF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CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
||||
16
node_modules/matrix-js-sdk/lib/@types/beacon.js
generated
vendored
16
node_modules/matrix-js-sdk/lib/@types/beacon.js
generated
vendored
@@ -1,3 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.M_BEACON_INFO = exports.M_BEACON = void 0;
|
||||
var _NamespacedValue = require("../NamespacedValue");
|
||||
/*
|
||||
Copyright 2022 The Matrix.org Foundation C.I.C.
|
||||
|
||||
@@ -14,7 +21,6 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { UnstableValue } from "../NamespacedValue.js";
|
||||
/**
|
||||
* Beacon info and beacon event types as described in MSC3672
|
||||
* https://github.com/matrix-org/matrix-spec-proposals/pull/3672
|
||||
@@ -27,7 +33,7 @@ import { UnstableValue } from "../NamespacedValue.js";
|
||||
* 2. a user can have an arbitrary number of beacon_info events
|
||||
*
|
||||
* 1. is achieved by setting the state_key to the owners mxid.
|
||||
* Event keys in room state are a combination of `typestate_key`.
|
||||
* Event keys in room state are a combination of `type` + `state_key`.
|
||||
* To achieve an arbitrary number of only owner-writable state events
|
||||
* we introduce a variable suffix to the event type
|
||||
*
|
||||
@@ -61,8 +67,9 @@ import { UnstableValue } from "../NamespacedValue.js";
|
||||
/**
|
||||
* Non-variable type for m.beacon_info event content
|
||||
*/
|
||||
export const M_BEACON_INFO = new UnstableValue("m.beacon_info", "org.matrix.msc3672.beacon_info");
|
||||
export const M_BEACON = new UnstableValue("m.beacon", "org.matrix.msc3672.beacon");
|
||||
const M_BEACON_INFO = new _NamespacedValue.UnstableValue("m.beacon_info", "org.matrix.msc3672.beacon_info");
|
||||
exports.M_BEACON_INFO = M_BEACON_INFO;
|
||||
const M_BEACON = new _NamespacedValue.UnstableValue("m.beacon", "org.matrix.msc3672.beacon");
|
||||
|
||||
/**
|
||||
* m.beacon_info Event example from the spec
|
||||
@@ -116,4 +123,5 @@ export const M_BEACON = new UnstableValue("m.beacon", "org.matrix.msc3672.beacon
|
||||
/**
|
||||
* Content of an m.beacon event
|
||||
*/
|
||||
exports.M_BEACON = M_BEACON;
|
||||
//# sourceMappingURL=beacon.js.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/beacon.js.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/beacon.js.map
generated
vendored
File diff suppressed because one or more lines are too long
10
node_modules/matrix-js-sdk/lib/@types/common.d.ts
generated
vendored
10
node_modules/matrix-js-sdk/lib/@types/common.d.ts
generated
vendored
@@ -1,10 +0,0 @@
|
||||
export type NonEmptyArray<T> = [T, ...T[]];
|
||||
export type Without<T, U> = {
|
||||
[P in Exclude<keyof T, keyof U>]?: never;
|
||||
};
|
||||
export type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
|
||||
export type Writeable<T> = {
|
||||
-readonly [P in keyof T]: T[P];
|
||||
};
|
||||
export type EmptyObject = Record<PropertyKey, never>;
|
||||
//# sourceMappingURL=common.d.ts.map
|
||||
1
node_modules/matrix-js-sdk/lib/@types/common.d.ts.map
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/common.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/@types/common.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAG3C,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK;CAAE,CAAC;AACzE,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACjG,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IAAE,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAE9D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC"}
|
||||
3
node_modules/matrix-js-sdk/lib/@types/common.js
generated
vendored
3
node_modules/matrix-js-sdk/lib/@types/common.js
generated
vendored
@@ -1,3 +0,0 @@
|
||||
export {};
|
||||
export {};
|
||||
//# sourceMappingURL=common.js.map
|
||||
1
node_modules/matrix-js-sdk/lib/@types/common.js.map
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/common.js.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"common.js","names":[],"sources":["../../src/@types/common.ts"],"sourcesContent":["/*\nCopyright 2024 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nexport type NonEmptyArray<T> = [T, ...T[]];\n\n// Based on https://stackoverflow.com/a/53229857/3532235\nexport type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };\nexport type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;\nexport type Writeable<T> = { -readonly [P in keyof T]: T[P] };\n\nexport type EmptyObject = Record<PropertyKey, never>;\n"],"mappings":"","ignoreList":[]}
|
||||
41
node_modules/matrix-js-sdk/lib/@types/crypto.d.ts
generated
vendored
41
node_modules/matrix-js-sdk/lib/@types/crypto.d.ts
generated
vendored
@@ -1,12 +1,40 @@
|
||||
import type { ISignatures } from "./signed.ts";
|
||||
import type { EventDecryptionResult } from "../common-crypto/CryptoBackend.ts";
|
||||
/** @deprecated This is an internal type and should not be used. */
|
||||
type IEventDecryptionResult = EventDecryptionResult;
|
||||
export type { IEventDecryptionResult };
|
||||
import type { IClearEvent } from "../models/event";
|
||||
import type { ISignatures } from "./signed";
|
||||
export type OlmGroupSessionExtraData = {
|
||||
untrusted?: boolean;
|
||||
sharedHistory?: boolean;
|
||||
};
|
||||
/**
|
||||
* The result of a (successful) call to {@link Crypto.decryptEvent}
|
||||
*/
|
||||
export interface IEventDecryptionResult {
|
||||
/**
|
||||
* The plaintext payload for the event (typically containing <tt>type</tt> and <tt>content</tt> fields).
|
||||
*/
|
||||
clearEvent: IClearEvent;
|
||||
/**
|
||||
* List of curve25519 keys involved in telling us about the senderCurve25519Key and claimedEd25519Key.
|
||||
* See {@link MatrixEvent#getForwardingCurve25519KeyChain}.
|
||||
*/
|
||||
forwardingCurve25519KeyChain?: string[];
|
||||
/**
|
||||
* Key owned by the sender of this event. See {@link MatrixEvent#getSenderKey}.
|
||||
*/
|
||||
senderCurve25519Key?: string;
|
||||
/**
|
||||
* ed25519 key claimed by the sender of this event. See {@link MatrixEvent#getClaimedEd25519Key}.
|
||||
*/
|
||||
claimedEd25519Key?: string;
|
||||
untrusted?: boolean;
|
||||
/**
|
||||
* The sender doesn't authorize the unverified devices to decrypt his messages
|
||||
*/
|
||||
encryptedDisabledForUnverifiedDevices?: boolean;
|
||||
}
|
||||
interface Extensible {
|
||||
[key: string]: any;
|
||||
}
|
||||
/** The result of a call to {@link crypto-api!CryptoApi.exportRoomKeys} */
|
||||
/** The result of a call to {@link MatrixClient.exportRoomKeys} */
|
||||
export interface IMegolmSessionData extends Extensible {
|
||||
/** Sender's Curve25519 device key */
|
||||
sender_key: string;
|
||||
@@ -43,4 +71,5 @@ export interface IOneTimeKey {
|
||||
fallback?: boolean;
|
||||
signatures?: ISignatures;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=crypto.d.ts.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/crypto.d.ts.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/crypto.d.ts.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/@types/crypto.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAG/E,mEAAmE;AACnE,KAAK,sBAAsB,GAAG,qBAAqB,CAAC;AACpD,YAAY,EAAE,sBAAsB,EAAE,CAAC;AAEvC,UAAU,UAAU;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,0EAA0E;AAC1E,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IAClD,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,+BAA+B,EAAE,MAAM,EAAE,CAAC;IAC1C,oCAAoC;IACpC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAA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,MAAM,CAAC;IACnB,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAID;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,UAAU,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,WAAW,CAAC;CAC5B"}
|
||||
7
node_modules/matrix-js-sdk/lib/@types/crypto.js
generated
vendored
7
node_modules/matrix-js-sdk/lib/@types/crypto.js
generated
vendored
@@ -1,3 +1,6 @@
|
||||
export {};
|
||||
export {};
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
//# sourceMappingURL=crypto.js.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/crypto.js.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/crypto.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"crypto.js","names":[],"sources":["../../src/@types/crypto.ts"],"sourcesContent":["/*\nCopyright 2022-2023 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport type { ISignatures } from \"./signed.ts\";\nimport type { EventDecryptionResult } from \"../common-crypto/CryptoBackend.ts\";\n\n// Backwards compatible re-export\n/** @deprecated This is an internal type and should not be used. */\ntype IEventDecryptionResult = EventDecryptionResult;\nexport type { IEventDecryptionResult };\n\ninterface Extensible {\n [key: string]: any;\n}\n\n/** The result of a call to {@link crypto-api!CryptoApi.exportRoomKeys} */\nexport interface IMegolmSessionData extends Extensible {\n /** Sender's Curve25519 device key */\n sender_key: string;\n /** Devices which forwarded this session to us (normally empty). */\n forwarding_curve25519_key_chain: string[];\n /** Other keys the sender claims. */\n sender_claimed_keys: Record<string, string>;\n /** Room this session is used in */\n room_id: string;\n /** Unique id for the session */\n session_id: string;\n /** Base64'ed key data */\n session_key: string;\n algorithm?: string;\n untrusted?: boolean;\n}\n\n/** the type of the `device_keys` parameter on `/_matrix/client/v3/keys/upload`\n *\n * @see https://spec.matrix.org/v1.5/client-server-api/#post_matrixclientv3keysupload\n */\nexport interface IDeviceKeys {\n algorithms: Array<string>;\n device_id: string;\n user_id: string;\n keys: Record<string, string>;\n signatures?: ISignatures;\n}\n\n/** the type of the `one_time_keys` and `fallback_keys` parameters on `/_matrix/client/v3/keys/upload`\n *\n * @see https://spec.matrix.org/v1.5/client-server-api/#post_matrixclientv3keysupload\n */\nexport interface IOneTimeKey {\n key: string;\n fallback?: boolean;\n signatures?: ISignatures;\n}\n"],"mappings":"","ignoreList":[]}
|
||||
{"version":3,"file":"crypto.js","names":[],"sources":["../../src/@types/crypto.ts"],"sourcesContent":["/*\nCopyright 2022-2023 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport type { IClearEvent } from \"../models/event\";\nimport type { ISignatures } from \"./signed\";\n\nexport type OlmGroupSessionExtraData = {\n untrusted?: boolean;\n sharedHistory?: boolean;\n};\n\n/**\n * The result of a (successful) call to {@link Crypto.decryptEvent}\n */\nexport interface IEventDecryptionResult {\n /**\n * The plaintext payload for the event (typically containing <tt>type</tt> and <tt>content</tt> fields).\n */\n clearEvent: IClearEvent;\n /**\n * List of curve25519 keys involved in telling us about the senderCurve25519Key and claimedEd25519Key.\n * See {@link MatrixEvent#getForwardingCurve25519KeyChain}.\n */\n forwardingCurve25519KeyChain?: string[];\n /**\n * Key owned by the sender of this event. See {@link MatrixEvent#getSenderKey}.\n */\n senderCurve25519Key?: string;\n /**\n * ed25519 key claimed by the sender of this event. See {@link MatrixEvent#getClaimedEd25519Key}.\n */\n claimedEd25519Key?: string;\n untrusted?: boolean;\n /**\n * The sender doesn't authorize the unverified devices to decrypt his messages\n */\n encryptedDisabledForUnverifiedDevices?: boolean;\n}\n\ninterface Extensible {\n [key: string]: any;\n}\n\n/* eslint-disable camelcase */\n\n/** The result of a call to {@link MatrixClient.exportRoomKeys} */\nexport interface IMegolmSessionData extends Extensible {\n /** Sender's Curve25519 device key */\n sender_key: string;\n /** Devices which forwarded this session to us (normally empty). */\n forwarding_curve25519_key_chain: string[];\n /** Other keys the sender claims. */\n sender_claimed_keys: Record<string, string>;\n /** Room this session is used in */\n room_id: string;\n /** Unique id for the session */\n session_id: string;\n /** Base64'ed key data */\n session_key: string;\n algorithm?: string;\n untrusted?: boolean;\n}\n\n/* eslint-enable camelcase */\n\n/** the type of the `device_keys` parameter on `/_matrix/client/v3/keys/upload`\n *\n * @see https://spec.matrix.org/v1.5/client-server-api/#post_matrixclientv3keysupload\n */\nexport interface IDeviceKeys {\n algorithms: Array<string>;\n device_id: string; // eslint-disable-line camelcase\n user_id: string; // eslint-disable-line camelcase\n keys: Record<string, string>;\n signatures?: ISignatures;\n}\n\n/** the type of the `one_time_keys` and `fallback_keys` parameters on `/_matrix/client/v3/keys/upload`\n *\n * @see https://spec.matrix.org/v1.5/client-server-api/#post_matrixclientv3keysupload\n */\nexport interface IOneTimeKey {\n key: string;\n fallback?: boolean;\n signatures?: ISignatures;\n}\n"],"mappings":""}
|
||||
204
node_modules/matrix-js-sdk/lib/@types/event.d.ts
generated
vendored
204
node_modules/matrix-js-sdk/lib/@types/event.d.ts
generated
vendored
@@ -1,20 +1,4 @@
|
||||
import { type EitherAnd } from "matrix-events-sdk";
|
||||
import { NamespacedValue, UnstableValue } from "../NamespacedValue.ts";
|
||||
import { type PolicyRuleEventContent, type RoomAvatarEventContent, type RoomCanonicalAliasEventContent, type RoomCreateEventContent, type RoomEncryptionEventContent, type RoomGuestAccessEventContent, type RoomHistoryVisibilityEventContent, type RoomJoinRulesEventContent, type RoomMemberEventContent, type RoomNameEventContent, type RoomPinnedEventsEventContent, type RoomPolicyContent, type RoomPowerLevelsEventContent, type RoomServerAclEventContent, type RoomThirdPartyInviteEventContent, type RoomTombstoneEventContent, type RoomTopicEventContent, type SpaceChildEventContent, type SpaceParentEventContent } from "./state_events.ts";
|
||||
import { type IGroupCallRoomMemberState, type IGroupCallRoomState } from "../webrtc/groupCall.ts";
|
||||
import { type MSC3089EventContent } from "../models/MSC3089Branch.ts";
|
||||
import { type M_BEACON, type M_BEACON_INFO, type MBeaconEventContent, type MBeaconInfoEventContent } from "./beacon.ts";
|
||||
import { type EmptyObject } from "./common.ts";
|
||||
import { type ReactionEventContent, type RoomMessageEventContent, type StickerEventContent } from "./events.ts";
|
||||
import { type MCallAnswer, type MCallBase, type MCallCandidates, type MCallHangupReject, type MCallInviteNegotiate, type MCallReplacesEvent, type MCallSelectAnswer, type SDPStreamMetadata } from "../webrtc/callEventTypes.ts";
|
||||
import { type IRTCNotificationContent, type IRTCDeclineContent, type EncryptionKeysEventContent, type ICallNotifyContent, type RtcSlotEventContent } from "../matrixrtc/types.ts";
|
||||
import { type M_POLL_END, type M_POLL_START, type PollEndEventContent, type PollStartEventContent } from "./polls.ts";
|
||||
import { type RtcMembershipData, type SessionMembershipData } from "../matrixrtc/membershipData/index.ts";
|
||||
import { type LocalNotificationSettings } from "./local_notifications.ts";
|
||||
import { type IPushRules } from "./PushRules.ts";
|
||||
import { type SecretInfo, type SecretStorageKeyDescription } from "../secret-storage.ts";
|
||||
import { type POLICIES_ACCOUNT_EVENT_TYPE } from "../models/invites-ignorer-types.ts";
|
||||
import type { ROOM_RETENTION_TYPE, RoomRetentionContent } from "./retention.ts";
|
||||
import { UnstableValue } from "../NamespacedValue";
|
||||
export declare enum EventType {
|
||||
RoomCanonicalAlias = "m.room.canonical_alias",
|
||||
RoomCreate = "m.room.create",
|
||||
@@ -32,9 +16,6 @@ export declare enum EventType {
|
||||
RoomServerAcl = "m.room.server_acl",
|
||||
RoomTombstone = "m.room.tombstone",
|
||||
RoomPredecessor = "org.matrix.msc3946.room_predecessor",
|
||||
PolicyRuleUser = "m.policy.rule.user",
|
||||
PolicyRuleRoom = "m.policy.rule.room",
|
||||
PolicyRuleServer = "m.policy.rule.server",
|
||||
SpaceChild = "m.space.child",
|
||||
SpaceParent = "m.space.parent",
|
||||
RoomRedaction = "m.room.redaction",
|
||||
@@ -53,7 +34,6 @@ export declare enum EventType {
|
||||
CallReplaces = "m.call.replaces",
|
||||
CallAssertedIdentity = "m.call.asserted_identity",
|
||||
CallAssertedIdentityPrefix = "org.matrix.call.asserted_identity",
|
||||
CallEncryptionKeysPrefix = "io.element.call.encryption_keys",
|
||||
KeyVerificationRequest = "m.key.verification.request",
|
||||
KeyVerificationStart = "m.key.verification.start",
|
||||
KeyVerificationCancel = "m.key.verification.cancel",
|
||||
@@ -70,28 +50,16 @@ export declare enum EventType {
|
||||
Presence = "m.presence",
|
||||
FullyRead = "m.fully_read",
|
||||
Tag = "m.tag",
|
||||
SpaceOrder = "org.matrix.msc3230.space_order",// MSC3230
|
||||
MarkedUnread = "m.marked_unread",
|
||||
SpaceOrder = "org.matrix.msc3230.space_order",
|
||||
PushRules = "m.push_rules",
|
||||
Direct = "m.direct",
|
||||
IgnoredUserList = "m.ignored_user_list",
|
||||
InvitePermissionConfig = "m.invite_permission_config",// MSC4380
|
||||
RoomKey = "m.room_key",
|
||||
RoomKeyRequest = "m.room_key_request",
|
||||
ForwardedRoomKey = "m.forwarded_room_key",
|
||||
Dummy = "m.dummy",
|
||||
SecretRequest = "m.secret.request",
|
||||
SecretSend = "m.secret.send",
|
||||
GroupCallPrefix = "org.matrix.msc3401.call",
|
||||
GroupCallMemberPrefix = "org.matrix.msc3401.call.member",
|
||||
RTCSlot = "org.matrix.msc4143.rtc.slot",
|
||||
RTCMembership = "org.matrix.msc4143.rtc.member",
|
||||
CallNotify = "org.matrix.msc4075.call.notify",
|
||||
RTCNotification = "org.matrix.msc4075.rtc.notification",
|
||||
RTCDecline = "org.matrix.msc4310.rtc.decline",
|
||||
RoomPolicy = "org.matrix.msc4284.policy",
|
||||
RetentionPolicy = "m.room.retention",
|
||||
RetentionPolicyUnstable = "org.matrix.msc1763.retention"
|
||||
GroupCallMemberPrefix = "org.matrix.msc3401.call.member"
|
||||
}
|
||||
export declare enum RelationType {
|
||||
Annotation = "m.annotation",
|
||||
@@ -213,160 +181,20 @@ export declare const LOCAL_NOTIFICATION_SETTINGS_PREFIX: UnstableValue<"m.local_
|
||||
* @experimental
|
||||
*/
|
||||
export declare const UNSIGNED_THREAD_ID_FIELD: UnstableValue<"thread_id", "org.matrix.msc4023.thread_id">;
|
||||
/**
|
||||
* https://github.com/matrix-org/matrix-spec-proposals/pull/4115
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export declare const UNSIGNED_MEMBERSHIP_FIELD: NamespacedValue<"membership", "io.element.msc4115.membership">;
|
||||
/**
|
||||
* Mapped type from event type to content type for all specified non-state room events.
|
||||
*/
|
||||
export interface TimelineEvents {
|
||||
[EventType.RoomMessage]: RoomMessageEventContent;
|
||||
[EventType.Sticker]: StickerEventContent;
|
||||
[EventType.Reaction]: ReactionEventContent;
|
||||
[EventType.CallReplaces]: MCallReplacesEvent;
|
||||
[EventType.CallAnswer]: MCallAnswer;
|
||||
[EventType.CallSelectAnswer]: MCallSelectAnswer;
|
||||
[EventType.CallNegotiate]: Omit<MCallInviteNegotiate, "offer">;
|
||||
[EventType.CallInvite]: MCallInviteNegotiate;
|
||||
[EventType.CallCandidates]: MCallCandidates;
|
||||
[EventType.CallHangup]: MCallHangupReject;
|
||||
[EventType.CallReject]: MCallHangupReject;
|
||||
[EventType.CallSDPStreamMetadataChangedPrefix]: MCallBase & EitherAnd<{
|
||||
sdp_stream_metadata: SDPStreamMetadata;
|
||||
}, {
|
||||
"org.matrix.msc3077.sdp_stream_metadata": SDPStreamMetadata;
|
||||
}>;
|
||||
[EventType.CallSDPStreamMetadataChanged]: MCallBase & EitherAnd<{
|
||||
sdp_stream_metadata: SDPStreamMetadata;
|
||||
}, {
|
||||
"org.matrix.msc3077.sdp_stream_metadata": SDPStreamMetadata;
|
||||
}>;
|
||||
[EventType.CallEncryptionKeysPrefix]: EncryptionKeysEventContent;
|
||||
[EventType.CallNotify]: ICallNotifyContent;
|
||||
[EventType.RTCNotification]: IRTCNotificationContent;
|
||||
[EventType.RTCDecline]: IRTCDeclineContent;
|
||||
[M_BEACON.name]: MBeaconEventContent;
|
||||
[M_POLL_START.name]: PollStartEventContent;
|
||||
[M_POLL_END.name]: PollEndEventContent;
|
||||
[EventType.RTCMembership]: RtcMembershipData | {
|
||||
msc4354_sticky_key: string;
|
||||
export interface IEncryptedFile {
|
||||
url: string;
|
||||
mimetype?: string;
|
||||
key: {
|
||||
alg: string;
|
||||
key_ops: string[];
|
||||
kty: string;
|
||||
k: string;
|
||||
ext: boolean;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Mapped type from event type to content type for all specified room state events.
|
||||
*/
|
||||
export interface StateEvents {
|
||||
[EventType.RoomCanonicalAlias]: RoomCanonicalAliasEventContent;
|
||||
[EventType.RoomCreate]: RoomCreateEventContent;
|
||||
[EventType.RoomJoinRules]: RoomJoinRulesEventContent;
|
||||
[EventType.RoomMember]: RoomMemberEventContent;
|
||||
[EventType.RoomThirdPartyInvite]: RoomThirdPartyInviteEventContent | EmptyObject;
|
||||
[EventType.RoomPowerLevels]: RoomPowerLevelsEventContent;
|
||||
[EventType.RoomName]: RoomNameEventContent;
|
||||
[EventType.RoomTopic]: RoomTopicEventContent;
|
||||
[EventType.RoomAvatar]: RoomAvatarEventContent;
|
||||
[EventType.RoomPinnedEvents]: RoomPinnedEventsEventContent;
|
||||
[EventType.RoomEncryption]: RoomEncryptionEventContent;
|
||||
[EventType.RoomHistoryVisibility]: RoomHistoryVisibilityEventContent;
|
||||
[EventType.RoomGuestAccess]: RoomGuestAccessEventContent;
|
||||
[EventType.RoomServerAcl]: RoomServerAclEventContent;
|
||||
[EventType.RoomTombstone]: RoomTombstoneEventContent;
|
||||
[EventType.SpaceChild]: SpaceChildEventContent;
|
||||
[EventType.SpaceParent]: SpaceParentEventContent;
|
||||
[EventType.PolicyRuleUser]: PolicyRuleEventContent | EmptyObject;
|
||||
[EventType.PolicyRuleRoom]: PolicyRuleEventContent | EmptyObject;
|
||||
[EventType.PolicyRuleServer]: PolicyRuleEventContent | EmptyObject;
|
||||
[EventType.RoomPolicy]: RoomPolicyContent | EmptyObject;
|
||||
[EventType.GroupCallPrefix]: IGroupCallRoomState;
|
||||
[EventType.GroupCallMemberPrefix]: IGroupCallRoomMemberState | SessionMembershipData | EmptyObject;
|
||||
[EventType.RTCMembership]: RtcMembershipData | EmptyObject;
|
||||
[EventType.RTCSlot]: RtcSlotEventContent | EmptyObject;
|
||||
[UNSTABLE_MSC3089_BRANCH.name]: MSC3089EventContent;
|
||||
[M_BEACON_INFO.name]: MBeaconInfoEventContent;
|
||||
[ROOM_RETENTION_TYPE.name]: RoomRetentionContent | EmptyObject;
|
||||
[ROOM_RETENTION_TYPE.altName]: RoomRetentionContent | EmptyObject;
|
||||
}
|
||||
/**
|
||||
* Mapped type from event type to content type for all specified room-specific account_data events.
|
||||
*/
|
||||
export interface RoomAccountDataEvents extends SecretStorageAccountDataEvents {
|
||||
[EventType.FullyRead]: {
|
||||
event_id: string;
|
||||
iv: string;
|
||||
hashes: {
|
||||
[alg: string]: string;
|
||||
};
|
||||
[EventType.Tag]: {
|
||||
tags: {
|
||||
[name: string]: {
|
||||
order?: number;
|
||||
};
|
||||
};
|
||||
};
|
||||
[EventType.SpaceOrder]: {
|
||||
order: string;
|
||||
};
|
||||
[EventType.MarkedUnread]: {
|
||||
unread: boolean;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Mapped type from event type to content type for all specified global account_data events.
|
||||
*/
|
||||
export interface AccountDataEvents extends SecretStorageAccountDataEvents {
|
||||
[EventType.PushRules]: IPushRules;
|
||||
[EventType.Direct]: {
|
||||
[userId: string]: string[];
|
||||
};
|
||||
[EventType.IgnoredUserList]: {
|
||||
ignored_users: {
|
||||
[userId: string]: EmptyObject;
|
||||
};
|
||||
};
|
||||
"m.secret_storage.default_key": {
|
||||
key: string;
|
||||
};
|
||||
"m.key_backup": {
|
||||
enabled: boolean;
|
||||
};
|
||||
"m.org.matrix.custom.backup_disabled": {
|
||||
disabled: boolean;
|
||||
};
|
||||
"m.identity_server": {
|
||||
base_url: string | null;
|
||||
};
|
||||
[key: `${typeof LOCAL_NOTIFICATION_SETTINGS_PREFIX.name}.${string}`]: LocalNotificationSettings;
|
||||
[key: `m.secret_storage.key.${string}`]: SecretStorageKeyDescription;
|
||||
[POLICIES_ACCOUNT_EVENT_TYPE.name]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
[POLICIES_ACCOUNT_EVENT_TYPE.altName]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
[EventType.InvitePermissionConfig]: {
|
||||
default_action?: string;
|
||||
};
|
||||
"m.recent_emoji": {
|
||||
recent_emoji: Array<{
|
||||
emoji: string;
|
||||
total: number;
|
||||
}>;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Subset of AccountDataEvents, excluding events specified in https://spec.matrix.org/v1.17/client-server-api/#server-behaviour-12
|
||||
*/
|
||||
export type WritableAccountDataEvents = Exclude<AccountDataEvents, "m.fully_read" | "m.push_rules">;
|
||||
/**
|
||||
* Mapped type from event type to content type for all specified global events encrypted by secret storage.
|
||||
*
|
||||
* See https://spec.matrix.org/v1.13/client-server-api/#msecret_storagev1aes-hmac-sha2-1
|
||||
*/
|
||||
export interface SecretStorageAccountDataEvents {
|
||||
"m.megolm_backup.v1": SecretInfo;
|
||||
"m.cross_signing.master": SecretInfo;
|
||||
"m.cross_signing.self_signing": SecretInfo;
|
||||
"m.cross_signing.user_signing": SecretInfo;
|
||||
"org.matrix.msc3814": SecretInfo;
|
||||
v: string;
|
||||
}
|
||||
//# sourceMappingURL=event.d.ts.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/event.d.ts.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/event.d.ts.map
generated
vendored
File diff suppressed because one or more lines are too long
135
node_modules/matrix-js-sdk/lib/@types/event.js
generated
vendored
135
node_modules/matrix-js-sdk/lib/@types/event.js
generated
vendored
@@ -1,5 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.UNSTABLE_MSC3089_TREE_SUBTYPE = exports.UNSTABLE_MSC3089_LEAF = exports.UNSTABLE_MSC3089_BRANCH = exports.UNSTABLE_MSC3088_PURPOSE = exports.UNSTABLE_MSC3088_ENABLED = exports.UNSTABLE_MSC2716_MARKER = exports.UNSTABLE_ELEMENT_FUNCTIONAL_USERS = exports.UNSIGNED_THREAD_ID_FIELD = exports.ToDeviceMessageId = exports.RoomType = exports.RoomCreateTypeField = exports.RelationType = exports.PUSHER_ENABLED = exports.PUSHER_DEVICE_ID = exports.MsgType = exports.MSC3912_RELATION_BASED_REDACTIONS_PROP = exports.LOCAL_NOTIFICATION_SETTINGS_PREFIX = exports.EventType = exports.EVENT_VISIBILITY_CHANGE_TYPE = void 0;
|
||||
var _NamespacedValue = require("../NamespacedValue");
|
||||
/*
|
||||
Copyright 2020-2026 The Matrix.org Foundation C.I.C.
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -13,10 +20,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { NamespacedValue, UnstableValue } from "../NamespacedValue.js";
|
||||
export let EventType = /*#__PURE__*/function (EventType) {
|
||||
// Room state events
|
||||
let EventType = /*#__PURE__*/function (EventType) {
|
||||
EventType["RoomCanonicalAlias"] = "m.room.canonical_alias";
|
||||
EventType["RoomCreate"] = "m.room.create";
|
||||
EventType["RoomJoinRules"] = "m.room.join_rules";
|
||||
@@ -33,13 +37,8 @@ export let EventType = /*#__PURE__*/function (EventType) {
|
||||
EventType["RoomServerAcl"] = "m.room.server_acl";
|
||||
EventType["RoomTombstone"] = "m.room.tombstone";
|
||||
EventType["RoomPredecessor"] = "org.matrix.msc3946.room_predecessor";
|
||||
// Moderation policy lists
|
||||
EventType["PolicyRuleUser"] = "m.policy.rule.user";
|
||||
EventType["PolicyRuleRoom"] = "m.policy.rule.room";
|
||||
EventType["PolicyRuleServer"] = "m.policy.rule.server";
|
||||
EventType["SpaceChild"] = "m.space.child";
|
||||
EventType["SpaceParent"] = "m.space.parent";
|
||||
// Room timeline events
|
||||
EventType["RoomRedaction"] = "m.room.redaction";
|
||||
EventType["RoomMessage"] = "m.room.message";
|
||||
EventType["RoomMessageEncrypted"] = "m.room.encrypted";
|
||||
@@ -56,7 +55,6 @@ export let EventType = /*#__PURE__*/function (EventType) {
|
||||
EventType["CallReplaces"] = "m.call.replaces";
|
||||
EventType["CallAssertedIdentity"] = "m.call.asserted_identity";
|
||||
EventType["CallAssertedIdentityPrefix"] = "org.matrix.call.asserted_identity";
|
||||
EventType["CallEncryptionKeysPrefix"] = "io.element.call.encryption_keys";
|
||||
EventType["KeyVerificationRequest"] = "m.key.verification.request";
|
||||
EventType["KeyVerificationStart"] = "m.key.verification.start";
|
||||
EventType["KeyVerificationCancel"] = "m.key.verification.cancel";
|
||||
@@ -64,62 +62,37 @@ export let EventType = /*#__PURE__*/function (EventType) {
|
||||
EventType["KeyVerificationDone"] = "m.key.verification.done";
|
||||
EventType["KeyVerificationKey"] = "m.key.verification.key";
|
||||
EventType["KeyVerificationAccept"] = "m.key.verification.accept";
|
||||
// Not used directly - see READY_TYPE in VerificationRequest.
|
||||
EventType["KeyVerificationReady"] = "m.key.verification.ready";
|
||||
// use of this is discouraged https://matrix.org/docs/spec/client_server/r0.6.1#m-room-message-feedback
|
||||
EventType["RoomMessageFeedback"] = "m.room.message.feedback";
|
||||
EventType["Reaction"] = "m.reaction";
|
||||
EventType["PollStart"] = "org.matrix.msc3381.poll.start";
|
||||
// Room ephemeral events
|
||||
EventType["Typing"] = "m.typing";
|
||||
EventType["Receipt"] = "m.receipt";
|
||||
EventType["Presence"] = "m.presence";
|
||||
// Room account_data events
|
||||
EventType["FullyRead"] = "m.fully_read";
|
||||
EventType["Tag"] = "m.tag";
|
||||
EventType["SpaceOrder"] = "org.matrix.msc3230.space_order";
|
||||
// MSC3230
|
||||
EventType["MarkedUnread"] = "m.marked_unread";
|
||||
// User account_data events
|
||||
EventType["PushRules"] = "m.push_rules";
|
||||
EventType["Direct"] = "m.direct";
|
||||
EventType["IgnoredUserList"] = "m.ignored_user_list";
|
||||
EventType["InvitePermissionConfig"] = "m.invite_permission_config";
|
||||
// MSC4380
|
||||
// to_device events
|
||||
EventType["RoomKey"] = "m.room_key";
|
||||
EventType["RoomKeyRequest"] = "m.room_key_request";
|
||||
EventType["ForwardedRoomKey"] = "m.forwarded_room_key";
|
||||
EventType["Dummy"] = "m.dummy";
|
||||
EventType["SecretRequest"] = "m.secret.request";
|
||||
EventType["SecretSend"] = "m.secret.send";
|
||||
// Group call events
|
||||
EventType["GroupCallPrefix"] = "org.matrix.msc3401.call";
|
||||
EventType["GroupCallMemberPrefix"] = "org.matrix.msc3401.call.member";
|
||||
// MatrixRTC events
|
||||
EventType["RTCSlot"] = "org.matrix.msc4143.rtc.slot";
|
||||
EventType["RTCMembership"] = "org.matrix.msc4143.rtc.member";
|
||||
EventType["CallNotify"] = "org.matrix.msc4075.call.notify";
|
||||
EventType["RTCNotification"] = "org.matrix.msc4075.rtc.notification";
|
||||
EventType["RTCDecline"] = "org.matrix.msc4310.rtc.decline";
|
||||
// Policy servers
|
||||
EventType["RoomPolicy"] = "org.matrix.msc4284.policy";
|
||||
// Retention
|
||||
EventType["RetentionPolicy"] = "m.room.retention";
|
||||
EventType["RetentionPolicyUnstable"] = "org.matrix.msc1763.retention";
|
||||
return EventType;
|
||||
}({});
|
||||
export let RelationType = /*#__PURE__*/function (RelationType) {
|
||||
exports.EventType = EventType;
|
||||
let RelationType = /*#__PURE__*/function (RelationType) {
|
||||
RelationType["Annotation"] = "m.annotation";
|
||||
RelationType["Replace"] = "m.replace";
|
||||
RelationType["Reference"] = "m.reference";
|
||||
// Don't use this yet: it's only the stable version. The code still assumes we support the unstable prefix and,
|
||||
// moreover, our tests currently use the unstable prefix. Use THREAD_RELATION_TYPE.name.
|
||||
// Once we support *only* the stable prefix, THREAD_RELATION_TYPE can die and we can switch to this.
|
||||
RelationType["Thread"] = "m.thread";
|
||||
return RelationType;
|
||||
}({});
|
||||
export let MsgType = /*#__PURE__*/function (MsgType) {
|
||||
exports.RelationType = RelationType;
|
||||
let MsgType = /*#__PURE__*/function (MsgType) {
|
||||
MsgType["Text"] = "m.text";
|
||||
MsgType["Emote"] = "m.emote";
|
||||
MsgType["Notice"] = "m.notice";
|
||||
@@ -131,49 +104,57 @@ export let MsgType = /*#__PURE__*/function (MsgType) {
|
||||
MsgType["KeyVerificationRequest"] = "m.key.verification.request";
|
||||
return MsgType;
|
||||
}({});
|
||||
export const RoomCreateTypeField = "type";
|
||||
export let RoomType = /*#__PURE__*/function (RoomType) {
|
||||
exports.MsgType = MsgType;
|
||||
const RoomCreateTypeField = "type";
|
||||
exports.RoomCreateTypeField = RoomCreateTypeField;
|
||||
let RoomType = /*#__PURE__*/function (RoomType) {
|
||||
RoomType["Space"] = "m.space";
|
||||
RoomType["UnstableCall"] = "org.matrix.msc3417.call";
|
||||
RoomType["ElementVideo"] = "io.element.video";
|
||||
return RoomType;
|
||||
}({});
|
||||
export const ToDeviceMessageId = "org.matrix.msgid";
|
||||
exports.RoomType = RoomType;
|
||||
const ToDeviceMessageId = "org.matrix.msgid";
|
||||
|
||||
/**
|
||||
* Identifier for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)
|
||||
* room purpose. Note that this reference is UNSTABLE and subject to breaking changes,
|
||||
* including its eventual removal.
|
||||
*/
|
||||
export const UNSTABLE_MSC3088_PURPOSE = new UnstableValue("m.room.purpose", "org.matrix.msc3088.purpose");
|
||||
exports.ToDeviceMessageId = ToDeviceMessageId;
|
||||
const UNSTABLE_MSC3088_PURPOSE = new _NamespacedValue.UnstableValue("m.room.purpose", "org.matrix.msc3088.purpose");
|
||||
|
||||
/**
|
||||
* Enabled flag for an [MSC3088](https://github.com/matrix-org/matrix-doc/pull/3088)
|
||||
* room purpose. Note that this reference is UNSTABLE and subject to breaking changes,
|
||||
* including its eventual removal.
|
||||
*/
|
||||
export const UNSTABLE_MSC3088_ENABLED = new UnstableValue("m.enabled", "org.matrix.msc3088.enabled");
|
||||
exports.UNSTABLE_MSC3088_PURPOSE = UNSTABLE_MSC3088_PURPOSE;
|
||||
const UNSTABLE_MSC3088_ENABLED = new _NamespacedValue.UnstableValue("m.enabled", "org.matrix.msc3088.enabled");
|
||||
|
||||
/**
|
||||
* Subtype for an [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.
|
||||
* Note that this reference is UNSTABLE and subject to breaking changes, including its
|
||||
* eventual removal.
|
||||
*/
|
||||
export const UNSTABLE_MSC3089_TREE_SUBTYPE = new UnstableValue("m.data_tree", "org.matrix.msc3089.data_tree");
|
||||
exports.UNSTABLE_MSC3088_ENABLED = UNSTABLE_MSC3088_ENABLED;
|
||||
const UNSTABLE_MSC3089_TREE_SUBTYPE = new _NamespacedValue.UnstableValue("m.data_tree", "org.matrix.msc3089.data_tree");
|
||||
|
||||
/**
|
||||
* Leaf type for an event in a [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room.
|
||||
* Note that this reference is UNSTABLE and subject to breaking changes, including its
|
||||
* eventual removal.
|
||||
*/
|
||||
export const UNSTABLE_MSC3089_LEAF = new UnstableValue("m.leaf", "org.matrix.msc3089.leaf");
|
||||
exports.UNSTABLE_MSC3089_TREE_SUBTYPE = UNSTABLE_MSC3089_TREE_SUBTYPE;
|
||||
const UNSTABLE_MSC3089_LEAF = new _NamespacedValue.UnstableValue("m.leaf", "org.matrix.msc3089.leaf");
|
||||
|
||||
/**
|
||||
* Branch (Leaf Reference) type for the index approach in a
|
||||
* [MSC3089](https://github.com/matrix-org/matrix-doc/pull/3089) space-room. Note that this reference is
|
||||
* UNSTABLE and subject to breaking changes, including its eventual removal.
|
||||
*/
|
||||
export const UNSTABLE_MSC3089_BRANCH = new UnstableValue("m.branch", "org.matrix.msc3089.branch");
|
||||
exports.UNSTABLE_MSC3089_LEAF = UNSTABLE_MSC3089_LEAF;
|
||||
const UNSTABLE_MSC3089_BRANCH = new _NamespacedValue.UnstableValue("m.branch", "org.matrix.msc3089.branch");
|
||||
|
||||
/**
|
||||
* Marker event type to point back at imported historical content in a room. See
|
||||
@@ -181,13 +162,15 @@ export const UNSTABLE_MSC3089_BRANCH = new UnstableValue("m.branch", "org.matrix
|
||||
* Note that this reference is UNSTABLE and subject to breaking changes,
|
||||
* including its eventual removal.
|
||||
*/
|
||||
export const UNSTABLE_MSC2716_MARKER = new UnstableValue("m.room.marker", "org.matrix.msc2716.marker");
|
||||
exports.UNSTABLE_MSC3089_BRANCH = UNSTABLE_MSC3089_BRANCH;
|
||||
const UNSTABLE_MSC2716_MARKER = new _NamespacedValue.UnstableValue("m.room.marker", "org.matrix.msc2716.marker");
|
||||
|
||||
/**
|
||||
* Name of the request property for relation based redactions.
|
||||
* {@link https://github.com/matrix-org/matrix-spec-proposals/pull/3912}
|
||||
*/
|
||||
export const MSC3912_RELATION_BASED_REDACTIONS_PROP = new UnstableValue("with_rel_types", "org.matrix.msc3912.with_relations");
|
||||
exports.UNSTABLE_MSC2716_MARKER = UNSTABLE_MSC2716_MARKER;
|
||||
const MSC3912_RELATION_BASED_REDACTIONS_PROP = new _NamespacedValue.UnstableValue("with_rel_types", "org.matrix.msc3912.with_relations");
|
||||
|
||||
/**
|
||||
* Functional members type for declaring a purpose of room members (e.g. helpful bots).
|
||||
@@ -211,7 +194,8 @@ export const MSC3912_RELATION_BASED_REDACTIONS_PROP = new UnstableValue("with_re
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export const UNSTABLE_ELEMENT_FUNCTIONAL_USERS = new UnstableValue("io.element.functional_members", "io.element.functional_members");
|
||||
exports.MSC3912_RELATION_BASED_REDACTIONS_PROP = MSC3912_RELATION_BASED_REDACTIONS_PROP;
|
||||
const UNSTABLE_ELEMENT_FUNCTIONAL_USERS = new _NamespacedValue.UnstableValue("io.element.functional_members", "io.element.functional_members");
|
||||
|
||||
/**
|
||||
* A type of message that affects visibility of a message,
|
||||
@@ -219,66 +203,39 @@ export const UNSTABLE_ELEMENT_FUNCTIONAL_USERS = new UnstableValue("io.element.f
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export const EVENT_VISIBILITY_CHANGE_TYPE = new UnstableValue("m.visibility", "org.matrix.msc3531.visibility");
|
||||
exports.UNSTABLE_ELEMENT_FUNCTIONAL_USERS = UNSTABLE_ELEMENT_FUNCTIONAL_USERS;
|
||||
const EVENT_VISIBILITY_CHANGE_TYPE = new _NamespacedValue.UnstableValue("m.visibility", "org.matrix.msc3531.visibility");
|
||||
|
||||
/**
|
||||
* https://github.com/matrix-org/matrix-doc/pull/3881
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export const PUSHER_ENABLED = new UnstableValue("enabled", "org.matrix.msc3881.enabled");
|
||||
exports.EVENT_VISIBILITY_CHANGE_TYPE = EVENT_VISIBILITY_CHANGE_TYPE;
|
||||
const PUSHER_ENABLED = new _NamespacedValue.UnstableValue("enabled", "org.matrix.msc3881.enabled");
|
||||
|
||||
/**
|
||||
* https://github.com/matrix-org/matrix-doc/pull/3881
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export const PUSHER_DEVICE_ID = new UnstableValue("device_id", "org.matrix.msc3881.device_id");
|
||||
exports.PUSHER_ENABLED = PUSHER_ENABLED;
|
||||
const PUSHER_DEVICE_ID = new _NamespacedValue.UnstableValue("device_id", "org.matrix.msc3881.device_id");
|
||||
|
||||
/**
|
||||
* https://github.com/matrix-org/matrix-doc/pull/3890
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export const LOCAL_NOTIFICATION_SETTINGS_PREFIX = new UnstableValue("m.local_notification_settings", "org.matrix.msc3890.local_notification_settings");
|
||||
exports.PUSHER_DEVICE_ID = PUSHER_DEVICE_ID;
|
||||
const LOCAL_NOTIFICATION_SETTINGS_PREFIX = new _NamespacedValue.UnstableValue("m.local_notification_settings", "org.matrix.msc3890.local_notification_settings");
|
||||
|
||||
/**
|
||||
* https://github.com/matrix-org/matrix-doc/pull/4023
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export const UNSIGNED_THREAD_ID_FIELD = new UnstableValue("thread_id", "org.matrix.msc4023.thread_id");
|
||||
|
||||
/**
|
||||
* https://github.com/matrix-org/matrix-spec-proposals/pull/4115
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export const UNSIGNED_MEMBERSHIP_FIELD = new NamespacedValue("membership", "io.element.msc4115.membership");
|
||||
|
||||
/**
|
||||
* Mapped type from event type to content type for all specified non-state room events.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mapped type from event type to content type for all specified room state events.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mapped type from event type to content type for all specified room-specific account_data events.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mapped type from event type to content type for all specified global account_data events.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Subset of AccountDataEvents, excluding events specified in https://spec.matrix.org/v1.17/client-server-api/#server-behaviour-12
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mapped type from event type to content type for all specified global events encrypted by secret storage.
|
||||
*
|
||||
* See https://spec.matrix.org/v1.13/client-server-api/#msecret_storagev1aes-hmac-sha2-1
|
||||
*/
|
||||
exports.LOCAL_NOTIFICATION_SETTINGS_PREFIX = LOCAL_NOTIFICATION_SETTINGS_PREFIX;
|
||||
const UNSIGNED_THREAD_ID_FIELD = new _NamespacedValue.UnstableValue("thread_id", "org.matrix.msc4023.thread_id");
|
||||
exports.UNSIGNED_THREAD_ID_FIELD = UNSIGNED_THREAD_ID_FIELD;
|
||||
//# sourceMappingURL=event.js.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/event.js.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/event.js.map
generated
vendored
File diff suppressed because one or more lines are too long
92
node_modules/matrix-js-sdk/lib/@types/events.d.ts
generated
vendored
92
node_modules/matrix-js-sdk/lib/@types/events.d.ts
generated
vendored
@@ -1,92 +0,0 @@
|
||||
import { type MsgType, type RelationType } from "./event.ts";
|
||||
import { type FileInfo, type ImageInfo, type MediaEventContent } from "./media.ts";
|
||||
import { type XOR } from "./common.ts";
|
||||
interface BaseTimelineEvent {
|
||||
"body": string;
|
||||
"m.mentions"?: {
|
||||
user_ids?: string[];
|
||||
room?: boolean;
|
||||
};
|
||||
}
|
||||
interface ReplyEvent {
|
||||
"m.relates_to"?: {
|
||||
"m.in_reply_to"?: {
|
||||
event_id: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
interface NoRelationEvent {
|
||||
"m.new_content"?: never;
|
||||
"m.relates_to"?: never;
|
||||
}
|
||||
/**
|
||||
* Partial content format of timeline events with rel_type `m.replace`
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.9/client-server-api/#event-replacements
|
||||
*/
|
||||
export interface ReplacementEvent<T> {
|
||||
"m.new_content": T;
|
||||
"m.relates_to": {
|
||||
event_id: string;
|
||||
rel_type: RelationType.Replace;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Partial content format of timeline events with rel_type other than `m.replace`
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.9/client-server-api/#forming-relationships-between-events
|
||||
*/
|
||||
export interface RelationEvent {
|
||||
"m.new_content"?: never;
|
||||
"m.relates_to": {
|
||||
event_id: string;
|
||||
rel_type: Exclude<RelationType, RelationType.Replace>;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Content format of timeline events with type `m.room.message` and `msgtype` `m.text`, `m.emote`, or `m.notice`
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.9/client-server-api/#mroommessage
|
||||
*/
|
||||
export interface RoomMessageTextEventContent extends BaseTimelineEvent {
|
||||
msgtype: MsgType.Text | MsgType.Emote | MsgType.Notice;
|
||||
format?: "org.matrix.custom.html";
|
||||
formatted_body?: string;
|
||||
}
|
||||
/**
|
||||
* Content format of timeline events with type `m.room.message` and `msgtype` `m.location`
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.9/client-server-api/#mlocation
|
||||
*/
|
||||
export interface RoomMessageLocationEventContent extends BaseTimelineEvent {
|
||||
body: string;
|
||||
geo_uri: string;
|
||||
info: Pick<FileInfo, "thumbnail_info" | "thumbnail_file" | "thumbnail_url">;
|
||||
msgtype: MsgType.Location;
|
||||
}
|
||||
type MessageEventContent = RoomMessageTextEventContent | RoomMessageLocationEventContent | MediaEventContent;
|
||||
export type RoomMessageEventContent = BaseTimelineEvent & XOR<XOR<ReplacementEvent<MessageEventContent>, RelationEvent>, XOR<ReplyEvent, NoRelationEvent>> & MessageEventContent;
|
||||
/**
|
||||
* Content format of timeline events with type `m.sticker`
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.9/client-server-api/#msticker
|
||||
*/
|
||||
export interface StickerEventContent extends BaseTimelineEvent {
|
||||
body: string;
|
||||
info: ImageInfo;
|
||||
url: string;
|
||||
}
|
||||
/**
|
||||
* Content format of timeline events with type `m.reaction`
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.9/client-server-api/#mreaction
|
||||
*/
|
||||
export interface ReactionEventContent {
|
||||
"m.relates_to": {
|
||||
event_id: string;
|
||||
key: string;
|
||||
rel_type: RelationType.Annotation;
|
||||
};
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=events.d.ts.map
|
||||
1
node_modules/matrix-js-sdk/lib/@types/events.d.ts.map
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/events.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/@types/events.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAEvC,UAAU,iBAAiB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE;QACX,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,IAAI,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;CACL;AAED,UAAU,UAAU;IAChB,cAAc,CAAC,EAAE;QACb,eAAe,CAAC,EAAE;YACd,QAAQ,EAAE,MAAM,CAAC;SACpB,CAAC;KACL,CAAC;CACL;AAED,UAAU,eAAe;IACrB,eAAe,CAAC,EAAE,KAAK,CAAC;IACxB,cAAc,CAAC,EAAE,KAAK,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAA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MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACjC,cAAc,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC;KACrC,CAAC;CACL"}
|
||||
3
node_modules/matrix-js-sdk/lib/@types/events.js
generated
vendored
3
node_modules/matrix-js-sdk/lib/@types/events.js
generated
vendored
@@ -1,3 +0,0 @@
|
||||
export {};
|
||||
export {};
|
||||
//# sourceMappingURL=events.js.map
|
||||
1
node_modules/matrix-js-sdk/lib/@types/events.js.map
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/events.js.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"events.js","names":[],"sources":["../../src/@types/events.ts"],"sourcesContent":["/*\nCopyright 2024 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type MsgType, type RelationType } from \"./event.ts\";\nimport { type FileInfo, type ImageInfo, type MediaEventContent } from \"./media.ts\";\nimport { type XOR } from \"./common.ts\";\n\ninterface BaseTimelineEvent {\n \"body\": string;\n \"m.mentions\"?: {\n user_ids?: string[];\n room?: boolean;\n };\n}\n\ninterface ReplyEvent {\n \"m.relates_to\"?: {\n \"m.in_reply_to\"?: {\n event_id: string;\n };\n };\n}\n\ninterface NoRelationEvent {\n \"m.new_content\"?: never;\n \"m.relates_to\"?: never;\n}\n\n/**\n * Partial content format of timeline events with rel_type `m.replace`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#event-replacements\n */\nexport interface ReplacementEvent<T> {\n \"m.new_content\": T;\n \"m.relates_to\": {\n event_id: string;\n rel_type: RelationType.Replace;\n };\n}\n\n/**\n * Partial content format of timeline events with rel_type other than `m.replace`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#forming-relationships-between-events\n */\nexport interface RelationEvent {\n \"m.new_content\"?: never;\n \"m.relates_to\": {\n event_id: string;\n rel_type: Exclude<RelationType, RelationType.Replace>;\n };\n}\n\n/**\n * Content format of timeline events with type `m.room.message` and `msgtype` `m.text`, `m.emote`, or `m.notice`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#mroommessage\n */\nexport interface RoomMessageTextEventContent extends BaseTimelineEvent {\n msgtype: MsgType.Text | MsgType.Emote | MsgType.Notice;\n format?: \"org.matrix.custom.html\";\n formatted_body?: string;\n}\n\n/**\n * Content format of timeline events with type `m.room.message` and `msgtype` `m.location`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#mlocation\n */\nexport interface RoomMessageLocationEventContent extends BaseTimelineEvent {\n body: string;\n geo_uri: string;\n info: Pick<FileInfo, \"thumbnail_info\" | \"thumbnail_file\" | \"thumbnail_url\">;\n msgtype: MsgType.Location;\n}\n\ntype MessageEventContent = RoomMessageTextEventContent | RoomMessageLocationEventContent | MediaEventContent;\n\nexport type RoomMessageEventContent = BaseTimelineEvent &\n XOR<XOR<ReplacementEvent<MessageEventContent>, RelationEvent>, XOR<ReplyEvent, NoRelationEvent>> &\n MessageEventContent;\n\n/**\n * Content format of timeline events with type `m.sticker`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#msticker\n */\nexport interface StickerEventContent extends BaseTimelineEvent {\n body: string;\n info: ImageInfo;\n url: string;\n}\n\n/**\n * Content format of timeline events with type `m.reaction`\n *\n * @see https://spec.matrix.org/v1.9/client-server-api/#mreaction\n */\nexport interface ReactionEventContent {\n \"m.relates_to\": {\n event_id: string;\n key: string;\n rel_type: RelationType.Annotation;\n };\n}\n"],"mappings":"","ignoreList":[]}
|
||||
8
node_modules/matrix-js-sdk/lib/@types/extensible_events.d.ts
generated
vendored
8
node_modules/matrix-js-sdk/lib/@types/extensible_events.d.ts
generated
vendored
@@ -1,4 +1,4 @@
|
||||
import { type EitherAnd, NamespacedValue, UnstableValue } from "matrix-events-sdk";
|
||||
import { EitherAnd, NamespacedValue, Optional, UnstableValue } from "matrix-events-sdk";
|
||||
/**
|
||||
* Represents the stable and unstable values of a given namespace.
|
||||
*/
|
||||
@@ -70,11 +70,11 @@ export type AnyRelation = TSNamespace<typeof REFERENCE_RELATION> | string;
|
||||
/**
|
||||
* An m.relates_to relationship
|
||||
*/
|
||||
export type RelatesToRelationship<R = never> = {
|
||||
export type RelatesToRelationship<R = never, C = never> = {
|
||||
"m.relates_to": {
|
||||
rel_type: [R] extends [never] ? AnyRelation : TSNamespace<R>;
|
||||
event_id: string;
|
||||
};
|
||||
} & DefaultNever<C, {}>;
|
||||
};
|
||||
/**
|
||||
* Partial types for a Matrix Event.
|
||||
@@ -94,5 +94,5 @@ export type ExtensibleEventType = NamespacedValue<string, string> | string;
|
||||
* @param expected - The expected event type.
|
||||
* @returns True if the given type matches the expected type.
|
||||
*/
|
||||
export declare function isEventTypeSame(given: ExtensibleEventType | null, expected: ExtensibleEventType | null): boolean;
|
||||
export declare function isEventTypeSame(given: Optional<ExtensibleEventType>, expected: Optional<ExtensibleEventType>): boolean;
|
||||
//# sourceMappingURL=extensible_events.d.ts.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/extensible_events.d.ts.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/extensible_events.d.ts.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"extensible_events.d.ts","sourceRoot":"","sources":["../../src/@types/extensible_events.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMnF;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IACrB,CAAC,SAAS,eAAe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kB,wCAAqC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,kBAAkB,CAAC,GAAG,MAAM,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,IAAI;IACtD,cAAc,EAAE;QAEZ,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAC7D,QAAQ,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,QAAQ;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,QAAQ,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC;AAE3E;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC3B,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC,EACpC,QAAQ,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GACxC,OAAO,CAmBT"}
|
||||
32
node_modules/matrix-js-sdk/lib/@types/extensible_events.js
generated
vendored
32
node_modules/matrix-js-sdk/lib/@types/extensible_events.js
generated
vendored
@@ -1,3 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.REFERENCE_RELATION = exports.M_TEXT = exports.M_MESSAGE = exports.M_HTML = void 0;
|
||||
exports.isEventTypeSame = isEventTypeSame;
|
||||
var _matrixEventsSdk = require("matrix-events-sdk");
|
||||
var _utilities = require("../extensible_events_v1/utilities");
|
||||
/*
|
||||
Copyright 2021 - 2023 The Matrix.org Foundation C.I.C.
|
||||
|
||||
@@ -14,9 +23,6 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { NamespacedValue, UnstableValue } from "matrix-events-sdk";
|
||||
import { isProvided } from "../extensible_events_v1/utilities.js";
|
||||
|
||||
// Types and utilities for MSC1767: Extensible events (version 1) in Matrix
|
||||
|
||||
/**
|
||||
@@ -36,7 +42,7 @@ import { isProvided } from "../extensible_events_v1/utilities.js";
|
||||
/**
|
||||
* The namespaced value for m.message
|
||||
*/
|
||||
export const M_MESSAGE = new UnstableValue("m.message", "org.matrix.msc1767.message");
|
||||
const M_MESSAGE = new _matrixEventsSdk.UnstableValue("m.message", "org.matrix.msc1767.message");
|
||||
|
||||
/**
|
||||
* An m.message event rendering
|
||||
@@ -45,20 +51,20 @@ export const M_MESSAGE = new UnstableValue("m.message", "org.matrix.msc1767.mess
|
||||
/**
|
||||
* The content for an m.message event
|
||||
*/
|
||||
|
||||
exports.M_MESSAGE = M_MESSAGE;
|
||||
/**
|
||||
* The namespaced value for m.text
|
||||
*/
|
||||
export const M_TEXT = new UnstableValue("m.text", "org.matrix.msc1767.text");
|
||||
const M_TEXT = new _matrixEventsSdk.UnstableValue("m.text", "org.matrix.msc1767.text");
|
||||
|
||||
/**
|
||||
* The content for an m.text event
|
||||
*/
|
||||
|
||||
exports.M_TEXT = M_TEXT;
|
||||
/**
|
||||
* The namespaced value for m.html
|
||||
*/
|
||||
export const M_HTML = new UnstableValue("m.html", "org.matrix.msc1767.html");
|
||||
const M_HTML = new _matrixEventsSdk.UnstableValue("m.html", "org.matrix.msc1767.html");
|
||||
|
||||
/**
|
||||
* The content for an m.html event
|
||||
@@ -67,11 +73,11 @@ export const M_HTML = new UnstableValue("m.html", "org.matrix.msc1767.html");
|
||||
/**
|
||||
* The content for an m.message, m.text, or m.html event
|
||||
*/
|
||||
|
||||
exports.M_HTML = M_HTML;
|
||||
/**
|
||||
* The namespaced value for an m.reference relation
|
||||
*/
|
||||
export const REFERENCE_RELATION = new NamespacedValue("m.reference");
|
||||
const REFERENCE_RELATION = new _matrixEventsSdk.NamespacedValue("m.reference");
|
||||
|
||||
/**
|
||||
* Represents any relation type
|
||||
@@ -88,7 +94,7 @@ export const REFERENCE_RELATION = new NamespacedValue("m.reference");
|
||||
/**
|
||||
* Represents a potentially namespaced event type.
|
||||
*/
|
||||
|
||||
exports.REFERENCE_RELATION = REFERENCE_RELATION;
|
||||
/**
|
||||
* Determines if two event types are the same, including namespaces.
|
||||
* @param given - The given event type. This will be compared
|
||||
@@ -96,7 +102,7 @@ export const REFERENCE_RELATION = new NamespacedValue("m.reference");
|
||||
* @param expected - The expected event type.
|
||||
* @returns True if the given type matches the expected type.
|
||||
*/
|
||||
export function isEventTypeSame(given, expected) {
|
||||
function isEventTypeSame(given, expected) {
|
||||
if (typeof given === "string") {
|
||||
if (typeof expected === "string") {
|
||||
return expected === given;
|
||||
@@ -109,7 +115,7 @@ export function isEventTypeSame(given, expected) {
|
||||
} else {
|
||||
const expectedNs = expected;
|
||||
const givenNs = given;
|
||||
return expectedNs.matches(givenNs.name) || isProvided(givenNs.altName) && expectedNs.matches(givenNs.altName);
|
||||
return expectedNs.matches(givenNs.name) || (0, _utilities.isProvided)(givenNs.altName) && expectedNs.matches(givenNs.altName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
node_modules/matrix-js-sdk/lib/@types/extensible_events.js.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/extensible_events.js.map
generated
vendored
File diff suppressed because one or more lines are too long
21
node_modules/matrix-js-sdk/lib/@types/global.d.js
generated
vendored
21
node_modules/matrix-js-sdk/lib/@types/global.d.js
generated
vendored
@@ -1,18 +1,7 @@
|
||||
/*
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
"use strict";
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
export {};
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
require("@matrix-org/olm");
|
||||
//# sourceMappingURL=global.d.js.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/global.d.js.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/global.d.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"global.d.js","names":[],"sources":["../../src/@types/global.d.ts"],"sourcesContent":["/*\nCopyright 2020 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nexport {};\n\ndeclare global {\n // use `number` as the return type in all cases for globalThis.set{Interval,Timeout},\n // so we don't accidentally use the methods on NodeJS.Timeout - they only exist in a subset of environments.\n // The overload for clear{Interval,Timeout} is resolved as expected.\n // We use `ReturnType<typeof setTimeout>` in the code to be agnostic of if this definition gets loaded.\n function setInterval(handler: TimerHandler, timeout: number, ...args: any[]): number;\n function setTimeout(handler: TimerHandler, timeout: number, ...args: any[]): number;\n\n namespace NodeJS {\n interface Global {\n // marker variable used to detect both the browser & node entrypoints being used at once\n __js_sdk_entrypoint: unknown;\n }\n }\n\n // Chrome-specific getUserMedia constraints\n interface MediaTrackConstraints {\n mandatory?: {\n chromeMediaSource: string;\n chromeMediaSourceId: string;\n };\n }\n\n interface Navigator {\n // We check for the webkit-prefixed getUserMedia to detect if we're\n // on webkit: we should check if we still need to do this\n webkitGetUserMedia?: unknown;\n }\n\n export interface Uint8ArrayToBase64Options {\n alphabet?: \"base64\" | \"base64url\";\n omitPadding?: boolean;\n }\n\n interface Uint8Array {\n // https://tc39.es/proposal-arraybuffer-base64/spec/#sec-uint8array.prototype.tobase64\n toBase64?(options?: Uint8ArrayToBase64Options): string;\n }\n\n export interface Uint8ArrayFromBase64Options {\n alphabet?: \"base64\"; // Our fallback code only handles base64.\n lastChunkHandling?: \"loose\"; // Our fallback code doesn't support other handling at this time.\n }\n\n interface Uint8ArrayConstructor {\n // https://tc39.es/proposal-arraybuffer-base64/spec/#sec-uint8array.frombase64\n fromBase64?(base64: string, options?: Uint8ArrayFromBase64Options): Uint8Array<ArrayBuffer>;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA","ignoreList":[]}
|
||||
{"version":3,"file":"global.d.js","names":["require"],"sources":["../../src/@types/global.d.ts"],"sourcesContent":["/*\nCopyright 2020 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// this is needed to tell TS about global.Olm\nimport \"@matrix-org/olm\";\n\nexport {};\n\ndeclare global {\n // use `number` as the return type in all cases for global.set{Interval,Timeout},\n // so we don't accidentally use the methods on NodeJS.Timeout - they only exist in a subset of environments.\n // The overload for clear{Interval,Timeout} is resolved as expected.\n // We use `ReturnType<typeof setTimeout>` in the code to be agnostic of if this definition gets loaded.\n function setInterval(handler: TimerHandler, timeout: number, ...arguments: any[]): number;\n function setTimeout(handler: TimerHandler, timeout: number, ...arguments: any[]): number;\n\n namespace NodeJS {\n interface Global {\n localStorage: Storage;\n // marker variable used to detect both the browser & node entrypoints being used at once\n __js_sdk_entrypoint: unknown;\n }\n }\n\n interface Window {\n webkitAudioContext: typeof AudioContext;\n }\n\n interface Crypto {\n webkitSubtle?: Window[\"crypto\"][\"subtle\"];\n }\n\n interface MediaDevices {\n // This is experimental and types don't know about it yet\n // https://github.com/microsoft/TypeScript/issues/33232\n getDisplayMedia(constraints: MediaStreamConstraints | DesktopCapturerConstraints): Promise<MediaStream>;\n getUserMedia(constraints: MediaStreamConstraints | DesktopCapturerConstraints): Promise<MediaStream>;\n }\n\n interface DesktopCapturerConstraints {\n audio:\n | boolean\n | {\n mandatory: {\n chromeMediaSource: string;\n chromeMediaSourceId: string;\n };\n };\n video:\n | boolean\n | {\n mandatory: {\n chromeMediaSource: string;\n chromeMediaSourceId: string;\n };\n };\n }\n\n interface DummyInterfaceWeShouldntBeUsingThis {}\n\n interface Navigator {\n // We check for the webkit-prefixed getUserMedia to detect if we're\n // on webkit: we should check if we still need to do this\n webkitGetUserMedia: DummyInterfaceWeShouldntBeUsingThis;\n }\n\n export interface ISettledFulfilled<T> {\n status: \"fulfilled\";\n value: T;\n }\n export interface ISettledRejected {\n status: \"rejected\";\n reason: any;\n }\n\n interface PromiseConstructor {\n allSettled<T>(promises: Promise<T>[]): Promise<Array<ISettledFulfilled<T> | ISettledRejected>>;\n }\n\n interface RTCRtpTransceiver {\n // This has been removed from TS\n // (https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1029),\n // but we still need this for MatrixCall::getRidOfRTXCodecs()\n setCodecPreferences(codecs: RTCRtpCodecCapability[]): void;\n }\n\n interface RequestInit {\n /**\n * Specifies the priority of the fetch request relative to other requests of the same type.\n * Must be one of the following strings:\n * high: A high priority fetch request relative to other requests of the same type.\n * low: A low priority fetch request relative to other requests of the same type.\n * auto: Automatically determine the priority of the fetch request relative to other requests of the same type (default).\n *\n * @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fetch-priority-attribute\n * @see https://github.com/microsoft/TypeScript/issues/54472\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#browser_compatibility\n * Not yet supported in Safari or Firefox\n */\n priority?: \"high\" | \"low\" | \"auto\";\n }\n}\n"],"mappings":";;;;;AAiBAA,OAAA"}
|
||||
7
node_modules/matrix-js-sdk/lib/@types/json.d.ts
generated
vendored
7
node_modules/matrix-js-sdk/lib/@types/json.d.ts
generated
vendored
@@ -1,7 +0,0 @@
|
||||
export type JsonValue = null | string | number | boolean;
|
||||
export type JsonArray = Array<JsonValue | JsonObject | JsonArray>;
|
||||
export interface JsonObject {
|
||||
[key: string]: JsonObject | JsonArray | JsonValue;
|
||||
}
|
||||
export type Json = JsonArray | JsonObject;
|
||||
//# sourceMappingURL=json.d.ts.map
|
||||
1
node_modules/matrix-js-sdk/lib/@types/json.d.ts.map
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/json.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/@types/json.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AACzD,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;AAClE,MAAM,WAAW,UAAU;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;CACrD;AACD,MAAM,MAAM,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC"}
|
||||
3
node_modules/matrix-js-sdk/lib/@types/json.js
generated
vendored
3
node_modules/matrix-js-sdk/lib/@types/json.js
generated
vendored
@@ -1,3 +0,0 @@
|
||||
export {};
|
||||
export {};
|
||||
//# sourceMappingURL=json.js.map
|
||||
1
node_modules/matrix-js-sdk/lib/@types/json.js.map
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/json.js.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"json.js","names":[],"sources":["../../src/@types/json.ts"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\n// Types for JSON and JSON objects, copied from element-web (left in both places as I don't think we\n// want this as a part of js-sdk's interface and I don't think it's worth it being its own package)\n\nexport type JsonValue = null | string | number | boolean;\nexport type JsonArray = Array<JsonValue | JsonObject | JsonArray>;\nexport interface JsonObject {\n [key: string]: JsonObject | JsonArray | JsonValue;\n}\nexport type Json = JsonArray | JsonObject;\n"],"mappings":"","ignoreList":[]}
|
||||
7
node_modules/matrix-js-sdk/lib/@types/local_notifications.js
generated
vendored
7
node_modules/matrix-js-sdk/lib/@types/local_notifications.js
generated
vendored
@@ -1,3 +1,6 @@
|
||||
export {};
|
||||
export {};
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
//# sourceMappingURL=local_notifications.js.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/local_notifications.js.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/local_notifications.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"local_notifications.js","names":[],"sources":["../../src/@types/local_notifications.ts"],"sourcesContent":["/*\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nexport interface LocalNotificationSettings {\n is_silenced: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
||||
{"version":3,"file":"local_notifications.js","names":[],"sources":["../../src/@types/local_notifications.ts"],"sourcesContent":["/*\nCopyright 2022 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nexport interface LocalNotificationSettings {\n is_silenced: boolean;\n}\n"],"mappings":""}
|
||||
6
node_modules/matrix-js-sdk/lib/@types/location.d.ts
generated
vendored
6
node_modules/matrix-js-sdk/lib/@types/location.d.ts
generated
vendored
@@ -1,6 +1,6 @@
|
||||
import { type EitherAnd } from "matrix-events-sdk";
|
||||
import { UnstableValue } from "../NamespacedValue.ts";
|
||||
import { type M_TEXT } from "./extensible_events.ts";
|
||||
import { EitherAnd } from "matrix-events-sdk";
|
||||
import { UnstableValue } from "../NamespacedValue";
|
||||
import { M_TEXT } from "./extensible_events";
|
||||
export declare enum LocationAssetType {
|
||||
Self = "m.self",
|
||||
Pin = "m.pin"
|
||||
|
||||
2
node_modules/matrix-js-sdk/lib/@types/location.d.ts.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/location.d.ts.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/@types/location.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,oBAAY,iBAAiB;IACzB,IAAI,WAAW;IACf,GAAG,UAAU;CAChB;A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,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,CAClC;IAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,EACvC;IAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAC7C,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC;IAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE;IAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAsB5F,KAAK,sBAAsB,GAAG,eAAe,GAAG,SAAS,CAAC;AAC1D;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG,WAAW,GAAG,UAAU,GAAG,sBAAsB,CAAC;AAEvG,MAAM,MAAM,0BAA0B,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,0BAA0B,GAAG,qBAAqB,CAAC,CAAC;AAEnG,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,GAAG,0BAA0B,CAAC"}
|
||||
25
node_modules/matrix-js-sdk/lib/@types/location.js
generated
vendored
25
node_modules/matrix-js-sdk/lib/@types/location.js
generated
vendored
@@ -1,3 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.M_TIMESTAMP = exports.M_LOCATION = exports.M_ASSET = exports.LocationAssetType = void 0;
|
||||
var _NamespacedValue = require("../NamespacedValue");
|
||||
var _extensible_events = require("./extensible_events");
|
||||
/*
|
||||
Copyright 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
@@ -13,27 +21,25 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Types for MSC3488 - m.location: Extending events with location data
|
||||
|
||||
import { UnstableValue } from "../NamespacedValue.js";
|
||||
export let LocationAssetType = /*#__PURE__*/function (LocationAssetType) {
|
||||
let LocationAssetType = /*#__PURE__*/function (LocationAssetType) {
|
||||
LocationAssetType["Self"] = "m.self";
|
||||
LocationAssetType["Pin"] = "m.pin";
|
||||
return LocationAssetType;
|
||||
}({});
|
||||
export const M_ASSET = new UnstableValue("m.asset", "org.matrix.msc3488.asset");
|
||||
exports.LocationAssetType = LocationAssetType;
|
||||
const M_ASSET = new _NamespacedValue.UnstableValue("m.asset", "org.matrix.msc3488.asset");
|
||||
|
||||
/**
|
||||
* The event definition for an m.asset event (in content)
|
||||
*/
|
||||
|
||||
export const M_TIMESTAMP = new UnstableValue("m.ts", "org.matrix.msc3488.ts");
|
||||
exports.M_ASSET = M_ASSET;
|
||||
const M_TIMESTAMP = new _NamespacedValue.UnstableValue("m.ts", "org.matrix.msc3488.ts");
|
||||
/**
|
||||
* The event definition for an m.ts event (in content)
|
||||
*/
|
||||
|
||||
export const M_LOCATION = new UnstableValue("m.location", "org.matrix.msc3488.location");
|
||||
exports.M_TIMESTAMP = M_TIMESTAMP;
|
||||
const M_LOCATION = new _NamespacedValue.UnstableValue("m.location", "org.matrix.msc3488.location");
|
||||
|
||||
/* From the spec at:
|
||||
* https://github.com/matrix-org/matrix-doc/blob/matthew/location/proposals/3488-location.md
|
||||
@@ -63,4 +69,5 @@ export const M_LOCATION = new UnstableValue("m.location", "org.matrix.msc3488.lo
|
||||
/**
|
||||
* Possible content for location events as sent over the wire
|
||||
*/
|
||||
exports.M_LOCATION = M_LOCATION;
|
||||
//# sourceMappingURL=location.js.map
|
||||
2
node_modules/matrix-js-sdk/lib/@types/location.js.map
generated
vendored
2
node_modules/matrix-js-sdk/lib/@types/location.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"location.js","names":[],"sources":["../../src/@types/location.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Types for MSC3488 - m.location: Extending events with location data\nimport { type EitherAnd } from \"matrix-events-sdk\";\n\nimport { UnstableValue } from \"../NamespacedValue.ts\";\nimport { type M_TEXT } from \"./extensible_events.ts\";\n\nexport enum LocationAssetType {\n Self = \"m.self\",\n Pin = \"m.pin\",\n}\n\nexport const M_ASSET = new UnstableValue(\"m.asset\", \"org.matrix.msc3488.asset\");\nexport type MAssetContent = { type: LocationAssetType };\n/**\n * The event definition for an m.asset event (in content)\n */\nexport type MAssetEvent = EitherAnd<{ [M_ASSET.name]: MAssetContent }, { [M_ASSET.altName]: MAssetContent }>;\n\nexport const M_TIMESTAMP = new UnstableValue(\"m.ts\", \"org.matrix.msc3488.ts\");\n/**\n * The event definition for an m.ts event (in content)\n */\nexport type MTimestampEvent = EitherAnd<{ [M_TIMESTAMP.name]: number }, { [M_TIMESTAMP.altName]: number }>;\n\nexport const M_LOCATION = new UnstableValue(\"m.location\", \"org.matrix.msc3488.location\");\n\nexport type MLocationContent = {\n uri: string;\n description?: string | null;\n};\n\nexport type MLocationEvent = EitherAnd<\n { [M_LOCATION.name]: MLocationContent },\n { [M_LOCATION.altName]: MLocationContent }\n>;\n\nexport type MTextEvent = EitherAnd<{ [M_TEXT.name]: string }, { [M_TEXT.altName]: string }>;\n\n/* From the spec at:\n * https://github.com/matrix-org/matrix-doc/blob/matthew/location/proposals/3488-location.md\n{\n \"type\": \"m.room.message\",\n \"content\": {\n \"body\": \"Matthew was at geo:51.5008,0.1247;u=35 as of Sat Nov 13 18:50:58 2021\",\n \"msgtype\": \"m.location\",\n \"geo_uri\": \"geo:51.5008,0.1247;u=35\",\n \"m.location\": {\n \"uri\": \"geo:51.5008,0.1247;u=35\",\n \"description\": \"Matthew's whereabouts\",\n },\n \"m.asset\": {\n \"type\": \"m.self\"\n },\n \"m.text\": \"Matthew was at geo:51.5008,0.1247;u=35 as of Sat Nov 13 18:50:58 2021\",\n \"m.ts\": 1636829458432,\n }\n}\n*/\ntype OptionalTimestampEvent = MTimestampEvent | undefined;\n/**\n * The content for an m.location event\n */\nexport type MLocationEventContent = MLocationEvent & MAssetEvent & MTextEvent & OptionalTimestampEvent;\n\nexport type LegacyLocationEventContent = {\n body: string;\n msgtype: string;\n geo_uri: string;\n};\n\n/**\n * Possible content for location events as sent over the wire\n */\nexport type LocationEventWireContent = Partial<LegacyLocationEventContent & MLocationEventContent>;\n\nexport type ILocationContent = MLocationEventContent & LegacyLocationEventContent;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAGA,SAAS,aAAa,QAAQ,uBAAuB;AAGrD,WAAY,iBAAiB,0BAAjB,iBAAiB;EAAjB,iBAAiB;EAAjB,iBAAiB;EAAA,OAAjB,iBAAiB;AAAA;AAK7B,OAAO,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,SAAS,EAAE,0BAA0B,CAAC;;AAE/E;AACA;AACA;;AAGA,OAAO,MAAM,WAAW,GAAG,IAAI,aAAa,CAAC,MAAM,EAAE,uBAAuB,CAAC;AAC7E;AACA;AACA;;AAGA,OAAO,MAAM,UAAU,GAAG,IAAI,aAAa,CAAC,YAAY,EAAE,6BAA6B,CAAC;;AAcxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AASA;AACA;AACA","ignoreList":[]}
|
||||
{"version":3,"file":"location.js","names":["_NamespacedValue","require","_extensible_events","LocationAssetType","exports","M_ASSET","UnstableValue","M_TIMESTAMP","M_LOCATION"],"sources":["../../src/@types/location.ts"],"sourcesContent":["/*\nCopyright 2021 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\n// Types for MSC3488 - m.location: Extending events with location data\nimport { EitherAnd } from \"matrix-events-sdk\";\n\nimport { UnstableValue } from \"../NamespacedValue\";\nimport { M_TEXT } from \"./extensible_events\";\n\nexport enum LocationAssetType {\n Self = \"m.self\",\n Pin = \"m.pin\",\n}\n\nexport const M_ASSET = new UnstableValue(\"m.asset\", \"org.matrix.msc3488.asset\");\nexport type MAssetContent = { type: LocationAssetType };\n/**\n * The event definition for an m.asset event (in content)\n */\nexport type MAssetEvent = EitherAnd<{ [M_ASSET.name]: MAssetContent }, { [M_ASSET.altName]: MAssetContent }>;\n\nexport const M_TIMESTAMP = new UnstableValue(\"m.ts\", \"org.matrix.msc3488.ts\");\n/**\n * The event definition for an m.ts event (in content)\n */\nexport type MTimestampEvent = EitherAnd<{ [M_TIMESTAMP.name]: number }, { [M_TIMESTAMP.altName]: number }>;\n\nexport const M_LOCATION = new UnstableValue(\"m.location\", \"org.matrix.msc3488.location\");\n\nexport type MLocationContent = {\n uri: string;\n description?: string | null;\n};\n\nexport type MLocationEvent = EitherAnd<\n { [M_LOCATION.name]: MLocationContent },\n { [M_LOCATION.altName]: MLocationContent }\n>;\n\nexport type MTextEvent = EitherAnd<{ [M_TEXT.name]: string }, { [M_TEXT.altName]: string }>;\n\n/* From the spec at:\n * https://github.com/matrix-org/matrix-doc/blob/matthew/location/proposals/3488-location.md\n{\n \"type\": \"m.room.message\",\n \"content\": {\n \"body\": \"Matthew was at geo:51.5008,0.1247;u=35 as of Sat Nov 13 18:50:58 2021\",\n \"msgtype\": \"m.location\",\n \"geo_uri\": \"geo:51.5008,0.1247;u=35\",\n \"m.location\": {\n \"uri\": \"geo:51.5008,0.1247;u=35\",\n \"description\": \"Matthew's whereabouts\",\n },\n \"m.asset\": {\n \"type\": \"m.self\"\n },\n \"m.text\": \"Matthew was at geo:51.5008,0.1247;u=35 as of Sat Nov 13 18:50:58 2021\",\n \"m.ts\": 1636829458432,\n }\n}\n*/\ntype OptionalTimestampEvent = MTimestampEvent | undefined;\n/**\n * The content for an m.location event\n */\nexport type MLocationEventContent = MLocationEvent & MAssetEvent & MTextEvent & OptionalTimestampEvent;\n\nexport type LegacyLocationEventContent = {\n body: string;\n msgtype: string;\n geo_uri: string;\n};\n\n/**\n * Possible content for location events as sent over the wire\n */\nexport type LocationEventWireContent = Partial<LegacyLocationEventContent & MLocationEventContent>;\n\nexport type ILocationContent = MLocationEventContent & LegacyLocationEventContent;\n"],"mappings":";;;;;;AAmBA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AApBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA,IAMYE,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAAAC,OAAA,CAAAD,iBAAA,GAAAA,iBAAA;AAKtB,MAAME,OAAO,GAAG,IAAIC,8BAAa,CAAC,SAAS,EAAE,0BAA0B,CAAC;;AAE/E;AACA;AACA;AAFAF,OAAA,CAAAC,OAAA,GAAAA,OAAA;AAKO,MAAME,WAAW,GAAG,IAAID,8BAAa,CAAC,MAAM,EAAE,uBAAuB,CAAC;AAC7E;AACA;AACA;AAFAF,OAAA,CAAAG,WAAA,GAAAA,WAAA;AAKO,MAAMC,UAAU,GAAG,IAAIF,8BAAa,CAAC,YAAY,EAAE,6BAA6B,CAAC;;AAcxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AASA;AACA;AACA;AAFAF,OAAA,CAAAI,UAAA,GAAAA,UAAA"}
|
||||
3
node_modules/matrix-js-sdk/lib/@types/matrix-sdk-crypto-wasm.d.js
generated
vendored
3
node_modules/matrix-js-sdk/lib/@types/matrix-sdk-crypto-wasm.d.js
generated
vendored
@@ -1,3 +0,0 @@
|
||||
export {};
|
||||
export {};
|
||||
//# sourceMappingURL=matrix-sdk-crypto-wasm.d.js.map
|
||||
1
node_modules/matrix-js-sdk/lib/@types/matrix-sdk-crypto-wasm.d.js.map
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/matrix-sdk-crypto-wasm.d.js.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"matrix-sdk-crypto-wasm.d.js","names":[],"sources":["../../src/@types/matrix-sdk-crypto-wasm.d.ts"],"sourcesContent":["/*\nCopyright 2024 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport type * as RustSdkCryptoJs from \"@matrix-org/matrix-sdk-crypto-wasm\";\n\ndeclare module \"@matrix-org/matrix-sdk-crypto-wasm\" {\n interface SecretsBundle {\n to_json(): Promise<{\n cross_signing: {\n master_key: string;\n self_signing_key: string;\n user_signing_key: string;\n };\n backup?: {\n algorithm: string;\n key: string;\n backup_version: string;\n };\n }>;\n }\n\n interface Device {\n requestVerification(methods?: any[]): [RustSdkCryptoJs.VerificationRequest, RustSdkCryptoJs.ToDeviceRequest];\n }\n}\n"],"mappings":"","ignoreList":[]}
|
||||
220
node_modules/matrix-js-sdk/lib/@types/media.d.ts
generated
vendored
220
node_modules/matrix-js-sdk/lib/@types/media.d.ts
generated
vendored
@@ -1,220 +0,0 @@
|
||||
import { type MsgType } from "../@types/event.ts";
|
||||
/**
|
||||
* Information on encrypted media attachments.
|
||||
*
|
||||
* Used within `m.room.message` events that reference files, such as `m.file` and `m.image`.
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.11/client-server-api/#extensions-to-mroommessage-msgtypes
|
||||
*/
|
||||
export interface EncryptedFile {
|
||||
/**
|
||||
* The URL to the file.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* A JSON Web Key object.
|
||||
*/
|
||||
key: {
|
||||
alg: string;
|
||||
key_ops: string[];
|
||||
kty: string;
|
||||
k: string;
|
||||
ext: boolean;
|
||||
};
|
||||
/**
|
||||
* The 128-bit unique counter block used by AES-CTR, encoded as unpadded base64.
|
||||
*/
|
||||
iv: string;
|
||||
/**
|
||||
* A map from an algorithm name to a hash of the ciphertext, encoded as unpadded base64.
|
||||
* Clients should support the SHA-256 hash, which uses the key `sha256`.
|
||||
*/
|
||||
hashes: {
|
||||
[alg: string]: string;
|
||||
};
|
||||
/**
|
||||
* Version of the encrypted attachment's protocol. Must be `v2`.
|
||||
*/
|
||||
v: string;
|
||||
}
|
||||
interface ThumbnailInfo {
|
||||
/**
|
||||
* The mimetype of the image, e.g. image/jpeg.
|
||||
*/
|
||||
mimetype?: string;
|
||||
/**
|
||||
* The intended display width of the image in pixels.
|
||||
* This may differ from the intrinsic dimensions of the image file.
|
||||
*/
|
||||
w?: number;
|
||||
/**
|
||||
* The intended display height of the image in pixels.
|
||||
* This may differ from the intrinsic dimensions of the image file.
|
||||
*/
|
||||
h?: number;
|
||||
/**
|
||||
* Size of the image in bytes.
|
||||
*/
|
||||
size?: number;
|
||||
}
|
||||
interface BaseInfo {
|
||||
mimetype?: string;
|
||||
size?: number;
|
||||
}
|
||||
/**
|
||||
* Information on media attachments of msgtype `m.file`
|
||||
*
|
||||
* Used within `m.room.message` events that reference files.
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.11/client-server-api/#mfile
|
||||
*/
|
||||
export interface FileInfo extends BaseInfo {
|
||||
/**
|
||||
* Information on the encrypted thumbnail file, as specified in End-to-end encryption.
|
||||
* Only present if the thumbnail is encrypted.
|
||||
* @see https://spec.matrix.org/v1.11/client-server-api/#sending-encrypted-attachments
|
||||
*/
|
||||
thumbnail_file?: EncryptedFile;
|
||||
/**
|
||||
* Metadata about the image referred to in thumbnail_url.
|
||||
*/
|
||||
thumbnail_info?: ThumbnailInfo;
|
||||
/**
|
||||
* The URL to the thumbnail of the file. Only present if the thumbnail is unencrypted.
|
||||
*/
|
||||
thumbnail_url?: string;
|
||||
}
|
||||
/**
|
||||
* Information on media attachments of msgtype `m.image`
|
||||
*
|
||||
* Used within `m.room.message` events that reference images.
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.11/client-server-api/#mimage
|
||||
*/
|
||||
export interface ImageInfo extends FileInfo, ThumbnailInfo {
|
||||
}
|
||||
/**
|
||||
* Information on media attachments of msgtype `m.audio`
|
||||
*
|
||||
* Used within `m.room.message` events that reference audio files.
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.11/client-server-api/#maudio
|
||||
*/
|
||||
export interface AudioInfo extends BaseInfo {
|
||||
/**
|
||||
* The duration of the audio in milliseconds.
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
/**
|
||||
* Information on media attachments of msgtype `m.video`
|
||||
*
|
||||
* Used within `m.room.message` events that reference video files.
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.11/client-server-api/#mvideo
|
||||
*/
|
||||
export interface VideoInfo extends AudioInfo, ImageInfo {
|
||||
/**
|
||||
* The duration of the video in milliseconds.
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
/**
|
||||
* Union type representing the `content.info` field of all specified media events.
|
||||
*/
|
||||
export type MediaEventInfo = FileInfo | ImageInfo | AudioInfo | VideoInfo;
|
||||
interface BaseContent {
|
||||
/**
|
||||
* Required if the file is encrypted. Information on the encrypted file, as specified in End-to-end encryption.
|
||||
* @see https://spec.matrix.org/v1.11/client-server-api/#sending-encrypted-attachments
|
||||
*/
|
||||
file?: EncryptedFile;
|
||||
/**
|
||||
* Required if the file is unencrypted. The URL (typically mxc:// URI) to the file.
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* If filename is not set or the value of both properties are identical,
|
||||
* this is the filename of the original upload. Otherwise, this is a
|
||||
* caption for the file.
|
||||
*/
|
||||
body: string;
|
||||
/**
|
||||
* The original filename of the uploaded file.
|
||||
*/
|
||||
filename?: string;
|
||||
/**
|
||||
* The format used in the `formatted_body`.
|
||||
*/
|
||||
format?: "org.matrix.custom.html";
|
||||
/**
|
||||
* The formatted version of the `body`, when it acts as a caption. This is required if `format` is specified.
|
||||
*/
|
||||
formatted_body?: string;
|
||||
}
|
||||
/**
|
||||
* Content format of media events with msgtype `m.file`
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.11/client-server-api/#mfile
|
||||
*/
|
||||
export interface FileContent extends BaseContent {
|
||||
/**
|
||||
* Information about the file referred to in url.
|
||||
*/
|
||||
info?: FileInfo;
|
||||
/**
|
||||
* One of: [m.file].
|
||||
*/
|
||||
msgtype: MsgType.File;
|
||||
}
|
||||
/**
|
||||
* Content format of media events with msgtype `m.image`
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.11/client-server-api/#mimage
|
||||
*/
|
||||
export interface ImageContent extends BaseContent {
|
||||
/**
|
||||
* Metadata about the image referred to in url.
|
||||
*/
|
||||
info?: ImageInfo;
|
||||
/**
|
||||
* One of: [m.image].
|
||||
*/
|
||||
msgtype: MsgType.Image;
|
||||
}
|
||||
/**
|
||||
* Content format of media events with msgtype `m.audio`
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.11/client-server-api/#maudio
|
||||
*/
|
||||
export interface AudioContent extends BaseContent {
|
||||
/**
|
||||
* Metadata for the audio clip referred to in url.
|
||||
*/
|
||||
info?: AudioInfo;
|
||||
/**
|
||||
* One of: [m.audio].
|
||||
*/
|
||||
msgtype: MsgType.Audio;
|
||||
}
|
||||
/**
|
||||
* Content format of media events with msgtype `m.video`
|
||||
*
|
||||
* @see https://spec.matrix.org/v1.11/client-server-api/#mvideo
|
||||
*/
|
||||
export interface VideoContent extends BaseContent {
|
||||
/**
|
||||
* Metadata about the video clip referred to in url.
|
||||
*/
|
||||
info?: VideoInfo;
|
||||
/**
|
||||
* One of: [m.video].
|
||||
*/
|
||||
msgtype: MsgType.Video;
|
||||
}
|
||||
/**
|
||||
* Type representing media event contents for `m.room.message` events listed in the Matrix specification
|
||||
*/
|
||||
export type MediaEventContent = FileContent | ImageContent | AudioContent | VideoContent;
|
||||
export {};
|
||||
//# sourceMappingURL=media.d.ts.map
|
||||
1
node_modules/matrix-js-sdk/lib/@types/media.d.ts.map
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/media.d.ts.map
generated
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/@types/media.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE;QACD,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,GAAG,EAAE,MAAM,CAAC;QACZ,CAAC,EAAE,MAAM,CAAC;QACV,GAAG,EAAE,OAAO,CAAC;KAChB,CAAC;IACF;;OAEG;IACH,EAAE,EAAE,MAAM,CAA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H,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC5C;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC7C;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC7C;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC7C;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC"}
|
||||
3
node_modules/matrix-js-sdk/lib/@types/media.js
generated
vendored
3
node_modules/matrix-js-sdk/lib/@types/media.js
generated
vendored
@@ -1,3 +0,0 @@
|
||||
export {};
|
||||
export {};
|
||||
//# sourceMappingURL=media.js.map
|
||||
1
node_modules/matrix-js-sdk/lib/@types/media.js.map
generated
vendored
1
node_modules/matrix-js-sdk/lib/@types/media.js.map
generated
vendored
File diff suppressed because one or more lines are too long
41
node_modules/matrix-js-sdk/lib/@types/membership.d.ts
generated
vendored
41
node_modules/matrix-js-sdk/lib/@types/membership.d.ts
generated
vendored
@@ -1,41 +0,0 @@
|
||||
/**
|
||||
* Well-known values (from the spec or MSCs) that are allowed in the
|
||||
* {@link Membership} type.
|
||||
*/
|
||||
export declare enum KnownMembership {
|
||||
/**
|
||||
* The user has been banned from the room, and is no longer allowed to join
|
||||
* it until they are un-banned from the room (by having their membership
|
||||
* state set to a value other than ban).
|
||||
*/
|
||||
Ban = "ban",
|
||||
/**
|
||||
* The user has been invited to join a room, but has not yet joined it.
|
||||
* They may not participate in the room until they join.
|
||||
* */
|
||||
Invite = "invite",
|
||||
/**
|
||||
* The user has joined the room (possibly after accepting an invite), and
|
||||
* may participate in it.
|
||||
*/
|
||||
Join = "join",
|
||||
/**
|
||||
* The user has knocked on the room, requesting permission to participate.
|
||||
* They may not participate in the room until they join.
|
||||
*/
|
||||
Knock = "knock",
|
||||
/**
|
||||
* The user was once joined to the room, but has since left (possibly by
|
||||
* choice, or possibly by being kicked).
|
||||
*/
|
||||
Leave = "leave"
|
||||
}
|
||||
/**
|
||||
* The membership state for a user in a room [1]. A value from
|
||||
* {@link KnownMembership} should be used where available, but all string values
|
||||
* are allowed to provide flexibility for upcoming spec changes or proposals.
|
||||
*
|
||||
* [1] https://spec.matrix.org/latest/client-server-api/#mroommember
|
||||
*/
|
||||
export type Membership = KnownMembership | string;
|
||||
//# sourceMappingURL=membership.d.ts.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user