toc_doc 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.env.example +17 -0
- data/.yardopts +12 -0
- data/CHANGELOG.md +22 -0
- data/CODE_OF_CONDUCT.md +10 -0
- data/LICENSE.md +595 -0
- data/README.md +370 -0
- data/Rakefile +12 -0
- data/TODO.md +77 -0
- data/lib/toc_doc/client/availabilities.rb +118 -0
- data/lib/toc_doc/client.rb +55 -0
- data/lib/toc_doc/core/authentication.rb +15 -0
- data/lib/toc_doc/core/configurable.rb +121 -0
- data/lib/toc_doc/core/connection.rb +196 -0
- data/lib/toc_doc/core/default.rb +163 -0
- data/lib/toc_doc/core/error.rb +16 -0
- data/lib/toc_doc/core/uri_utils.rb +30 -0
- data/lib/toc_doc/core/version.rb +8 -0
- data/lib/toc_doc/http/middleware/raise_error.rb +28 -0
- data/lib/toc_doc/http/response/base_middleware.rb +25 -0
- data/lib/toc_doc/middleware/.keep +0 -0
- data/lib/toc_doc/models/availability.rb +21 -0
- data/lib/toc_doc/models/resource.rb +82 -0
- data/lib/toc_doc/models/response/availability.rb +79 -0
- data/lib/toc_doc/models.rb +6 -0
- data/lib/toc_doc.rb +90 -0
- data/sig/toc_doc.rbs +4 -0
- metadata +107 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 3637aae8586b1ea3b5b568a4ef64a295b3e3664ada7d252163e8176ce429aa37
|
|
4
|
+
data.tar.gz: da283d2f5efd9c37b7f6b20d6bc207dcb79f826850b8d7d0953157473f36345f
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 79a3d614929d14b5709dec397ab39a78c07db2db0e31da2e2de7423af8da4a1af5b5dbc77f3943da8b104ab25b85531328e739697384fb7a8a53451320bf9951
|
|
7
|
+
data.tar.gz: 962d1c35bb6ede7899491b93e0f00c868a3aa87ffe4a32b076576b0017d96ff09e3214eb37000bee0ba40f43269597c75d21daf18c77e92787b39d61b29b4696
|
data/.env.example
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Example environment configuration for TocDoc
|
|
2
|
+
# Copy this file to `.env` and adjust values as needed.
|
|
3
|
+
|
|
4
|
+
# Base API endpoint (supports other regions like .de, .it)
|
|
5
|
+
# TOCDOC_API_ENDPOINT=https://www.doctolib.fr
|
|
6
|
+
|
|
7
|
+
# Custom user agent sent with each request
|
|
8
|
+
# TOCDOC_USER_AGENT=TocDoc Ruby Gem
|
|
9
|
+
|
|
10
|
+
# Default media type for requests
|
|
11
|
+
# TOCDOC_MEDIA_TYPE=application/json
|
|
12
|
+
|
|
13
|
+
# Default pagination limit
|
|
14
|
+
# TOCDOC_PER_PAGE=3
|
|
15
|
+
|
|
16
|
+
# Max retry attempts for transient HTTP errors
|
|
17
|
+
# TOCDOC_RETRY_MAX=3
|
data/.yardopts
ADDED
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## [Unreleased]
|
|
2
|
+
|
|
3
|
+
## [1.0.0] - 2026-03-04
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Client** — `TocDoc::Client` with configurable options, method delegation from top-level `TocDoc` module, and block-based `TocDoc.setup`
|
|
8
|
+
- **Configuration** — 7 config keys (`api_endpoint`, `user_agent`, `middleware`, `connection_options`, `default_media_type`, `per_page`, `auto_paginate`) with environment variable overrides (`TOCDOC_API_ENDPOINT`, etc.)
|
|
9
|
+
- **Availabilities endpoint** — `Client#availabilities` supporting `visit_motive_ids`, `agenda_ids`, `start_date`, `limit`, and arbitrary extra query params
|
|
10
|
+
- **Pagination** — automatic multi-page fetching via `auto_paginate` option; merges results across pages using `next_slot`-based page advancement
|
|
11
|
+
- **Response models** — `TocDoc::Response::Availability` wrapping the API response with `#total`, `#next_slot`, `#availabilities` (filtered) and `#raw_availabilities` (unfiltered)
|
|
12
|
+
- **Resource base model** — `TocDoc::Resource` with dot-notation attribute access, bracket access, and Hash equality
|
|
13
|
+
- **Availability model** — `TocDoc::Availability` with `#date` and `#slots`
|
|
14
|
+
- **Error handling** — `TocDoc::Error` base class and `TocDoc::Middleware::RaiseError` Faraday middleware wrapping Faraday errors
|
|
15
|
+
- **Connection layer** — Faraday-based HTTP with `get`, `post`, `put`, `patch`, `delete`, `head` and a default middleware stack (retry, raise_error, JSON parsing)
|
|
16
|
+
- **Retry middleware** — automatic retries (up to 3, configurable via `TOCDOC_RETRY_MAX`) with exponential backoff on `429`, `5xx` errors
|
|
17
|
+
- **URI utilities** — `#dashed_ids` helper for Doctolib's dash-separated ID format
|
|
18
|
+
- **YARD documentation**
|
|
19
|
+
|
|
20
|
+
## [0.1.0] - 2026-02-27
|
|
21
|
+
|
|
22
|
+
- Initial build
|
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
"tocdoc" follows [The Ruby Community Conduct Guideline](https://www.ruby-lang.org/en/conduct) in all "collaborative space", which is defined as community communications channels (such as mailing lists, submitted patches, commit comments, etc.):
|
|
4
|
+
|
|
5
|
+
* Participants will be tolerant of opposing views.
|
|
6
|
+
* Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
|
|
7
|
+
* When interpreting the words and actions of others, participants should always assume good intentions.
|
|
8
|
+
* Behaviour which can be reasonably considered harassment will not be tolerated.
|
|
9
|
+
|
|
10
|
+
If you have any concerns about behaviour within this project, please contact us at ["m.louguet@gmail.com"](mailto:"m.louguet@gmail.com").
|