Repository navigation
fix(sdk): align with api contract and publish on main (2.0.0) - #6
Merged
Merged
Conversation
…orbidden and api errors
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.
Alinha o
ararahq-sdkao contrato real da API por chave (origin/main @ 35451b75) e passa a publicar no PyPI a cada push na main. Versão 1.8.1 → 2.0.0 (tem quebras, ver CHANGELOG.md).P0
messages.send,messages.send_batchecampaigns.createsempre mandamIdempotency-Key(a do caller viaidempotency_key=, ou um UUID v4 por chamada). A chave vai no header da chamada, então todo retry dela reaproveita a mesma. O http client só repete POST/PATCH que levam a chave; GET/PUT/DELETE continuam repetindo livremente.get/get_status/delete/analyticsrecebem o UUID. Busca por nome =templates.list(name=...)(documentado).templates.listesmart_links.listdevolvemPage(data+pagination) compage/size(ename/statusem templates). Antes lançavam sempre. Campanhas usam{content,totalPages,totalElements}.payments,brain,organizations,users,api_keys(403/404 por chave). Entrouauth.me()→GET /auth/me.status_code/code/message/details/retry_after. 403PLAN_FEATURE_LOCKED→AraraPlanFeatureLockedError(feature,current_plan,upgrade_to); 403 com outro código →AraraApiError; 403 sem envelope (corpo Spring/vazio: chave sem permissão, fora da allowlist) →AraraForbiddenError; 401 →AraraAuthError; 422 →AraraUnprocessableError. Chave de idempotência em branco conta como ausente.CreateTemplateRequestmandabody(+ header/headerType/footer/buttons/samples/variableExamples/carouselCards);structureJsonsaiu.MessageResponse.costopcional e comreason.P1 feito
messages.send_batch(≤1000, validado local) emessages.list_by_batch.campaigns.list/get/cancel;CampaignRequestcomscheduled_ateab_test.templates.analytics.opt_outs(list/create/get/delete, telefone URL-encoded).auth.meexigem chave ADMIN.Higiene
class Config/Field(env=...)(pytest agora sai sem warning de depreciação).Noneem vez de quebrar no parse..DS_Storeno .gitignore.ci.yml(PR na main: ruff + pytest + build em 3.9 e 3.12).Pendente
campaigns.estimate,templates.recreate/library/sync/usage,contactssegments/export,wallet/calculate,organizations/me/plan,media/upload.opt_outsetemplates.analyticsdevolvemdict: a API respondeMap/Anye o shape não foi fixado no contrato.dist/ehtmlcov/locais antigos não são versionados (já estavam no .gitignore).Pro founder cadastrar antes do merge (senão o publish falha)
ararahq-sdk→ Manage → Publishing → Add a new publisher (GitHub):ararahqarara-python-sdkpypi-publish.ymlpypipypi(se ainda não existe).O job
publishtem sóid-token: write+contents: read; tag e release rodam num jobreleaseseparado comcontents: write. O gate publica só com 404 do PyPI, pula com 200 e falha com qualquer outro status. Depois do merge, o workflow roda na main, vê que 2.0.0 não existe no PyPI, publica, cria a tagv2.0.0e o release com os artefatos.Prova (local, Python 3.12)