Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appwrite.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
"value": "64a521785f5be62b796f"
},
{
"key": "ROOMS_COLLECTION_ID",
"key": "ROOMS_TABLE_ID",
"value": "64a5217e695bf2c4ec9c"
}
],
Expand Down
34 changes: 22 additions & 12 deletions functions/create-room/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion functions/create-room/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"livekit-server-sdk": "^1.2.6",
"node-appwrite": "^17.0.0"
"node-appwrite": "^18.0.0"
},
"devDependencies": {
"prettier": "^3.0.0"
Expand Down
18 changes: 9 additions & 9 deletions functions/create-room/src/appwrite.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, Databases, ID } from "node-appwrite";
import { Client, TablesDB, ID } from "node-appwrite";

class AppwriteService {
constructor() {
Expand All @@ -9,18 +9,18 @@ class AppwriteService {
)
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
.setKey(process.env.APPWRITE_API_KEY);
this.databases = new Databases(client);
this.tables = new TablesDB(client);
}

async createRoom(newRoomData) {
const newRoomDocRef = await this.databases.createDocument(
process.env.MASTER_DATABASE_ID,
process.env.ROOMS_COLLECTION_ID,
ID.unique(),
newRoomData
);
const rowId = ID.unique();
const newRoomRows = await this.tables.createRows({
databaseId: process.env.MASTER_DATABASE_ID,
tableId: process.env.ROOMS_TABLE_ID,
rows: [{ $id: rowId, ...newRoomData }]
});

return newRoomDocRef.$id;
return newRoomRows.rows[0].$id;
}
}

Expand Down
2 changes: 1 addition & 1 deletion functions/create-room/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default async ({ req, res, log, error }) => {
throwIfMissing(process.env, [
"APPWRITE_API_KEY",
"MASTER_DATABASE_ID",
"ROOMS_COLLECTION_ID",
"ROOMS_TABLE_ID",
"LIVEKIT_HOST",
"LIVEKIT_API_KEY",
"LIVEKIT_API_SECRET",
Expand Down
110 changes: 13 additions & 97 deletions functions/database-cleaner/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion functions/database-cleaner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"format": "prettier --write ."
},
"dependencies": {
"node-appwrite": "^17.0.0"
"node-appwrite": "^18.0.0"
},
"devDependencies": {
"prettier": "^3.0.0"
Expand Down
Loading