-
Notifications
You must be signed in to change notification settings - Fork 3
/
notes.yml
385 lines (380 loc) · 11.3 KB
/
notes.yml
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
openapi: 3.0.0
info:
title: Notes API
version: 3.0.0
paths:
/note-types:
get:
description: Return a list of note types
operationId: getNoteTypeCollection
tags:
- note-types
parameters:
- $ref: '#/components/parameters/cqlQueryNoteType'
- $ref: '#/components/parameters/offset'
- $ref: '#/components/parameters/limit'
responses:
'200':
$ref: '#/components/responses/NoteTypeCollection'
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'500':
description: Unexpected error
post:
description: Create a new note type.
operationId: createNoteType
tags:
- note-types
requestBody:
$ref: '#/components/requestBodies/NoteTypeBody'
responses:
'201':
$ref: '#/components/responses/NoteType'
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'500':
description: Unexpected error
/note-types/{id}:
parameters:
- $ref: '#/components/parameters/resourceId'
get:
description: Retrieve note type with given ID
operationId: getNoteType
tags:
- note-types
responses:
'200':
$ref: '#/components/responses/NoteType'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'500':
description: Unexpected error
put:
description: Update note type with given ID
operationId: updateNoteType
tags:
- note-types
requestBody:
$ref: '#/components/requestBodies/NoteTypeBody'
responses:
'204':
description: Note Type successfully updated
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'500':
description: Unexpected error
delete:
description: Delete note type with given ID
operationId: deleteNoteType
tags:
- note-types
responses:
'204':
description: Note type deleted successfully
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'500':
description: Unexpected error
/notes:
get:
description: Return a list of notes
operationId: getNoteCollection
tags:
- notes
parameters:
- $ref: '#/components/parameters/cqlQueryNote'
- $ref: '#/components/parameters/offset'
- $ref: '#/components/parameters/limit'
responses:
'200':
$ref: '#/components/responses/NoteCollection'
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'500':
description: Unexpected error
post:
description: Create a new note.
operationId: createNote
tags:
- notes
requestBody:
$ref: '#/components/requestBodies/NoteBody'
responses:
'201':
$ref: '#/components/responses/Note'
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'500':
description: Unexpected error
/notes/{id}:
parameters:
- $ref: '#/components/parameters/resourceId'
get:
description: Retrieve note with given ID
operationId: getNote
tags:
- notes
responses:
'200':
$ref: '#/components/responses/Note'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'500':
description: Unexpected error
put:
description: Update note with given ID
operationId: updateNote
tags:
- notes
requestBody:
$ref: '#/components/requestBodies/NoteBody'
responses:
'204':
description: Note successfully updated
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'500':
description: Unexpected error
delete:
description: Delete note with given ID
operationId: deleteNote
tags:
- notes
responses:
'204':
description: Note deleted successfully
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'500':
description: Unexpected error
/note-links/type/{objectType}/id/{objectId}:
parameters:
- $ref: '#/components/parameters/objectType'
- $ref: '#/components/parameters/objectId'
put:
description: Add or delete links to specified list of notes
operationId: updateLinks
tags:
- notes
requestBody:
$ref: '#/components/requestBodies/NoteLinksPutBody'
responses:
'204':
description: Links successfully added
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'500':
description: Unexpected error
/note-links/domain/{domain}/type/{objectType}/id/{objectId}:
parameters:
- $ref: '#/components/parameters/domain'
- $ref: '#/components/parameters/objectType'
- $ref: '#/components/parameters/objectId'
get:
description: Return a list of notes by status. A maximum of 1000 notes can be returned per request.
operationId: getNoteCollectionByLink
tags:
- notes
parameters:
- name: search
in: query
schema:
type: string
required: false
description: Partial match case-insensitive search term for note title and note content
- name: noteType
in: query
schema:
type: array
items:
type: string
required: false
description: Search string for note type. Note(s) is returned only if it equals to
specified word or sequence of words in the titleseparated by com type name. Multiple types should be
declared with query parameter sequentially as follows "noteType=a¬eType=b".
- name: status
in: query
schema:
$ref: 'schemas/link.yaml#/linkStatusFilter'
default: all
required: false
description: Filtering records by status. Possible values are ASSIGNED, UNASSIGNED, ALL.
- name: orderBy
in: query
schema:
$ref: 'schemas/link.yaml#/notesOrderBy'
required: false
description: Field by which notes are ordered. Possible values are title, content, noteType, updatedDate.
The default ascending sorting is applied for title, content, noteType parameters. For updatedDate is descending.
- name: order
in: query
schema:
$ref: 'schemas/common.yaml#/orderDirection'
required: false
description: Indicates order of notes. Possible values asc, desc.
- $ref: '#/components/parameters/offset'
- $ref: '#/components/parameters/limit'
responses:
'200':
$ref: '#/components/responses/NoteCollection'
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'500':
description: Unexpected error
components:
requestBodies:
NoteTypeBody:
description: Note type object
required: true
content:
application/json:
schema:
$ref: 'schemas/noteType.yaml#/noteType'
NoteBody:
description: Note object
required: true
content:
application/json:
schema:
$ref: 'schemas/note.yaml#/note'
NoteLinksPutBody:
description: Collection of note links
required: true
content:
application/json:
schema:
$ref: 'schemas/link.yaml#/noteLinkUpdateCollection'
responses:
NoteType:
description: Returns a note type
content:
application/json:
schema:
$ref: 'schemas/noteType.yaml#/noteType'
NoteTypeCollection:
description: Returns a note types collectiom
content:
application/json:
schema:
$ref: 'schemas/noteType.yaml#/noteTypeCollection'
Note:
description: Returns a note
content:
application/json:
schema:
$ref: 'schemas/note.yaml#/note'
NoteCollection:
description: Returns a note collectiom
content:
application/json:
schema:
$ref: 'schemas/note.yaml#/noteCollection'
Unauthorized:
description: Not authorized to perform requested action
content:
text/plain:
example: unable to perform action -- unauthorized
NotFound:
description: Resource with a given ID not found
content:
text/plain:
example: resource not found
UnprocessableEntity:
description: Validation errors
content:
application/json:
schema:
$ref: 'schemas/common.yaml#/errors'
parameters:
resourceId:
name: id
in: path
required: true
schema:
"$ref": 'schemas/common.yaml#/uuid'
description: The UUID of a resource
objectId:
name: objectId
in: path
required: true
schema:
type: string
description: The ID of link's object
objectType:
name: objectType
in: path
required: true
schema:
type: string
description: The type of link's object
domain:
name: domain
in: path
required: true
schema:
type: string
description: The domain of note
cqlQueryNote:
name: query
in: query
schema:
type: string
default: cql.allRecords=1
required: false
description: A query expressed as a CQL string, for details see [Notes API](https://github.com/folio-org/mod-notes/blob/master/docs/api-guide.md#notes-api)
cqlQueryNoteType:
name: query
in: query
schema:
type: string
default: cql.allRecords=1
required: false
description: A query expressed as a CQL string, for details see [Note Types API](https://github.com/folio-org/mod-notes/blob/master/docs/api-guide.md#note-types-api)
offset:
name: offset
in: query
schema:
type: integer
default: 0
minimum: 0
maximum: 2147483647
required: false
description: Skip over a number of elements by specifying an offset value for the query
limit:
name: limit
in: query
schema:
type: integer
default: 1000
minimum: 1
maximum: 2147483647
required: false
description: Limit the number of elements returned in the response