UNPKG

1.16 kBJavaScriptView Raw
1/**
2 * Module dependencies
3 */
4
5var request = require('../lib/request')
6
7/**
8 * List Scopes
9 */
10
11function listScopes (options) {
12 options = options || {}
13 options.url = '/v1/scopes'
14 return request.bind(this)(options)
15}
16
17exports.list = listScopes
18
19/**
20 * Get Scope
21 */
22
23function getScope (id, options) {
24 options = options || {}
25 options.url = '/v1/scopes/' + id
26 return request.bind(this)(options)
27}
28
29exports.get = getScope
30
31/**
32 * Create Scope
33 */
34
35function createScope (data, options) {
36 options = options || {}
37 options.url = '/v1/scopes'
38 options.method = 'POST'
39 options.json = data
40 return request.bind(this)(options)
41}
42
43exports.create = createScope
44
45/**
46 * Update Scope
47 */
48
49function updateScope (id, data, options) {
50 options = options || {}
51 options.url = '/v1/scopes/' + id
52 options.method = 'PATCH'
53 options.json = data
54 return request.bind(this)(options)
55}
56
57exports.update = updateScope
58
59/**
60 * Delete Scope
61 */
62
63function deleteScope (id, options) {
64 options = options || {}
65 options.url = '/v1/scopes/' + id
66 options.method = 'DELETE'
67 delete options.json
68 return request.bind(this)(options)
69}
70
71exports.delete = deleteScope