|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
Executes framework-owned declarative action contracts for dynamic apps. More...
#include "native_dynamic_business_logic.h"#include "native_dynamic_multipart.h"#include "native_dynamic_request_fields.h"#include "native_fs.h"#include "native_http_response.h"#include "native_support.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <arpa/inet.h>#include <errno.h>#include <netdb.h>#include <netinet/in.h>#include <sys/socket.h>#include <sys/time.h>#include <unistd.h>Go to the source code of this file.
Data Structures | |
| struct | InputFieldValueLogicLocal |
| struct | InputFieldMapLogicLocal |
| struct | ActionExecutionContextLogicLocal |
| struct | ActionEffectCountsLogicLocal |
| struct | ParsedHttpUrlLogicLocal |
| struct | OutboundHttpResultLogicLocal |
Functions | |
| static char * | request_body_bytes_dup_logic_local (const HttpRequest *request, size_t *out_size) |
| static char * | request_form_value_dup_logic_local (const HttpRequest *request, const char *field_name) |
| static void | write_json_error_logic_local (NativeConnection *connection, int status, const char *status_text, const char *error_kind, const char *message) |
| static int | now_iso_utc_logic_local (char out[20]) |
| static char * | app_manifest_path_dup_logic_local (const AppRuntime *app) |
| static char * | fixture_path_dup_logic_local (const AppRuntime *app, const char *fixture_key) |
| static yyjson_doc * | load_fixture_doc_logic_local (const AppRuntime *app, const char *fixture_key) |
| static yyjson_val * | find_action_contract_logic_local (yyjson_val *root, const char *action_id) |
| static yyjson_val * | find_workflow_transition_logic_local (yyjson_val *root, const char *action_id, yyjson_val **workflow_out) |
| static void | free_action_execution_context_logic_local (ActionExecutionContextLogicLocal *context) |
| static void | free_parsed_http_url_logic_local (ParsedHttpUrlLogicLocal *url) |
| static void | free_outbound_http_result_logic_local (OutboundHttpResultLogicLocal *result) |
| static int | now_plus_seconds_iso_utc_logic_local (long offset_seconds, char out[20]) |
| static int | replace_owned_string_logic_local (char **slot, const char *value) |
| static int | note_created_record_logic_local (ActionExecutionContextLogicLocal *context, long record_id, const char *resource_id) |
| static int | note_updated_record_logic_local (ActionExecutionContextLogicLocal *context, long record_id, const char *resource_id) |
| static int | note_bounded_scope_logic_local (ActionExecutionContextLogicLocal *context, long matched_count, long applied_count, const char *overflow_policy) |
| static void | free_input_field_map_logic_local (InputFieldMapLogicLocal *map) |
| static char * | input_field_value_dup_logic_local (const InputFieldMapLogicLocal *map, const char *field_id) |
| static char * | action_presentation_string_dup_logic_local (yyjson_val *action_contract, const char *field_name) |
| static char * | workflow_presentation_string_dup_logic_local (yyjson_val *transition, const char *field_name) |
| static int | load_action_inputs_logic_local (const HttpRequest *request, yyjson_val *action_contract, InputFieldMapLogicLocal *map, char **error_message_out) |
| static char * | string_value_from_contract_logic_local (yyjson_val *value_contract, const InputFieldMapLogicLocal *inputs, const ActionExecutionContextLogicLocal *context, const char *list_item_text, yyjson_val *source_record_context) |
| static yyjson_mut_val * | field_value_from_contract_logic_local (yyjson_mut_doc *doc, yyjson_val *value_contract, const InputFieldMapLogicLocal *inputs, long next_id, yyjson_val *record_context, const ActionExecutionContextLogicLocal *context, const char *list_item_text, yyjson_val *source_record_context) |
| static int | append_list_item_logic_local (char ***items_out, size_t *count_out, const char *start, size_t length) |
| static void | free_split_items_logic_local (char **items, size_t count) |
| static int | split_input_list_logic_local (const char *raw_value, const char *delimiter, char ***items_out, size_t *count_out) |
| static int | set_mut_object_field_logic_local (yyjson_mut_doc *doc, yyjson_mut_val *obj, const char *field_name, yyjson_mut_val *value) |
| static char * | scoped_resource_id_dup_logic_local (const char *collection_name, const char *field_name, const char *expected_text) |
| static int | record_field_matches_text_value_logic_local (yyjson_val *record, const char *field_name, const char *expected_text) |
| static int | record_field_matches_text_logic_local (yyjson_mut_val *record, const char *field_name, const char *expected_text) |
| static char * | scope_match_expected_text_dup_logic_local (yyjson_val *scope_match, const InputFieldMapLogicLocal *inputs, const ActionExecutionContextLogicLocal *context) |
| static long | matching_record_count_value_logic_local (yyjson_val *collection, const char *scope_field, const char *expected_text) |
| static long | matching_record_count_logic_local (yyjson_mut_val *collection, const char *scope_field, const char *expected_text) |
| static int | append_record_primitive_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, yyjson_val *primitive, const InputFieldMapLogicLocal *inputs, const ActionExecutionContextLogicLocal *context, long next_id, long *created_record_id_out, char **resource_id_out) |
| static yyjson_mut_val * | find_mut_record_by_long_field_logic_local (yyjson_mut_val *array, const char *field_name, long match_value) |
| static int | append_records_from_input_list_primitive_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, yyjson_val *primitive, const InputFieldMapLogicLocal *inputs, ActionExecutionContextLogicLocal *context, long next_id, long *created_count_out, char **resource_id_out) |
| static yyjson_mut_val * | find_mut_record_by_id_logic_local (yyjson_mut_val *collection, long record_id) |
| static int | append_records_from_related_collection_primitive_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, yyjson_val *source_root, yyjson_val *primitive, const InputFieldMapLogicLocal *inputs, ActionExecutionContextLogicLocal *context, long next_id, long *created_count_out, char **resource_id_out) |
| static int | update_record_primitive_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, yyjson_val *primitive, const InputFieldMapLogicLocal *inputs, ActionExecutionContextLogicLocal *context, char **resource_id_out, char **from_state_out, char **to_state_out) |
| static int | scoped_reassignment_primitive_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, yyjson_val *source_root, yyjson_val *primitive, const InputFieldMapLogicLocal *inputs, ActionExecutionContextLogicLocal *context, char **resource_id_out) |
| static int | bulk_update_primitive_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, yyjson_val *primitive, const InputFieldMapLogicLocal *inputs, ActionExecutionContextLogicLocal *context, char **resource_id_out, char **from_state_out, char **to_state_out) |
| static int | set_root_fields_primitive_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, yyjson_val *primitive, const InputFieldMapLogicLocal *inputs, const ActionExecutionContextLogicLocal *context, long next_id) |
| static long | next_section_id_logic_local (yyjson_mut_val *root, const char *section_name) |
| static yyjson_mut_val * | ensure_mut_array_field_logic_local (yyjson_mut_doc *doc, yyjson_mut_val *root, const char *field_name) |
| static int | append_mut_object_to_array_logic_local (yyjson_mut_doc *doc, yyjson_mut_val *root, const char *section_name, yyjson_mut_val *obj) |
| static yyjson_val * | find_integration_adapter_logic_local (yyjson_val *root, const char *adapter_id) |
| static char * | integration_adapter_target_url_dup_logic_local (yyjson_val *adapter) |
| static int | parse_http_url_logic_local (const char *url, ParsedHttpUrlLogicLocal *parsed) |
| static int | append_bytes_logic_local (char **buffer, size_t *length, size_t *capacity, const char *chunk, size_t chunk_len) |
| static int | outbound_http_post_logic_local (const char *target_url, const char *content_type, const char *payload_json, OutboundHttpResultLogicLocal *result) |
| static char * | effect_payload_json_dup_logic_local (const char *action_id, const char *adapter_id, const char *resource_id, const char *replay_trace_id, const char *created_at) |
| static int | append_job_attempt_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, long job_execution_id, const char *execution_status, const char *payload_json, const char *created_at, const char *error_message) |
| static int | process_webhook_delivery_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, yyjson_mut_val *delivery, const char *created_at, const char *payload_json) |
| static int | process_due_integration_deliveries_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, const char *created_at, const char *payload_json) |
| static int | append_action_report_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, yyjson_val *action_contract, yyjson_val *workflow, yyjson_val *transition, const ActionExecutionContextLogicLocal *context, const ActionEffectCountsLogicLocal *effect_counts, const char *resource_id, const char *from_state, const char *to_state, const char *created_at, const char *policy_gate, const char *success_message, const char *operator_summary, const char *transition_label, const char *from_state_label, const char *to_state_label, long workflow_execution_id, long created_record_id, char **report_json_out, char **replay_trace_id_out) |
| static int | append_workflow_and_effects_logic_local (const AppRuntime *app, yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, yyjson_val *action_contract, yyjson_val *workflow, yyjson_val *transition, const InputFieldMapLogicLocal *inputs, const ActionExecutionContextLogicLocal *context, const char *policy_gate, const char *resource_id, const char *from_state, const char *to_state, const char *created_at, const char *replay_trace_id, long *workflow_execution_id_out, ActionEffectCountsLogicLocal *effect_counts_out) |
| static int | append_audit_event_logic_local (yyjson_mut_doc *mut_doc, yyjson_mut_val *mut_root, yyjson_val *transition, const char *resource_id, const char *created_at, const char *replay_trace_id, const char *report_json, const char *from_state, const char *to_state) |
| static int | persist_mut_doc_logic_local (const AppRuntime *app, yyjson_mut_doc *mut_doc) |
| static const char * | http_reason_phrase_logic_local (int status) |
| Resolves a minimal HTTP reason phrase for framework-owned responses. | |
| static int | send_redirect_logic_local (NativeConnection *connection, const AppRuntime *app, yyjson_val *response_contract) |
| Sends a declarative redirect response contract. | |
| static int | send_json_action_result_logic_local (NativeConnection *connection, yyjson_val *response_contract, const char *action_id, const char *resource_id, long workflow_execution_id, const char *report_json, yyjson_mut_doc *mut_doc) |
| Sends a declarative JSON action-result response contract. | |
| static int | send_action_response_logic_local (NativeConnection *connection, const AppRuntime *app, yyjson_val *response_contract, const char *action_id, const char *resource_id, long workflow_execution_id, const char *report_json, yyjson_mut_doc *mut_doc) |
| Sends the configured declarative response contract for an action. | |
| int | native_dynamic_action_presentation_dup (const AppRuntime *app, const char *action_id, char **submit_label_out, char **summary_out) |
| Loads declarative presentation overrides for one action contract. | |
| int | native_dynamic_execute_declarative_action (NativeConnection *connection, const AppRuntime *app, const HttpRequest *request, const char *action_id) |
| Executes one declarative dynamic-app action contract against JSON state. | |
Executes framework-owned declarative action contracts for dynamic apps.
Definition in file native_dynamic_business_logic.c.
|
static |
Definition at line 423 of file native_dynamic_business_logic.c.
References native_json_obj_get(), and native_json_obj_get_string_dup().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 129 of file native_dynamic_business_logic.c.
References AppRuntime::app_root, and path_join().
Referenced by fixture_path_dup_logic_local().
|
static |
Definition at line 2263 of file native_dynamic_business_logic.c.
References ActionExecutionContextLogicLocal::anchor_record_id, ActionExecutionContextLogicLocal::created_record_count, ensure_mut_array_field_logic_local(), ActionEffectCountsLogicLocal::job_count, ActionExecutionContextLogicLocal::last_created_record_id, ActionExecutionContextLogicLocal::last_touched_record_id, ActionExecutionContextLogicLocal::matched_record_count, native_json_obj_get_string_dup(), ActionEffectCountsLogicLocal::notification_count, ActionExecutionContextLogicLocal::overflow_policy, set_mut_object_field_logic_local(), ActionExecutionContextLogicLocal::skipped_record_count, ActionExecutionContextLogicLocal::updated_record_count, ActionEffectCountsLogicLocal::webhook_count, yyjson_mut_arr_append(), yyjson_mut_obj(), yyjson_mut_obj_add_int(), and yyjson_mut_obj_add_strcpy().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 2766 of file native_dynamic_business_logic.c.
References ensure_mut_array_field_logic_local(), native_json_doc_free(), native_json_doc_load_text(), native_json_obj_get_string_dup(), yyjson_doc_get_root(), yyjson_mut_arr_append(), yyjson_mut_obj(), yyjson_mut_obj_add_strcpy(), yyjson_mut_obj_put(), yyjson_mut_strcpy(), and yyjson_val_mut_copy().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 1898 of file native_dynamic_business_logic.c.
Referenced by outbound_http_post_logic_local().
|
static |
Definition at line 2132 of file native_dynamic_business_logic.c.
References ensure_mut_array_field_logic_local(), native_json_doc_free(), native_json_doc_load_text(), next_section_id_logic_local(), yyjson_doc_get_root(), yyjson_mut_arr_append(), yyjson_mut_obj(), yyjson_mut_obj_add_int(), yyjson_mut_obj_add_strcpy(), yyjson_mut_obj_put(), yyjson_mut_strcpy(), and yyjson_val_mut_copy().
Referenced by append_workflow_and_effects_logic_local().
|
static |
Definition at line 676 of file native_dynamic_business_logic.c.
References dup_range(), and trim_in_place().
Referenced by split_input_list_logic_local().
|
static |
Definition at line 1803 of file native_dynamic_business_logic.c.
References ensure_mut_array_field_logic_local(), and yyjson_mut_arr_append().
|
static |
Definition at line 851 of file native_dynamic_business_logic.c.
References field_value_from_contract_logic_local(), native_json_obj_get(), native_json_obj_get_string_dup(), set_mut_object_field_logic_local(), yyjson_get_sint(), yyjson_get_str(), yyjson_is_num(), yyjson_is_obj(), yyjson_mut_arr(), yyjson_mut_arr_append(), yyjson_mut_is_arr(), yyjson_mut_obj(), yyjson_mut_obj_get(), yyjson_mut_obj_put(), yyjson_mut_strcpy(), yyjson_obj_iter_get_val(), yyjson_obj_iter_init(), and yyjson_obj_iter_next().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 947 of file native_dynamic_business_logic.c.
References field_value_from_contract_logic_local(), free_split_items_logic_local(), input_field_value_dup_logic_local(), native_json_obj_get(), native_json_obj_get_string_dup(), note_created_record_logic_local(), set_mut_object_field_logic_local(), split_input_list_logic_local(), yyjson_get_sint(), yyjson_get_str(), yyjson_is_num(), yyjson_is_obj(), yyjson_mut_arr(), yyjson_mut_arr_append(), yyjson_mut_is_arr(), yyjson_mut_obj(), yyjson_mut_obj_get(), yyjson_mut_obj_put(), yyjson_mut_strcpy(), yyjson_obj_iter_get_val(), yyjson_obj_iter_init(), and yyjson_obj_iter_next().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 1120 of file native_dynamic_business_logic.c.
References field_value_from_contract_logic_local(), matching_record_count_value_logic_local(), native_json_obj_get(), native_json_obj_get_long_default(), native_json_obj_get_string_dup(), note_bounded_scope_logic_local(), note_created_record_logic_local(), record_field_matches_text_value_logic_local(), scope_match_expected_text_dup_logic_local(), scoped_resource_id_dup_logic_local(), set_mut_object_field_logic_local(), streq(), yyjson_arr_foreach, yyjson_get_sint(), yyjson_get_str(), yyjson_is_arr(), yyjson_is_num(), yyjson_is_obj(), yyjson_mut_arr(), yyjson_mut_arr_append(), yyjson_mut_is_arr(), yyjson_mut_obj(), yyjson_mut_obj_get(), yyjson_mut_obj_put(), yyjson_mut_strcpy(), yyjson_obj_iter_get_val(), yyjson_obj_iter_init(), and yyjson_obj_iter_next().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 2446 of file native_dynamic_business_logic.c.
References append_job_attempt_logic_local(), effect_payload_json_dup_logic_local(), ensure_mut_array_field_logic_local(), find_integration_adapter_logic_local(), integration_adapter_target_url_dup_logic_local(), ActionEffectCountsLogicLocal::job_count, load_fixture_doc_logic_local(), native_json_doc_free(), native_json_obj_get(), native_json_obj_get_long_default(), native_json_obj_get_string_dup(), next_section_id_logic_local(), ActionEffectCountsLogicLocal::notification_count, string_value_from_contract_logic_local(), ActionEffectCountsLogicLocal::webhook_count, yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_arr_size(), yyjson_doc_get_root(), yyjson_get_str(), yyjson_is_arr(), yyjson_is_obj(), yyjson_is_str(), yyjson_mut_arr_append(), yyjson_mut_obj(), yyjson_mut_obj_add_int(), yyjson_mut_obj_add_strcpy(), yyjson_mut_obj_put(), and yyjson_mut_strcpy().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 1579 of file native_dynamic_business_logic.c.
References field_value_from_contract_logic_local(), matching_record_count_logic_local(), native_json_obj_get(), native_json_obj_get_long_default(), native_json_obj_get_string_dup(), note_bounded_scope_logic_local(), note_updated_record_logic_local(), record_field_matches_text_logic_local(), scope_match_expected_text_dup_logic_local(), scoped_resource_id_dup_logic_local(), set_mut_object_field_logic_local(), streq(), yyjson_get_sint(), yyjson_get_str(), yyjson_is_num(), yyjson_is_obj(), yyjson_is_str(), yyjson_mut_arr_foreach, yyjson_mut_is_arr(), yyjson_mut_is_obj(), yyjson_mut_is_str(), yyjson_mut_obj_get(), yyjson_obj_iter_get_val(), yyjson_obj_iter_init(), and yyjson_obj_iter_next().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 2104 of file native_dynamic_business_logic.c.
References yyjson_mut_doc_free(), yyjson_mut_doc_new(), yyjson_mut_doc_set_root(), yyjson_mut_obj(), yyjson_mut_obj_add_strcpy(), yyjson_mut_write(), and YYJSON_WRITE_NOFLAG.
Referenced by append_workflow_and_effects_logic_local().
|
static |
Definition at line 1791 of file native_dynamic_business_logic.c.
References yyjson_mut_arr(), yyjson_mut_is_arr(), yyjson_mut_obj_get(), yyjson_mut_obj_put(), and yyjson_mut_strcpy().
Referenced by append_action_report_logic_local(), append_audit_event_logic_local(), append_job_attempt_logic_local(), append_mut_object_to_array_logic_local(), append_workflow_and_effects_logic_local(), process_due_integration_deliveries_logic_local(), and process_webhook_delivery_logic_local().
|
static |
Definition at line 597 of file native_dynamic_business_logic.c.
References ActionExecutionContextLogicLocal::anchor_record_id, input_field_value_dup_logic_local(), ActionExecutionContextLogicLocal::last_created_record_id, ActionExecutionContextLogicLocal::last_touched_record_id, native_json_obj_get(), native_json_obj_get_string_dup(), streq(), yyjson_get_bool(), yyjson_get_sint(), yyjson_get_str(), yyjson_is_bool(), yyjson_is_null(), yyjson_is_num(), yyjson_is_obj(), yyjson_is_str(), yyjson_mut_bool(), yyjson_mut_int(), yyjson_mut_null(), yyjson_mut_sint(), and yyjson_mut_strcpy().
Referenced by append_record_primitive_logic_local(), append_records_from_input_list_primitive_logic_local(), append_records_from_related_collection_primitive_logic_local(), bulk_update_primitive_logic_local(), scoped_reassignment_primitive_logic_local(), set_root_fields_primitive_logic_local(), and update_record_primitive_logic_local().
|
static |
Definition at line 183 of file native_dynamic_business_logic.c.
References native_json_obj_get(), yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_equals_str(), yyjson_is_arr(), and yyjson_is_obj().
Referenced by native_dynamic_action_presentation_dup(), and native_dynamic_execute_declarative_action().
|
static |
Definition at line 1811 of file native_dynamic_business_logic.c.
References native_json_obj_get(), yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_equals_str(), yyjson_is_arr(), and yyjson_is_obj().
Referenced by append_workflow_and_effects_logic_local().
|
static |
Definition at line 1099 of file native_dynamic_business_logic.c.
References yyjson_get_sint(), yyjson_is_num(), yyjson_mut_arr_foreach, yyjson_mut_is_arr(), yyjson_mut_is_obj(), and yyjson_mut_obj_get().
Referenced by scoped_reassignment_primitive_logic_local().
|
static |
Definition at line 931 of file native_dynamic_business_logic.c.
References yyjson_get_sint(), yyjson_is_num(), yyjson_mut_arr_foreach, yyjson_mut_is_arr(), yyjson_mut_is_obj(), and yyjson_mut_obj_get().
Referenced by update_record_primitive_logic_local().
|
static |
Definition at line 200 of file native_dynamic_business_logic.c.
References native_json_obj_get(), yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_equals_str(), yyjson_is_arr(), and yyjson_is_obj().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 136 of file native_dynamic_business_logic.c.
References app_manifest_path_dup_logic_local(), AppRuntime::app_root, native_json_doc_free(), native_json_doc_load_file(), native_json_obj_get(), native_json_obj_get_string_dup(), path_join(), and yyjson_doc_get_root().
Referenced by load_fixture_doc_logic_local().
|
static |
Definition at line 277 of file native_dynamic_business_logic.c.
References ActionExecutionContextLogicLocal::anchor_resource_id, ActionExecutionContextLogicLocal::last_created_resource_id, ActionExecutionContextLogicLocal::last_touched_resource_id, and ActionExecutionContextLogicLocal::overflow_policy.
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 396 of file native_dynamic_business_logic.c.
References InputFieldMapLogicLocal::count, InputFieldValueLogicLocal::field_id, InputFieldMapLogicLocal::items, and InputFieldValueLogicLocal::value.
Referenced by load_action_inputs_logic_local(), and native_dynamic_execute_declarative_action().
|
static |
Definition at line 298 of file native_dynamic_business_logic.c.
References OutboundHttpResultLogicLocal::error_message, and OutboundHttpResultLogicLocal::response_body.
Referenced by process_webhook_delivery_logic_local().
|
static |
Definition at line 288 of file native_dynamic_business_logic.c.
References ParsedHttpUrlLogicLocal::host, ParsedHttpUrlLogicLocal::path, and ParsedHttpUrlLogicLocal::scheme.
Referenced by outbound_http_post_logic_local(), and parse_http_url_logic_local().
|
static |
Definition at line 702 of file native_dynamic_business_logic.c.
Referenced by append_records_from_input_list_primitive_logic_local().
|
static |
Resolves a minimal HTTP reason phrase for framework-owned responses.
| status | HTTP status code. |
Definition at line 2834 of file native_dynamic_business_logic.c.
Referenced by send_json_action_result_logic_local().
|
static |
Definition at line 410 of file native_dynamic_business_logic.c.
References InputFieldMapLogicLocal::count, InputFieldValueLogicLocal::field_id, InputFieldMapLogicLocal::items, streq(), and InputFieldValueLogicLocal::value.
Referenced by append_records_from_input_list_primitive_logic_local(), field_value_from_contract_logic_local(), scope_match_expected_text_dup_logic_local(), string_value_from_contract_logic_local(), and update_record_primitive_logic_local().
|
static |
Definition at line 1828 of file native_dynamic_business_logic.c.
References native_json_obj_get_string_dup(), and yyjson_is_obj().
Referenced by append_workflow_and_effects_logic_local().
|
static |
Definition at line 439 of file native_dynamic_business_logic.c.
References InputFieldMapLogicLocal::count, InputFieldValueLogicLocal::field_id, free_input_field_map_logic_local(), InputFieldMapLogicLocal::items, native_json_obj_get(), native_json_obj_get_string_dup(), request_form_value_dup_logic_local(), streq(), InputFieldValueLogicLocal::value, yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_arr_size(), yyjson_get_bool(), and yyjson_is_arr().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 173 of file native_dynamic_business_logic.c.
References fixture_path_dup_logic_local(), and native_json_doc_load_file().
Referenced by append_workflow_and_effects_logic_local(), native_dynamic_action_presentation_dup(), and native_dynamic_execute_declarative_action().
|
static |
Definition at line 843 of file native_dynamic_business_logic.c.
References matching_record_count_value_logic_local().
Referenced by bulk_update_primitive_logic_local().
|
static |
Definition at line 820 of file native_dynamic_business_logic.c.
References record_field_matches_text_value_logic_local(), yyjson_arr_foreach, yyjson_is_arr(), and yyjson_is_obj().
Referenced by append_records_from_related_collection_primitive_logic_local(), matching_record_count_logic_local(), and scoped_reassignment_primitive_logic_local().
| int native_dynamic_action_presentation_dup | ( | const AppRuntime * | app, |
| const char * | action_id, | ||
| char ** | submit_label_out, | ||
| char ** | summary_out ) |
Loads declarative presentation overrides for one action contract.
| app | Finalized app runtime metadata. |
| action_id | Action identifier to inspect. |
| submit_label_out | Optional duplicated submit label. |
| summary_out | Optional duplicated summary text. |
Definition at line 3027 of file native_dynamic_business_logic.c.
References find_action_contract_logic_local(), load_fixture_doc_logic_local(), native_json_doc_free(), native_json_obj_get(), native_json_obj_get_string_dup(), and yyjson_doc_get_root().
Referenced by proof_home_page_params_json_dup_runtime().
| int native_dynamic_execute_declarative_action | ( | NativeConnection * | connection, |
| const AppRuntime * | app, | ||
| const HttpRequest * | request, | ||
| const char * | action_id ) |
Executes one declarative dynamic-app action contract against JSON state.
The shared runtime uses this helper for framework-owned action contracts that express typed inputs, mutation primitives, workflow bindings, effect hooks, and explanation reporting declaratively in app fixtures.
| connection | Connection that receives any error or redirect response. |
| app | Finalized app runtime metadata. |
| request | Parsed HTTP request. |
| action_id | Action identifier from the matched route. |
Definition at line 3047 of file native_dynamic_business_logic.c.
References action_presentation_string_dup_logic_local(), ActionExecutionContextLogicLocal::anchor_record_id, ActionExecutionContextLogicLocal::anchor_resource_id, append_action_report_logic_local(), append_audit_event_logic_local(), append_record_primitive_logic_local(), append_records_from_input_list_primitive_logic_local(), append_records_from_related_collection_primitive_logic_local(), append_workflow_and_effects_logic_local(), bulk_update_primitive_logic_local(), ActionExecutionContextLogicLocal::created_record_count, find_action_contract_logic_local(), find_workflow_transition_logic_local(), free_action_execution_context_logic_local(), free_input_field_map_logic_local(), ActionExecutionContextLogicLocal::last_created_record_id, ActionExecutionContextLogicLocal::last_touched_resource_id, load_action_inputs_logic_local(), load_fixture_doc_logic_local(), native_json_doc_free(), native_json_doc_load_file(), native_json_obj_get(), native_json_obj_get_long_default(), native_json_obj_get_string_dup(), note_created_record_logic_local(), now_iso_utc_logic_local(), persist_mut_doc_logic_local(), scoped_reassignment_primitive_logic_local(), send_action_response_logic_local(), set_mut_object_field_logic_local(), set_root_fields_primitive_logic_local(), AppRuntime::state_path, streq(), update_record_primitive_logic_local(), workflow_presentation_string_dup_logic_local(), write_json_error_logic_local(), yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_doc_get_root(), yyjson_doc_mut_copy(), yyjson_is_arr(), yyjson_is_obj(), yyjson_mut_doc_free(), yyjson_mut_doc_get_root(), yyjson_mut_int(), and yyjson_mut_is_obj().
Referenced by handle_action_route().
|
static |
Definition at line 1773 of file native_dynamic_business_logic.c.
References yyjson_get_sint(), yyjson_is_num(), yyjson_mut_arr_foreach, yyjson_mut_is_arr(), and yyjson_mut_obj_get().
Referenced by append_job_attempt_logic_local(), append_workflow_and_effects_logic_local(), and process_webhook_delivery_logic_local().
|
static |
Definition at line 376 of file native_dynamic_business_logic.c.
References ActionExecutionContextLogicLocal::matched_record_count, ActionExecutionContextLogicLocal::overflow_policy, replace_owned_string_logic_local(), and ActionExecutionContextLogicLocal::skipped_record_count.
Referenced by append_records_from_related_collection_primitive_logic_local(), bulk_update_primitive_logic_local(), and scoped_reassignment_primitive_logic_local().
|
static |
Definition at line 342 of file native_dynamic_business_logic.c.
References ActionExecutionContextLogicLocal::anchor_record_id, ActionExecutionContextLogicLocal::anchor_resource_id, ActionExecutionContextLogicLocal::created_record_count, ActionExecutionContextLogicLocal::last_created_record_id, ActionExecutionContextLogicLocal::last_created_resource_id, ActionExecutionContextLogicLocal::last_touched_record_id, ActionExecutionContextLogicLocal::last_touched_resource_id, and replace_owned_string_logic_local().
Referenced by append_records_from_input_list_primitive_logic_local(), append_records_from_related_collection_primitive_logic_local(), and native_dynamic_execute_declarative_action().
|
static |
Definition at line 364 of file native_dynamic_business_logic.c.
References ActionExecutionContextLogicLocal::last_touched_record_id, ActionExecutionContextLogicLocal::last_touched_resource_id, replace_owned_string_logic_local(), and ActionExecutionContextLogicLocal::updated_record_count.
Referenced by bulk_update_primitive_logic_local(), scoped_reassignment_primitive_logic_local(), and update_record_primitive_logic_local().
|
static |
Definition at line 111 of file native_dynamic_business_logic.c.
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 307 of file native_dynamic_business_logic.c.
Referenced by process_webhook_delivery_logic_local().
|
static |
Definition at line 1923 of file native_dynamic_business_logic.c.
References append_bytes_logic_local(), OutboundHttpResultLogicLocal::error_message, free_parsed_http_url_logic_local(), ParsedHttpUrlLogicLocal::host, OutboundHttpResultLogicLocal::http_status, OutboundHttpResultLogicLocal::ok, parse_http_url_logic_local(), ParsedHttpUrlLogicLocal::path, ParsedHttpUrlLogicLocal::port, and OutboundHttpResultLogicLocal::response_body.
Referenced by process_webhook_delivery_logic_local().
|
static |
Definition at line 1852 of file native_dynamic_business_logic.c.
References dup_range(), free_parsed_http_url_logic_local(), ParsedHttpUrlLogicLocal::host, ParsedHttpUrlLogicLocal::path, ParsedHttpUrlLogicLocal::port, and ParsedHttpUrlLogicLocal::scheme.
Referenced by outbound_http_post_logic_local().
|
static |
Definition at line 2813 of file native_dynamic_business_logic.c.
References AppRuntime::state_path, write_text_file(), yyjson_mut_write(), and YYJSON_WRITE_NOFLAG.
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 2229 of file native_dynamic_business_logic.c.
References ensure_mut_array_field_logic_local(), native_json_obj_get_string_dup(), process_webhook_delivery_logic_local(), streq(), and yyjson_mut_arr_foreach.
|
static |
Definition at line 2160 of file native_dynamic_business_logic.c.
References ensure_mut_array_field_logic_local(), OutboundHttpResultLogicLocal::error_message, free_outbound_http_result_logic_local(), OutboundHttpResultLogicLocal::http_status, native_json_obj_get_long_default(), native_json_obj_get_string_dup(), next_section_id_logic_local(), now_plus_seconds_iso_utc_logic_local(), OutboundHttpResultLogicLocal::ok, outbound_http_post_logic_local(), OutboundHttpResultLogicLocal::response_body, set_mut_object_field_logic_local(), streq(), yyjson_get_sint(), yyjson_mut_arr_append(), yyjson_mut_int(), yyjson_mut_obj(), yyjson_mut_obj_add_int(), yyjson_mut_obj_add_strcpy(), yyjson_mut_obj_get(), and yyjson_mut_strcpy().
Referenced by process_due_integration_deliveries_logic_local().
|
static |
Definition at line 795 of file native_dynamic_business_logic.c.
References record_field_matches_text_value_logic_local().
Referenced by bulk_update_primitive_logic_local().
|
static |
Definition at line 771 of file native_dynamic_business_logic.c.
References native_json_obj_get(), streq(), yyjson_get_bool(), yyjson_get_sint(), yyjson_get_str(), yyjson_is_bool(), yyjson_is_null(), yyjson_is_num(), and yyjson_is_str().
Referenced by append_records_from_related_collection_primitive_logic_local(), matching_record_count_value_logic_local(), record_field_matches_text_logic_local(), and scoped_reassignment_primitive_logic_local().
|
static |
Definition at line 326 of file native_dynamic_business_logic.c.
Referenced by note_bounded_scope_logic_local(), note_created_record_logic_local(), and note_updated_record_logic_local().
|
static |
Definition at line 32 of file native_dynamic_business_logic.c.
References HttpRequest::body, HttpRequest::body_file_path, and read_file_text().
Referenced by request_form_value_dup_logic_local().
|
static |
Definition at line 54 of file native_dynamic_business_logic.c.
References HttpRequest::content_type, HttpRequest::is_multipart, native_dynamic_form_value(), native_dynamic_multipart_extract_text(), and request_body_bytes_dup_logic_local().
Referenced by load_action_inputs_logic_local().
|
static |
Definition at line 799 of file native_dynamic_business_logic.c.
References input_field_value_dup_logic_local(), native_json_obj_get(), native_json_obj_get_string_dup(), string_value_from_contract_logic_local(), and yyjson_is_obj().
Referenced by append_records_from_related_collection_primitive_logic_local(), bulk_update_primitive_logic_local(), and scoped_reassignment_primitive_logic_local().
|
static |
Definition at line 1426 of file native_dynamic_business_logic.c.
References field_value_from_contract_logic_local(), find_mut_record_by_id_logic_local(), matching_record_count_value_logic_local(), native_json_obj_get(), native_json_obj_get_long_default(), native_json_obj_get_string_dup(), note_bounded_scope_logic_local(), note_updated_record_logic_local(), record_field_matches_text_value_logic_local(), scope_match_expected_text_dup_logic_local(), scoped_resource_id_dup_logic_local(), set_mut_object_field_logic_local(), streq(), yyjson_arr_foreach, yyjson_get_sint(), yyjson_is_arr(), yyjson_is_num(), yyjson_is_obj(), yyjson_mut_is_arr(), and yyjson_mut_obj_get().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 749 of file native_dynamic_business_logic.c.
Referenced by append_records_from_related_collection_primitive_logic_local(), bulk_update_primitive_logic_local(), and scoped_reassignment_primitive_logic_local().
|
static |
Sends the configured declarative response contract for an action.
| connection | Connection receiving the response. |
| app | Finalized app runtime metadata. |
| response_contract | Declarative response contract object. |
| action_id | Executed action identifier. |
| resource_id | Touched or created resource identifier. |
| workflow_execution_id | Persisted workflow execution identifier. |
| report_json | Serialized framework action report JSON. |
| mut_doc | Mutated state document after the action applied. |
Definition at line 3006 of file native_dynamic_business_logic.c.
References native_json_obj_get_string_dup(), send_json_action_result_logic_local(), send_redirect_logic_local(), and streq().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Sends a declarative JSON action-result response contract.
The response is framework-owned and exposes a stable generic envelope with action metadata, the persisted action report, and optional post-action state.
| connection | Connection receiving the response. |
| response_contract | Declarative response contract object. |
| action_id | Executed action identifier. |
| resource_id | Touched or created resource identifier. |
| workflow_execution_id | Persisted workflow execution identifier. |
| report_json | Serialized framework action report JSON. |
| mut_doc | Mutated state document after the action applied. |
Definition at line 2903 of file native_dynamic_business_logic.c.
References http_reason_phrase_logic_local(), native_connection_printf(), native_json_doc_free(), native_json_doc_load_text(), native_json_obj_get(), native_json_obj_get_long_default(), native_send_text_response(), yyjson_doc_get_root(), yyjson_get_bool(), yyjson_mut_doc_free(), yyjson_mut_doc_new(), yyjson_mut_doc_set_root(), yyjson_mut_obj(), yyjson_mut_obj_add_bool(), yyjson_mut_obj_add_int(), yyjson_mut_obj_add_strcpy(), yyjson_mut_obj_put(), yyjson_mut_strcpy(), yyjson_mut_write(), yyjson_val_mut_copy(), and YYJSON_WRITE_NOFLAG.
Referenced by send_action_response_logic_local().
|
static |
Sends a declarative redirect response contract.
| connection | Connection receiving the response. |
| app | Finalized app runtime metadata. |
| response_contract | Declarative response contract object. |
Definition at line 2865 of file native_dynamic_business_logic.c.
References AppRuntime::base_path, native_connection_printf(), and native_json_obj_get_string_dup().
Referenced by send_action_response_logic_local().
|
static |
Definition at line 741 of file native_dynamic_business_logic.c.
References yyjson_mut_is_obj(), yyjson_mut_obj_put(), yyjson_mut_obj_remove_key(), and yyjson_mut_strcpy().
Referenced by append_action_report_logic_local(), append_record_primitive_logic_local(), append_records_from_input_list_primitive_logic_local(), append_records_from_related_collection_primitive_logic_local(), bulk_update_primitive_logic_local(), native_dynamic_execute_declarative_action(), process_webhook_delivery_logic_local(), scoped_reassignment_primitive_logic_local(), set_root_fields_primitive_logic_local(), and update_record_primitive_logic_local().
|
static |
Definition at line 1740 of file native_dynamic_business_logic.c.
References field_value_from_contract_logic_local(), native_json_obj_get(), set_mut_object_field_logic_local(), yyjson_get_str(), yyjson_is_obj(), yyjson_obj_iter_get_val(), yyjson_obj_iter_init(), and yyjson_obj_iter_next().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 710 of file native_dynamic_business_logic.c.
References append_list_item_logic_local().
Referenced by append_records_from_input_list_primitive_logic_local().
|
static |
Definition at line 524 of file native_dynamic_business_logic.c.
References ActionExecutionContextLogicLocal::anchor_record_id, input_field_value_dup_logic_local(), ActionExecutionContextLogicLocal::last_created_record_id, ActionExecutionContextLogicLocal::last_touched_record_id, native_json_obj_get(), native_json_obj_get_string_dup(), streq(), yyjson_get_bool(), yyjson_get_sint(), yyjson_get_str(), yyjson_is_bool(), yyjson_is_null(), yyjson_is_num(), yyjson_is_obj(), and yyjson_is_str().
Referenced by append_workflow_and_effects_logic_local(), and scope_match_expected_text_dup_logic_local().
|
static |
Definition at line 1325 of file native_dynamic_business_logic.c.
References field_value_from_contract_logic_local(), find_mut_record_by_long_field_logic_local(), input_field_value_dup_logic_local(), native_json_obj_get(), native_json_obj_get_string_dup(), note_updated_record_logic_local(), set_mut_object_field_logic_local(), streq(), yyjson_get_str(), yyjson_is_obj(), yyjson_is_str(), yyjson_mut_is_str(), yyjson_mut_obj_get(), yyjson_obj_iter_get_val(), yyjson_obj_iter_init(), and yyjson_obj_iter_next().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 431 of file native_dynamic_business_logic.c.
References native_json_obj_get(), and native_json_obj_get_string_dup().
Referenced by native_dynamic_execute_declarative_action().
|
static |
Definition at line 76 of file native_dynamic_business_logic.c.
References native_connection_printf(), and native_send_text_response().
Referenced by native_dynamic_execute_declarative_action().