-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move tenant information to url (#18)
- Loading branch information
Showing
27 changed files
with
321 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,3 @@ KEYCLOAK_CLIENT_ID="" | |
KEYCLOAK_CLIENT_SECRET="" | ||
|
||
LHUT_API_URL="" | ||
LHUT_TENANT_ID="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
"use server"; | ||
import { clientWithErrorHandling } from "@/lib/client"; | ||
import { | ||
ListUserTaskDefNamesRequest, | ||
ListUserTasksRequest, | ||
UserTask, | ||
UserTaskResult, | ||
} from "@littlehorse-enterprises/user-tasks-api-client"; | ||
|
||
export async function adminCancelUserTask( | ||
tenantId: string, | ||
userTask: UserTask, | ||
) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.adminCancelUserTask(userTask), | ||
); | ||
} | ||
|
||
export async function adminAssignUserTask( | ||
tenantId: string, | ||
userTask: UserTask, | ||
assignment: { userId?: string; userGroupId?: string }, | ||
) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.adminAssignUserTask(userTask, assignment), | ||
); | ||
} | ||
|
||
export async function adminListUsers(tenantId: string) { | ||
return clientWithErrorHandling(tenantId, (client) => client.adminListUsers()); | ||
} | ||
|
||
export async function adminListUserGroups(tenantId: string) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.adminListUserGroups(), | ||
); | ||
} | ||
|
||
export async function adminListUserTaskDefNames( | ||
tenantId: string, | ||
search: ListUserTaskDefNamesRequest, | ||
) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.adminListUserTaskDefNames(search), | ||
); | ||
} | ||
|
||
export async function adminListUserTasks( | ||
tenantId: string, | ||
search: ListUserTasksRequest, | ||
) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.adminListUserTasks(search), | ||
); | ||
} | ||
|
||
export async function adminGetUserTask(tenantId: string, userTask: UserTask) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.adminGetUserTask(userTask), | ||
); | ||
} | ||
|
||
export async function adminCompleteUserTask( | ||
tenantId: string, | ||
userTask: UserTask, | ||
values: UserTaskResult, | ||
) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.adminCompleteUserTask(userTask, values), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"use server"; | ||
import { clientWithErrorHandling } from "@/lib/client"; | ||
import { | ||
ListUserTasksRequest, | ||
UserTask, | ||
UserTaskResult, | ||
} from "@littlehorse-enterprises/user-tasks-api-client"; | ||
|
||
export async function claimUserTask(tenantId: string, userTask: UserTask) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.claimUserTask(userTask), | ||
); | ||
} | ||
|
||
export async function cancelUserTask(tenantId: string, userTask: UserTask) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.cancelUserTask(userTask), | ||
); | ||
} | ||
|
||
export async function listUserTasks( | ||
tenantId: string, | ||
search: Omit<ListUserTasksRequest, "type">, | ||
) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.listUserTasks(search), | ||
); | ||
} | ||
|
||
export async function listUserGroups(tenantId: string) { | ||
return clientWithErrorHandling(tenantId, (client) => client.listUserGroups()); | ||
} | ||
|
||
export async function getUserTask(tenantId: string, userTask: UserTask) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.getUserTask(userTask), | ||
); | ||
} | ||
|
||
export async function completeUserTask( | ||
tenantId: string, | ||
userTask: UserTask, | ||
values: UserTaskResult, | ||
) { | ||
return clientWithErrorHandling(tenantId, (client) => | ||
client.completeUserTask(userTask, values), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.