-
Notifications
You must be signed in to change notification settings - Fork 258
Expand file tree
/
Copy pathtypes.ts
More file actions
27 lines (21 loc) · 911 Bytes
/
types.ts
File metadata and controls
27 lines (21 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { Connection, Repo, RepoToConnection } from "@sourcebot/db";
import { ConnectionConfig } from "@sourcebot/schemas/v3/connection.type";
import { Settings as SettingsSchema } from "@sourcebot/schemas/v3/index.type";
export type Settings = Required<SettingsSchema>;
// @see : https://stackoverflow.com/a/61132308
export type DeepPartial<T> = T extends object ? {
[P in keyof T]?: DeepPartial<T[P]>;
} : T;
// @see: https://stackoverflow.com/a/69328045
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
export type RepoWithConnections = Repo & { connections: (RepoToConnection & { connection: Connection })[] };
export type RepoAuthCredentials = {
hostUrl?: string;
token: string;
cloneUrlWithToken?: string;
authHeader?: string;
/** The connection that configured the
* credentials for this repo.
*/
connectionConfig?: ConnectionConfig;
}