Skip to content

Commit 8a63238

Browse files
mivertowskiclaude
andcommitted
Add CI/CD workflows and polish README/CHANGELOG for crates.io
- Add GitHub Actions CI workflow (test on stable + MSRV 1.83, clippy, fmt, doc build, package check) - Add publish workflow triggered on version tags (verify, publish to crates.io, create GitHub release) - Polish README with badges, API coverage table with credit costs, feature flags table, MSRV section - Clean up CHANGELOG with link references - Add crates.io metadata to Cargo.toml (keywords, categories, homepage, documentation, exclude docs/ and CLAUDE.md from package) - Run cargo fmt on all source files Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6270369 commit 8a63238

18 files changed

Lines changed: 2122 additions & 228 deletions

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUSTFLAGS: -Dwarnings
12+
13+
jobs:
14+
test:
15+
name: Test
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
rust: [stable, "1.83"]
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: dtolnay/rust-toolchain@master
23+
with:
24+
toolchain: ${{ matrix.rust }}
25+
- uses: Swatinem/rust-cache@v2
26+
- name: Install libssl-dev
27+
run: sudo apt-get update && sudo apt-get install -y libssl-dev
28+
- run: cargo test --all-features
29+
30+
clippy:
31+
name: Clippy
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: dtolnay/rust-toolchain@stable
36+
with:
37+
components: clippy
38+
- uses: Swatinem/rust-cache@v2
39+
- name: Install libssl-dev
40+
run: sudo apt-get update && sudo apt-get install -y libssl-dev
41+
- run: cargo clippy --all-features -- -D warnings
42+
43+
fmt:
44+
name: Format
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: dtolnay/rust-toolchain@stable
49+
with:
50+
components: rustfmt
51+
- run: cargo fmt --check
52+
53+
doc:
54+
name: Documentation
55+
runs-on: ubuntu-latest
56+
env:
57+
RUSTDOCFLAGS: -Dwarnings
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: dtolnay/rust-toolchain@stable
61+
- uses: Swatinem/rust-cache@v2
62+
- name: Install libssl-dev
63+
run: sudo apt-get update && sudo apt-get install -y libssl-dev
64+
- run: cargo doc --no-deps --all-features
65+
66+
package:
67+
name: Package
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
- uses: dtolnay/rust-toolchain@stable
72+
- uses: Swatinem/rust-cache@v2
73+
- run: cargo package

.github/workflows/publish.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish to crates.io
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
verify:
13+
name: Verify
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: dtolnay/rust-toolchain@stable
18+
- uses: Swatinem/rust-cache@v2
19+
- run: cargo test --all-features
20+
- run: cargo clippy --all-features -- -D warnings
21+
- run: cargo fmt --check
22+
- run: cargo package
23+
24+
publish:
25+
name: Publish
26+
needs: verify
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: dtolnay/rust-toolchain@stable
31+
- uses: Swatinem/rust-cache@v2
32+
- run: cargo publish
33+
env:
34+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
35+
36+
release:
37+
name: GitHub Release
38+
needs: publish
39+
runs-on: ubuntu-latest
40+
permissions:
41+
contents: write
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Create GitHub Release
45+
env:
46+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
TAG_NAME: ${{ github.ref_name }}
48+
run: gh release create "$TAG_NAME" --generate-notes --title "$TAG_NAME"

CHANGELOG.md

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,65 +7,63 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [1.0.0] - 2026-03-18
99

