Event and message catalogue

Four unrelated things are called "events" in this codebase. This page catalogues all four.

1. Domain event types

src/app/manage/event-rules/event-rule.models.ts — what an event rule can match.

eventTypes member Produced by

analitics (sic)

The analytics stream. MonitorService sends X-EventLogger-Type: analitics.

api-event

API-originated events.

cli-event

CLI service operations.

event

Generic domain events.

messaging-log

Outbound message log entries.

messaging-result

Delivery results.

task-change-event

CRM task transitions.

underwriting-event

Underwriting decisions and changes.

eventTargets member Subject of the event

compliance

A compliance/KYC action.

crm-task

A CRM task.

email

An email.

marketplace

A marketplace or marketplace link.

supplier

A supplier — the common case; the target id is the supplier key.

The target id travels as a header: X-EventLogger-TargetUUID on event-logger calls, X-Actions-TargetUUID on Actions Tools calls. X-InstanceId / X-EventLogger-InstanceId carry env.instanceId (8001) — except MonitorService, which hardcodes 8003.

Stores: eventLoggerUrl (v2 — es-changelog, track) and eventRulesOldUrl (v1 — event_rules/, plus a raw Elasticsearch endpoint at es against the index em_events).

See events.

2. Event-rule actions

Action static members in the same file:

Constant Wire value Status

Action.CREATE_TASK

create-task

Active

Action.SEND_EMAIL

send-email

Active

Action.EDIT_SUPPLIER

edit-supplier

Active

Action.SEND_TO_EVENT_BRIDGE

push-to-event-bridge

Active

Action.SLACK_NOTIF

notify-on-slack

Defined but commented out of actionTypes — not selectable

Action fields: type, template, to, contextMapping, dataMapping, data, delay, delayTime, delayPeriod, delayEnabled.

Delay units (send-email.component.ts): MINUTES = 60, DAYS = 86400, WEEKS = 604800 seconds. No hours, no seconds.

EventBridge action names must start with em_event_rule_ (PREFIX_EVNET_RULE, misspelled constant, correct value).

Filter operators

Filter parses expressions into { name, op, val }:

Expression Stored op Rendered back as

=

eq

=

!=

ne

!=

<

lt

<

>

gt

>

>= / ⇒

gte

>=

⇐ / =<

lte

=<

Regex: /([a-zA-Z.]+ ) *(!=|=|<|>|>=|⇐|=<|⇒) *([^ ]+)/ — note the required trailing space in the field-name group, and that field names may contain dots (data.target_type).

The same { name, op, val } shape is the API’s query language, used by EventsService.historyList.

3. Iframe postMessage protocol

src/app/shared/iframe/communication/message-type.enum.ts. Values are human-readable strings. Envelope: { pluginIframeId, payload: { type: MESSAGE_TYPE, data? } }.

MESSAGE_SOURCE is PARENT ('parent') or CHILD ('child').

Configuration

Type Value Dir. Payload / effect

GENERAL__CONFIG_REQUEST

[GENERAL] Config Request

EVA→IA

EVA asks for its config.

GENERAL__CONFIG_RESPONSE

[GENERAL] Config Response

IA→EVA

{ flags: string[], permissions: EvaPermissions }.

GENERAL__CONFIG_UPDATE

[GENERAL] Config Update

EVA→IA

EVA reports its own available/build flags.

FEATURE_FLAGS__RESET

[FEATURE FLAGS] Reset

IA→EVA

Clear EVA’s flag overrides.

Type Value Dir. Effect

GENERAL__NAVIGATE_BY_LINK

[GENERAL] Navigate By Link

EVA→IA

router.navigate([data.url]).

GENERAL__ONLY_CHANGE_ROUTE

[GENERAL] Only Change Route

EVA→IA

Same handler — behaviourally identical today.

GENERAL__CHANGE_PARENT_ROUTE

[GENERAL] Change Parent Route

IA→EVA

Sent to the top bar on every NavigationEnd (changeParentRouteCommand(url)).

MAIN_HEADER__NAVIGATE_BY_DEAL_LINK

[MAIN HEADER] Navigate By Deal Link

EVA→IA

Jump to the external sales CRM via extDealId.

Supplier state

Type Value Dir. Effect

GET_STORE__SUPPLIER_DETAILS

[GET STORE] Supplier Details

EVA→IA

IA waits for a matching supplierKey, then replies once.

UPDATE_EVA_STORE__SUPPLIER_DETAILS

[UPDATE EVA STORE] Supplier Details

IA→EVA

Push details into EVA’s store — sent on every change.

GENERAL__UPDATE_SUPPLIER_DETAILS_STORE

[GENERAL] Update Supplier Details Store

EVA→IA

Dispatches UpdateSupplierDetailsModelByEva.

MAIN_HEADER__REFETCH_SUPPLIER_DETAILS

[MAIN HEADER] Refetch Supplier Details

IA→EVA

Ask EVA’s header to re-fetch.

SUPPLIER_MENU__GET_MENU_CONDITIONS

[SUPPLIER MENU] Get Menu Conditions

both

IA replies { isAmazonLending, isSellerCard }.

