-
Notifications
You must be signed in to change notification settings - Fork 30
/
user-doc.js
158 lines (140 loc) · 3.08 KB
/
user-doc.js
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// NOTE: validation is not defined here as that would require calling code to
// use seneca-doc
module.exports = {
adjust_user: {
desc: 'Adjust user status idempotently (activated, etc.).',
reply_desc: {
ok: '_true_ if user found',
user: 'user entity',
},
},
auth_user: {
desc: 'Authenticate a login using token',
reply_desc: {
ok: '_true_ if login is active',
user: 'user entity',
login: 'user entity',
},
},
register_user: {
desc: 'Register a new user',
reply_desc: {
ok: '_true_ if user registration succeeded',
user: 'user entity',
},
},
get_user: {
desc: 'Get user details',
reply_desc: {
ok: '_true_ if user found',
user: 'user entity',
},
},
remove_user: {
desc: 'Remove a user',
reply_desc: {
ok: '_true_ if user removed',
user: 'user entity',
},
},
update_user: {
desc: 'Update a user',
reply_desc: {
ok: '_true_ if user updated',
user: 'user entity',
},
},
list_user: {
desc: 'List users',
reply_desc: {
ok: '_true_ if user found',
items: 'user entity item list',
},
},
list_login: {
desc: 'List logins for a user',
reply_desc: {
ok: '_true_ if user found',
items: 'user entity item list',
},
},
login_user: {
desc: 'Login user',
reply_desc: {
ok: '_true_ if user logged in',
user: 'user entity',
login: 'login entity',
},
},
logout_user: {
desc: 'Login user',
reply_desc: {
ok: '_true_ if user logged in',
count: 'number of logouts',
},
},
cmd_encrypt: {
desc: 'Encrypt a plain text password string.',
examples: {
'pass:foofoobarbar':
'Result: {ok:true, pass:_encrypted-string_, salt:_string_}',
},
reply_desc: {
ok: '_true_ if encryption succeeded',
pass: 'encrypted password string',
salt: 'salt value string',
},
},
check_exists: {
desc: 'Check user exists.',
reply_desc: {
ok: '_true_ if user exists',
user: 'user entity',
},
},
make_verify: {
desc: 'Create a verification entry (multiple use cases).',
reply_desc: {
ok: '_true_ if user found',
verify: 'verify entity',
},
},
change_handle: {
desc: 'Change user handle.',
reply_desc: {
ok: '_true_ if changed',
user: 'user entity',
},
},
change_email: {
desc: 'Change user email.',
reply_desc: {
ok: '_true_ if changed',
user: 'user entity',
},
},
change_pass: {
desc: 'Change user password.',
reply_desc: {
ok: '_true_ if changed',
user: 'user entity',
},
},
check_verify: {
desc: 'Check a verfication entry.',
reply_desc: {
ok: '_true_ if valid',
why: 'string coded reason if not valid',
},
},
cmd_pass: {
desc: 'Validate a plain text password string.',
examples: {
'pass:goodpassword': 'Result: {ok:true}',
},
reply_desc: {
ok: '_true_ if password is valid',
why: 'string coded reason if not valid',
},
},
}