10-
### Breaking Changes
11-
12-
- **Base URL** changed from `/v1` to `/api/v1` to match production API
13-
- **`PaginatedResponse`** field renamed: `total``total_count`
14-
- **`Company`** model restructured: removed `legal_seat`, `capital_nominal`, `capital_currency`, `auditor_name`, `registration_date`, `deletion_date`, `data_source`, `last_modified`; added `address`, `auditor_category`, `created_at`, `updated_at`
15-
- **`Person`** model simplified: `first_name`/`last_name``name`, `roles` is now `Vec<String>`, added `companies: Vec<String>`
16-
- **`Dossier`** model restructured: removed `id`, `status`, `executive_summary`, `key_insights`, `risk_factors`; added `company_name`, `summary`, `risk_score`
17-
- **`GenerateDossierRequest`** field renamed: `level``dossier_type` (serialized as `"type"`)
18-
- **Dossier generation** path changed from `POST /dossiers` to `POST /dossiers/{uid}/generate`
19-
- **`ApiKeyInfo`** renamed to `ApiKey` with simplified fields; `ApiKeyCreated.raw_key``key`
20-
- **`CreateApiKeyRequest`** simplified: removed `permissions`, `is_test``is_test_key`
21-
- **`UsageBreakdown.period`** changed from `Option<UsagePeriod>` to `Option<String>`; removed `UsagePeriod` and `UsageOperation.count`
22-
- **Billing types** unified: `CheckoutSessionResponse`/`PortalSessionResponse``SessionUrlResponse`; billing methods now take `CheckoutRequest` instead of `&str`
23-
- **Billing paths** changed: `/billing/checkout``/billing/checkout-session`, `/billing/portal``/billing/portal-session`
24-
- **`CreateTeamRequest`** now includes optional `owner_email` and `owner_name`
25-
- **`Team`** now includes `updated_at`
26-
- **Companies resource**: `search()` renamed to `list()`, old `count()` now takes `CompanyCountParams` instead of `CompanySearchParams`
27-
- **Removed resources**: `webhooks()`, `users()`, `settings()` — not in final API spec
10+
First stable release, aligned with the VynCo OpenAPI 1.0.0 specification.
2811

2912
### Added
3013

31-
- **7 new resource modules** with 23 new endpoints:
32-
- `changes()``list`, `by_company`, `statistics`, `by_sogc`, `review`, `batch`
33-
- `analytics()``cluster`, `anomalies`, `cohorts`, `cantons`, `auditors`, `rfm_segments`, `velocity`
34-
- `watches()``list`, `create`, `remove`, `notifications`
35-
- `news()``for_company`, `recent`
36-
- `reports()``for_company`
37-
- `relationships()``for_company`, `hierarchy`
38-
- `health()``check`
39-
- **New company endpoints**: `search` (POST full-text), `batch` (multi-UID lookup), `compare` (side-by-side)
40-
- **Expanded persons**: `list`, `roles`, `connections`, `board_members`, `network_stats`
41-
- **Expanded dossiers**: `list`, `get`, `statistics`
42-
- **Expanded teams**: `members`, `invite_member`, `update_member_role`, `remove_member`, `billing_summary`
43-
- **New types**: `CompanyStatistics`, `CompanyRelationship`, `RelationshipResponse`, `CompanyWatch`, `CreateWatchRequest`, `ChangeNotification`, `TeamMember`, `InviteMemberRequest`, `UpdateMemberRoleRequest`, `BillingSummary`, `MemberUsage`, `CreditLedgerEntry`, `HealthResponse`, `HealthCheck`, `ChangeStatistics`, `ReviewChangeRequest`, `ReviewChangeResponse`, `BatchChangeRequest`, `CompanySearchRequest`, `BatchCompanyRequest`, `CompareCompaniesRequest`, `ClusterRequest`, `AnomalyRequest`, `CohortParams`, `CompanyNewsResponse`, `RecentNewsResponse`, `CompanyReportsResponse`
44-
- **`ErrorBody`** now includes `error_type` and `title` fields for RFC 7807 compliance
14+
- **7 new resource modules** (23 endpoints):
15+
- `changes()` — list, by_company, statistics, by_sogc, review, batch
16+
- `analytics()` — cluster, anomalies, cohorts, cantons, auditors, rfm_segments, velocity
17+
- `watches()` — list, create, remove, notifications
18+
- `news()` — for_company, recent
19+
- `reports()` — for_company
20+
- `relationships()` — for_company, hierarchy
21+
- `health()` — check
22+
- **New company endpoints**: full-text search (POST), batch lookup, compare
23+
- **Expanded persons**: list, roles, connections, board_members, network_stats
24+
- **Expanded dossiers**: list, get, statistics
25+
- **Expanded teams**: members, invite_member, update_member_role, remove_member, billing_summary
4526
- **`VyncoError::Conflict`** variant for HTTP 409
46-
- **`ResponseMeta`** now includes `rate_limit_remaining` (`X-RateLimit-Remaining`) and `rate_limit_reset` (`X-RateLimit-Reset`)
47-
- **16 integration tests** covering all error variants, company endpoints, changes, health, API keys, credits, and response metadata
27+
- **RFC 7807 ProblemDetails** fields on `ErrorBody` (`error_type`, `title`)
28+
- **Rate limit headers** on `ResponseMeta` (`rate_limit_remaining`, `rate_limit_reset`)
29+
- **CI/CD** via GitHub Actions with automated crates.io publishing on tags
30+
31+
### Changed
32+
33+
- **Base URL**: `/v1``/api/v1`
34+
- **`PaginatedResponse`**: `total``total_count`
35+
- **`Company`** model: replaced `legal_seat`, `capital_nominal`, `capital_currency`, `auditor_name`, `registration_date`, `deletion_date`, `data_source`, `last_modified` with `address`, `auditor_category`, `created_at`, `updated_at`
36+
- **`Person`** model: simplified to `name`, `roles: Vec<String>`, `companies: Vec<String>`
37+
- **`Dossier`** model: now uses `company_name`, `summary`, `risk_score`
38+
- **`GenerateDossierRequest`**: `level``dossier_type` (serialized as `"type"`)
39+
- **Dossier generation path**: `POST /dossiers``POST /dossiers/{uid}/generate`
40+
- **`ApiKeyInfo`**`ApiKey`; `ApiKeyCreated.raw_key``key`
41+
- **`CreateApiKeyRequest`**: simplified (removed `permissions`, `is_test``is_test_key`)
42+
- **Billing types**: unified `CheckoutSessionResponse`/`PortalSessionResponse``SessionUrlResponse`
43+
- **Billing paths**: `/billing/checkout``/billing/checkout-session`, `/billing/portal``/billing/portal-session`
44+
- **Companies resource**: `search()``list()`, `count()` now takes `CompanyCountParams`
45+
- **Tests**: expanded from 12 → 16 covering new endpoints and error variants
4846

