Repository navigation
Add the 11 endpoints missing from the SDK (KYC, verification, agent auth, CAS generator, inbox read, inbound email files) - #28
Open
kriton-dev wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The OpenAPI spec at https://api.casparser.in/openapi.json (v4.0.0) has 31 endpoints and this SDK covers 20 of them. This PR adds the other 11, following the generated code already in the repo: a params type and a response type for each endpoint, sync and async methods with the raw and streaming variants, four new resources wired into both clients, entries in
api.md, and tests in the existing pattern (skipped like the rest, since the mock server tests are disabled here). Nothing that is already in the SDK is renamed or removed.GET /v1/agent-auth/token/{token}client.agent_auth.poll()POST /v1/agent-auth/token/{token}/approveclient.agent_auth.approve()POST /v1/kyc/digilocker/account-lookupclient.kyc.lookup_digilocker_account()POST /v1/kyc/digilocker/sessionclient.kyc.start_digilocker_session()POST /v1/kyc/digilocker/result/{session_id}client.kyc.get_digilocker_result()POST /v1/kyc/pan/statusclient.kyc.check_pan_status()POST /v1/verify/mfdclient.verification.verify_mfd()POST /v1/verify/sebiclient.verification.verify_sebi()POST /v4/generateclient.cas_generator.generate_cas()POST /v4/inbox/readclient.inbox.read()GET /v4/inbound-email/{inbound_email_id}/filesclient.inbound_email.list_files()I generated the code from the spec with my own generator, set up to match the Stainless output in this repo, and then read through the result.
ruff check,ruff format --check, strictpyrightandmypy, with the versions pinned inrequirements-dev.lock, give the same results as main (the one existing mypy error in_utils/_typing.pyis unchanged). The full test suite passes, 494 tests, 22 of them in one new file,tests/test_added_calls_stubbed.py. That file calls every new method sync and async against a respx stub and checks the request method, path, body, query and headers against the spec, and that the documented response parses into the new type with strict validation on.Two other things I noticed. The newest
cas-parser-pythonon PyPI is 1.2.1 from February 14, and the changelog here lists 20 versions since then, up to 1.16.0, sopip installstill gets the February build. The PHP SDK'scomposer.jsonstill has the package nameorg-placeholder/cas-parser, so it cannot be installed from Packagist by name.I found this repo while looking at SDKs that stopped getting updates when Stainless shut down its hosted service. The Node, Go and PHP SDKs are missing the same 11 endpoints. Bringing those up to date and keeping all four in sync with the API is paid work I do, and I would be glad to talk about it here. If a smaller review is easier, I can split this into one PR per resource.