feat: add license integration (#2346)

Changes:
- Adds integration for the license server.
- Prevent adding flags that the instance is not allowed to add
This commit is contained in:
David Nguyen
2026-01-29 13:30:48 +11:00
committed by GitHub
parent d18dcb4d60
commit 1b0df2d082
29 changed files with 1645 additions and 93 deletions
@@ -0,0 +1,17 @@
import { LicenseClient } from '@documenso/lib/server-only/license/license-client';
import { adminProcedure } from '../trpc';
import { ZResyncLicenseRequestSchema, ZResyncLicenseResponseSchema } from './resync-license.types';
export const resyncLicenseRoute = adminProcedure
.input(ZResyncLicenseRequestSchema)
.output(ZResyncLicenseResponseSchema)
.mutation(async () => {
const client = LicenseClient.getInstance();
if (!client) {
return;
}
await client.resync();
});
@@ -0,0 +1,8 @@
import { z } from 'zod';
export const ZResyncLicenseRequestSchema = z.void();
export const ZResyncLicenseResponseSchema = z.void();
export type TResyncLicenseRequest = z.infer<typeof ZResyncLicenseRequestSchema>;
export type TResyncLicenseResponse = z.infer<typeof ZResyncLicenseResponseSchema>;
@@ -17,6 +17,7 @@ import { getUserRoute } from './get-user';
import { promoteMemberToOwnerRoute } from './promote-member-to-owner';
import { resealDocumentRoute } from './reseal-document';
import { resetTwoFactorRoute } from './reset-two-factor-authentication';
import { resyncLicenseRoute } from './resync-license';
import { updateAdminOrganisationRoute } from './update-admin-organisation';
import { updateOrganisationMemberRoleRoute } from './update-organisation-member-role';
import { updateRecipientRoute } from './update-recipient';
@@ -44,6 +45,9 @@ export const adminRouter = router({
stripe: {
createCustomer: createStripeCustomerRoute,
},
license: {
resync: resyncLicenseRoute,
},
user: {
get: getUserRoute,
update: updateUserRoute,