4947
### Removed
5048

51-
- `Webhooks` resource and related types (`Webhook`, `WebhookCreated`, `CreateWebhookRequest`, `UpdateWebhookRequest`)
52-
- `Users` resource and related types (`UserProfile`, `UpdateProfileRequest`)
53-
- `Settings` resource
54-
- `PersonRole` type (person roles are now `Vec<String>`)
55-
- `PersonSearchParams` type (replaced by `PersonListParams`)
56-
- `CompanySearchParams` type (replaced by `CompanyListParams` and `CompanyCountParams`)
57-
- `UsagePeriod` type
49+
- `webhooks()`, `users()`, `settings()` resources (not in final API)
50+
- Types: `Webhook`, `WebhookCreated`, `CreateWebhookRequest`, `UpdateWebhookRequest`, `UserProfile`, `UpdateProfileRequest`, `PersonRole`, `PersonSearchParams`, `CompanySearchParams`, `UsagePeriod`
5851

5952
## [0.1.0] - 2026-03-17
6053

54+
Initial release (draft API).
55+
6156
### Added
6257

63-
- **Async client** with builder pattern (`Client::builder(api_key).build()`)
64-
- **Blocking client** behind `blocking` feature flag for synchronous usage
65-
- **10 resource modules** covering the VynCo draft API
66-
- **Response metadata** via `Response<T>` wrapper exposing API headers
67-
- **Typed error handling** with `VyncoError` enum mapping HTTP status codes
68-
- **Automatic retry** with exponential backoff on 429 and 5xx responses
69-
- **Retry-After header** support for rate-limited requests
70-
- **TLS backend selection** via `rustls-tls` (default) or `native-tls` features
71-
- **12 integration tests** with mockito
58+
- Async client with builder pattern
59+
- Blocking client behind `blocking` feature flag
60+
- 10 resource modules (30 endpoints)
61+
- Response metadata wrapper (`Response<T>`) with 5 API headers
62+
- Typed error handling with `VyncoError` enum (7 HTTP status variants)
63+
- Automatic retry with exponential backoff on 429/5xx
64+
- Retry-After header support
65+
- TLS backend selection (rustls default, native-tls optional)
66+
- 12 integration tests with mockito
67+
68+
[1.0.0]: https://github.com/VynCorp/vc-rust/compare/v0.1.0...v1.0.0
69+
[0.1.0]: https://github.com/VynCorp/vc-rust/releases/tag/v0.1.0

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ license = "Apache-2.0"
77
authors = ["VynCo <hello@vynco.ch>"]
88
description = "Rust SDK for the VynCo Swiss Corporate Intelligence API"
99
repository = "https://github.com/VynCorp/vc-rust"
10+
homepage = "https://vynco.ch"
11+
documentation = "https://docs.rs/vynco"
12+
readme = "README.md"
13+
keywords = ["vynco", "swiss", "corporate", "zefix", "sdk"]
14+
categories = ["api-bindings", "web-programming::http-client"]
15+
exclude = ["docs/", "CLAUDE.md"]
1016

1117
[dependencies]
1218
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }

0 commit comments

Comments
 (0)