f501cc4ad5
* WIP can create project * WIP can create project more work * complete body, stencil tests * feat(shared): move workspace plan types into shared * test progress wip * feat(shared): add more logic to canCreateWorkspaceProject * a few more tests, as a treat * chore(authz): round out tests * fixed loaders, new GQL checks, dataLoaders in auth loaders * fix(authz): get workspace limits loader * chore(authz): update loaders * frontend fixed up to snuff * fix(authz): fix workspace plans for tests * fix(authz): classic * fix(authz): 0 counts --------- Co-authored-by: Chuck Driesler <chuck@speckle.systems> Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
21 lines
671 B
TypeScript
21 lines
671 B
TypeScript
import { RequestDataLoaders } from '@/modules/core/loaders'
|
|
import { Authz, MaybeAsync } from '@speckle/shared'
|
|
|
|
export type ServerLoadersContext = {
|
|
dataLoaders: RequestDataLoaders
|
|
}
|
|
|
|
// Inject extra argument to all loaders, e.g. for GQL dataloaders
|
|
export type ServerLoaders = Partial<{
|
|
[K in keyof Authz.AuthCheckContextLoaders]: Authz.AuthCheckContextLoaders[K] extends (
|
|
...args: infer A
|
|
) => infer R
|
|
? (...args: [...A, ctx: ServerLoadersContext]) => R
|
|
: never
|
|
}>
|
|
|
|
// define being an arg simplifes usage in export default calls
|
|
export const defineModuleLoaders = (define: () => MaybeAsync<ServerLoaders>) => {
|
|
return async () => await define()
|
|
}
|