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,124 +1,124 @@
|
|
|
1
|
-
/reflect/{dbname}/{path}:
|
|
2
|
-
get:
|
|
3
|
-
tags:
|
|
4
|
-
- data
|
|
5
|
-
summary: Reflection
|
|
6
|
-
description: Gets information about a node and/or its children without loading any values. When signed in as the admin user, it is possible to include security info (read/write access rights) for an impersonated 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
|
-
- name: path
|
|
16
|
-
in: path
|
|
17
|
-
description: database path
|
|
18
|
-
required: true
|
|
19
|
-
schema:
|
|
20
|
-
type: string
|
|
21
|
-
example: collection/child/property
|
|
22
|
-
- name: type
|
|
23
|
-
in: query
|
|
24
|
-
description: reflection type
|
|
25
|
-
required: true
|
|
26
|
-
schema:
|
|
27
|
-
type: string
|
|
28
|
-
enum:
|
|
29
|
-
- info
|
|
30
|
-
- children
|
|
31
|
-
example: info
|
|
32
|
-
- name: include_child_count
|
|
33
|
-
in: query
|
|
34
|
-
required: false
|
|
35
|
-
description: if type is 'info', whether to include the child count
|
|
36
|
-
schema:
|
|
37
|
-
type: boolean
|
|
38
|
-
example: false
|
|
39
|
-
- name: child_limit
|
|
40
|
-
in: query
|
|
41
|
-
required: false
|
|
42
|
-
description: (for paging) if type is 'info', the max number of children to reflect. To skip previously acquired children, use in combination with `skip` or `from`
|
|
43
|
-
schema:
|
|
44
|
-
type: integer
|
|
45
|
-
example: 10
|
|
46
|
-
- name: child_skip
|
|
47
|
-
in: query
|
|
48
|
-
required: false
|
|
49
|
-
description: (for paging) if type is 'info', the number of children to skip
|
|
50
|
-
schema:
|
|
51
|
-
type: integer
|
|
52
|
-
example: 0
|
|
53
|
-
- name: child_from
|
|
54
|
-
in: query
|
|
55
|
-
required: false
|
|
56
|
-
description: (for paging) if type is 'info', the last child in previous reflection results to start enumerating
|
|
57
|
-
schema:
|
|
58
|
-
oneOf:
|
|
59
|
-
- type: string
|
|
60
|
-
description: key of the last enumerated child
|
|
61
|
-
- type: number
|
|
62
|
-
description: index of the last enumerated child
|
|
63
|
-
- name: limit
|
|
64
|
-
in: query
|
|
65
|
-
required: false
|
|
66
|
-
description: (for paging) if type is 'children', the max number of children to reflect. To skip previously acquired children, use in combination with `skip` or `from`
|
|
67
|
-
schema:
|
|
68
|
-
type: integer
|
|
69
|
-
example: 10
|
|
70
|
-
- name: skip
|
|
71
|
-
in: query
|
|
72
|
-
required: false
|
|
73
|
-
description: (for paging) if type is 'children', the number of children to skip
|
|
74
|
-
schema:
|
|
75
|
-
type: integer
|
|
76
|
-
example: 0
|
|
77
|
-
- name: from
|
|
78
|
-
in: query
|
|
79
|
-
required: false
|
|
80
|
-
description: (for paging) if type is 'children', the last child in previous reflection results to start enumerating
|
|
81
|
-
schema:
|
|
82
|
-
oneOf:
|
|
83
|
-
- type: string
|
|
84
|
-
description: key of the last enumerated child
|
|
85
|
-
- type: number
|
|
86
|
-
description: index of the last enumerated child
|
|
87
|
-
- name: impersonate
|
|
88
|
-
in: query
|
|
89
|
-
description: uid of the user to add access rights information for
|
|
90
|
-
required: false
|
|
91
|
-
schema:
|
|
92
|
-
type: string
|
|
93
|
-
responses:
|
|
94
|
-
200:
|
|
95
|
-
description: Returns requested reflection info for the target path
|
|
96
|
-
content:
|
|
97
|
-
'application/json':
|
|
98
|
-
schema:
|
|
99
|
-
oneOf:
|
|
100
|
-
- $ref: '#/components/schemas/ReflectionNodeInfo'
|
|
101
|
-
description: If reflection type is 'info'
|
|
102
|
-
- type: object
|
|
103
|
-
description: If reflection type is 'children'
|
|
104
|
-
properties:
|
|
105
|
-
more:
|
|
106
|
-
type: boolean
|
|
107
|
-
description: If there are more children
|
|
108
|
-
example: true
|
|
109
|
-
list:
|
|
110
|
-
type: array
|
|
111
|
-
items:
|
|
112
|
-
$ref: '#/components/schemas/ReflectionNodeInfo'
|
|
113
|
-
403:
|
|
114
|
-
description: Returns a "403 Forbidden" if the signed in user is not allowed to read from the target path
|
|
115
|
-
content:
|
|
116
|
-
'application/json':
|
|
117
|
-
schema:
|
|
118
|
-
$ref: '#/components/schemas/Error'
|
|
119
|
-
500:
|
|
120
|
-
description: An unexpected error occurred
|
|
121
|
-
content:
|
|
122
|
-
'application/json':
|
|
123
|
-
schema:
|
|
124
|
-
$ref: '#/components/schemas/UnexpectedError'
|
|
1
|
+
/reflect/{dbname}/{path}:
|
|
2
|
+
get:
|
|
3
|
+
tags:
|
|
4
|
+
- data
|
|
5
|
+
summary: Reflection
|
|
6
|
+
description: Gets information about a node and/or its children without loading any values. When signed in as the admin user, it is possible to include security info (read/write access rights) for an impersonated 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
|
+
- name: path
|
|
16
|
+
in: path
|
|
17
|
+
description: database path
|
|
18
|
+
required: true
|
|
19
|
+
schema:
|
|
20
|
+
type: string
|
|
21
|
+
example: collection/child/property
|
|
22
|
+
- name: type
|
|
23
|
+
in: query
|
|
24
|
+
description: reflection type
|
|
25
|
+
required: true
|
|
26
|
+
schema:
|
|
27
|
+
type: string
|
|
28
|
+
enum:
|
|
29
|
+
- info
|
|
30
|
+
- children
|
|
31
|
+
example: info
|
|
32
|
+
- name: include_child_count
|
|
33
|
+
in: query
|
|
34
|
+
required: false
|
|
35
|
+
description: if type is 'info', whether to include the child count
|
|
36
|
+
schema:
|
|
37
|
+
type: boolean
|
|
38
|
+
example: false
|
|
39
|
+
- name: child_limit
|
|
40
|
+
in: query
|
|
41
|
+
required: false
|
|
42
|
+
description: (for paging) if type is 'info', the max number of children to reflect. To skip previously acquired children, use in combination with `skip` or `from`
|
|
43
|
+
schema:
|
|
44
|
+
type: integer
|
|
45
|
+
example: 10
|
|
46
|
+
- name: child_skip
|
|
47
|
+
in: query
|
|
48
|
+
required: false
|
|
49
|
+
description: (for paging) if type is 'info', the number of children to skip
|
|
50
|
+
schema:
|
|
51
|
+
type: integer
|
|
52
|
+
example: 0
|
|
53
|
+
- name: child_from
|
|
54
|
+
in: query
|
|
55
|
+
required: false
|
|
56
|
+
description: (for paging) if type is 'info', the last child in previous reflection results to start enumerating
|
|
57
|
+
schema:
|
|
58
|
+
oneOf:
|
|
59
|
+
- type: string
|
|
60
|
+
description: key of the last enumerated child
|
|
61
|
+
- type: number
|
|
62
|
+
description: index of the last enumerated child
|
|
63
|
+
- name: limit
|
|
64
|
+
in: query
|
|
65
|
+
required: false
|
|
66
|
+
description: (for paging) if type is 'children', the max number of children to reflect. To skip previously acquired children, use in combination with `skip` or `from`
|
|
67
|
+
schema:
|
|
68
|
+
type: integer
|
|
69
|
+
example: 10
|
|
70
|
+
- name: skip
|
|
71
|
+
in: query
|
|
72
|
+
required: false
|
|
73
|
+
description: (for paging) if type is 'children', the number of children to skip
|
|
74
|
+
schema:
|
|
75
|
+
type: integer
|
|
76
|
+
example: 0
|
|
77
|
+
- name: from
|
|
78
|
+
in: query
|
|
79
|
+
required: false
|
|
80
|
+
description: (for paging) if type is 'children', the last child in previous reflection results to start enumerating
|
|
81
|
+
schema:
|
|
82
|
+
oneOf:
|
|
83
|
+
- type: string
|
|
84
|
+
description: key of the last enumerated child
|
|
85
|
+
- type: number
|
|
86
|
+
description: index of the last enumerated child
|
|
87
|
+
- name: impersonate
|
|
88
|
+
in: query
|
|
89
|
+
description: uid of the user to add access rights information for
|
|
90
|
+
required: false
|
|
91
|
+
schema:
|
|
92
|
+
type: string
|
|
93
|
+
responses:
|
|
94
|
+
200:
|
|
95
|
+
description: Returns requested reflection info for the target path
|
|
96
|
+
content:
|
|
97
|
+
'application/json':
|
|
98
|
+
schema:
|
|
99
|
+
oneOf:
|
|
100
|
+
- $ref: '#/components/schemas/ReflectionNodeInfo'
|
|
101
|
+
description: If reflection type is 'info'
|
|
102
|
+
- type: object
|
|
103
|
+
description: If reflection type is 'children'
|
|
104
|
+
properties:
|
|
105
|
+
more:
|
|
106
|
+
type: boolean
|
|
107
|
+
description: If there are more children
|
|
108
|
+
example: true
|
|
109
|
+
list:
|
|
110
|
+
type: array
|
|
111
|
+
items:
|
|
112
|
+
$ref: '#/components/schemas/ReflectionNodeInfo'
|
|
113
|
+
403:
|
|
114
|
+
description: Returns a "403 Forbidden" if the signed in user is not allowed to read from the target path
|
|
115
|
+
content:
|
|
116
|
+
'application/json':
|
|
117
|
+
schema:
|
|
118
|
+
$ref: '#/components/schemas/Error'
|
|
119
|
+
500:
|
|
120
|
+
description: An unexpected error occurred
|
|
121
|
+
content:
|
|
122
|
+
'application/json':
|
|
123
|
+
schema:
|
|
124
|
+
$ref: '#/components/schemas/UnexpectedError'
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
/schema/{dbname}/{path}:
|
|
2
|
-
get:
|
|
3
|
-
tags:
|
|
4
|
-
- data
|
|
5
|
-
- schemas
|
|
6
|
-
summary: Gets the schema defined on a path
|
|
7
|
-
description: Gets the schema defined on a specific path
|
|
8
|
-
parameters:
|
|
9
|
-
- name: dbname
|
|
10
|
-
in: path
|
|
11
|
-
description: name of the database
|
|
12
|
-
required: true
|
|
13
|
-
schema:
|
|
14
|
-
type: string
|
|
15
|
-
example: mydb
|
|
16
|
-
- name: path
|
|
17
|
-
in: path
|
|
18
|
-
description: database path
|
|
19
|
-
required: true
|
|
20
|
-
schema:
|
|
21
|
-
type: string
|
|
22
|
-
example: collection/item
|
|
23
|
-
responses:
|
|
24
|
-
200:
|
|
25
|
-
description: Returns the defined schema on the target path
|
|
26
|
-
content:
|
|
27
|
-
'application/json':
|
|
28
|
-
schema:
|
|
29
|
-
type: object
|
|
30
|
-
description: Object containing the string representation of the schema
|
|
31
|
-
example:
|
|
32
|
-
path: collection/child
|
|
33
|
-
schema: "{ name: string, stats?: { size: number, created: Date, modified: Date, deleted?: Date } }"
|
|
34
|
-
text: "{ name: string, stats?: { size: number, created: Date, modified: Date, deleted?: Date } }"
|
|
35
|
-
403:
|
|
36
|
-
description: Returns a "403 Forbidden" if the signed in user is not admin
|
|
37
|
-
content:
|
|
38
|
-
'application/json':
|
|
39
|
-
schema:
|
|
40
|
-
$ref: '#/components/schemas/Error'
|
|
41
|
-
410:
|
|
42
|
-
description: Returns "410 Gone" if there is no schema definition on the requested path
|
|
43
|
-
content:
|
|
44
|
-
'text/plain':
|
|
45
|
-
schema:
|
|
46
|
-
type: text
|
|
47
|
-
example: Not Found
|
|
48
|
-
500:
|
|
49
|
-
description: An unexpected error occurred
|
|
50
|
-
content:
|
|
51
|
-
'application/json':
|
|
52
|
-
schema:
|
|
53
|
-
$ref: '#/components/schemas/UnexpectedError'
|
|
1
|
+
/schema/{dbname}/{path}:
|
|
2
|
+
get:
|
|
3
|
+
tags:
|
|
4
|
+
- data
|
|
5
|
+
- schemas
|
|
6
|
+
summary: Gets the schema defined on a path
|
|
7
|
+
description: Gets the schema defined on a specific path
|
|
8
|
+
parameters:
|
|
9
|
+
- name: dbname
|
|
10
|
+
in: path
|
|
11
|
+
description: name of the database
|
|
12
|
+
required: true
|
|
13
|
+
schema:
|
|
14
|
+
type: string
|
|
15
|
+
example: mydb
|
|
16
|
+
- name: path
|
|
17
|
+
in: path
|
|
18
|
+
description: database path
|
|
19
|
+
required: true
|
|
20
|
+
schema:
|
|
21
|
+
type: string
|
|
22
|
+
example: collection/item
|
|
23
|
+
responses:
|
|
24
|
+
200:
|
|
25
|
+
description: Returns the defined schema on the target path
|
|
26
|
+
content:
|
|
27
|
+
'application/json':
|
|
28
|
+
schema:
|
|
29
|
+
type: object
|
|
30
|
+
description: Object containing the string representation of the schema
|
|
31
|
+
example:
|
|
32
|
+
path: collection/child
|
|
33
|
+
schema: "{ name: string, stats?: { size: number, created: Date, modified: Date, deleted?: Date } }"
|
|
34
|
+
text: "{ name: string, stats?: { size: number, created: Date, modified: Date, deleted?: Date } }"
|
|
35
|
+
403:
|
|
36
|
+
description: Returns a "403 Forbidden" if the signed in user is not admin
|
|
37
|
+
content:
|
|
38
|
+
'application/json':
|
|
39
|
+
schema:
|
|
40
|
+
$ref: '#/components/schemas/Error'
|
|
41
|
+
410:
|
|
42
|
+
description: Returns "410 Gone" if there is no schema definition on the requested path
|
|
43
|
+
content:
|
|
44
|
+
'text/plain':
|
|
45
|
+
schema:
|
|
46
|
+
type: text
|
|
47
|
+
example: Not Found
|
|
48
|
+
500:
|
|
49
|
+
description: An unexpected error occurred
|
|
50
|
+
content:
|
|
51
|
+
'application/json':
|
|
52
|
+
schema:
|
|
53
|
+
$ref: '#/components/schemas/UnexpectedError'
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
/schema/{dbname}:
|
|
2
|
-
post:
|
|
3
|
-
tags:
|
|
4
|
-
- data
|
|
5
|
-
- schemas
|
|
6
|
-
summary: Add a schema definition
|
|
7
|
-
description: Adds a schema definition to the specified path. This schema will be enabled while the server runs, and cleared upon restart. If you need the schema to be persisted, add it to your server's rules.json file
|
|
8
|
-
parameters:
|
|
9
|
-
- name: dbname
|
|
10
|
-
in: path
|
|
11
|
-
description: name of the database
|
|
12
|
-
required: true
|
|
13
|
-
schema:
|
|
14
|
-
type: string
|
|
15
|
-
example: mydb
|
|
16
|
-
requestBody:
|
|
17
|
-
description: details about the data and schema to test
|
|
18
|
-
content:
|
|
19
|
-
'application/json':
|
|
20
|
-
schema:
|
|
21
|
-
type: object
|
|
22
|
-
properties:
|
|
23
|
-
action:
|
|
24
|
-
type: string
|
|
25
|
-
description: The desired operation `'set'` (optional, deprecated since v1.10.0)
|
|
26
|
-
example: set
|
|
27
|
-
path:
|
|
28
|
-
type: string
|
|
29
|
-
description: database path to the given value
|
|
30
|
-
example: collection/item
|
|
31
|
-
schema:
|
|
32
|
-
type: string
|
|
33
|
-
description: When given, tests this schema definition against the passed value instead of ones defined in the database
|
|
34
|
-
example: "{ name: string, stats?: { size: number, created: Date, modified: Date, deleted?: Date } }"
|
|
35
|
-
warnOnly:
|
|
36
|
-
type: boolean
|
|
37
|
-
description: whether to issue warnings for failing schema checks instead of denying writes. This allows you to add schemas to an existing database and testdrive them without enforcing them yet. Default is `false`
|
|
38
|
-
example: false
|
|
39
|
-
required:
|
|
40
|
-
- path
|
|
41
|
-
- schema
|
|
42
|
-
responses:
|
|
43
|
-
200:
|
|
44
|
-
description: Returns "200 OK" if the schema was added successfully
|
|
45
|
-
content:
|
|
46
|
-
'application/json':
|
|
47
|
-
schema:
|
|
48
|
-
type: object
|
|
49
|
-
properties:
|
|
50
|
-
success:
|
|
51
|
-
type: boolean
|
|
52
|
-
example: true
|
|
53
|
-
403:
|
|
54
|
-
description: Returns a "403 Forbidden" if the signed in user is not admin
|
|
55
|
-
content:
|
|
56
|
-
'application/json':
|
|
57
|
-
schema:
|
|
58
|
-
$ref: '#/components/schemas/Error'
|
|
59
|
-
500:
|
|
60
|
-
description: An error occurred
|
|
61
|
-
content:
|
|
62
|
-
'application/json':
|
|
63
|
-
schema:
|
|
64
|
-
$ref: '#/components/schemas/UnexpectedError'
|
|
1
|
+
/schema/{dbname}:
|
|
2
|
+
post:
|
|
3
|
+
tags:
|
|
4
|
+
- data
|
|
5
|
+
- schemas
|
|
6
|
+
summary: Add a schema definition
|
|
7
|
+
description: Adds a schema definition to the specified path. This schema will be enabled while the server runs, and cleared upon restart. If you need the schema to be persisted, add it to your server's rules.json file
|
|
8
|
+
parameters:
|
|
9
|
+
- name: dbname
|
|
10
|
+
in: path
|
|
11
|
+
description: name of the database
|
|
12
|
+
required: true
|
|
13
|
+
schema:
|
|
14
|
+
type: string
|
|
15
|
+
example: mydb
|
|
16
|
+
requestBody:
|
|
17
|
+
description: details about the data and schema to test
|
|
18
|
+
content:
|
|
19
|
+
'application/json':
|
|
20
|
+
schema:
|
|
21
|
+
type: object
|
|
22
|
+
properties:
|
|
23
|
+
action:
|
|
24
|
+
type: string
|
|
25
|
+
description: The desired operation `'set'` (optional, deprecated since v1.10.0)
|
|
26
|
+
example: set
|
|
27
|
+
path:
|
|
28
|
+
type: string
|
|
29
|
+
description: database path to the given value
|
|
30
|
+
example: collection/item
|
|
31
|
+
schema:
|
|
32
|
+
type: string
|
|
33
|
+
description: When given, tests this schema definition against the passed value instead of ones defined in the database
|
|
34
|
+
example: "{ name: string, stats?: { size: number, created: Date, modified: Date, deleted?: Date } }"
|
|
35
|
+
warnOnly:
|
|
36
|
+
type: boolean
|
|
37
|
+
description: whether to issue warnings for failing schema checks instead of denying writes. This allows you to add schemas to an existing database and testdrive them without enforcing them yet. Default is `false`
|
|
38
|
+
example: false
|
|
39
|
+
required:
|
|
40
|
+
- path
|
|
41
|
+
- schema
|
|
42
|
+
responses:
|
|
43
|
+
200:
|
|
44
|
+
description: Returns "200 OK" if the schema was added successfully
|
|
45
|
+
content:
|
|
46
|
+
'application/json':
|
|
47
|
+
schema:
|
|
48
|
+
type: object
|
|
49
|
+
properties:
|
|
50
|
+
success:
|
|
51
|
+
type: boolean
|
|
52
|
+
example: true
|
|
53
|
+
403:
|
|
54
|
+
description: Returns a "403 Forbidden" if the signed in user is not admin
|
|
55
|
+
content:
|
|
56
|
+
'application/json':
|
|
57
|
+
schema:
|
|
58
|
+
$ref: '#/components/schemas/Error'
|
|
59
|
+
500:
|
|
60
|
+
description: An error occurred
|
|
61
|
+
content:
|
|
62
|
+
'application/json':
|
|
63
|
+
schema:
|
|
64
|
+
$ref: '#/components/schemas/UnexpectedError'
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
/schema/{dbname}/test:
|
|
2
|
-
post:
|
|
3
|
-
tags:
|
|
4
|
-
- data
|
|
5
|
-
- schemas
|
|
6
|
-
summary: Test a data schema
|
|
7
|
-
description: Tests an existing data schema in the database, or a given custom schema.
|
|
8
|
-
parameters:
|
|
9
|
-
- name: dbname
|
|
10
|
-
in: path
|
|
11
|
-
description: name of the database
|
|
12
|
-
required: true
|
|
13
|
-
schema:
|
|
14
|
-
type: string
|
|
15
|
-
example: mydb
|
|
16
|
-
requestBody:
|
|
17
|
-
description: details about the data and schema to test
|
|
18
|
-
content:
|
|
19
|
-
'application/json':
|
|
20
|
-
schema:
|
|
21
|
-
type: object
|
|
22
|
-
properties:
|
|
23
|
-
path:
|
|
24
|
-
type: string
|
|
25
|
-
description: database path to the given value
|
|
26
|
-
example: collection/item
|
|
27
|
-
value:
|
|
28
|
-
$ref: '#/components/schemas/SerializedValue'
|
|
29
|
-
partial:
|
|
30
|
-
type: boolean
|
|
31
|
-
description: Whether to only test passed data (`update` db operation), or to validate the value against the entire schema (`set` db operation). Update operations allow required children in the schema not to be present in the passed value.
|
|
32
|
-
example: false
|
|
33
|
-
schema:
|
|
34
|
-
type: string
|
|
35
|
-
description: When given, tests this schema definition against the passed value instead of ones defined in the database
|
|
36
|
-
example: "{ name: string, stats?: { size: number, created: Date, modified: Date, deleted?: Date } }"
|
|
37
|
-
required:
|
|
38
|
-
- path
|
|
39
|
-
- value
|
|
40
|
-
- partial
|
|
41
|
-
responses:
|
|
42
|
-
200:
|
|
43
|
-
description: Returns an object that indicates whether the value successfully validated against schema
|
|
44
|
-
content:
|
|
45
|
-
'application/json':
|
|
46
|
-
schema:
|
|
47
|
-
type: object
|
|
48
|
-
properties:
|
|
49
|
-
ok:
|
|
50
|
-
type: boolean
|
|
51
|
-
example: false
|
|
52
|
-
reason:
|
|
53
|
-
type: string
|
|
54
|
-
example: path "books/book1/title" must be typeof string
|
|
55
|
-
403:
|
|
56
|
-
description: Returns a "403 Forbidden" if the signed in user is not admin
|
|
57
|
-
content:
|
|
58
|
-
'application/json':
|
|
59
|
-
schema:
|
|
60
|
-
$ref: '#/components/schemas/Error'
|
|
61
|
-
500:
|
|
62
|
-
description: An unexpected error occurred
|
|
63
|
-
content:
|
|
64
|
-
'application/json':
|
|
65
|
-
schema:
|
|
66
|
-
$ref: '#/components/schemas/UnexpectedError'
|
|
1
|
+
/schema/{dbname}/test:
|
|
2
|
+
post:
|
|
3
|
+
tags:
|
|
4
|
+
- data
|
|
5
|
+
- schemas
|
|
6
|
+
summary: Test a data schema
|
|
7
|
+
description: Tests an existing data schema in the database, or a given custom schema.
|
|
8
|
+
parameters:
|
|
9
|
+
- name: dbname
|
|
10
|
+
in: path
|
|
11
|
+
description: name of the database
|
|
12
|
+
required: true
|
|
13
|
+
schema:
|
|
14
|
+
type: string
|
|
15
|
+
example: mydb
|
|
16
|
+
requestBody:
|
|
17
|
+
description: details about the data and schema to test
|
|
18
|
+
content:
|
|
19
|
+
'application/json':
|
|
20
|
+
schema:
|
|
21
|
+
type: object
|
|
22
|
+
properties:
|
|
23
|
+
path:
|
|
24
|
+
type: string
|
|
25
|
+
description: database path to the given value
|
|
26
|
+
example: collection/item
|
|
27
|
+
value:
|
|
28
|
+
$ref: '#/components/schemas/SerializedValue'
|
|
29
|
+
partial:
|
|
30
|
+
type: boolean
|
|
31
|
+
description: Whether to only test passed data (`update` db operation), or to validate the value against the entire schema (`set` db operation). Update operations allow required children in the schema not to be present in the passed value.
|
|
32
|
+
example: false
|
|
33
|
+
schema:
|
|
34
|
+
type: string
|
|
35
|
+
description: When given, tests this schema definition against the passed value instead of ones defined in the database
|
|
36
|
+
example: "{ name: string, stats?: { size: number, created: Date, modified: Date, deleted?: Date } }"
|
|
37
|
+
required:
|
|
38
|
+
- path
|
|
39
|
+
- value
|
|
40
|
+
- partial
|
|
41
|
+
responses:
|
|
42
|
+
200:
|
|
43
|
+
description: Returns an object that indicates whether the value successfully validated against schema
|
|
44
|
+
content:
|
|
45
|
+
'application/json':
|
|
46
|
+
schema:
|
|
47
|
+
type: object
|
|
48
|
+
properties:
|
|
49
|
+
ok:
|
|
50
|
+
type: boolean
|
|
51
|
+
example: false
|
|
52
|
+
reason:
|
|
53
|
+
type: string
|
|
54
|
+
example: path "books/book1/title" must be typeof string
|
|
55
|
+
403:
|
|
56
|
+
description: Returns a "403 Forbidden" if the signed in user is not admin
|
|
57
|
+
content:
|
|
58
|
+
'application/json':
|
|
59
|
+
schema:
|
|
60
|
+
$ref: '#/components/schemas/Error'
|
|
61
|
+
500:
|
|
62
|
+
description: An unexpected error occurred
|
|
63
|
+
content:
|
|
64
|
+
'application/json':
|
|
65
|
+
schema:
|
|
66
|
+
$ref: '#/components/schemas/UnexpectedError'
|