Commit Graph
11 Commits
Author SHA1 Message Date
Stevan Freeborn 54e9f04ae1 chore: suppress dead_code warnings in integration test common module 2026-03-25 19:15:45 -05:00
Stevan Freeborn 9a5e00c560 fix: load .env file in integration tests and examples
Add dotenvy to dev-dependencies and call dotenvy::dotenv().ok() in
the integration test common module and all examples so env vars can
be loaded from a .env file.
2026-03-25 19:06:25 -05:00
Stevan Freeborn a517aef3bd feat: add integration tests and runnable examples
Add 91 integration tests (all #[ignore]) mirroring the JavaScript SDK's
integration test suite. Tests cover all endpoints: ping, apps, fields,
records, files, lists, and reports with success, auth, access, and
not-found scenarios.

Add 7 runnable examples (cargo run --example <name>) for quick manual
smoke testing against a real Onspring instance.

Both use env vars (API_BASE_URL, SANDBOX_API_KEY, TEST_*) matching the
JavaScript SDK setup.

Also rename crate to onspring-api-sdk-rust with [lib] name = "onspring"
so imports remain `use onspring::*`.
2026-03-25 18:57:45 -05:00
Stevan Freeborn 905f7f945a style: use 2-space indentation across entire codebase
Add rustfmt.toml with tab_spaces = 2 and reformat all source files,
tests, and README code examples to use 2-space indentation.
2026-03-25 14:11:08 -05:00
Stevan Freeborn fa81603c63 feat: add reports endpoint with get report and list reports methods
Implement ReportInfo, ReportData, and ReportRow models. Add get_report
(with optional data format and data type params) and list_reports
(paginated) methods. Tests cover report data retrieval, format
parameters, listing reports by app, and not-found error.
2026-03-25 13:47:11 -05:00
Stevan Freeborn 9d63911fc1 feat: add lists endpoint with save and delete list item methods
Implement SaveListItemRequest and SaveListItemResponse models. Add
save_list_item (create/update via PUT) and delete_list_item methods.
Tests cover creating, updating, deleting list items and not-found error.
2026-03-25 13:45:29 -05:00
Stevan Freeborn 1161c645bf feat: add files endpoint with info, download, upload, and delete
Implement FileInfo, FileResponse, SaveFileRequest, and
CreatedWithIdResponse models. Add get_file_info, get_file (binary
download), upload_file (multipart), and delete_file methods. Tests
cover metadata retrieval, binary content download with headers, file
upload, deletion, and not-found error with message extraction.
2026-03-25 13:44:03 -05:00
Stevan Freeborn f7050506d2 feat: add records endpoint with all CRUD and query methods
Implement Record, RecordFieldValue, SaveRecordRequest,
QueryRecordsRequest, BatchGetRecordsRequest, and BatchDeleteRecordsRequest
models. Add 7 endpoint methods: list_records, get_record, save_record,
delete_record, batch_get_records, query_records, batch_delete_records.
Add 9 tests covering all methods including parameterized queries.
2026-03-25 13:42:24 -05:00
Stevan Freeborn 46c54b4589 feat: add fields endpoint with get, batch-get, and list methods
Implement Field model supporting base fields and polymorphic variants
(list, formula, reference fields via optional properties). Add get_field,
batch_get_fields, and list_fields endpoint methods with tests covering
basic fields, list-type fields, batch retrieval, pagination, and
not-found scenarios.
2026-03-25 13:40:11 -05:00
Stevan Freeborn fe883a9dd2 feat: add apps endpoint with list, get, and batch-get methods
Implement App model and three endpoint methods: list_apps (paginated),
get_app (by ID), and batch_get_apps (up to 100 by IDs). Add
comprehensive tests for success, pagination, not-found, and batch
scenarios.
2026-03-25 13:37:55 -05:00
Stevan Freeborn 6735bca09f feat: add ping endpoint with test infrastructure
Implement ping() method on OnspringClient. Set up wiremock-based test
infrastructure with shared setup helper. Add tests for success and
unauthorized scenarios verifying correct headers are sent.
2026-03-25 13:35:52 -05:00