diff --git a/src/api/acts/admin.ts b/src/api/acts/admin.ts index 8aa1a7d..993f48a 100644 --- a/src/api/acts/admin.ts +++ b/src/api/acts/admin.ts @@ -3,9 +3,9 @@ import { PERMISSIONS } from "../../server/permissions.js"; import { sha256 } from "../../sys/crypto.js"; import { accounts, db, signupOTA } from "../../sys/db.js"; import { get64, uts } from "../../sys/tools.js"; -import { Client, STATE } from "../user.js"; +import { Act, Client, STATE } from "../user.js"; -export const getAccounts = { +export const getAccounts: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API | PERMISSIONS.SHOW_USERS_AND_LISTS, data: {}, @@ -39,7 +39,7 @@ export const getAccounts = { } }; -export const setPermissions = { +export const setPermissions: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API | PERMISSIONS.EDIT_RIGHTS, data: { @@ -60,7 +60,7 @@ export const setPermissions = { } }; -export const resetPassword = { +export const resetPassword: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API | PERMISSIONS.EDIT_USERS, data: { @@ -83,7 +83,7 @@ export const resetPassword = { } }; -export const setMaxValues = { +export const setMaxValues: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API | PERMISSIONS.EDIT_USERS, data: { @@ -108,7 +108,7 @@ export const setMaxValues = { } }; -export const getOTAs = { +export const getOTAs: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API | PERMISSIONS.MANAGE_OTA_TOKENS, data: {}, @@ -133,7 +133,7 @@ export const getOTAs = { } } -export const addOTA = { +export const addOTA: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API | PERMISSIONS.MANAGE_OTA_TOKENS, data: { @@ -156,7 +156,7 @@ export const addOTA = { aws("ok", ""); } } -export const deleteOTA = { +export const deleteOTA: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API | PERMISSIONS.MANAGE_OTA_TOKENS, data: { diff --git a/src/api/acts/client.ts b/src/api/acts/client.ts index 1db5a68..9e82368 100644 --- a/src/api/acts/client.ts +++ b/src/api/acts/client.ts @@ -5,11 +5,11 @@ import { accounts, db, roomMembers, rooms } from "../../sys/db.js"; import { selfTag } from "../../sys/selfTag.js"; import { getSettings, SETTINGS } from "../../sys/settings.js"; import { get64 } from "../../sys/tools.js"; -import { Client, STATE } from "../user.js"; +import { Act, Client, STATE } from "../user.js"; import { canCreateRoom } from "../helper.js" -export const deleteAccount = { +export const deleteAccount: Act = { state: STATE.client, right: 0, data: {}, @@ -23,7 +23,7 @@ export const deleteAccount = { } }; -export const createSignature = { +export const createSignature: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API | PERMISSIONS.PROVIDE_CERT, data: { @@ -37,7 +37,7 @@ export const createSignature = { } }; -export const getMyAccount = { +export const getMyAccount: Act = { state: STATE.client, right: 0, data: {}, @@ -69,7 +69,7 @@ export const getMyAccount = { } }; -export const changePassword = { +export const changePassword: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API, data: { @@ -91,7 +91,7 @@ export const changePassword = { } }; -export const createRoom = { +export const createRoom: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API, data: { @@ -136,7 +136,7 @@ export const createRoom = { } }; -export const deleteRoom = { +export const deleteRoom: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API, data: { @@ -157,7 +157,7 @@ export const deleteRoom = { } }; -export const listPublicRooms = { +export const listPublicRooms: Act = { state: STATE.client, right: PERMISSIONS.CAN_USE_API, data: {}, diff --git a/src/api/acts/login.ts b/src/api/acts/login.ts index 1980b49..781afda 100644 --- a/src/api/acts/login.ts +++ b/src/api/acts/login.ts @@ -72,7 +72,7 @@ export const signup: Act = { } }; -export const signupOTA = { +export const signupOTA: Act = { state: STATE.no, right: 0, data: { @@ -119,7 +119,7 @@ export const signupOTA = { } }; -export const signin = { +export const signin: Act = { state: STATE.no, right: 0, data: { @@ -154,7 +154,7 @@ export const signin = { } }; -export const remote1 = { +export const remote1: Act = { state: STATE.no, right: 0, data: { @@ -187,7 +187,7 @@ export const remote1 = { } }; -export const remote2 = { +export const remote2: Act = { state: STATE.remoteP, right: 0, data: { @@ -204,7 +204,7 @@ export const remote2 = { } }; -export const remoteServer1 = { +export const remoteServer1: Act = { state: STATE.no, right: 0, data: { @@ -231,7 +231,7 @@ export const remoteServer1 = { } }; -export const remoteServer2 = { +export const remoteServer2: Act = { state: STATE.serverP, right: 0, data: { diff --git a/src/api/acts/roomContent.ts b/src/api/acts/roomContent.ts new file mode 100644 index 0000000..b28b04f --- /dev/null +++ b/src/api/acts/roomContent.ts @@ -0,0 +1,3 @@ + + + diff --git a/src/api/acts/server.ts b/src/api/acts/server.ts deleted file mode 100644 index e69de29..0000000