ede566eed9
* prep for new resources algo * typescriptifying stuff * minor types fix * migrate to resources col * repo & creation updated, WIP processing/retrieval * WIP invite processing * finished finalization refactor * project invite management * transformed all invites services * fixed up projects & core serverinvites resolvers * test fixes * WIP workspace create GQL & test * basic invite creation test works * a buncha working tests * more tests * cancelation tests * minor invite use refactor * invite retrieval tasks * invite use() works as expected * filtering out broken invites * enabled invite retrieval by token irregardless of who is it for * minor adjustments * tests fix * test config improvements * test env adjustment * extra test case * making resource access limits harder to ignore * linter fixes * eventBus type cleanup * better generic names * refactored serverinvites resource migration * fix(server): better error message in project invite edge case
23 lines
640 B
TypeScript
23 lines
640 B
TypeScript
import { registerOrUpdateScopeFactory } from '@/modules/shared/repositories/scopes'
|
|
import { moduleLogger } from '@/logging/logging'
|
|
import db from '@/db/knex'
|
|
import { Scopes } from '@speckle/shared'
|
|
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
|
|
|
const scopes = [
|
|
{
|
|
name: Scopes.Users.Invite,
|
|
description: 'Invite others to join this server.',
|
|
public: false
|
|
}
|
|
]
|
|
|
|
export const init: SpeckleModule['init'] = async () => {
|
|
moduleLogger.info('💌 Init invites module')
|
|
|
|
const registerFunc = registerOrUpdateScopeFactory({ db })
|
|
for (const scope of scopes) {
|
|
await registerFunc({ scope })
|
|
}
|
|
}
|