Skip to content

Commit

Permalink
Merge branch 'release/v0.12.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Nov 4, 2024
2 parents 1c09b47 + e71d5ae commit 493c5fc
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 38 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [[0.12.14]](https://github.com/thoth-pub/thoth/releases/tag/v0.12.14) - 2024-11-04
### Changed
- [642](https://github.com/thoth-pub/thoth/issues/642) - Output `ProductAvailability` based on work status in Thoth ONIX 3.0
- [642](https://github.com/thoth-pub/thoth/issues/642) - Use `UnpricedItemType` code `01` (Free of charge) for unpriced products in Thoth ONIX 3.0

## [[0.12.13]](https://github.com/thoth-pub/thoth/releases/tag/v0.12.13) - 2024-10-23
### Fixed
- [639](https://github.com/thoth-pub/thoth/issues/639) - Make new locations canonical by default
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth"
version = "0.12.13"
version = "0.12.14"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -16,11 +16,11 @@ maintenance = { status = "actively-developed" }
members = ["thoth-api", "thoth-api-server", "thoth-app", "thoth-app-server", "thoth-client", "thoth-errors", "thoth-export-server"]

[dependencies]
thoth-api = { version = "=0.12.13", path = "thoth-api", features = ["backend"] }
thoth-api-server = { version = "=0.12.13", path = "thoth-api-server" }
thoth-app-server = { version = "=0.12.13", path = "thoth-app-server" }
thoth-errors = { version = "=0.12.13", path = "thoth-errors" }
thoth-export-server = { version = "=0.12.13", path = "thoth-export-server" }
thoth-api = { version = "=0.12.14", path = "thoth-api", features = ["backend"] }
thoth-api-server = { version = "=0.12.14", path = "thoth-api-server" }
thoth-app-server = { version = "=0.12.14", path = "thoth-app-server" }
thoth-errors = { version = "=0.12.14", path = "thoth-errors" }
thoth-export-server = { version = "=0.12.14", path = "thoth-export-server" }
clap = { version = "4.5.16", features = ["cargo", "env"] }
dialoguer = { version = "0.11.0", features = ["password"] }
dotenv = "0.15.0"
Expand Down
6 changes: 3 additions & 3 deletions thoth-api-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-api-server"
version = "0.12.13"
version = "0.12.14"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -9,8 +9,8 @@ repository = "https://github.com/thoth-pub/thoth"
readme = "README.md"

[dependencies]
thoth-api = { version = "=0.12.13", path = "../thoth-api", features = ["backend"] }
thoth-errors = { version = "=0.12.13", path = "../thoth-errors" }
thoth-api = { version = "=0.12.14", path = "../thoth-api", features = ["backend"] }
thoth-errors = { version = "=0.12.14", path = "../thoth-errors" }
actix-web = "4.9"
actix-cors = "0.7.0"
actix-identity = "0.7.1"
Expand Down
4 changes: 2 additions & 2 deletions thoth-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-api"
version = "0.12.13"
version = "0.12.14"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -16,7 +16,7 @@ maintenance = { status = "actively-developed" }
backend = ["diesel", "diesel-derive-enum", "diesel_migrations", "futures", "actix-web", "jsonwebtoken"]

[dependencies]
thoth-errors = { version = "=0.12.13", path = "../thoth-errors" }
thoth-errors = { version = "=0.12.14", path = "../thoth-errors" }
actix-web = { version = "4.8", optional = true }
argon2rs = "0.2.5"
isbn2 = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion thoth-app-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-app-server"
version = "0.12.13"
version = "0.12.14"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions thoth-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-app"
version = "0.12.13"
version = "0.12.14"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down Expand Up @@ -36,8 +36,8 @@ uuid = { version = "1.10.0", features = ["serde", "v4"] }
# `getrandom` is a dependency of `uuid`, we need to explicitly import and include the `js` feature to enable wasm
# https://docs.rs/getrandom/latest/getrandom/#webassembly-support
getrandom = { version = "0.2", features = ["js"] }
thoth-api = { version = "=0.12.13", path = "../thoth-api" }
thoth-errors = { version = "=0.12.13", path = "../thoth-errors" }
thoth-api = { version = "=0.12.14", path = "../thoth-api" }
thoth-errors = { version = "=0.12.14", path = "../thoth-errors" }

[build-dependencies]
dotenv = "0.15.0"
8 changes: 4 additions & 4 deletions thoth-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-client"
version = "0.12.13"
version = "0.12.14"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -10,8 +10,8 @@ readme = "README.md"
build = "build.rs"

[dependencies]
thoth-api = {version = "=0.12.13", path = "../thoth-api" }
thoth-errors = {version = "=0.12.13", path = "../thoth-errors" }
thoth-api = {version = "=0.12.14", path = "../thoth-api" }
thoth-errors = {version = "=0.12.14", path = "../thoth-errors" }
graphql_client = "0.14.0"
chrono = { version = "0.4.38", features = ["serde"] }
reqwest = { version = "0.12", features = ["json"] }
Expand All @@ -22,4 +22,4 @@ serde_json = "1.0"
uuid = { version = "1.10.0", features = ["serde"] }

[build-dependencies]
thoth-api = { version = "=0.12.13", path = "../thoth-api", features = ["backend"] }
thoth-api = { version = "=0.12.14", path = "../thoth-api", features = ["backend"] }
2 changes: 1 addition & 1 deletion thoth-errors/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-errors"
version = "0.12.13"
version = "0.12.14"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
8 changes: 4 additions & 4 deletions thoth-export-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth-export-server"
version = "0.12.13"
version = "0.12.14"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -10,9 +10,9 @@ readme = "README.md"
build = "build.rs"

[dependencies]
thoth-api = { version = "=0.12.13", path = "../thoth-api" }
thoth-errors = { version = "=0.12.13", path = "../thoth-errors" }
thoth-client = { version = "=0.12.13", path = "../thoth-client" }
thoth-api = { version = "=0.12.14", path = "../thoth-api" }
thoth-errors = { version = "=0.12.14", path = "../thoth-errors" }
thoth-client = { version = "=0.12.14", path = "../thoth-client" }
actix-web = "4.9"
actix-cors = "0.7.0"
cc_license = "0.1.0"
Expand Down
21 changes: 15 additions & 6 deletions thoth-export-server/src/xml/onix3_thoth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -924,9 +924,18 @@ impl XmlElementBlock<Onix3Thoth> for Work {
}
Ok(())
})?;
// 99 Contact supplier
write_element_block("ProductAvailability", w, |w| {
w.write(XmlEvent::Characters("99")).map_err(|e| e.into())
let availability = match self.work_status {
WorkStatus::CANCELLED => "01", // 01 – Cancelled
WorkStatus::FORTHCOMING => "10", // 10 – Not yet available
WorkStatus::POSTPONED_INDEFINITELY => "09", // 09 – Not yet available, postponed indefinitely
WorkStatus::ACTIVE => "20", // 20 – Available
WorkStatus::SUPERSEDED => "41", // 41 – Not available, replaced by new product
WorkStatus::WITHDRAWN => "49", // 49 – Recalled
WorkStatus::Other(_) => unreachable!(),
};
w.write(XmlEvent::Characters(availability))
.map_err(|e| e.into())
})?;
if let Some(date) = &self.publication_date {
write_element_block("SupplyDate", w, |w| {
Expand All @@ -949,9 +958,9 @@ impl XmlElementBlock<Onix3Thoth> for Work {
})?;
}
if publication.prices.is_empty() {
// 04 Contact supplier
// 01 Free of charge
write_element_block("UnpricedItemType", w, |w| {
w.write(XmlEvent::Characters("04")).map_err(|e| e.into())
w.write(XmlEvent::Characters("01")).map_err(|e| e.into())
})
} else {
for price in &publication.prices {
Expand Down Expand Up @@ -2836,7 +2845,7 @@ mod tests {
<WebsiteLink>https://www.book.com/pb_landing</WebsiteLink>
</Website>
</Supplier>
<ProductAvailability>99</ProductAvailability>
<ProductAvailability>20</ProductAvailability>
<SupplyDate>
<SupplyDateRole>08</SupplyDateRole>
<Date dateformat="00">19991231</Date>
Expand Down Expand Up @@ -3357,7 +3366,7 @@ mod tests {
</Website>"#
));
// UnpricedItemType block instead of any Prices
assert!(output.contains(r#" <UnpricedItemType>04</UnpricedItemType>"#));
assert!(output.contains(r#" <UnpricedItemType>01</UnpricedItemType>"#));
assert!(!output.contains(r#" <Price>"#));

// Remove chapter DOI: can't output ContentDetail block
Expand Down

0 comments on commit 493c5fc

Please sign in to comment.