-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAuth.js
More file actions
36 lines (30 loc) · 832 Bytes
/
Auth.js
File metadata and controls
36 lines (30 loc) · 832 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
28
29
30
31
32
33
34
35
36
// @flow
import { request, required } from './Client'
// flow types
import type { FetchOptions } from './Client';
import type {
AuthorizationEntity,
} from './definitions';
type createAuthorizationParams = {
scopes?: Array<any>,
note: string,
note_url?: string,
client_id?: string,
client_secret?: string,
fingerprint?: string,
}
export function createAuthorization(
params: createAuthorizationParams,
options?: FetchOptions
): Promise<AuthorizationEntity> {
return request(`/authorizations`, params, "POST", options);
}
type deleteAuthorizationParams = {
}
export function deleteAuthorization(
id: number = required("id"),
params: deleteAuthorizationParams,
options?: FetchOptions
): Promise<any> {
return request(`/authorizations/${id}`, params, "DELETE", options);
}