aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/types/models/oauth
diff options
context:
space:
mode:
Diffstat (limited to 'server/types/models/oauth')
-rw-r--r--server/types/models/oauth/index.ts2
-rw-r--r--server/types/models/oauth/oauth-client.ts3
-rw-r--r--server/types/models/oauth/oauth-token.ts14
3 files changed, 19 insertions, 0 deletions
diff --git a/server/types/models/oauth/index.ts b/server/types/models/oauth/index.ts
new file mode 100644
index 000000000..36b7ea8ca
--- /dev/null
+++ b/server/types/models/oauth/index.ts
@@ -0,0 +1,2 @@
1export * from './oauth-client'
2export * from './oauth-token'
diff --git a/server/types/models/oauth/oauth-client.ts b/server/types/models/oauth/oauth-client.ts
new file mode 100644
index 000000000..904a07863
--- /dev/null
+++ b/server/types/models/oauth/oauth-client.ts
@@ -0,0 +1,3 @@
1import { OAuthClientModel } from '@server/models/oauth/oauth-client'
2
3export type MOAuthClient = Omit<OAuthClientModel, 'OAuthTokens'>
diff --git a/server/types/models/oauth/oauth-token.ts b/server/types/models/oauth/oauth-token.ts
new file mode 100644
index 000000000..396cf6429
--- /dev/null
+++ b/server/types/models/oauth/oauth-token.ts
@@ -0,0 +1,14 @@
1import { OAuthTokenModel } from '@server/models/oauth/oauth-token'
2import { PickWith } from '@server/types/utils'
3import { MUserAccountUrl } from '../user/user'
4
5type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M>
6
7// ############################################################################
8
9export type MOAuthToken = Omit<OAuthTokenModel, 'User' | 'OAuthClients'>
10
11export type MOAuthTokenUser =
12 MOAuthToken &
13 Use<'User', MUserAccountUrl> &
14 { user?: MUserAccountUrl }