-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathsync-api.ts
More file actions
38 lines (30 loc) · 1.11 KB
/
Copy pathsync-api.ts
File metadata and controls
38 lines (30 loc) · 1.11 KB
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
28
29
30
31
32
33
34
35
36
37
38
import type { Credential, CredentialConfig, Sync } from './sync-types'
// Sync Service — Route Map
interface ListResponse<T> {
data: T[]
has_more: boolean
}
export interface SyncAPI {
// MARK: - Credentials
/** List Credentials */
'GET /credentials': { response: ListResponse<Credential> }
/** Create Credential */
'POST /credentials': { body: CredentialConfig; response: Credential }
/** Retrieve Credential */
'GET /credentials/:id': { response: Credential }
/** Update Credential */
'PATCH /credentials/:id': { body: Partial<CredentialConfig>; response: Credential }
/** Delete Credential */
'DELETE /credentials/:id': { response: { id: `cred_${string}`; deleted: true } }
// MARK: - Syncs
/** List Syncs */
'GET /syncs': { response: ListResponse<Sync> }
/** Create Sync */
'POST /syncs': { body: Omit<Sync, 'id'>; response: Sync }
/** Retrieve Sync */
'GET /syncs/:id': { response: Sync }
/** Update Sync */
'PATCH /syncs/:id': { body: Partial<Omit<Sync, 'id'>>; response: Sync }
/** Delete Sync */
'DELETE /syncs/:id': { response: { id: `sync_${string}`; deleted: true } }
}