ORE Studio 0.0.4
Loading...
Searching...
No Matches
message_types.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2025 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_COMMS_MESSAGING_MESSAGE_TYPES_HPP
21#define ORES_COMMS_MESSAGING_MESSAGE_TYPES_HPP
22
23#include <ostream>
24#include <cstdint>
25#include "ores.utility/serialization/error_code.hpp"
26
27// Configure magic_enum to support our enum value ranges
28#ifdef MAGIC_ENUM_RANGE_MIN
29#undef MAGIC_ENUM_RANGE_MIN
30#endif
31#ifdef MAGIC_ENUM_RANGE_MAX
32#undef MAGIC_ENUM_RANGE_MAX
33#endif
34#define MAGIC_ENUM_RANGE_MIN 0
35#define MAGIC_ENUM_RANGE_MAX 0x7000
36
37#include <magic_enum/magic_enum.hpp>
38
39namespace ores::comms::messaging {
40
41 // "ORES" in ASCII
42constexpr std::uint32_t PROTOCOL_MAGIC = 0x4F524553;
43
44// Protocol version 7 adds correlation_id field to frame header for
45// request/response matching, enabling concurrent operations and server-push
46// notifications.
47//
48// Version 7.1 adds subscription protocol messages (subscribe_request,
49// subscribe_response, unsubscribe_request, unsubscribe_response, notification)
50// for server-push event notifications.
51//
52// Version 7.2 changes logout_request to have empty payload. Account ID is now
53// determined from session context to prevent clients from forging logout
54// requests for other users.
55//
56// Version 7.3 adds database_status_notification message for server-push
57// database health status updates, and database_unavailable error code.
58// Version 8.0 removes requester_account_id from lock_account_request and
59// unlock_account_request. Authorization is now handled via server-side session
60// tracking instead of client-provided identity. This is a breaking change.
61//
62// Version 9.0 adds optional payload compression support. The reserved1 field
63// in the frame header is now used for compression_type (1 byte) and flags
64// (1 byte). Supported compression algorithms: none, zlib, gzip, bzip2.
65// Uncompressed payloads remain fully supported (compression_type::none).
66//
67// Version 10.0 replaces valid_from/valid_to fields with recorded_by/recorded_at
68// in domain types (currency, account, feature_flags). This is a breaking change
69// affecting all entity serialization in the protocol.
70//
71// Version 10.1 adds save_account_request and save_account_response messages
72// for editing existing account email and admin status.
73//
74// Version 11.0 changes lock_account_request and unlock_account_request to support
75// batch operations with a vector of account IDs. Responses now return a vector of
76// per-account results (lock_account_result/unlock_account_result). This is a
77// breaking change as the wire format is incompatible with previous versions.
78//
79// Version 12.0 adds reset_password_request and reset_password_response messages
80// for admin-initiated password reset. Adds password_reset_required field to
81// login_response and list_login_info_response. This is a breaking change as
82// existing serialization formats are extended with new fields.
83//
84// Version 13.0 adds role-based access control (RBAC) with full authorization
85// system. New domain types: permission, role, account_role, role_permission.
86// New RBAC messages: list_roles_request/response, list_permissions_request/response,
87// assign_role_request/response, revoke_role_request/response,
88// get_account_roles_request/response, get_account_permissions_request/response.
89// Adds authorization checks to all protected endpoints. This is a breaking change
90// as it introduces mandatory RBAC enforcement for administrative operations.
91//
92// Version 13.1 adds user self-registration (signup) workflow. New messages:
93// signup_request/response for creating accounts without admin privileges.
94// New error codes: signup_disabled, username_taken, email_taken,
95// signup_requires_authorization. Signup is controlled by system.user_signups
96// feature flag.
97//
98// Version 14.0 adds assets subsystem for dynamic image loading. New messages:
99// get_currency_images_request/response for retrieving currency-image mappings,
100// get_images_request/response for batched image retrieval (max 100 per request).
101// This enables the UI to display flag icons for currencies.
102//
103// Version 15.0 adds session tracking and statistics. New messages:
104// list_sessions_request/response for querying session history by account,
105// get_session_statistics_request/response for aggregated session metrics.
106// Sessions now track bytes sent/received, client version, and geolocation.
107// Session data is stored in a TimescaleDB hypertable for time-series analysis.
108//
109// Version 15.1 adds telemetry subsystem for log record streaming. New messages:
110// submit_log_records_request for fire-and-forget batched log record submission.
111// Clients can stream telemetry data to the server for centralized storage and
112// analysis. Controlled by telemetry.streaming.enabled feature flag.
113//
114// Version 16.0 adds entity_ids field to notification_message. This allows
115// clients to identify which specific entities changed (e.g., currency ISO codes
116// or account IDs) rather than just knowing that some entity of a type changed.
117// This is a breaking change as the wire format for notifications is extended.
118//
119// Version 16.1 adds list_images_request/response to list all available flag images,
120// and set_currency_image_request/response to assign or remove flags from currencies.
121//
122// Version 16.2 adds server-side telemetry persistence. New messages:
123// submit_telemetry_response (0x5001) for acknowledging batch submissions.
124// get_telemetry_logs_request/response (0x5010/0x5011) for querying raw logs.
125// get_telemetry_stats_request/response (0x5020/0x5021) for querying aggregated stats.
126// Telemetry logs are stored in a TimescaleDB hypertable with 30-day retention.
127//
128// Version 17.0 removes obsolete currency_image junction table messages. The
129// image_id field is now directly on the currency entity, so currency->image
130// mappings come from get_currencies_response. Flag changes appear in currency
131// version history. Removed messages: get_currency_images_request/response,
132// set_currency_image_request/response. Breaking change.
133//
134// Version 18.0 uses 32-bit length prefix for svg_data in get_images_response.
135// Previously used 16-bit length which truncated SVGs larger than 65535 bytes.
136// This is a breaking change affecting image serialization.
137//
138// Version 19.0 adds recorded_at field to get_feature_flags_response.
139// Previously the timestamp was not serialized. Breaking change.
140//
141// Version 20.0 adds version field to get_feature_flags_response.
142// Breaking change.
143//
144// Version 20.1 adds countries subsystem messages for CRUD operations on
145// ISO 3166-1 country reference data. New messages: get_countries_request/response,
146// save_country_request/response, delete_country_request/response,
147// get_country_history_request/response.
148//
149// Version 20.2 adds image_id field to currency version history serialization.
150// Previously the flag reference was missing from get_currency_history_response.
151// This is a breaking change affecting currency history wire format.
152//
153// Version 20.3 adds feature flag history messages for querying version history.
154// New messages: get_feature_flag_history_request (0x3006),
155// get_feature_flag_history_response (0x3007).
156//
157// Version 21.0 standardizes naming and adds change tracking fields:
158// - Renamed list_accounts_* to get_accounts_* for consistency with other entities
159// - Renamed list_feature_flags_* to get_feature_flags_* for consistency
160// - Merged create_account_* and update_account_* into save_account_* for consistency
161// with save_currency, save_country, save_feature_flag patterns
162// - Added change_reason_code and change_commentary fields to all entity serialization
163// (currency, country, feature_flags, account, role, image) for audit trail support
164// This is a breaking change affecting multiple message types and wire formats.
165//
166// Version 21.1 adds change management messages for querying the catalog of valid
167// change reasons. New messages: get_change_reason_categories_request/response,
168// get_change_reasons_request/response, get_change_reasons_by_category_request/response.
169//
170// Version 21.2 adds CRUD and history operations for change reasons and categories.
171// New messages: save_change_reason_request/response, delete_change_reason_request/response,
172// get_change_reason_history_request/response, save_change_reason_category_request/response,
173// delete_change_reason_category_request/response, get_change_reason_category_history_request/response.
174//
175// Version 21.3 adds event channel discovery. New messages:
176// list_event_channels_request/response (0x0015/0x0016) for querying available
177// event channels that clients can subscribe to. This replaces hardcoded channel
178// lists in clients with server-provided discovery.
179//
180// Version 21.4 adds Data Quality (DQ) subsystem messages for managing
181// data organization, datasets, coding schemes, and dimension reference data.
182// New subsystem range: DQ_SUBSYSTEM (0x6000-0x6FFF).
183// New messages: catalog CRUD (0x6000-0x6007), data_domain CRUD (0x6008-0x600F),
184// subject_area CRUD (0x6010-0x6019), dataset CRUD (0x6020-0x6027),
185// methodology CRUD (0x6028-0x602F), coding_scheme CRUD (0x6030-0x6041),
186// dimension CRUD (nature/origin/treatment) (0x6050-0x6067).
187//
188// Version 22.0 moves change_reason and change_reason_category messages from
189// IAM subsystem (0x2050-0x2061) to DQ subsystem (0x6070-0x6081). This is a
190// breaking change as the message type IDs have changed. Change management is
191// now properly located in the Data Quality subsystem alongside other DQ types.
192// The dq_message_handler now handles all DQ messages including change reasons.
193//
194// Version 22.1 adds dataset dependency messages for querying dependencies
195// between datasets using stable dataset codes. New messages:
196// get_dataset_dependencies_request/response,
197// get_dataset_dependencies_by_dataset_request/response.
198// Replaces catalog dependency messages.
199//
200// Version 22.2 adds artefact_type field to dataset serialization. This field
201// indicates which population function to call when publishing the dataset.
202// Valid values: "images", "countries", "currencies", "ip2country".
203//
204// Version 22.3 adds publish_datasets_request/response messages (0x6090-0x6091)
205// for publishing datasets from artefact tables to production tables.
206//
207// Version 22.4 adds get_publications_request/response messages (0x6092-0x6093)
208// for querying publication history.
209//
210// Version 22.5 adds resolve_dependencies_request/response messages (0x6094-0x6095)
211// for client-side dependency resolution before publishing. This allows clients
212// to preview the dependency order without actually publishing.
213//
214// Version 22.6 adds dataset bundle messages for managing named collections of
215// datasets. New messages: get_dataset_bundles_request/response (0x60A0-0x60A1),
216// save_dataset_bundle_request/response (0x60A2-0x60A3),
217// delete_dataset_bundle_request/response (0x60A4-0x60A5),
218// get_dataset_bundle_history_request/response (0x60A6-0x60A7).
219// Also adds dataset bundle member messages for managing bundle membership:
220// get_dataset_bundle_members_request/response (0x60B0-0x60B1),
221// get_dataset_bundle_members_by_bundle_request/response (0x60B2-0x60B3),
222// save_dataset_bundle_member_request/response (0x60B4-0x60B5),
223// delete_dataset_bundle_member_request/response (0x60B6-0x60B7).
224//
225// Version 23.0 adds publish_bundle_request/response (0x60B8-0x60B9) for atomic
226// transactional publishing of dataset bundles. Also adds atomic field to
227// publish_datasets_request for atomic individual dataset publishing. This is
228// a breaking change due to the new field in publish_datasets_request.
229//
230// Version 24.0 adds available_bundles field to bootstrap_status_response to
231// provide bundle choices during system provisioning without requiring auth.
232// This is a breaking change due to the new field in bootstrap_status_response.
233constexpr std::uint16_t PROTOCOL_VERSION_MAJOR = 24;
234constexpr std::uint16_t PROTOCOL_VERSION_MINOR = 0;
235
236// Subsystem message type ranges
237constexpr std::uint16_t CORE_SUBSYSTEM_MIN = 0x0000;
238constexpr std::uint16_t CORE_SUBSYSTEM_MAX = 0x0FFF;
239constexpr std::uint16_t RISK_SUBSYSTEM_MIN = 0x1000;
240constexpr std::uint16_t RISK_SUBSYSTEM_MAX = 0x1FFF;
241constexpr std::uint16_t IAM_SUBSYSTEM_MIN = 0x2000;
242constexpr std::uint16_t IAM_SUBSYSTEM_MAX = 0x2FFF;
243constexpr std::uint16_t VARIABILITY_SUBSYSTEM_MIN = 0x3000;
244constexpr std::uint16_t VARIABILITY_SUBSYSTEM_MAX = 0x3FFF;
245constexpr std::uint16_t ASSETS_SUBSYSTEM_MIN = 0x4000;
246constexpr std::uint16_t ASSETS_SUBSYSTEM_MAX = 0x4FFF;
247constexpr std::uint16_t TELEMETRY_SUBSYSTEM_MIN = 0x5000;
248constexpr std::uint16_t TELEMETRY_SUBSYSTEM_MAX = 0x5FFF;
249constexpr std::uint16_t DQ_SUBSYSTEM_MIN = 0x6000;
250constexpr std::uint16_t DQ_SUBSYSTEM_MAX = 0x6FFF;
251
259enum class compression_type : std::uint8_t {
260 none = 0x00, // No compression (default)
261 zlib = 0x01, // zlib/deflate compression
262 gzip = 0x02, // gzip compression
263 bzip2 = 0x03 // bzip2 compression
264};
265
266enum class message_type {
267 // Core protocol messages (0x0000 - 0x0FFF)
268 handshake_request = 0x0001,
269 handshake_response = 0x0002,
270 handshake_ack = 0x0003,
271 error_response = 0x0004,
272 ping = 0x0005,
273 pong = 0x0006,
274
275 // Subscription/Notification messages (0x0010 - 0x001F)
276 subscribe_request = 0x0010,
277 subscribe_response = 0x0011,
278 unsubscribe_request = 0x0012,
279 unsubscribe_response = 0x0013,
280 notification = 0x0014,
281 list_event_channels_request = 0x0015,
282 list_event_channels_response = 0x0016,
283
284 // System status notifications (0x0020 - 0x002F)
285 database_status_notification = 0x0020,
286
287 // Risk subsystem messages (0x1000 - 0x1FFF)
288 // Currency messages (0x1001 - 0x1008)
289 get_currencies_request = 0x1001,
290 get_currencies_response = 0x1002,
291 save_currency_request = 0x1003,
292 save_currency_response = 0x1004,
293 delete_currency_request = 0x1005,
294 delete_currency_response = 0x1006,
295 get_currency_history_request = 0x1007,
296 get_currency_history_response = 0x1008,
297
298 // Country messages (0x1009 - 0x1010)
299 get_countries_request = 0x1009,
300 get_countries_response = 0x100A,
301 save_country_request = 0x100B,
302 save_country_response = 0x100C,
303 delete_country_request = 0x100D,
304 delete_country_response = 0x100E,
305 get_country_history_request = 0x100F,
306 get_country_history_response = 0x1010,
307
308 // Accounts subsystem messages (0x2000 - 0x2FFF)
309 // Note: 0x2001-0x2002 deprecated in v21.0 (create_account merged into save_account)
310 get_accounts_request = 0x2003, // Renamed from list_accounts in v21.0
311 get_accounts_response = 0x2004,
312 login_request = 0x2005,
313 login_response = 0x2006,
314 unlock_account_request = 0x2007,
315 unlock_account_response = 0x2008,
316 delete_account_request = 0x2009,
317 delete_account_response = 0x200A,
318 list_login_info_request = 0x200B,
319 list_login_info_response = 0x200C,
320 logout_request = 0x200D,
321 logout_response = 0x200E,
322 create_initial_admin_request = 0x200F,
323 create_initial_admin_response = 0x2010,
324 bootstrap_status_request = 0x2011,
325 bootstrap_status_response = 0x2012,
326 lock_account_request = 0x2013,
327 lock_account_response = 0x2014,
328 save_account_request = 0x2015, // Merged create/update in v21.0
329 save_account_response = 0x2016,
330 get_account_history_request = 0x2017,
331 get_account_history_response = 0x2018,
332 reset_password_request = 0x2019,
333 reset_password_response = 0x201A,
334 change_password_request = 0x201B,
335 change_password_response = 0x201C,
336 update_my_email_request = 0x201D,
337 update_my_email_response = 0x201E,
338
339 // Authorization/RBAC messages (0x2020 - 0x202F)
340 list_roles_request = 0x2020,
341 list_roles_response = 0x2021,
342 list_permissions_request = 0x2022,
343 list_permissions_response = 0x2023,
344 assign_role_request = 0x2024,
345 assign_role_response = 0x2025,
346 revoke_role_request = 0x2026,
347 revoke_role_response = 0x2027,
348 get_account_roles_request = 0x2028,
349 get_account_roles_response = 0x2029,
350 get_account_permissions_request = 0x202A,
351 get_account_permissions_response = 0x202B,
352 get_role_request = 0x202C,
353 get_role_response = 0x202D,
354
355 // User self-registration messages (0x2030 - 0x203F)
356 signup_request = 0x2030,
357 signup_response = 0x2031,
358
359 // Session tracking messages (0x2040 - 0x204F)
360 list_sessions_request = 0x2040,
361 list_sessions_response = 0x2041,
362 get_session_statistics_request = 0x2042,
363 get_session_statistics_response = 0x2043,
364 get_active_sessions_request = 0x2044,
365 get_active_sessions_response = 0x2045,
366
367 // Variability subsystem messages (0x3000 - 0x3FFF)
368 get_feature_flags_request = 0x3000, // Renamed from list_feature_flags in v21.0
369 get_feature_flags_response = 0x3001,
370 save_feature_flag_request = 0x3002,
371 save_feature_flag_response = 0x3003,
372 delete_feature_flag_request = 0x3004,
373 delete_feature_flag_response = 0x3005,
374 get_feature_flag_history_request = 0x3006,
375 get_feature_flag_history_response = 0x3007,
376
377 // Assets subsystem messages (0x4000 - 0x4FFF)
378 // Note: 0x4000-0x4001 and 0x4006-0x4007 removed in v17.0 (currency_image)
379 get_images_request = 0x4002,
380 get_images_response = 0x4003,
381 list_images_request = 0x4004,
382 list_images_response = 0x4005,
383
384 // Telemetry subsystem messages (0x5000 - 0x5FFF)
385 submit_log_records_request = 0x5000,
386 submit_telemetry_response = 0x5001,
387 get_telemetry_logs_request = 0x5010,
388 get_telemetry_logs_response = 0x5011,
389 get_telemetry_stats_request = 0x5020,
390 get_telemetry_stats_response = 0x5021,
391
392 // Data Quality subsystem messages (0x6000 - 0x6FFF)
393 // Data Organization (catalog, data_domain, subject_area) (0x6000 - 0x601F)
394 get_catalogs_request = 0x6000,
395 get_catalogs_response = 0x6001,
396 save_catalog_request = 0x6002,
397 save_catalog_response = 0x6003,
398 delete_catalog_request = 0x6004,
399 delete_catalog_response = 0x6005,
400 get_catalog_history_request = 0x6006,
401 get_catalog_history_response = 0x6007,
402
403 get_data_domains_request = 0x6008,
404 get_data_domains_response = 0x6009,
405 save_data_domain_request = 0x600A,
406 save_data_domain_response = 0x600B,
407 delete_data_domain_request = 0x600C,
408 delete_data_domain_response = 0x600D,
409 get_data_domain_history_request = 0x600E,
410 get_data_domain_history_response = 0x600F,
411
412 get_subject_areas_request = 0x6010,
413 get_subject_areas_response = 0x6011,
414 get_subject_areas_by_domain_request = 0x6012,
415 get_subject_areas_by_domain_response = 0x6013,
416 save_subject_area_request = 0x6014,
417 save_subject_area_response = 0x6015,
418 delete_subject_area_request = 0x6016,
419 delete_subject_area_response = 0x6017,
420 get_subject_area_history_request = 0x6018,
421 get_subject_area_history_response = 0x6019,
422
423 // Dataset and Methodology (0x6020 - 0x602F)
424 get_datasets_request = 0x6020,
425 get_datasets_response = 0x6021,
426 save_dataset_request = 0x6022,
427 save_dataset_response = 0x6023,
428 delete_dataset_request = 0x6024,
429 delete_dataset_response = 0x6025,
430 get_dataset_history_request = 0x6026,
431 get_dataset_history_response = 0x6027,
432
433 get_methodologies_request = 0x6028,
434 get_methodologies_response = 0x6029,
435 save_methodology_request = 0x602A,
436 save_methodology_response = 0x602B,
437 delete_methodology_request = 0x602C,
438 delete_methodology_response = 0x602D,
439 get_methodology_history_request = 0x602E,
440 get_methodology_history_response = 0x602F,
441
442 // Coding Scheme (0x6030 - 0x6047)
443 get_coding_schemes_request = 0x6030,
444 get_coding_schemes_response = 0x6031,
445 get_coding_schemes_by_authority_type_request = 0x6032,
446 get_coding_schemes_by_authority_type_response = 0x6033,
447 save_coding_scheme_request = 0x6034,
448 save_coding_scheme_response = 0x6035,
449 delete_coding_scheme_request = 0x6036,
450 delete_coding_scheme_response = 0x6037,
451 get_coding_scheme_history_request = 0x6038,
452 get_coding_scheme_history_response = 0x6039,
453
454 get_coding_scheme_authority_types_request = 0x603A,
455 get_coding_scheme_authority_types_response = 0x603B,
456 save_coding_scheme_authority_type_request = 0x603C,
457 save_coding_scheme_authority_type_response = 0x603D,
458 delete_coding_scheme_authority_type_request = 0x603E,
459 delete_coding_scheme_authority_type_response = 0x603F,
460 get_coding_scheme_authority_type_history_request = 0x6040,
461 get_coding_scheme_authority_type_history_response = 0x6041,
462
463 // Dimensions (nature, origin, treatment) (0x6050 - 0x606F)
464 get_nature_dimensions_request = 0x6050,
465 get_nature_dimensions_response = 0x6051,
466 save_nature_dimension_request = 0x6052,
467 save_nature_dimension_response = 0x6053,
468 delete_nature_dimension_request = 0x6054,
469 delete_nature_dimension_response = 0x6055,
470 get_nature_dimension_history_request = 0x6056,
471 get_nature_dimension_history_response = 0x6057,
472
473 get_origin_dimensions_request = 0x6058,
474 get_origin_dimensions_response = 0x6059,
475 save_origin_dimension_request = 0x605A,
476 save_origin_dimension_response = 0x605B,
477 delete_origin_dimension_request = 0x605C,
478 delete_origin_dimension_response = 0x605D,
479 get_origin_dimension_history_request = 0x605E,
480 get_origin_dimension_history_response = 0x605F,
481
482 get_treatment_dimensions_request = 0x6060,
483 get_treatment_dimensions_response = 0x6061,
484 save_treatment_dimension_request = 0x6062,
485 save_treatment_dimension_response = 0x6063,
486 delete_treatment_dimension_request = 0x6064,
487 delete_treatment_dimension_response = 0x6065,
488 get_treatment_dimension_history_request = 0x6066,
489 get_treatment_dimension_history_response = 0x6067,
490
491 // Change Management (change_reason, change_reason_category) (0x6070 - 0x6081)
492 // Moved from IAM subsystem (0x2050-0x2061) in v22.0
493 get_change_reason_categories_request = 0x6070,
494 get_change_reason_categories_response = 0x6071,
495 get_change_reasons_request = 0x6072,
496 get_change_reasons_response = 0x6073,
497 get_change_reasons_by_category_request = 0x6074,
498 get_change_reasons_by_category_response = 0x6075,
499 save_change_reason_request = 0x6076,
500 save_change_reason_response = 0x6077,
501 delete_change_reason_request = 0x6078,
502 delete_change_reason_response = 0x6079,
503 get_change_reason_history_request = 0x607A,
504 get_change_reason_history_response = 0x607B,
505 save_change_reason_category_request = 0x607C,
506 save_change_reason_category_response = 0x607D,
507 delete_change_reason_category_request = 0x607E,
508 delete_change_reason_category_response = 0x607F,
509 get_change_reason_category_history_request = 0x6080,
510 get_change_reason_category_history_response = 0x6081,
511
512 // Dataset Dependency (0x6082 - 0x6087)
513 get_dataset_dependencies_request = 0x6082,
514 get_dataset_dependencies_response = 0x6083,
515 get_dataset_dependencies_by_dataset_request = 0x6084,
516 get_dataset_dependencies_by_dataset_response = 0x6085,
517
518 // Publication (0x6090 - 0x6097)
519 publish_datasets_request = 0x6090,
520 publish_datasets_response = 0x6091,
521 get_publications_request = 0x6092,
522 get_publications_response = 0x6093,
523 resolve_dependencies_request = 0x6094,
524 resolve_dependencies_response = 0x6095,
525
526 // Dataset Bundle (0x60A0 - 0x60A7)
527 get_dataset_bundles_request = 0x60A0,
528 get_dataset_bundles_response = 0x60A1,
529 save_dataset_bundle_request = 0x60A2,
530 save_dataset_bundle_response = 0x60A3,
531 delete_dataset_bundle_request = 0x60A4,
532 delete_dataset_bundle_response = 0x60A5,
533 get_dataset_bundle_history_request = 0x60A6,
534 get_dataset_bundle_history_response = 0x60A7,
535
536 // Dataset Bundle Member (0x60B0 - 0x60B7)
537 get_dataset_bundle_members_request = 0x60B0,
538 get_dataset_bundle_members_response = 0x60B1,
539 get_dataset_bundle_members_by_bundle_request = 0x60B2,
540 get_dataset_bundle_members_by_bundle_response = 0x60B3,
541 save_dataset_bundle_member_request = 0x60B4,
542 save_dataset_bundle_member_response = 0x60B5,
543 delete_dataset_bundle_member_request = 0x60B6,
544 delete_dataset_bundle_member_response = 0x60B7,
545
546 // Bundle Publication (0x60B8 - 0x60B9)
547 publish_bundle_request = 0x60B8,
548 publish_bundle_response = 0x60B9,
549
550 last_value
551};
552
560inline std::ostream& operator<<(std::ostream& os, message_type mt) {
561 auto name = magic_enum::enum_name(mt);
562 if (name.empty()) {
563 os << "[unknown]";
564 } else {
565 os << name;
566 }
567 return os << " (0x" << std::hex << static_cast<std::uint16_t>(mt) << std::dec << ")";
568}
569
576inline std::ostream& operator<<(std::ostream& os, ores::utility::serialization::error_code ec) {
577 return os << magic_enum::enum_name(ec)
578 << " (0x" << std::hex << static_cast<std::uint16_t>(ec) << std::dec << ")";
579}
580
584inline std::ostream& operator<<(std::ostream& os, compression_type ct) {
585 return os << magic_enum::enum_name(ct)
586 << " (0x" << std::hex << static_cast<std::uint8_t>(ct) << std::dec << ")";
587}
588
592inline std::string to_string(ores::utility::serialization::error_code ec) {
593 return std::string(magic_enum::enum_name(ec));
594}
595
596}
597
598#endif
Contains messaging related infrastructure in the comms library.
Definition assets_protocol.hpp:122
std::string to_string(ores::utility::serialization::error_code ec)
Convert error_code to string for display.
Definition message_types.hpp:592
compression_type
Compression algorithm used for payload compression.
Definition message_types.hpp:259