acebase-server 1.19.0 → 1.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +49 -49
- package/.github/workflows/publish.yml +125 -0
- package/Dockerfile +26 -26
- package/LICENSE +21 -21
- package/bin/acebase-server.js +8 -8
- package/create-package-files.sh +25 -0
- package/dist/cjs/routes/data-exists.js +2 -2
- package/dist/cjs/routes/data-export.js +2 -2
- package/dist/cjs/routes/data-get.js +2 -2
- package/dist/cjs/routes/data-reflect.js +2 -2
- package/dist/cjs/routes/docs.js +1 -1
- package/dist/cjs/routes/meta-info.js +1 -1
- package/dist/esm/routes/data-exists.js +1 -2
- package/dist/esm/routes/data-export.js +1 -2
- package/dist/esm/routes/data-get.js +1 -1
- package/dist/esm/routes/data-reflect.js +1 -2
- package/dist/esm/routes/docs.js +1 -1
- package/dist/esm/routes/meta-info.js +1 -1
- package/package.json +6 -7
- package/release_notes.md +2 -0
- package/src/routes/auth-change-password.yaml +73 -73
- package/src/routes/auth-delete.yaml +77 -77
- package/src/routes/auth-forgot-password.yaml +49 -49
- package/src/routes/auth-reset-password.yaml +53 -53
- package/src/routes/auth-signin.yaml +129 -129
- package/src/routes/auth-signout.yaml +46 -46
- package/src/routes/auth-signup.yaml +135 -135
- package/src/routes/auth-state.yaml +28 -28
- package/src/routes/auth-update.yaml +151 -151
- package/src/routes/auth-verify-email.yaml +52 -52
- package/src/routes/data-exists.yaml +44 -44
- package/src/routes/data-export.yaml +63 -63
- package/src/routes/data-import.yaml +74 -74
- package/src/routes/data-index-create.yaml +105 -105
- package/src/routes/data-index-delete.yaml +51 -51
- package/src/routes/data-index-list.yaml +84 -84
- package/src/routes/data-query.yaml +165 -165
- package/src/routes/data-reflect.yaml +124 -124
- package/src/routes/data-schema-get.yaml +53 -53
- package/src/routes/data-schema-set.yaml +64 -64
- package/src/routes/data-schema-test.yaml +66 -66
- package/src/routes/data-schemas-list.yaml +41 -41
- package/src/routes/data-set.yaml +77 -77
- package/src/routes/data-sync-changes.yaml +66 -66
- package/src/routes/data-sync-mutations.yaml +66 -66
- package/src/routes/data-transaction-finish.yaml +82 -82
- package/src/routes/data-transaction-start.yaml +58 -58
- package/src/routes/data-update.yaml +77 -77
- package/src/routes/meta-info.yaml +40 -40
- package/src/routes/meta-ping.yaml +22 -22
- package/src/routes/meta-stats.yaml +40 -40
- package/src/routes/oauth2-init.yaml +62 -62
- package/src/routes/oauth2-refresh.yaml +64 -64
- package/src/routes/oauth2-signin.yaml +65 -65
- package/webmanager/acebase-client-browser.min.js +12 -12
- package/webmanager/index.html +271 -271
- package/webmanager/index.js +437 -437
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
/auth/{dbname}/signin:
|
|
2
|
-
post:
|
|
3
|
-
tags:
|
|
4
|
-
- auth
|
|
5
|
-
summary: Sign in a user
|
|
6
|
-
description: Signs in an existing user
|
|
7
|
-
parameters:
|
|
8
|
-
- name: dbname
|
|
9
|
-
in: path
|
|
10
|
-
description: name of the database
|
|
11
|
-
required: true
|
|
12
|
-
schema:
|
|
13
|
-
type: string
|
|
14
|
-
example: mydb
|
|
15
|
-
requestBody:
|
|
16
|
-
description: sign in details
|
|
17
|
-
content:
|
|
18
|
-
'application/json':
|
|
19
|
-
schema:
|
|
20
|
-
oneOf:
|
|
21
|
-
- type: object
|
|
22
|
-
properties:
|
|
23
|
-
client_id:
|
|
24
|
-
description: ID of the connected websocket
|
|
25
|
-
type: string
|
|
26
|
-
method:
|
|
27
|
-
description: Method of authentication (email)
|
|
28
|
-
type: string
|
|
29
|
-
value: email
|
|
30
|
-
email:
|
|
31
|
-
description: User email address
|
|
32
|
-
type: string
|
|
33
|
-
password:
|
|
34
|
-
description: Password
|
|
35
|
-
type: string
|
|
36
|
-
format: password
|
|
37
|
-
required:
|
|
38
|
-
- method
|
|
39
|
-
- email
|
|
40
|
-
- password
|
|
41
|
-
example:
|
|
42
|
-
method: email
|
|
43
|
-
email: user@example.com
|
|
44
|
-
password: sup3rs3cr3t
|
|
45
|
-
- type: object
|
|
46
|
-
properties:
|
|
47
|
-
client_id:
|
|
48
|
-
description: ID of the connected websocket
|
|
49
|
-
type: string
|
|
50
|
-
method:
|
|
51
|
-
description: Method of authentication (account)
|
|
52
|
-
type: string
|
|
53
|
-
value: account
|
|
54
|
-
username:
|
|
55
|
-
description: Username
|
|
56
|
-
type: string
|
|
57
|
-
password:
|
|
58
|
-
description: Password
|
|
59
|
-
type: string
|
|
60
|
-
format: password
|
|
61
|
-
required:
|
|
62
|
-
- method
|
|
63
|
-
- username
|
|
64
|
-
- password
|
|
65
|
-
example:
|
|
66
|
-
method: account
|
|
67
|
-
username: admin
|
|
68
|
-
password: sup3rs3cr3t
|
|
69
|
-
- type: object
|
|
70
|
-
properties:
|
|
71
|
-
client_id:
|
|
72
|
-
type: string
|
|
73
|
-
description: ID of the connected websocket
|
|
74
|
-
method:
|
|
75
|
-
type: string
|
|
76
|
-
value: token
|
|
77
|
-
description: Method of authentication (token)
|
|
78
|
-
access_token:
|
|
79
|
-
type: string
|
|
80
|
-
description: Previously acquired access token to sign in with
|
|
81
|
-
required:
|
|
82
|
-
- method
|
|
83
|
-
- access_token
|
|
84
|
-
example:
|
|
85
|
-
method: token
|
|
86
|
-
access_token: bewufh387f3fyubqwekrjbcqwkuiec7gq3euyfbqwkuyebqjk..
|
|
87
|
-
responses:
|
|
88
|
-
200:
|
|
89
|
-
description: When signin succeeds, it returns an object with the result
|
|
90
|
-
content:
|
|
91
|
-
'application/json':
|
|
92
|
-
schema:
|
|
93
|
-
type: object
|
|
94
|
-
properties:
|
|
95
|
-
access_token:
|
|
96
|
-
description: The access token that provides access to API calls that require authentication. This access token should be added to the Authorization header of those requests. The token is allowed to be cached by the client to sign in witht the token method later
|
|
97
|
-
type: string
|
|
98
|
-
example: ewufh387f3fyubqwekrjbcqwkuiec7gq3euyfbqwkuyebqjk..
|
|
99
|
-
user:
|
|
100
|
-
$ref: '#/components/schemas/User'
|
|
101
|
-
401:
|
|
102
|
-
description: When the sent request details are incorrect, this "401 Unauthorized" is returned
|
|
103
|
-
content:
|
|
104
|
-
'application/json':
|
|
105
|
-
schema:
|
|
106
|
-
type: object
|
|
107
|
-
properties:
|
|
108
|
-
code:
|
|
109
|
-
type: string
|
|
110
|
-
description: The exact error code
|
|
111
|
-
enum:
|
|
112
|
-
- invalid_token
|
|
113
|
-
- not_found
|
|
114
|
-
- duplicate
|
|
115
|
-
- token_mismatch
|
|
116
|
-
- wrong_password
|
|
117
|
-
example: not_found
|
|
118
|
-
message:
|
|
119
|
-
type: string
|
|
120
|
-
description: Description of the error
|
|
121
|
-
example: Incorrect email
|
|
122
|
-
example:
|
|
123
|
-
code: wrong_password
|
|
124
|
-
message: Incorrect password
|
|
125
|
-
500:
|
|
126
|
-
description: An unenexpected error occurred on the server
|
|
127
|
-
content:
|
|
128
|
-
'application/json':
|
|
129
|
-
schema:
|
|
1
|
+
/auth/{dbname}/signin:
|
|
2
|
+
post:
|
|
3
|
+
tags:
|
|
4
|
+
- auth
|
|
5
|
+
summary: Sign in a user
|
|
6
|
+
description: Signs in an existing user
|
|
7
|
+
parameters:
|
|
8
|
+
- name: dbname
|
|
9
|
+
in: path
|
|
10
|
+
description: name of the database
|
|
11
|
+
required: true
|
|
12
|
+
schema:
|
|
13
|
+
type: string
|
|
14
|
+
example: mydb
|
|
15
|
+
requestBody:
|
|
16
|
+
description: sign in details
|
|
17
|
+
content:
|
|
18
|
+
'application/json':
|
|
19
|
+
schema:
|
|
20
|
+
oneOf:
|
|
21
|
+
- type: object
|
|
22
|
+
properties:
|
|
23
|
+
client_id:
|
|
24
|
+
description: ID of the connected websocket
|
|
25
|
+
type: string
|
|
26
|
+
method:
|
|
27
|
+
description: Method of authentication (email)
|
|
28
|
+
type: string
|
|
29
|
+
value: email
|
|
30
|
+
email:
|
|
31
|
+
description: User email address
|
|
32
|
+
type: string
|
|
33
|
+
password:
|
|
34
|
+
description: Password
|
|
35
|
+
type: string
|
|
36
|
+
format: password
|
|
37
|
+
required:
|
|
38
|
+
- method
|
|
39
|
+
- email
|
|
40
|
+
- password
|
|
41
|
+
example:
|
|
42
|
+
method: email
|
|
43
|
+
email: user@example.com
|
|
44
|
+
password: sup3rs3cr3t
|
|
45
|
+
- type: object
|
|
46
|
+
properties:
|
|
47
|
+
client_id:
|
|
48
|
+
description: ID of the connected websocket
|
|
49
|
+
type: string
|
|
50
|
+
method:
|
|
51
|
+
description: Method of authentication (account)
|
|
52
|
+
type: string
|
|
53
|
+
value: account
|
|
54
|
+
username:
|
|
55
|
+
description: Username
|
|
56
|
+
type: string
|
|
57
|
+
password:
|
|
58
|
+
description: Password
|
|
59
|
+
type: string
|
|
60
|
+
format: password
|
|
61
|
+
required:
|
|
62
|
+
- method
|
|
63
|
+
- username
|
|
64
|
+
- password
|
|
65
|
+
example:
|
|
66
|
+
method: account
|
|
67
|
+
username: admin
|
|
68
|
+
password: sup3rs3cr3t
|
|
69
|
+
- type: object
|
|
70
|
+
properties:
|
|
71
|
+
client_id:
|
|
72
|
+
type: string
|
|
73
|
+
description: ID of the connected websocket
|
|
74
|
+
method:
|
|
75
|
+
type: string
|
|
76
|
+
value: token
|
|
77
|
+
description: Method of authentication (token)
|
|
78
|
+
access_token:
|
|
79
|
+
type: string
|
|
80
|
+
description: Previously acquired access token to sign in with
|
|
81
|
+
required:
|
|
82
|
+
- method
|
|
83
|
+
- access_token
|
|
84
|
+
example:
|
|
85
|
+
method: token
|
|
86
|
+
access_token: bewufh387f3fyubqwekrjbcqwkuiec7gq3euyfbqwkuyebqjk..
|
|
87
|
+
responses:
|
|
88
|
+
200:
|
|
89
|
+
description: When signin succeeds, it returns an object with the result
|
|
90
|
+
content:
|
|
91
|
+
'application/json':
|
|
92
|
+
schema:
|
|
93
|
+
type: object
|
|
94
|
+
properties:
|
|
95
|
+
access_token:
|
|
96
|
+
description: The access token that provides access to API calls that require authentication. This access token should be added to the Authorization header of those requests. The token is allowed to be cached by the client to sign in witht the token method later
|
|
97
|
+
type: string
|
|
98
|
+
example: ewufh387f3fyubqwekrjbcqwkuiec7gq3euyfbqwkuyebqjk..
|
|
99
|
+
user:
|
|
100
|
+
$ref: '#/components/schemas/User'
|
|
101
|
+
401:
|
|
102
|
+
description: When the sent request details are incorrect, this "401 Unauthorized" is returned
|
|
103
|
+
content:
|
|
104
|
+
'application/json':
|
|
105
|
+
schema:
|
|
106
|
+
type: object
|
|
107
|
+
properties:
|
|
108
|
+
code:
|
|
109
|
+
type: string
|
|
110
|
+
description: The exact error code
|
|
111
|
+
enum:
|
|
112
|
+
- invalid_token
|
|
113
|
+
- not_found
|
|
114
|
+
- duplicate
|
|
115
|
+
- token_mismatch
|
|
116
|
+
- wrong_password
|
|
117
|
+
example: not_found
|
|
118
|
+
message:
|
|
119
|
+
type: string
|
|
120
|
+
description: Description of the error
|
|
121
|
+
example: Incorrect email
|
|
122
|
+
example:
|
|
123
|
+
code: wrong_password
|
|
124
|
+
message: Incorrect password
|
|
125
|
+
500:
|
|
126
|
+
description: An unenexpected error occurred on the server
|
|
127
|
+
content:
|
|
128
|
+
'application/json':
|
|
129
|
+
schema:
|
|
130
130
|
$ref: '#/components/schemas/UnexpectedError'
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/auth/{dbname}/signout:
|
|
2
|
-
post:
|
|
3
|
-
tags:
|
|
4
|
-
- auth
|
|
5
|
-
summary: Sign out current user
|
|
6
|
-
description: Signs out the currently signed in user
|
|
7
|
-
parameters:
|
|
8
|
-
- name: dbname
|
|
9
|
-
in: path
|
|
10
|
-
description: name of the database
|
|
11
|
-
required: true
|
|
12
|
-
schema:
|
|
13
|
-
type: string
|
|
14
|
-
example: mydb
|
|
15
|
-
requestBody:
|
|
16
|
-
description: Sign out details
|
|
17
|
-
content:
|
|
18
|
-
'application/json':
|
|
19
|
-
schema:
|
|
20
|
-
type: object
|
|
21
|
-
properties:
|
|
22
|
-
client_id:
|
|
23
|
-
type: string
|
|
24
|
-
description: ID of the connected websocket
|
|
25
|
-
everywhere:
|
|
26
|
-
type: boolean
|
|
27
|
-
description: Whether the user should sign out on ALL clients
|
|
28
|
-
example:
|
|
29
|
-
client_id: x8WIv7-mJelg7on_ALbx
|
|
30
|
-
everywhere: false
|
|
31
|
-
responses:
|
|
32
|
-
200:
|
|
33
|
-
description: Returns `"Bye!"` if signout is successful
|
|
34
|
-
content:
|
|
35
|
-
'text/plain':
|
|
36
|
-
schema:
|
|
37
|
-
type: string
|
|
38
|
-
value: Bye!
|
|
39
|
-
example: Bye!
|
|
40
|
-
500:
|
|
41
|
-
description: Returns an object describing an unexpected error
|
|
42
|
-
content:
|
|
43
|
-
'application/json':
|
|
44
|
-
schema:
|
|
45
|
-
$ref: '#/components/schemas/Error'
|
|
46
|
-
|
|
1
|
+
/auth/{dbname}/signout:
|
|
2
|
+
post:
|
|
3
|
+
tags:
|
|
4
|
+
- auth
|
|
5
|
+
summary: Sign out current user
|
|
6
|
+
description: Signs out the currently signed in user
|
|
7
|
+
parameters:
|
|
8
|
+
- name: dbname
|
|
9
|
+
in: path
|
|
10
|
+
description: name of the database
|
|
11
|
+
required: true
|
|
12
|
+
schema:
|
|
13
|
+
type: string
|
|
14
|
+
example: mydb
|
|
15
|
+
requestBody:
|
|
16
|
+
description: Sign out details
|
|
17
|
+
content:
|
|
18
|
+
'application/json':
|
|
19
|
+
schema:
|
|
20
|
+
type: object
|
|
21
|
+
properties:
|
|
22
|
+
client_id:
|
|
23
|
+
type: string
|
|
24
|
+
description: ID of the connected websocket
|
|
25
|
+
everywhere:
|
|
26
|
+
type: boolean
|
|
27
|
+
description: Whether the user should sign out on ALL clients
|
|
28
|
+
example:
|
|
29
|
+
client_id: x8WIv7-mJelg7on_ALbx
|
|
30
|
+
everywhere: false
|
|
31
|
+
responses:
|
|
32
|
+
200:
|
|
33
|
+
description: Returns `"Bye!"` if signout is successful
|
|
34
|
+
content:
|
|
35
|
+
'text/plain':
|
|
36
|
+
schema:
|
|
37
|
+
type: string
|
|
38
|
+
value: Bye!
|
|
39
|
+
example: Bye!
|
|
40
|
+
500:
|
|
41
|
+
description: Returns an object describing an unexpected error
|
|
42
|
+
content:
|
|
43
|
+
'application/json':
|
|
44
|
+
schema:
|
|
45
|
+
$ref: '#/components/schemas/Error'
|
|
46
|
+
|
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
/auth/{dbname}/signup:
|
|
2
|
-
post:
|
|
3
|
-
tags:
|
|
4
|
-
- auth
|
|
5
|
-
summary: Create a new user
|
|
6
|
-
description: Signs up a new user (must be enabled in the server config)
|
|
7
|
-
parameters:
|
|
8
|
-
- name: dbname
|
|
9
|
-
in: path
|
|
10
|
-
description: name of the database
|
|
11
|
-
required: true
|
|
12
|
-
schema:
|
|
13
|
-
type: string
|
|
14
|
-
example: mydb
|
|
15
|
-
requestBody:
|
|
16
|
-
description: new user details
|
|
17
|
-
content:
|
|
18
|
-
'application/json':
|
|
19
|
-
schema:
|
|
20
|
-
type: object
|
|
21
|
-
properties:
|
|
22
|
-
username:
|
|
23
|
-
type: string
|
|
24
|
-
description: Requested username (optional if `email` provided)
|
|
25
|
-
email:
|
|
26
|
-
type: string
|
|
27
|
-
description: Email address (optional if `username` provided)
|
|
28
|
-
displayName:
|
|
29
|
-
type: string
|
|
30
|
-
description: Name of the user for public displaying purposes. Consider this a real name, alias or handle
|
|
31
|
-
password:
|
|
32
|
-
type: string
|
|
33
|
-
format: password
|
|
34
|
-
description: Password to set for the account
|
|
35
|
-
picture:
|
|
36
|
-
type: object
|
|
37
|
-
description: Profile picture
|
|
38
|
-
properties:
|
|
39
|
-
url:
|
|
40
|
-
type: string
|
|
41
|
-
width:
|
|
42
|
-
type: number
|
|
43
|
-
height:
|
|
44
|
-
type: number
|
|
45
|
-
example:
|
|
46
|
-
url: https://my.profile.pic/me.jpg
|
|
47
|
-
width: 500
|
|
48
|
-
height: 500
|
|
49
|
-
settings:
|
|
50
|
-
type: object
|
|
51
|
-
otherProperties: true
|
|
52
|
-
desciption: (optional) miscellanious other info to store with the user account
|
|
53
|
-
required:
|
|
54
|
-
- username
|
|
55
|
-
- email
|
|
56
|
-
- displayName
|
|
57
|
-
- password
|
|
58
|
-
example:
|
|
59
|
-
email: user@example.com
|
|
60
|
-
displayName: Real Name
|
|
61
|
-
password: sup3rs3cr3t
|
|
62
|
-
responses:
|
|
63
|
-
200:
|
|
64
|
-
description: When signup succeeds, it returns an object with the result
|
|
65
|
-
content:
|
|
66
|
-
'application/json':
|
|
67
|
-
schema:
|
|
68
|
-
type: object
|
|
69
|
-
properties:
|
|
70
|
-
access_token:
|
|
71
|
-
description: The access token that provides access to API calls that require authentication. This access token should be added to the Authorization header of those requests. The token is allowed to be cached by the client to sign in witht the token method later
|
|
72
|
-
type: string
|
|
73
|
-
example: ewufh387f3fyubqwekrjbcqwkuiec7gq3euyfbqwkuyebqjk..
|
|
74
|
-
user:
|
|
75
|
-
$ref: '#/components/schemas/User'
|
|
76
|
-
403:
|
|
77
|
-
description: If user signup is disabled in the server config, only the admin user can create new accounts and `"403 Forbidden"` is returned
|
|
78
|
-
content:
|
|
79
|
-
'application/json':
|
|
80
|
-
schema:
|
|
81
|
-
type: object
|
|
82
|
-
properties:
|
|
83
|
-
code:
|
|
84
|
-
type: string
|
|
85
|
-
value: admin_only
|
|
86
|
-
message:
|
|
87
|
-
type: string
|
|
88
|
-
value: Only admin is allowed to create users
|
|
89
|
-
example:
|
|
90
|
-
code: admin_only
|
|
91
|
-
message: Only admin is allowed to create users
|
|
92
|
-
409:
|
|
93
|
-
description: An account with the same username or email address exists already
|
|
94
|
-
content:
|
|
95
|
-
'application/json':
|
|
96
|
-
schema:
|
|
97
|
-
type: object
|
|
98
|
-
properties:
|
|
99
|
-
code:
|
|
100
|
-
type: string
|
|
101
|
-
value: conflict
|
|
102
|
-
message:
|
|
103
|
-
type: string
|
|
104
|
-
value: Account with username and/or email already exists
|
|
105
|
-
422:
|
|
106
|
-
description: When the sent request details are incorrect, `"422 Unprocessable Entity"` is returned
|
|
107
|
-
content:
|
|
108
|
-
'application/json':
|
|
109
|
-
schema:
|
|
110
|
-
type: object
|
|
111
|
-
properties:
|
|
112
|
-
code:
|
|
113
|
-
type: string
|
|
114
|
-
description: The exact error code
|
|
115
|
-
enum:
|
|
116
|
-
- missing_details
|
|
117
|
-
- invalid_email
|
|
118
|
-
- invalid_username
|
|
119
|
-
- invalid_display_name
|
|
120
|
-
- invalid_password
|
|
121
|
-
- invalid_settings
|
|
122
|
-
- invalid_picture
|
|
123
|
-
example: missing_details
|
|
124
|
-
message:
|
|
125
|
-
type: string
|
|
126
|
-
description: Description of the error
|
|
127
|
-
example: No username or email provided
|
|
128
|
-
example:
|
|
129
|
-
code: invalid_password
|
|
130
|
-
message: Invalid password, must be at least 8 characters and cannot contain spaces
|
|
131
|
-
500:
|
|
132
|
-
description: An unenexpected error occurred on the server
|
|
133
|
-
content:
|
|
134
|
-
'application/json':
|
|
135
|
-
schema:
|
|
1
|
+
/auth/{dbname}/signup:
|
|
2
|
+
post:
|
|
3
|
+
tags:
|
|
4
|
+
- auth
|
|
5
|
+
summary: Create a new user
|
|
6
|
+
description: Signs up a new user (must be enabled in the server config)
|
|
7
|
+
parameters:
|
|
8
|
+
- name: dbname
|
|
9
|
+
in: path
|
|
10
|
+
description: name of the database
|
|
11
|
+
required: true
|
|
12
|
+
schema:
|
|
13
|
+
type: string
|
|
14
|
+
example: mydb
|
|
15
|
+
requestBody:
|
|
16
|
+
description: new user details
|
|
17
|
+
content:
|
|
18
|
+
'application/json':
|
|
19
|
+
schema:
|
|
20
|
+
type: object
|
|
21
|
+
properties:
|
|
22
|
+
username:
|
|
23
|
+
type: string
|
|
24
|
+
description: Requested username (optional if `email` provided)
|
|
25
|
+
email:
|
|
26
|
+
type: string
|
|
27
|
+
description: Email address (optional if `username` provided)
|
|
28
|
+
displayName:
|
|
29
|
+
type: string
|
|
30
|
+
description: Name of the user for public displaying purposes. Consider this a real name, alias or handle
|
|
31
|
+
password:
|
|
32
|
+
type: string
|
|
33
|
+
format: password
|
|
34
|
+
description: Password to set for the account
|
|
35
|
+
picture:
|
|
36
|
+
type: object
|
|
37
|
+
description: Profile picture
|
|
38
|
+
properties:
|
|
39
|
+
url:
|
|
40
|
+
type: string
|
|
41
|
+
width:
|
|
42
|
+
type: number
|
|
43
|
+
height:
|
|
44
|
+
type: number
|
|
45
|
+
example:
|
|
46
|
+
url: https://my.profile.pic/me.jpg
|
|
47
|
+
width: 500
|
|
48
|
+
height: 500
|
|
49
|
+
settings:
|
|
50
|
+
type: object
|
|
51
|
+
otherProperties: true
|
|
52
|
+
desciption: (optional) miscellanious other info to store with the user account
|
|
53
|
+
required:
|
|
54
|
+
- username
|
|
55
|
+
- email
|
|
56
|
+
- displayName
|
|
57
|
+
- password
|
|
58
|
+
example:
|
|
59
|
+
email: user@example.com
|
|
60
|
+
displayName: Real Name
|
|
61
|
+
password: sup3rs3cr3t
|
|
62
|
+
responses:
|
|
63
|
+
200:
|
|
64
|
+
description: When signup succeeds, it returns an object with the result
|
|
65
|
+
content:
|
|
66
|
+
'application/json':
|
|
67
|
+
schema:
|
|
68
|
+
type: object
|
|
69
|
+
properties:
|
|
70
|
+
access_token:
|
|
71
|
+
description: The access token that provides access to API calls that require authentication. This access token should be added to the Authorization header of those requests. The token is allowed to be cached by the client to sign in witht the token method later
|
|
72
|
+
type: string
|
|
73
|
+
example: ewufh387f3fyubqwekrjbcqwkuiec7gq3euyfbqwkuyebqjk..
|
|
74
|
+
user:
|
|
75
|
+
$ref: '#/components/schemas/User'
|
|
76
|
+
403:
|
|
77
|
+
description: If user signup is disabled in the server config, only the admin user can create new accounts and `"403 Forbidden"` is returned
|
|
78
|
+
content:
|
|
79
|
+
'application/json':
|
|
80
|
+
schema:
|
|
81
|
+
type: object
|
|
82
|
+
properties:
|
|
83
|
+
code:
|
|
84
|
+
type: string
|
|
85
|
+
value: admin_only
|
|
86
|
+
message:
|
|
87
|
+
type: string
|
|
88
|
+
value: Only admin is allowed to create users
|
|
89
|
+
example:
|
|
90
|
+
code: admin_only
|
|
91
|
+
message: Only admin is allowed to create users
|
|
92
|
+
409:
|
|
93
|
+
description: An account with the same username or email address exists already
|
|
94
|
+
content:
|
|
95
|
+
'application/json':
|
|
96
|
+
schema:
|
|
97
|
+
type: object
|
|
98
|
+
properties:
|
|
99
|
+
code:
|
|
100
|
+
type: string
|
|
101
|
+
value: conflict
|
|
102
|
+
message:
|
|
103
|
+
type: string
|
|
104
|
+
value: Account with username and/or email already exists
|
|
105
|
+
422:
|
|
106
|
+
description: When the sent request details are incorrect, `"422 Unprocessable Entity"` is returned
|
|
107
|
+
content:
|
|
108
|
+
'application/json':
|
|
109
|
+
schema:
|
|
110
|
+
type: object
|
|
111
|
+
properties:
|
|
112
|
+
code:
|
|
113
|
+
type: string
|
|
114
|
+
description: The exact error code
|
|
115
|
+
enum:
|
|
116
|
+
- missing_details
|
|
117
|
+
- invalid_email
|
|
118
|
+
- invalid_username
|
|
119
|
+
- invalid_display_name
|
|
120
|
+
- invalid_password
|
|
121
|
+
- invalid_settings
|
|
122
|
+
- invalid_picture
|
|
123
|
+
example: missing_details
|
|
124
|
+
message:
|
|
125
|
+
type: string
|
|
126
|
+
description: Description of the error
|
|
127
|
+
example: No username or email provided
|
|
128
|
+
example:
|
|
129
|
+
code: invalid_password
|
|
130
|
+
message: Invalid password, must be at least 8 characters and cannot contain spaces
|
|
131
|
+
500:
|
|
132
|
+
description: An unenexpected error occurred on the server
|
|
133
|
+
content:
|
|
134
|
+
'application/json':
|
|
135
|
+
schema:
|
|
136
136
|
$ref: '#/components/schemas/UnexpectedError'
|