Merge branch 'workstream-k'
This commit is contained in:
@@ -9,11 +9,8 @@ import { resendVerificationEmail as resendVerificationHandler } from "./procedur
|
||||
import { resetPassword as resetPasswordHandler } from "./procedures/auth/reset-password.js";
|
||||
import { signup as signupHandler } from "./procedures/auth/signup.js";
|
||||
import { verifyEmail as verifyEmailHandler } from "./procedures/auth/verify-email.js";
|
||||
import {
|
||||
authMiddleware,
|
||||
loginRequestMiddleware,
|
||||
os,
|
||||
} from "./procedures/base.js";
|
||||
import { authMiddleware, loginRequestMiddleware, os } from "./procedures/base.js";
|
||||
import { adminRoutes } from "./procedures/admin/_routes.js";
|
||||
import { meDelete } from "./procedures/me/delete.js";
|
||||
import {
|
||||
getDeviceInfo,
|
||||
@@ -207,91 +204,6 @@ const setupProfile = os.me.setupProfile
|
||||
// - invitesList, invitesCreate, invitesCancel, invitesAccept
|
||||
// - sitesList
|
||||
|
||||
// Admin orgs procedures (require superuser - for now just auth, will add superuser middleware later)
|
||||
const adminOrgsList = os.admin.orgs.list
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
const adminOrgsGet = os.admin.orgs.get.use(authMiddleware).handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
const adminOrgsCreate = os.admin.orgs.create
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
const adminOrgsUpdate = os.admin.orgs.update
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
const adminOrgsDelete = os.admin.orgs.delete
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
const adminOrgsListSites = os.admin.orgs.listSites
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
const adminOrgsAddSite = os.admin.orgs.addSite
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
const adminOrgsRemoveSite = os.admin.orgs.removeSite
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
// Admin users procedures
|
||||
const adminUsersList = os.admin.users.list
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
const adminUsersGet = os.admin.users.get
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
const adminUsersCreate = os.admin.users.create
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
const adminUsersUpdate = os.admin.users.update
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
const adminUsersConfirmEmail = os.admin.users.confirmEmail
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
// Admin auth procedures
|
||||
const adminAuthCompleteLogin = os.admin.auth.completeLogin
|
||||
.use(authMiddleware)
|
||||
.handler(async () => {
|
||||
throw new ORPCError("NOT_IMPLEMENTED", { message: "Not implemented" });
|
||||
});
|
||||
|
||||
// Build the router
|
||||
export const router = os.router({
|
||||
auth: {
|
||||
@@ -354,26 +266,5 @@ export const router = os.router({
|
||||
list: sitesList,
|
||||
},
|
||||
},
|
||||
admin: {
|
||||
orgs: {
|
||||
list: adminOrgsList,
|
||||
get: adminOrgsGet,
|
||||
create: adminOrgsCreate,
|
||||
update: adminOrgsUpdate,
|
||||
delete: adminOrgsDelete,
|
||||
listSites: adminOrgsListSites,
|
||||
addSite: adminOrgsAddSite,
|
||||
removeSite: adminOrgsRemoveSite,
|
||||
},
|
||||
users: {
|
||||
list: adminUsersList,
|
||||
get: adminUsersGet,
|
||||
create: adminUsersCreate,
|
||||
update: adminUsersUpdate,
|
||||
confirmEmail: adminUsersConfirmEmail,
|
||||
},
|
||||
auth: {
|
||||
completeLogin: adminAuthCompleteLogin,
|
||||
},
|
||||
},
|
||||
admin: adminRoutes,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user