mirror of
https://github.com/documenso/documenso.git
synced 2026-07-24 08:54:20 +10:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user