Repository navigation
feat(code): cloud functions — list / qualifiers / invoke / event-sample / runs - #46
Merged
Merged
Conversation
…velope types, Fake provider references/hub_dtos.py refreshed in place with x python (BaseUrl swapped to the campaign gateway's ephemeral port, header restored): the five code/functions requests, the CodeFunction* envelope types, FunctionRefDto, TriggerActionCodeDto.function_ref, CodeProvider.Fake, FakeCodeIntegration*. AiScopeDto and OAuthAuthorizeDecisionRequest drop out — the gateway no longer has them. references/api_dtos.py kept: the Api metadata no longer exports the 18 JsonSchemaFieldDto subclasses. hub/code.py has no methods for the new routes: scripts/generate_endpoints.py is not on disk. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…le / runs The five Code-function routes of the gateway contract (Code.Functions.md §3.3, §3.4, §5.1) on `hub.code`, sync and async: `get_code_functions`, `get_code_function_qualifiers`, `invoke_code_function`, `get_code_function_event_sample`, `get_code_function_runs`. `norbix_python.functions`: `parse_function_event(raw)` reads the envelope a cloud function receives (`CodeFunctionEventDto`, specVersion "1") into a `FunctionEvent` — a wrapper over the decoded dict with a typed `context` (`run_as.access_token`, `hub_url`, `api_url`, …), the views `as_database_record_change()`, `as_user_change()`, `as_file_change()`, `as_payment()`, `as_scheduled_task()`, `as_ai_usage()`, `payload()`, and `client_options()` → the `Norbix` constructor kwargs for the run-as user. No DTO is re-declared; the generated types stay in `references/hub_dtos.py`. Tests: the five routes (verb, path, query, body; sync + async), one envelope sample per source, bad specVersion / non-object refusals, a client built from an event calling the envelope's deployment. Docs: `docs/hub/code.md`, README "Cloud functions". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What changed
hub.code(sync and async): the five Code-function routes of the gateway contract —get_code_functions(GET /{version}/code/functions),get_code_function_qualifiers(GET …/qualifiers),invoke_code_function(POST …/invoke),get_code_function_event_sample(GET …/event-sample),get_code_function_runs(GET …/runs). Written in the generated style (**request→ query for GET, JSON body for POST).norbix_python.functions:parse_function_event(raw)→FunctionEvent(a wrapper over the decoded envelope,specVersion"1"), typedcontext(run_as.access_token,hub_url,api_url, …), the viewsas_database_record_change(),as_user_change(),as_file_change(),as_payment(),as_scheduled_task(),as_ai_usage(),payload(), andclient_options()→ theNorbix/AsyncNorbixconstructor kwargs for the run-as user. Exported from the package. No DTO is hand-written: the generated types stay inreferences/hub_dtos.py.docs/hub/code.md(new; index row), README "Cloud functions".Tests
uv run pytest: 1094 passed (was 1066; +28: five routes × sync / async + surface, seven envelope samples, refusals, a client built from an event).uv run ruff check .,uv run mypy src: clean.uv.lockuntouched).Context
docs/architecture/Code.Functions.md§3.3, §3.4, §4, §5.1, §7 (branchaudit/code); taskgateway docs/tasks/code-functions.md (branch audit/code).🤖 Generated with Claude Code