Actions

Type Value Dir. Effect

MAIN_HEADER__LOGIN_AS_SUPPLIER

[MAIN HEADER] Login As Supplier

EVA→IA

Login-as-supplier flow (needs the browser extension).

MAIN_HEADER__LOGIN_TO_AMAZON

[MAIN HEADER] Login To Amazon

EVA→IA

Amazon login flow.

ONBOARDING__INIT_LOAD_EARNINGS_PROCESS

[ONBOARDING] Init Load Earnings Process

EVA→IA

Start an earnings load.

CONTRACTS__REFRESH

[CONTRACTS] Refresh page

EVA→IA

Refresh the contracts page.

GENERAL__SHOW_TOAST

[GENERAL] Show Toast

EVA→IA

{ type, message } — 'success' → success toast, otherwise error.

Sizing

Type Value Effect

RESIZE_IFRAME_SIZE

[RESIZE] Resize Iframe Size

Set height and width.

RESIZE_IFRAME_WIDTH_SIZE

[RESIZE] Resize Iframe Width Size

Set width.

RESIZE_IFRAME_HEIGHT_SIZE

[RESIZE] Resize Iframe Height Size

Set height.

RESET_IFRAME_SIZE

[RESIZE] Reset Iframe Size

Back to 100%.

FULL_SIZE_TOP_BAR

[RESIZE] Full Size Top Bar

Expand the supplier top bar.

REVERT_TOP_BAR_SIZE

[RESIZE] Revert Top Bar Size

Restore it.

Resize payloads may carry differentFrameSelector to resize another frame.

Iframe host selectors

shared/eva/const/eva-iframe-selector.enum.ts — how the parent addresses a frame:

Member Selector

TOP_BAR

app-supplier-box-header-eva

TRACKER

app-tracker

ONBOARDING_DETAILS

app-supplier-onboarding-details

UNDERWRITING_BETA

app-supplier-underwriting-beta

SUPPLIER_CONTRACTS

app-supplier-contracts

CONTRACTS

app-contracts

EVENT_RULES

app-event-rules-2

FEATURE_FLAGS

app-admin-feature-flags

QA

app-admin-qa

Cookie key: EVA_COOKIE_TOKEN_KEY = 'PYBEvaToken' (shared/eva/const/eva.ts).

MESSAGE_TYPE is a cross-repository contract shared with the EVA codebase. Adding a type is safe (unknown types are ignored by the switch); changing or removing one requires a coordinated release on both sides.

4. In-app event bus

src/app/shared/table-events.service.ts — string-named Subject bus.

Event Broadcast by → consumed by

TASK_COUNTERS_UPDATE

CrmEffects after a task mutation → TaskCountBadgeComponent.

CRM_OPEN_ALL_TAB

CrmEffects after adding a CRM item → the CRM panel switches to "All".

ADD_TRANSACTION_EVENT

Transaction dialogs → transaction grids refresh.

SIDENAV_CLOSED_EVENT

Sidebar → layout listeners.

on() has no unsubscribe — register once. A throwing listener kills the shared Subject for everyone. See the in-app event bus.

Other Subject buses

Service Emits

CancelEmitService

onCancellationChange: Subject<boolean>, onWinbackChange: Subject<void>, editOnCancellationChange: Subject<string>.

CommunicationService

incomingMessage$, featureFlagsFromEva$.

PendingInterceptorService

pendingRequestsStatus: Observable<boolean>.

CardFormgroupMessageService

Card save/error feedback.

B2bWorkflowService

The shared SSE stream plus an internal handler subject.

Server-sent events

One stream: GET <workflowApiUrl>tasksMonitoring, opened by B2bWorkflowService.taskMonitoring() through SseService (EventSourcePolyfill with an X-Session-Token header). Messages are arbitrary JSON carrying at least taskName.

No reconnect logic — any error or parse failure terminates the stream. See real-time streams.

CRM timeline item types

Not events, but the adjacent vocabulary — the type discriminator in the activity/ feed (CrmService.listActions):

type Model

note

NoteModel

task

TaskModel

event

EventModel

file

FileModel

email, email_supplier

EmailModel

batch

EmailModel

(anything else)

BaseCrmModel

See CRM.

Analytics events

Event Sent by

WINDOW ERROR

window.onerror in src/main.ts → Segment track.

identify('KYC Secure Site Guardrails', …)

MonitorService.logEvent → Segment.

POST <eventLoggerUrl>track

MonitorService.logEvent — subject: 'Restricted UW Access', extra.eventTypeCode: 'kyc_secure_site_guardrails'. Only for REST_UW_ACCESS / ADVANCE_AUDITORS users.

identify(loggedUser.name, …)

MonitorService.initFullStory on login.

Arbitrary track(message.subject, …)

MonitorService.sendSegmentEvent.

ErrorLogger.log(title, …)

Segment track, optionally with a redacted store dump.

Misspellings that are load-bearing

Item Note

analitics

The event type and the X-EventLogger-Type header value.

PREFIX_EVNET_RULE

Constant name only; the value em_event_rule_ is correct.

superceded, cancelation_status

Fields in the balance-approval API contract.