summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rust/fatcat-api/README.md2
-rw-r--r--rust/fatcat-api/api.yaml54
-rw-r--r--rust/fatcat-api/api/swagger.yaml142
-rw-r--r--rust/fatcat-api/examples/client.rs12
-rw-r--r--rust/fatcat-api/examples/server.rs2
-rw-r--r--rust/fatcat-api/examples/server_lib/server.rs12
-rw-r--r--rust/fatcat-api/src/client.rs16
-rw-r--r--rust/fatcat-api/src/models.rs87
-rw-r--r--rust/fatcat-api/src/server.rs14
-rw-r--r--rust/src/api_server.rs119
-rw-r--r--rust/src/database_models.rs61
-rw-r--r--rust/src/database_schema.rs75
-rw-r--r--rust/tests/test_api_server.rs5
13 files changed, 481 insertions, 120 deletions
diff --git a/rust/fatcat-api/README.md b/rust/fatcat-api/README.md
index 5ef72265..f1fbb5cc 100644
--- a/rust/fatcat-api/README.md
+++ b/rust/fatcat-api/README.md
@@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)
- API version: 0.1.0
-- Build date: 2018-07-21T02:36:21.158Z
+- Build date: 2018-07-24T08:38:19.335Z
This autogenerated project defines an API crate `fatcat` which contains:
* An `Api` trait defining the API in Rust.
diff --git a/rust/fatcat-api/api.yaml b/rust/fatcat-api/api.yaml
index dde02734..94acccb3 100644
--- a/rust/fatcat-api/api.yaml
+++ b/rust/fatcat-api/api.yaml
@@ -113,10 +113,21 @@ definitions:
type: string
#format: custom
example: "a77e4c11a57f1d757fca5754a8f83b5d4ece49a2d28596889127c1a2f3f28832"
- url:
- type: string
- format: url
- example: "https://example.edu/~frau/prcding.pdf"
+ urls:
+ type: array
+ items:
+ type: object
+ required:
+ - url
+ - rel
+ properties:
+ url:
+ type: string
+ format: url
+ example: "https://example.edu/~frau/prcding.pdf"
+ rel:
+ type: string
+ example: "webarchive"
mimetype:
type: string
example: "application/pdf"
@@ -155,6 +166,10 @@ definitions:
isbn13:
type: string
#format: custom
+ pmid:
+ type: string
+ pmcid:
+ type: string
volume:
type: string
issue:
@@ -175,12 +190,27 @@ definitions:
type: array
items:
$ref: "#/definitions/release_ref"
+ abstracts:
+ type: array
+ items:
+ type: object
+ properties:
+ sha1:
+ type: string
+ example: "3f242a192acc258bdfdb151943419437f440c313"
+ content:
+ type: string
+ example: "<jats:p>Some abstract thing goes here</jats:p>"
+ mimetype:
+ type: string
+ example: "application/xml+jats"
+ lang:
+ type: string
+ example: "en"
work_entity:
type: object
properties:
<<: *ENTITYPROPS
- work_type:
- type: string
entity_history_entry:
type: object
required:
@@ -212,6 +242,10 @@ definitions:
type: string
#format: uuid
example: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
+ prev_revision:
+ type: string
+ #format: uuid
+ example: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
redirect_ident:
type: string
example: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -301,8 +335,9 @@ definitions:
target_release_id:
type: string
#format: ident
- raw:
- type: string
+ extra:
+ type: object
+ additionalProperties: {}
key:
type: string
year:
@@ -326,6 +361,9 @@ definitions:
#format: ident
raw:
type: string
+ extra:
+ type: object
+ additionalProperties: {}
role:
type: string
stats_response:
diff --git a/rust/fatcat-api/api/swagger.yaml b/rust/fatcat-api/api/swagger.yaml
index 75b65f4b..3a87109e 100644
--- a/rust/fatcat-api/api/swagger.yaml
+++ b/rust/fatcat-api/api/swagger.yaml
@@ -2031,10 +2031,10 @@ definitions:
mimetype:
type: "string"
example: "application/pdf"
- url:
- type: "string"
- format: "url"
- example: "https://example.edu/~frau/prcding.pdf"
+ urls:
+ type: "array"
+ items:
+ $ref: "#/definitions/file_entity_urls"
sha256:
type: "string"
example: "a77e4c11a57f1d757fca5754a8f83b5d4ece49a2d28596889127c1a2f3f28832"
@@ -2073,12 +2073,16 @@ definitions:
redirect: "q3nouwy3nnbsvo3h5klxsx4a7y"
sha256: "a77e4c11a57f1d757fca5754a8f83b5d4ece49a2d28596889127c1a2f3f28832"
ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
- url: "https://example.edu/~frau/prcding.pdf"
releases:
- "releases"
- "releases"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
sha1: "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8"
+ urls:
+ - rel: "webarchive"
+ url: "https://example.edu/~frau/prcding.pdf"
+ - rel: "webarchive"
+ url: "https://example.edu/~frau/prcding.pdf"
size: 1048576
extra: "{}"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2091,6 +2095,10 @@ definitions:
required:
- "title"
properties:
+ abstracts:
+ type: "array"
+ items:
+ $ref: "#/definitions/release_entity_abstracts"
refs:
type: "array"
items:
@@ -2111,6 +2119,10 @@ definitions:
example: "12"
volume:
type: "string"
+ pmcid:
+ type: "string"
+ pmid:
+ type: "string"
isbn13:
type: "string"
doi:
@@ -2158,17 +2170,29 @@ definitions:
redirect: "q3nouwy3nnbsvo3h5klxsx4a7y"
work_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
issue: "12"
+ abstracts:
+ - sha1: "3f242a192acc258bdfdb151943419437f440c313"
+ mimetype: "application/xml+jats"
+ lang: "en"
+ content: "<jats:p>Some abstract thing goes here</jats:p>"
+ - sha1: "3f242a192acc258bdfdb151943419437f440c313"
+ mimetype: "application/xml+jats"
+ lang: "en"
+ content: "<jats:p>Some abstract thing goes here</jats:p>"
ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
release_type: "book"
language: "language"
+ pmid: "pmid"
title: "title"
release_status: "preprint"
contribs:
- role: "role"
+ extra: "{}"
creator_id: "creator_id"
index: 1
raw: "raw"
- role: "role"
+ extra: "{}"
creator_id: "creator_id"
index: 1
raw: "raw"
@@ -2179,16 +2203,16 @@ definitions:
- target_release_id: "target_release_id"
year: 6
container_title: "container_title"
+ extra: "{}"
index: 0
- raw: "raw"
title: "title"
locator: "p123"
key: "key"
- target_release_id: "target_release_id"
year: 6
container_title: "container_title"
+ extra: "{}"
index: 0
- raw: "raw"
title: "title"
locator: "p123"
key: "key"
@@ -2198,14 +2222,13 @@ definitions:
publisher: "publisher"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
state: "wip"
+ pmcid: "pmcid"
container_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
doi: "10.1234/abcde.789"
upperCaseName: "RELEASE_ENTITY"
work_entity:
type: "object"
properties:
- work_type:
- type: "string"
extra:
type: "object"
editgroup_id:
@@ -2231,7 +2254,6 @@ definitions:
redirect: "q3nouwy3nnbsvo3h5klxsx4a7y"
ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
extra: "{}"
- work_type: "work_type"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
state: "wip"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
@@ -2259,12 +2281,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
creators:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2272,12 +2296,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
files:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2285,12 +2311,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
containers:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2298,12 +2326,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
releases:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2311,12 +2341,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
description: "description"
editor_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2327,6 +2359,7 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
changelog_entry:
editgroup:
@@ -2338,12 +2371,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
creators:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2351,12 +2386,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
files:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2364,12 +2401,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
containers:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2377,12 +2416,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
releases:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2390,12 +2431,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
description: "description"
editor_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2421,6 +2464,9 @@ definitions:
revision:
type: "string"
example: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
+ prev_revision:
+ type: "string"
+ example: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
redirect_ident:
type: "string"
example: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2435,6 +2481,7 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
upperCaseName: "ENTITY_EDIT"
editor:
@@ -2478,12 +2525,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
creators:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2491,12 +2540,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
files:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2504,12 +2555,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
containers:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2517,12 +2570,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
releases:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2530,12 +2585,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
description: "description"
editor_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2569,12 +2626,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
creators:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2582,12 +2641,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
files:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2595,12 +2656,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
containers:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2608,12 +2671,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
releases:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2621,12 +2686,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
description: "description"
editor_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2643,8 +2710,8 @@ definitions:
format: "int64"
target_release_id:
type: "string"
- raw:
- type: "string"
+ extra:
+ type: "object"
key:
type: "string"
year:
@@ -2661,8 +2728,8 @@ definitions:
target_release_id: "target_release_id"
year: 6
container_title: "container_title"
+ extra: "{}"
index: 0
- raw: "raw"
title: "title"
locator: "p123"
key: "key"
@@ -2677,10 +2744,13 @@ definitions:
type: "string"
raw:
type: "string"
+ extra:
+ type: "object"
role:
type: "string"
example:
role: "role"
+ extra: "{}"
creator_id: "creator_id"
index: 1
raw: "raw"
@@ -2693,6 +2763,42 @@ definitions:
example:
extra: "{}"
upperCaseName: "STATS_RESPONSE"
+ file_entity_urls:
+ required:
+ - "rel"
+ - "url"
+ properties:
+ url:
+ type: "string"
+ format: "url"
+ example: "https://example.edu/~frau/prcding.pdf"
+ rel:
+ type: "string"
+ example: "webarchive"
+ example:
+ rel: "webarchive"
+ url: "https://example.edu/~frau/prcding.pdf"
+ upperCaseName: "FILE_ENTITY_URLS"
+ release_entity_abstracts:
+ properties:
+ sha1:
+ type: "string"
+ example: "3f242a192acc258bdfdb151943419437f440c313"
+ content:
+ type: "string"
+ example: "<jats:p>Some abstract thing goes here</jats:p>"
+ mimetype:
+ type: "string"
+ example: "application/xml+jats"
+ lang:
+ type: "string"
+ example: "en"
+ example:
+ sha1: "3f242a192acc258bdfdb151943419437f440c313"
+ mimetype: "application/xml+jats"
+ lang: "en"
+ content: "<jats:p>Some abstract thing goes here</jats:p>"
+ upperCaseName: "RELEASE_ENTITY_ABSTRACTS"
editgroup_edits:
properties:
containers:
@@ -2722,12 +2828,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
creators:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2735,12 +2843,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
files:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2748,12 +2858,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
containers:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2761,12 +2873,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
releases:
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
@@ -2774,12 +2888,14 @@ definitions:
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
- ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
edit_id: 847
extra: "{}"
redirect_ident: "q3nouwy3nnbsvo3h5klxsx4a7y"
editgroup_id: "q3nouwy3nnbsvo3h5klxsx4a7y"
+ prev_revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
revision: "86daea5b-1b6b-432a-bb67-ea97795f80fe"
upperCaseName: "EDITGROUP_EDITS"
x-entity-props:
diff --git a/rust/fatcat-api/examples/client.rs b/rust/fatcat-api/examples/client.rs
index 3fa6508e..46ff0abd 100644
--- a/rust/fatcat-api/examples/client.rs
+++ b/rust/fatcat-api/examples/client.rs
@@ -11,11 +11,13 @@ extern crate uuid;
use clap::{App, Arg};
#[allow(unused_imports)]
-use fatcat::{AcceptEditgroupResponse, ApiError, ApiNoContext, ContextWrapperExt, CreateContainerBatchResponse, CreateContainerResponse, CreateCreatorBatchResponse, CreateCreatorResponse,
- CreateEditgroupResponse, CreateFileBatchResponse, CreateFileResponse, CreateReleaseBatchResponse, CreateReleaseResponse, CreateWorkBatchResponse, CreateWorkResponse,
- GetChangelogEntryResponse, GetChangelogResponse, GetContainerHistoryResponse, GetContainerResponse, GetCreatorHistoryResponse, GetCreatorReleasesResponse, GetCreatorResponse,
- GetEditgroupResponse, GetEditorChangelogResponse, GetEditorResponse, GetFileHistoryResponse, GetFileResponse, GetReleaseFilesResponse, GetReleaseHistoryResponse, GetReleaseResponse,
- GetStatsResponse, GetWorkHistoryResponse, GetWorkReleasesResponse, GetWorkResponse, LookupContainerResponse, LookupCreatorResponse, LookupFileResponse, LookupReleaseResponse};
+use fatcat::{
+ AcceptEditgroupResponse, ApiError, ApiNoContext, ContextWrapperExt, CreateContainerBatchResponse, CreateContainerResponse, CreateCreatorBatchResponse, CreateCreatorResponse,
+ CreateEditgroupResponse, CreateFileBatchResponse, CreateFileResponse, CreateReleaseBatchResponse, CreateReleaseResponse, CreateWorkBatchResponse, CreateWorkResponse, GetChangelogEntryResponse,
+ GetChangelogResponse, GetContainerHistoryResponse, GetContainerResponse, GetCreatorHistoryResponse, GetCreatorReleasesResponse, GetCreatorResponse, GetEditgroupResponse,
+ GetEditorChangelogResponse, GetEditorResponse, GetFileHistoryResponse, GetFileResponse, GetReleaseFilesResponse, GetReleaseHistoryResponse, GetReleaseResponse, GetStatsResponse,
+ GetWorkHistoryResponse, GetWorkReleasesResponse, GetWorkResponse, LookupContainerResponse, LookupCreatorResponse, LookupFileResponse, LookupReleaseResponse,
+};
#[allow(unused_imports)]
use futures::{future, stream, Future, Stream};
diff --git a/rust/fatcat-api/examples/server.rs b/rust/fatcat-api/examples/server.rs
index 612ec4b2..8d2e9b64 100644
--- a/rust/fatcat-api/examples/server.rs
+++ b/rust/fatcat-api/examples/server.rs
@@ -19,10 +19,10 @@ extern crate futures;
extern crate error_chain;
use clap::{App, Arg};
-use hyper_openssl::OpensslServer;
use hyper_openssl::openssl::error::ErrorStack;
use hyper_openssl::openssl::ssl::{SslAcceptorBuilder, SslMethod};
use hyper_openssl::openssl::x509::X509_FILETYPE_PEM;
+use hyper_openssl::OpensslServer;
use iron::{Chain, Iron};
use swagger::auth::AllowAllMiddleware;
diff --git a/rust/fatcat-api/examples/server_lib/server.rs b/rust/fatcat-api/examples/server_lib/server.rs
index 608d715f..a25e175f 100644
--- a/rust/fatcat-api/examples/server_lib/server.rs
+++ b/rust/fatcat-api/examples/server_lib/server.rs
@@ -10,11 +10,13 @@ use std::collections::HashMap;
use swagger;
use fatcat::models;
-use fatcat::{AcceptEditgroupResponse, Api, ApiError, Context, CreateContainerBatchResponse, CreateContainerResponse, CreateCreatorBatchResponse, CreateCreatorResponse, CreateEditgroupResponse,
- CreateFileBatchResponse, CreateFileResponse, CreateReleaseBatchResponse, CreateReleaseResponse, CreateWorkBatchResponse, CreateWorkResponse, GetChangelogEntryResponse,
- GetChangelogResponse, GetContainerHistoryResponse, GetContainerResponse, GetCreatorHistoryResponse, GetCreatorReleasesResponse, GetCreatorResponse, GetEditgroupResponse,
- GetEditorChangelogResponse, GetEditorResponse, GetFileHistoryResponse, GetFileResponse, GetReleaseFilesResponse, GetReleaseHistoryResponse, GetReleaseResponse, GetStatsResponse,
- GetWorkHistoryResponse, GetWorkReleasesResponse, GetWorkResponse, LookupContainerResponse, LookupCreatorResponse, LookupFileResponse, LookupReleaseResponse};
+use fatcat::{
+ AcceptEditgroupResponse, Api, ApiError, Context, CreateContainerBatchResponse, CreateContainerResponse, CreateCreatorBatchResponse, CreateCreatorResponse, CreateEditgroupResponse,
+ CreateFileBatchResponse, CreateFileResponse, CreateReleaseBatchResponse, CreateReleaseResponse, CreateWorkBatchResponse, CreateWorkResponse, GetChangelogEntryResponse, GetChangelogResponse,
+ GetContainerHistoryResponse, GetContainerResponse, GetCreatorHistoryResponse, GetCreatorReleasesResponse, GetCreatorResponse, GetEditgroupResponse, GetEditorChangelogResponse, GetEditorResponse,
+ GetFileHistoryResponse, GetFileResponse, GetReleaseFilesResponse, GetReleaseHistoryResponse, GetReleaseResponse, GetStatsResponse, GetWorkHistoryResponse, GetWorkReleasesResponse,
+ GetWorkResponse, LookupContainerResponse, LookupCreatorResponse, LookupFileResponse, LookupReleaseResponse,
+};
#[derive(Copy, Clone)]
pub struct Server;
diff --git a/rust/fatcat-api/src/client.rs b/rust/fatcat-api/src/client.rs
index b785adab..2b6fd2a6 100644
--- a/rust/fatcat-api/src/client.rs
+++ b/rust/fatcat-api/src/client.rs
@@ -6,14 +6,14 @@ extern crate url;
use self::hyper_openssl::openssl;
use self::url::percent_encoding::{utf8_percent_encode, PATH_SEGMENT_ENCODE_SET, QUERY_ENCODE_SET};
use futures;
-use futures::{Future, Stream};
use futures::{future, stream};
+use futures::{Future, Stream};
use hyper;
-use hyper::Url;
use hyper::client::IntoUrl;
use hyper::header::{ContentType, Headers};
use hyper::mime;
use hyper::mime::{Attr, Mime, SubLevel, TopLevel, Value};
+use hyper::Url;
use std::borrow::Cow;
use std::error;
use std::fmt;
@@ -34,11 +34,13 @@ use swagger;
use swagger::{ApiError, Context, XSpanId};
use models;
-use {AcceptEditgroupResponse, Api, CreateContainerBatchResponse, CreateContainerResponse, CreateCreatorBatchResponse, CreateCreatorResponse, CreateEditgroupResponse, CreateFileBatchResponse,
- CreateFileResponse, CreateReleaseBatchResponse, CreateReleaseResponse, CreateWorkBatchResponse, CreateWorkResponse, GetChangelogEntryResponse, GetChangelogResponse, GetContainerHistoryResponse,
- GetContainerResponse, GetCreatorHistoryResponse, GetCreatorReleasesResponse, GetCreatorResponse, GetEditgroupResponse, GetEditorChangelogResponse, GetEditorResponse, GetFileHistoryResponse,
- GetFileResponse, GetReleaseFilesResponse, GetReleaseHistoryResponse, GetReleaseResponse, GetStatsResponse, GetWorkHistoryResponse, GetWorkReleasesResponse, GetWorkResponse,
- LookupContainerResponse, LookupCreatorResponse, LookupFileResponse, LookupReleaseResponse};
+use {
+ AcceptEditgroupResponse, Api, CreateContainerBatchResponse, CreateContainerResponse, CreateCreatorBatchResponse, CreateCreatorResponse, CreateEditgroupResponse, CreateFileBatchResponse,
+ CreateFileResponse, CreateReleaseBatchResponse, CreateReleaseResponse, CreateWorkBatchResponse, CreateWorkResponse, GetChangelogEntryResponse, GetChangelogResponse, GetContainerHistoryResponse,
+ GetContainerResponse, GetCreatorHistoryResponse, GetCreatorReleasesResponse, GetCreatorResponse, GetEditgroupResponse, GetEditorChangelogResponse, GetEditorResponse, GetFileHistoryResponse,
+ GetFileResponse, GetReleaseFilesResponse, GetReleaseHistoryResponse, GetReleaseResponse, GetStatsResponse, GetWorkHistoryResponse, GetWorkReleasesResponse, GetWorkResponse,
+ LookupContainerResponse, LookupCreatorResponse, LookupFileResponse, LookupReleaseResponse,
+};
/// Convert input into a base path, e.g. "http://example:123". Also checks the scheme as it goes.
fn into_base_path<T: IntoUrl>(input: T, correct_scheme: Option<&'static str>) -> Result<String, ClientInitError> {
diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs
index 4ecc180c..d798fe03 100644
--- a/rust/fatcat-api/src/models.rs
+++ b/rust/fatcat-api/src/models.rs
@@ -258,6 +258,10 @@ pub struct EntityEdit {
#[serde(skip_serializing_if = "Option::is_none")]
pub revision: Option<String>,
+ #[serde(rename = "prev_revision")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub prev_revision: Option<String>,
+
#[serde(rename = "redirect_ident")]
#[serde(skip_serializing_if = "Option::is_none")]
pub redirect_ident: Option<String>,
@@ -276,6 +280,7 @@ impl EntityEdit {
edit_id: edit_id,
ident: ident,
revision: None,
+ prev_revision: None,
redirect_ident: None,
editgroup_id: editgroup_id,
extra: None,
@@ -327,9 +332,9 @@ pub struct FileEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub mimetype: Option<String>,
- #[serde(rename = "url")]
+ #[serde(rename = "urls")]
#[serde(skip_serializing_if = "Option::is_none")]
- pub url: Option<String>,
+ pub urls: Option<Vec<models::FileEntityUrls>>,
#[serde(rename = "sha256")]
#[serde(skip_serializing_if = "Option::is_none")]
@@ -378,7 +383,7 @@ impl FileEntity {
FileEntity {
releases: None,
mimetype: None,
- url: None,
+ urls: None,
sha256: None,
md5: None,
sha1: None,
@@ -394,6 +399,21 @@ impl FileEntity {
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
+pub struct FileEntityUrls {
+ #[serde(rename = "url")]
+ pub url: String,
+
+ #[serde(rename = "rel")]
+ pub rel: String,
+}
+
+impl FileEntityUrls {
+ pub fn new(url: String, rel: String) -> FileEntityUrls {
+ FileEntityUrls { url: url, rel: rel }
+ }
+}
+
+#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ReleaseContrib {
#[serde(rename = "index")]
#[serde(skip_serializing_if = "Option::is_none")]
@@ -407,6 +427,10 @@ pub struct ReleaseContrib {
#[serde(skip_serializing_if = "Option::is_none")]
pub raw: Option<String>,
+ #[serde(rename = "extra")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub extra: Option<serde_json::Value>,
+
#[serde(rename = "role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<String>,
@@ -418,6 +442,7 @@ impl ReleaseContrib {
index: None,
creator_id: None,
raw: None,
+ extra: None,
role: None,
}
}
@@ -425,6 +450,10 @@ impl ReleaseContrib {
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ReleaseEntity {
+ #[serde(rename = "abstracts")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub abstracts: Option<Vec<models::ReleaseEntityAbstracts>>,
+
#[serde(rename = "refs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub refs: Option<Vec<models::ReleaseRef>>,
@@ -454,6 +483,14 @@ pub struct ReleaseEntity {
#[serde(skip_serializing_if = "Option::is_none")]
pub volume: Option<String>,
+ #[serde(rename = "pmcid")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub pmcid: Option<String>,
+
+ #[serde(rename = "pmid")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub pmid: Option<String>,
+
#[serde(rename = "isbn13")]
#[serde(skip_serializing_if = "Option::is_none")]
pub isbn13: Option<String>,
@@ -514,6 +551,7 @@ pub struct ReleaseEntity {
impl ReleaseEntity {
pub fn new(title: String) -> ReleaseEntity {
ReleaseEntity {
+ abstracts: None,
refs: None,
contribs: None,
language: None,
@@ -521,6 +559,8 @@ impl ReleaseEntity {
pages: None,
issue: None,
volume: None,
+ pmcid: None,
+ pmid: None,
isbn13: None,
doi: None,
release_date: None,
@@ -540,6 +580,36 @@ impl ReleaseEntity {
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
+pub struct ReleaseEntityAbstracts {
+ #[serde(rename = "sha1")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub sha1: Option<String>,
+
+ #[serde(rename = "content")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub content: Option<String>,
+
+ #[serde(rename = "mimetype")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub mimetype: Option<String>,
+
+ #[serde(rename = "lang")]
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub lang: Option<String>,
+}
+
+impl ReleaseEntityAbstracts {
+ pub fn new() -> ReleaseEntityAbstracts {
+ ReleaseEntityAbstracts {
+ sha1: None,
+ content: None,
+ mimetype: None,
+ lang: None,
+ }
+ }
+}
+
+#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ReleaseRef {
#[serde(rename = "index")]
#[serde(skip_serializing_if = "Option::is_none")]
@@ -549,9 +619,9 @@ pub struct ReleaseRef {
#[serde(skip_serializing_if = "Option::is_none")]
pub target_release_id: Option<String>,
- #[serde(rename = "raw")]
+ #[serde(rename = "extra")]
#[serde(skip_serializing_if = "Option::is_none")]
- pub raw: Option<String>,
+ pub extra: Option<serde_json::Value>,
#[serde(rename = "key")]
#[serde(skip_serializing_if = "Option::is_none")]
@@ -579,7 +649,7 @@ impl ReleaseRef {
ReleaseRef {
index: None,
target_release_id: None,
- raw: None,
+ extra: None,
key: None,
year: None,
container_title: None,
@@ -616,10 +686,6 @@ impl Success {
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct WorkEntity {
- #[serde(rename = "work_type")]
- #[serde(skip_serializing_if = "Option::is_none")]
- pub work_type: Option<String>,
-
#[serde(rename = "extra")]
#[serde(skip_serializing_if = "Option::is_none")]
pub extra: Option<serde_json::Value>,
@@ -649,7 +715,6 @@ pub struct WorkEntity {
impl WorkEntity {
pub fn new() -> WorkEntity {
WorkEntity {
- work_type: None,
extra: None,
editgroup_id: None,
redirect: None,
diff --git a/rust/fatcat-api/src/server.rs b/rust/fatcat-api/src/server.rs
index e4e0bc1d..e94fd5ef 100644
--- a/rust/fatcat-api/src/server.rs
+++ b/rust/fatcat-api/src/server.rs
@@ -12,8 +12,8 @@ use self::iron::url::percent_encoding::percent_decode;
use self::iron::{modifiers, status, BeforeMiddleware};
use self::router::Router;
use self::urlencoded::UrlEncodedQuery;
-use futures::Future;
use futures::future;
+use futures::Future;
use futures::{stream, Stream};
use hyper;
use hyper::header::{ContentType, Headers};
@@ -36,11 +36,13 @@ use swagger::{ApiError, Context, XSpanId};
#[allow(unused_imports)]
use models;
-use {AcceptEditgroupResponse, Api, CreateContainerBatchResponse, CreateContainerResponse, CreateCreatorBatchResponse, CreateCreatorResponse, CreateEditgroupResponse, CreateFileBatchResponse,
- CreateFileResponse, CreateReleaseBatchResponse, CreateReleaseResponse, CreateWorkBatchResponse, CreateWorkResponse, GetChangelogEntryResponse, GetChangelogResponse, GetContainerHistoryResponse,
- GetContainerResponse, GetCreatorHistoryResponse, GetCreatorReleasesResponse, GetCreatorResponse, GetEditgroupResponse, GetEditorChangelogResponse, GetEditorResponse, GetFileHistoryResponse,
- GetFileResponse, GetReleaseFilesResponse, GetReleaseHistoryResponse, GetReleaseResponse, GetStatsResponse, GetWorkHistoryResponse, GetWorkReleasesResponse, GetWorkResponse,
- LookupContainerResponse, LookupCreatorResponse, LookupFileResponse, LookupReleaseResponse};
+use {
+ AcceptEditgroupResponse, Api, CreateContainerBatchResponse, CreateContainerResponse, CreateCreatorBatchResponse, CreateCreatorResponse, CreateEditgroupResponse, CreateFileBatchResponse,
+ CreateFileResponse, CreateReleaseBatchResponse, CreateReleaseResponse, CreateWorkBatchResponse, CreateWorkResponse, GetChangelogEntryResponse, GetChangelogResponse, GetContainerHistoryResponse,
+ GetContainerResponse, GetCreatorHistoryResponse, GetCreatorReleasesResponse, GetCreatorResponse, GetEditgroupResponse, GetEditorChangelogResponse, GetEditorResponse, GetFileHistoryResponse,
+ GetFileResponse, GetReleaseFilesResponse, GetReleaseHistoryResponse, GetReleaseResponse, GetStatsResponse, GetWorkHistoryResponse, GetWorkReleasesResponse, GetWorkResponse,
+ LookupContainerResponse, LookupCreatorResponse, LookupFileResponse, LookupReleaseResponse,
+};
header! { (Warning, "Warning") => [String] }
diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs
index b260a98a..a2a3a182 100644
--- a/rust/src/api_server.rs
+++ b/rust/src/api_server.rs
@@ -1,19 +1,21 @@
//! API endpoint handlers
-use ConnectionPool;
-use api_helpers::{accept_editgroup, get_or_create_editgroup, fcid2uuid, uuid2fcid};
+use api_helpers::{accept_editgroup, fcid2uuid, get_or_create_editgroup, uuid2fcid};
use chrono;
use database_models::*;
-use database_schema::{changelog, container_edit, container_ident, container_rev, creator_edit,
- creator_ident, creator_rev, editgroup, editor, file_edit, file_ident,
- file_release, file_rev, release_contrib, release_edit, release_ident,
- release_ref, release_rev, work_edit, work_ident, work_rev};
+use database_schema::{
+ changelog, container_edit, container_ident, container_rev, creator_edit, creator_ident,
+ creator_rev, editgroup, editor, file_edit, file_ident, file_release, file_rev, file_rev_url,
+ release_contrib, release_edit, release_ident, release_ref, release_rev, release_rev_abstract,
+ work_edit, work_ident, work_rev,
+};
use diesel::prelude::*;
use diesel::{self, insert_into};
use errors::*;
use fatcat_api::models;
use fatcat_api::models::*;
use uuid::Uuid;
+use ConnectionPool;
type DbConn = diesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::PgConnection>>;
@@ -146,8 +148,18 @@ fn file_row2entity(
let releases: Vec<String> = file_release::table
.filter(file_release::file_rev.eq(rev.id))
.get_results(conn)?
- .iter()
- .map(|r: &FileReleaseRow| uuid2fcid(&r.target_release_ident_id))
+ .into_iter()
+ .map(|r: FileReleaseRow| uuid2fcid(&r.target_release_ident_id))
+ .collect();
+
+ let urls: Vec<FileEntityUrls> = file_rev_url::table
+ .filter(file_rev_url::file_rev.eq(rev.id))
+ .get_results(conn)?
+ .into_iter()
+ .map(|r: FileRevUrlRow| FileEntityUrls {
+ rel: r.rel,
+ url: r.url,
+ })
.collect();
Ok(FileEntity {
@@ -155,7 +167,7 @@ fn file_row2entity(
sha256: rev.sha256,
md5: rev.md5,
size: rev.size.map(|v| v as i64),
- url: rev.url,
+ urls: Some(urls),
mimetype: rev.mimetype,
releases: Some(releases),
state: state,
@@ -186,15 +198,15 @@ fn release_row2entity(
.order(release_ref::index.asc())
.get_results(conn)
.expect("fetch release refs")
- .iter()
- .map(|r: &ReleaseRefRow| ReleaseRef {
- index: r.index.clone(),
- key: r.key.clone(),
- raw: r.raw.clone(),
- container_title: r.container_title.clone(),
- year: r.year.clone(),
- title: r.title.clone(),
- locator: r.locator.clone(),
+ .into_iter()
+ .map(|r: ReleaseRefRow| ReleaseRef {
+ index: r.index,
+ key: r.key,
+ extra: r.extra_json,
+ container_title: r.container_title,
+ year: r.year,
+ title: r.title,
+ locator: r.locator,
target_release_id: r.target_release_ident_id.map(|v| uuid2fcid(&v)),
})
.collect();
@@ -204,15 +216,29 @@ fn release_row2entity(
.order((release_contrib::role.asc(), release_contrib::index.asc()))
.get_results(conn)
.expect("fetch release refs")
- .iter()
- .map(|c: &ReleaseContribRow| ReleaseContrib {
+ .into_iter()
+ .map(|c: ReleaseContribRow| ReleaseContrib {
index: c.index,
- role: c.role.clone(),
- raw: c.raw.clone(),
+ raw: c.raw,
+ role: c.role,
+ extra: c.extra_json,
creator_id: c.creator_ident_id.map(|v| uuid2fcid(&v)),
})
.collect();
+ // XXX: join abstracts table
+ let abstracts: Vec<ReleaseEntityAbstracts> = release_rev_abstract::table
+ .filter(release_rev_abstract::release_rev.eq(rev.id))
+ .get_results(conn)?
+ .into_iter()
+ .map(|r: ReleaseRevAbstractRow| ReleaseEntityAbstracts {
+ sha1: Some(r.abstract_sha1),
+ mimetype: r.mimetype,
+ lang: r.lang,
+ content: None,
+ })
+ .collect();
+
Ok(ReleaseEntity {
title: rev.title,
release_type: rev.release_type,
@@ -220,6 +246,8 @@ fn release_row2entity(
release_date: rev.release_date
.map(|v| chrono::DateTime::from_utc(v.and_hms(0, 0, 0), chrono::Utc)),
doi: rev.doi,
+ pmid: rev.pmid,
+ pmcid: rev.pmcid,
isbn13: rev.isbn13,
volume: rev.volume,
issue: rev.issue,
@@ -230,6 +258,7 @@ fn release_row2entity(
work_id: Some(uuid2fcid(&rev.work_ident_id)),
refs: Some(refs),
contribs: Some(contribs),
+ abstracts: Some(abstracts),
state: state,
ident: ident_id,
revision: Some(rev.id.to_string()),
@@ -249,7 +278,6 @@ fn work_row2entity(ident: Option<WorkIdentRow>, rev: WorkRevRow) -> Result<WorkE
None => (None, None, None),
};
Ok(WorkEntity {
- work_type: rev.work_type,
state: state,
ident: ident_id,
revision: Some(rev.id.to_string()),
@@ -530,20 +558,19 @@ impl Server {
let edit: FileEditRow =
diesel::sql_query(
- "WITH rev AS ( INSERT INTO file_rev (size, sha1, sha256, md5, url, mimetype, extra_json)
- VALUES ($1, $2, $3, $4, $5, $6, $7)
+ "WITH rev AS ( INSERT INTO file_rev (size, sha1, sha256, md5, mimetype, extra_json)
+ VALUES ($1, $2, $3, $4, $5, $6)
RETURNING id ),
ident AS ( INSERT INTO file_ident (rev_id)
VALUES ((SELECT rev.id FROM rev))
RETURNING id )
INSERT INTO file_edit (editgroup_id, ident_id, rev_id) VALUES
- ($8, (SELECT ident.id FROM ident), (SELECT rev.id FROM rev))
+ ($7, (SELECT ident.id FROM ident), (SELECT rev.id FROM rev))
RETURNING *",
).bind::<diesel::sql_types::Nullable<diesel::sql_types::Int8>, _>(entity.size)
.bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(entity.sha1)
.bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(entity.sha256)
.bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(entity.md5)
- .bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(entity.url)
.bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(entity.mimetype)
.bind::<diesel::sql_types::Nullable<diesel::sql_types::Json>, _>(entity.extra)
.bind::<diesel::sql_types::Uuid, _>(editgroup_id)
@@ -572,6 +599,29 @@ impl Server {
}
};
+ let _urls: Option<Vec<FileRevUrlRow>> = match entity.urls {
+ None => None,
+ Some(url_list) => {
+ if url_list.len() == 0 {
+ Some(vec![])
+ } else {
+ let url_rows: Vec<FileRevUrlNewRow> = url_list
+ .into_iter()
+ .map(|u| FileRevUrlNewRow {
+ file_rev: edit.rev_id.unwrap(),
+ rel: u.rel,
+ url: u.url,
+ })
+ .collect();
+ let url_rows: Vec<FileRevUrlRow> = insert_into(file_rev_url::table)
+ .values(url_rows)
+ .get_results(conn)
+ .expect("error inserting file_rev_url");
+ Some(url_rows)
+ }
+ }
+ };
+
edit.to_model()
}
@@ -600,7 +650,6 @@ impl Server {
None => {
// If a work_id wasn't passed, create a new work under the current editgroup
let work_model = models::WorkEntity {
- work_type: None,
ident: None,
revision: None,
redirect: None,
@@ -665,7 +714,7 @@ impl Server {
year: r.year,
title: r.title.clone(),
locator: r.locator.clone(),
- raw: r.raw.clone(),
+ extra_json: r.extra.clone(),
})
.collect();
let ref_rows: Vec<ReleaseRefRow> = insert_into(release_ref::table)
@@ -690,9 +739,10 @@ impl Server {
creator_ident_id: c.creator_id
.clone()
.map(|v| fcid2uuid(&v).expect("valid fatcat identifier")),
+ raw: c.raw.clone(),
index: c.index,
role: c.role.clone(),
- raw: c.raw.clone(),
+ extra_json: c.extra.clone(),
})
.collect();
let contrib_rows: Vec<ReleaseContribRow> = insert_into(release_contrib::table)
@@ -730,17 +780,16 @@ impl Server {
let edit: WorkEditRow =
diesel::sql_query(
- "WITH rev AS ( INSERT INTO work_rev (work_type, extra_json)
- VALUES ($1, $2)
+ "WITH rev AS ( INSERT INTO work_rev (extra_json)
+ VALUES ($1)
RETURNING id ),
ident AS ( INSERT INTO work_ident (rev_id)
VALUES ((SELECT rev.id FROM rev))
RETURNING id )
INSERT INTO work_edit (editgroup_id, ident_id, rev_id) VALUES
- ($3, (SELECT ident.id FROM ident), (SELECT rev.id FROM rev))
+ ($2, (SELECT ident.id FROM ident), (SELECT rev.id FROM rev))
RETURNING *",
- ).bind::<diesel::sql_types::Nullable<diesel::sql_types::Text>, _>(entity.work_type)
- .bind::<diesel::sql_types::Nullable<diesel::sql_types::Json>, _>(entity.extra)
+ ).bind::<diesel::sql_types::Nullable<diesel::sql_types::Json>, _>(entity.extra)
.bind::<diesel::sql_types::Uuid, _>(editgroup_id)
.get_result(conn)?;
diff --git a/rust/src/database_models.rs b/rust/src/database_models.rs
index 167d2fbe..58dc4d42 100644
--- a/rust/src/database_models.rs
+++ b/rust/src/database_models.rs
@@ -43,9 +43,11 @@ macro_rules! entity_structs {
pub struct $edit_struct {
pub id: i64,
pub editgroup_id: Uuid,
+ pub updated: chrono::NaiveDateTime,
pub ident_id: Uuid,
pub rev_id: Option<Uuid>,
pub redirect_id: Option<Uuid>,
+ pub prev_rev: Option<Uuid>,
pub extra_json: Option<serde_json::Value>,
}
@@ -56,6 +58,7 @@ macro_rules! entity_structs {
editgroup_id: uuid2fcid(&self.editgroup_id),
revision: self.rev_id.map(|v| v.to_string()),
redirect_ident: self.redirect_id.map(|v| uuid2fcid(&v)),
+ prev_revision: self.prev_rev.map(|v| v.to_string()),
ident: uuid2fcid(&self.ident_id),
edit_id: self.id,
extra: self.extra_json,
@@ -96,6 +99,7 @@ pub struct ContainerRevRow {
pub name: String,
pub publisher: Option<String>,
pub issnl: Option<String>,
+ pub wikidata_qid: Option<String>,
pub abbrev: Option<String>,
pub coden: Option<String>,
}
@@ -116,6 +120,7 @@ pub struct CreatorRevRow {
pub given_name: Option<String>,
pub surname: Option<String>,
pub orcid: Option<String>,
+ pub wikidata_qid: Option<String>,
}
entity_structs!(
@@ -126,6 +131,23 @@ entity_structs!(
);
#[derive(Debug, Queryable, Identifiable, Associations, AsChangeset)]
+#[table_name = "file_rev_url"]
+pub struct FileRevUrlRow {
+ pub id: i64,
+ pub file_rev: Uuid,
+ pub rel: String,
+ pub url: String,
+}
+
+#[derive(Debug, Queryable, Associations, AsChangeset, Insertable)]
+#[table_name = "file_rev_url"]
+pub struct FileRevUrlNewRow {
+ pub file_rev: Uuid,
+ pub rel: String,
+ pub url: String,
+}
+
+#[derive(Debug, Queryable, Identifiable, Associations, AsChangeset)]
#[table_name = "file_rev"]
pub struct FileRevRow {
pub id: Uuid,
@@ -134,7 +156,6 @@ pub struct FileRevRow {
pub sha1: Option<String>,
pub sha256: Option<String>,
pub md5: Option<String>,
- pub url: Option<String>,
pub mimetype: Option<String>,
}
@@ -152,6 +173,9 @@ pub struct ReleaseRevRow {
pub release_status: Option<String>,
pub release_date: Option<chrono::NaiveDate>,
pub doi: Option<String>,
+ pub pmid: Option<String>,
+ pub pmcid: Option<String>,
+ pub wikidata_qid: Option<String>,
pub isbn13: Option<String>,
pub volume: Option<String>,
pub issue: Option<String>,
@@ -172,21 +196,39 @@ entity_structs!(
pub struct WorkRevRow {
pub id: Uuid,
pub extra_json: Option<serde_json::Value>,
- pub work_type: Option<String>,
- pub primary_release_id: Option<Uuid>,
}
entity_structs!("work_edit", WorkEditRow, "work_ident", WorkIdentRow);
#[derive(Debug, Queryable, Identifiable, Associations, AsChangeset)]
+#[table_name = "release_rev_abstract"]
+pub struct ReleaseRevAbstractRow {
+ pub id: i64,
+ pub release_rev: Uuid,
+ pub abstract_sha1: String,
+ pub mimetype: Option<String>,
+ pub lang: Option<String>,
+}
+
+#[derive(Debug, Queryable, Associations, AsChangeset, Insertable)]
+#[table_name = "release_rev_abstract"]
+pub struct ReleaseRevAbstractNewRow {
+ pub release_rev: Uuid,
+ pub abstract_sha1: String,
+ pub mimetype: Option<String>,
+ pub lang: Option<String>,
+}
+
+#[derive(Debug, Queryable, Identifiable, Associations, AsChangeset)]
#[table_name = "release_contrib"]
pub struct ReleaseContribRow {
pub id: i64,
pub release_rev: Uuid,
pub creator_ident_id: Option<Uuid>,
+ pub raw: Option<String>,
pub role: Option<String>,
pub index: Option<i64>,
- pub raw: Option<String>,
+ pub extra_json: Option<serde_json::Value>,
}
#[derive(Debug, Insertable)]
@@ -194,9 +236,10 @@ pub struct ReleaseContribRow {
pub struct ReleaseContribNewRow {
pub release_rev: Uuid,
pub creator_ident_id: Option<Uuid>,
+ pub raw: Option<String>,
pub role: Option<String>,
pub index: Option<i64>,
- pub raw: Option<String>,
+ pub extra_json: Option<serde_json::Value>,
}
#[derive(Debug, Queryable, Identifiable, Associations, AsChangeset)]
@@ -207,7 +250,7 @@ pub struct ReleaseRefRow {
pub target_release_ident_id: Option<Uuid>,
pub index: Option<i64>,
pub key: Option<String>,
- pub raw: Option<String>,
+ pub extra_json: Option<serde_json::Value>,
pub container_title: Option<String>,
pub year: Option<i64>,
pub title: Option<String>,
@@ -221,7 +264,7 @@ pub struct ReleaseRefNewRow {
pub target_release_ident_id: Option<Uuid>,
pub index: Option<i64>,
pub key: Option<String>,
- pub raw: Option<String>,
+ pub extra_json: Option<serde_json::Value>,
pub container_title: Option<String>,
pub year: Option<i64>,
pub title: Option<String>,
@@ -239,8 +282,9 @@ pub struct FileReleaseRow {
#[table_name = "editgroup"]
pub struct EditgroupRow {
pub id: Uuid,
- pub extra_json: Option<serde_json::Value>,
pub editor_id: Uuid,
+ pub created: chrono::NaiveDateTime,
+ pub extra_json: Option<serde_json::Value>,
pub description: Option<String>,
}
@@ -264,6 +308,7 @@ pub struct EditorRow {
pub id: Uuid,
pub username: String,
pub is_admin: bool,
+ pub registered: chrono::NaiveDateTime,
pub active_editgroup_id: Option<Uuid>,
}
diff --git a/rust/src/database_schema.rs b/rust/src/database_schema.rs
index d99fdd3f..c23e3f83 100644
--- a/rust/src/database_schema.rs
+++ b/rust/src/database_schema.rs
@@ -1,4 +1,11 @@
table! {
+ abstracts (sha1) {
+ sha1 -> Bpchar,
+ content -> Text,
+ }
+}
+
+table! {
changelog (id) {
id -> Int8,
editgroup_id -> Uuid,
@@ -10,9 +17,11 @@ table! {
container_edit (id) {
id -> Int8,
editgroup_id -> Uuid,
+ updated -> Timestamp,
ident_id -> Uuid,
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
+ prev_rev -> Nullable<Uuid>,
extra_json -> Nullable<Json>,
}
}
@@ -32,7 +41,8 @@ table! {
extra_json -> Nullable<Json>,
name -> Text,
publisher -> Nullable<Text>,
- issnl -> Nullable<Text>,
+ issnl -> Nullable<Bpchar>,
+ wikidata_qid -> Nullable<Text>,
abbrev -> Nullable<Text>,
coden -> Nullable<Text>,
}
@@ -42,9 +52,11 @@ table! {
creator_edit (id) {
id -> Int8,
editgroup_id -> Uuid,
+ updated -> Timestamp,
ident_id -> Uuid,
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
+ prev_rev -> Nullable<Uuid>,
extra_json -> Nullable<Json>,
}
}
@@ -65,15 +77,17 @@ table! {
display_name -> Text,
given_name -> Nullable<Text>,
surname -> Nullable<Text>,
- orcid -> Nullable<Text>,
+ orcid -> Nullable<Bpchar>,
+ wikidata_qid -> Nullable<Text>,
}
}
table! {
editgroup (id) {
id -> Uuid,
- extra_json -> Nullable<Json>,
editor_id -> Uuid,
+ created -> Timestamp,
+ extra_json -> Nullable<Json>,
description -> Nullable<Text>,
}
}
@@ -83,6 +97,7 @@ table! {
id -> Uuid,
username -> Text,
is_admin -> Bool,
+ registered -> Timestamp,
active_editgroup_id -> Nullable<Uuid>,
}
}
@@ -91,9 +106,11 @@ table! {
file_edit (id) {
id -> Int8,
editgroup_id -> Uuid,
+ updated -> Timestamp,
ident_id -> Uuid,
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
+ prev_rev -> Nullable<Uuid>,
extra_json -> Nullable<Json>,
}
}
@@ -119,22 +136,31 @@ table! {
id -> Uuid,
extra_json -> Nullable<Json>,
size -> Nullable<Int8>,
- sha1 -> Nullable<Text>,
- sha256 -> Nullable<Text>,
- md5 -> Nullable<Text>,
- url -> Nullable<Text>,
+ sha1 -> Nullable<Bpchar>,
+ sha256 -> Nullable<Bpchar>,
+ md5 -> Nullable<Bpchar>,
mimetype -> Nullable<Text>,
}
}
table! {
+ file_rev_url (id) {
+ id -> Int8,
+ file_rev -> Uuid,
+ rel -> Text,
+ url -> Text,
+ }
+}
+
+table! {
release_contrib (id) {
id -> Int8,
release_rev -> Uuid,
creator_ident_id -> Nullable<Uuid>,
+ raw -> Nullable<Text>,
role -> Nullable<Text>,
index -> Nullable<Int8>,
- raw -> Nullable<Text>,
+ extra_json -> Nullable<Json>,
}
}
@@ -142,9 +168,11 @@ table! {
release_edit (id) {
id -> Int8,
editgroup_id -> Uuid,
+ updated -> Timestamp,
ident_id -> Uuid,
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
+ prev_rev -> Nullable<Uuid>,
extra_json -> Nullable<Json>,
}
}
@@ -165,7 +193,7 @@ table! {
target_release_ident_id -> Nullable<Uuid>,
index -> Nullable<Int8>,
key -> Nullable<Text>,
- raw -> Nullable<Text>,
+ extra_json -> Nullable<Json>,
container_title -> Nullable<Text>,
year -> Nullable<Int8>,
title -> Nullable<Text>,
@@ -184,6 +212,9 @@ table! {
release_status -> Nullable<Text>,
release_date -> Nullable<Date>,
doi -> Nullable<Text>,
+ pmid -> Nullable<Text>,
+ pmcid -> Nullable<Text>,
+ wikidata_qid -> Nullable<Text>,
isbn13 -> Nullable<Text>,
volume -> Nullable<Text>,
issue -> Nullable<Text>,
@@ -194,12 +225,24 @@ table! {
}
table! {
+ release_rev_abstract (id) {
+ id -> Int8,
+ release_rev -> Uuid,
+ abstract_sha1 -> Bpchar,
+ mimetype -> Nullable<Text>,
+ lang -> Nullable<Text>,
+ }
+}
+
+table! {
work_edit (id) {
id -> Int8,
editgroup_id -> Uuid,
+ updated -> Timestamp,
ident_id -> Uuid,
rev_id -> Nullable<Uuid>,
redirect_id -> Nullable<Uuid>,
+ prev_rev -> Nullable<Uuid>,
extra_json -> Nullable<Json>,
}
}
@@ -217,38 +260,34 @@ table! {
work_rev (id) {
id -> Uuid,
extra_json -> Nullable<Json>,
- work_type -> Nullable<Text>,
- primary_release_id -> Nullable<Uuid>,
}
}
joinable!(changelog -> editgroup (editgroup_id));
-joinable!(container_edit -> container_rev (rev_id));
joinable!(container_edit -> editgroup (editgroup_id));
joinable!(container_ident -> container_rev (rev_id));
-joinable!(creator_edit -> creator_rev (rev_id));
joinable!(creator_edit -> editgroup (editgroup_id));
joinable!(creator_ident -> creator_rev (rev_id));
joinable!(file_edit -> editgroup (editgroup_id));
-joinable!(file_edit -> file_rev (rev_id));
joinable!(file_ident -> file_rev (rev_id));
joinable!(file_release -> file_rev (file_rev));
joinable!(file_release -> release_ident (target_release_ident_id));
+joinable!(file_rev_url -> file_rev (file_rev));
joinable!(release_contrib -> creator_ident (creator_ident_id));
joinable!(release_contrib -> release_rev (release_rev));
joinable!(release_edit -> editgroup (editgroup_id));
-joinable!(release_edit -> release_rev (rev_id));
joinable!(release_ident -> release_rev (rev_id));
joinable!(release_ref -> release_ident (target_release_ident_id));
joinable!(release_ref -> release_rev (release_rev));
joinable!(release_rev -> container_ident (container_ident_id));
joinable!(release_rev -> work_ident (work_ident_id));
+joinable!(release_rev_abstract -> abstracts (abstract_sha1));
+joinable!(release_rev_abstract -> release_rev (release_rev));
joinable!(work_edit -> editgroup (editgroup_id));
-joinable!(work_edit -> work_rev (rev_id));
joinable!(work_ident -> work_rev (rev_id));
-joinable!(work_rev -> release_ident (primary_release_id));
allow_tables_to_appear_in_same_query!(
+ abstracts,
changelog,
container_edit,
container_ident,
@@ -262,11 +301,13 @@ allow_tables_to_appear_in_same_query!(
file_ident,
file_release,
file_rev,
+ file_rev_url,
release_contrib,
release_edit,
release_ident,
release_ref,
release_rev,
+ release_rev_abstract,
work_edit,
work_ident,
work_rev,
diff --git a/rust/tests/test_api_server.rs b/rust/tests/test_api_server.rs
index 4c269e7f..b831f122 100644
--- a/rust/tests/test_api_server.rs
+++ b/rust/tests/test_api_server.rs
@@ -318,8 +318,8 @@ fn test_post_file() {
headers,
r#"{"size": 76543,
"sha1": "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8",
- "md5": "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8",
- "sha256": "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8",
+ "md5": "0b6d347b01d437a092be84c2edfce72c",
+ "sha256": "a77e4c11a57f1d757fca5754a8f83b5d4ece49a2d28596889127c1a2f3f28832",
"url": "http://archive.org/asdf.txt",
"mimetype": "application/pdf",
"releases": [
@@ -415,7 +415,6 @@ fn test_post_work() {
headers.clone(),
// TODO: target_work_id
r#"{
- "work_type": "journal-article",
"extra": { "source": "speculation" }
}"#,
&router,