Skip to content

Commit 96e1355

Browse files
authored
Add monograph identifier batch (#331)
* Implements monograph identifier batch: an intermediate entity for controlling downloadable set of identifiers for ISBN/ISMN publisher range * Removes ability to directly download publisher range identifiers
1 parent 7b090bb commit 96e1355

622 files changed

Lines changed: 11421 additions & 6180 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
# Always use LF
2-
*.txt text
3-
text eol=lf
1+
* text=false

‎apidoc/openapi.json‎

Lines changed: 280 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,200 @@
823823
}
824824
}
825825
},
826+
"/v2/monograph/identifier-batches": {
827+
"post": {
828+
"operationId": "createMonographIdentifierBatch",
829+
"summary": "Create a new identifier batch for ISBN or ISMN publisher range",
830+
"security": [
831+
{
832+
"openId": [
833+
"admin"
834+
]
835+
}
836+
],
837+
"tags": [
838+
"monograph"
839+
],
840+
"requestBody": {
841+
"required": true,
842+
"content": {
843+
"application/json": {
844+
"schema": {
845+
"$ref": "#/components/schemas/monograph-identifier-batch-create-body"
846+
}
847+
}
848+
}
849+
},
850+
"responses": {
851+
"201": {
852+
"description": "Resource was created",
853+
"content": {
854+
"application/json": {
855+
"schema": {
856+
"$ref": "#/components/schemas/monograph-identifier-batch"
857+
}
858+
}
859+
}
860+
},
861+
"401": {
862+
"description": "Unauthorized"
863+
},
864+
"403": {
865+
"description": "Forbidden"
866+
},
867+
"409": {
868+
"description": "Conflict"
869+
},
870+
"422": {
871+
"description": "Unprocessable Entity"
872+
},
873+
"default": {
874+
"$ref": "#/components/responses/error"
875+
}
876+
}
877+
}
878+
},
879+
"/v2/monograph/identifier-batches/{id}": {
880+
"get": {
881+
"operationId": "readMonographIdentifierBatch",
882+
"summary": "Read monograph identifier batch information that is public",
883+
"security": [],
884+
"tags": [
885+
"monograph"
886+
],
887+
"parameters": [
888+
{
889+
"$ref": "#/components/parameters/id"
890+
}
891+
],
892+
"responses": {
893+
"200": {
894+
"description": "Ok",
895+
"content": {
896+
"application/json": {
897+
"schema": {
898+
"$ref": "#/components/schemas/monograph-identifier-batch-public"
899+
}
900+
}
901+
}
902+
},
903+
"401": {
904+
"description": "Unauthorized"
905+
},
906+
"403": {
907+
"description": "Forbidden"
908+
},
909+
"404": {
910+
"description": "Resource was not found"
911+
},
912+
"409": {
913+
"description": "Conflict"
914+
},
915+
"default": {
916+
"$ref": "#/components/responses/error"
917+
}
918+
}
919+
},
920+
"delete": {
921+
"operationId": "deleteMonographIdentifierBatch",
922+
"summary": "Delete monograph identifier batch and deassign associated identifiers",
923+
"security": [
924+
{
925+
"openId": [
926+
"admin"
927+
]
928+
}
929+
],
930+
"tags": [
931+
"monograph"
932+
],
933+
"parameters": [
934+
{
935+
"$ref": "#/components/parameters/id"
936+
}
937+
],
938+
"responses": {
939+
"204": {
940+
"description": "Resource was deleted"
941+
},
942+
"401": {
943+
"description": "Unauthorized"
944+
},
945+
"403": {
946+
"description": "Forbidden"
947+
},
948+
"404": {
949+
"description": "Resource was not found"
950+
},
951+
"409": {
952+
"description": "Conflict"
953+
},
954+
"default": {
955+
"$ref": "#/components/responses/error"
956+
}
957+
}
958+
}
959+
},
960+
"/v2/monograph/identifier-batches/{id}/download": {
961+
"post": {
962+
"operationId": "downloadMonographIdentifierBattch",
963+
"summary": "Download ISBN/ISMN identifiers associated with batch id given as parameter as text file",
964+
"security": [],
965+
"tags": [
966+
"monograph"
967+
],
968+
"parameters": [
969+
{
970+
"$ref": "#/components/parameters/id"
971+
}
972+
],
973+
"requestBody": {
974+
"required": true,
975+
"content": {
976+
"application/json": {
977+
"schema": {
978+
"type": "object",
979+
"properties": {
980+
"turnstile_token": {
981+
"type": "string"
982+
}
983+
},
984+
"required": [
985+
"turnstile_token"
986+
]
987+
}
988+
}
989+
}
990+
},
991+
"responses": {
992+
"200": {
993+
"description": "Ok",
994+
"content": {
995+
"text/plain": {
996+
"schema": {
997+
"type": "string"
998+
}
999+
}
1000+
}
1001+
},
1002+
"401": {
1003+
"description": "Unauthorized"
1004+
},
1005+
"403": {
1006+
"description": "Forbidden"
1007+
},
1008+
"404": {
1009+
"description": "Resource was not found"
1010+
},
1011+
"409": {
1012+
"description": "Conflict"
1013+
},
1014+
"default": {
1015+
"$ref": "#/components/responses/error"
1016+
}
1017+
}
1018+
}
1019+
},
8261020
"/v2/monograph/publishers/{id}": {
8271021
"get": {
8281022
"operationId": "readmonographPublisher",
@@ -3403,6 +3597,75 @@
34033597
"monograph_publisher_id"
34043598
]
34053599
},
3600+
"monograph-identifier-batch-create-body": {
3601+
"type": "object",
3602+
"properties": {
3603+
"isbn_publisher_range_id": {
3604+
"description": "ISBN publisher range to create batch for (either isbn_publisher_range_id or ismn_publisher_range_id is required)",
3605+
"type": "number"
3606+
},
3607+
"ismn_publisher_range_id": {
3608+
"description": "ISMN publisher range to create batch for (either isbn_publisher_range_id or ismn_publisher_range_id is required)",
3609+
"type": "number"
3610+
},
3611+
"identifier_count": {
3612+
"type": "number"
3613+
}
3614+
},
3615+
"required": [
3616+
"identifier_count"
3617+
]
3618+
},
3619+
"monograph-identifier-batch": {
3620+
"allOf": [
3621+
{
3622+
"type": "object",
3623+
"properties": {
3624+
"id": {
3625+
"type": "number"
3626+
},
3627+
"monograph_publisher_id": {
3628+
"type": "number"
3629+
},
3630+
"isbn_publisher_range_id": {
3631+
"type": [
3632+
"number",
3633+
"null"
3634+
]
3635+
},
3636+
"ismn_publisher_range_id": {
3637+
"type": [
3638+
"number",
3639+
"null"
3640+
]
3641+
},
3642+
"identifier_count": {
3643+
"type": "number"
3644+
}
3645+
}
3646+
},
3647+
{
3648+
"$ref": "#/components/schemas/created-metadata"
3649+
}
3650+
]
3651+
},
3652+
"monograph-identifier-batch-public": {
3653+
"type": "object",
3654+
"properties": {
3655+
"id": {
3656+
"type": "number"
3657+
},
3658+
"monograph_publisher_name": {
3659+
"type": "string"
3660+
},
3661+
"identifier_type": {
3662+
"type": "string"
3663+
},
3664+
"identifier_count": {
3665+
"type": "number"
3666+
}
3667+
}
3668+
},
34063669
"monograph-publisher-admin": {
34073670
"allOf": [
34083671
{
@@ -5736,11 +5999,11 @@
57365999
"monograph_publisher_id": {
57376000
"type": "number"
57386001
},
5739-
"isbn_publisher_range_id": {
5740-
"type": "number"
5741-
},
5742-
"ismn_publisher_range_id": {
5743-
"type": "number"
6002+
"monograph_identifier_batch_id": {
6003+
"type": [
6004+
"number",
6005+
"null"
6006+
]
57446007
},
57456008
"manifestation_ids": {
57466009
"type": "array",
@@ -5828,6 +6091,12 @@
58286091
"null"
58296092
]
58306093
},
6094+
"monograph_identifier_batch_id": {
6095+
"type": [
6096+
"number",
6097+
"null"
6098+
]
6099+
},
58316100
"manifestation_ids": {
58326101
"type": "array",
58336102
"items": {
@@ -5938,6 +6207,12 @@
59386207
"null"
59396208
]
59406209
},
6210+
"monograph_identifier_batch_id": {
6211+
"type": [
6212+
"number",
6213+
"null"
6214+
]
6215+
},
59416216
"expression_title": {
59426217
"type": [
59436218
"string",

‎apidoc/openapi.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ paths:
4141
/v2/monograph/ismn-publisher-ranges/{id}:
4242
$ref: './resources/monograph/ismn-publisher-ranges/id.yaml'
4343

44+
/v2/monograph/identifier-batches:
45+
$ref: './resources/monograph/identifier-batches/root.yaml'
46+
/v2/monograph/identifier-batches/{id}:
47+
$ref: './resources/monograph/identifier-batches/id.yaml'
48+
/v2/monograph/identifier-batches/{id}/download:
49+
$ref: './resources/monograph/identifier-batches/download.yaml'
50+
4451
/v2/monograph/publishers/{id}:
4552
$ref: './resources/monograph/publishers/id.yaml'
4653
/v2/monograph/publishers/{id}/archive:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Using HTTP POST mainly for turnstile token since we don't yet have HTTP QUERY (i.e., GET requests with body)
2+
post:
3+
operationId: downloadMonographIdentifierBattch
4+
summary: Download ISBN/ISMN identifiers associated with batch id given as parameter as text file
5+
security: []
6+
tags:
7+
- monograph
8+
parameters:
9+
- $ref: '../../../parameters/path/id.yaml'
10+
requestBody:
11+
required: true
12+
content:
13+
application/json:
14+
schema:
15+
type: object
16+
properties:
17+
turnstile_token:
18+
type: string
19+
required:
20+
- turnstile_token
21+
responses:
22+
'200':
23+
description: Ok
24+
content:
25+
text/plain:
26+
schema:
27+
type: string
28+
'401':
29+
description: Unauthorized
30+
'403':
31+
description: Forbidden
32+
'404':
33+
description: Resource was not found
34+
'409':
35+
description: Conflict
36+
default:
37+
$ref: '../../../responses/error.yaml'

0 commit comments

Comments
 (0)