core: type operation timestamps
This commit is contained in:
+11
-11
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"db_name": "PostgreSQL",
|
||||||
"query": "select\n operations.id,\n operations.workspace_id,\n operations.name,\n operations.display_name,\n operations.category,\n operations.protocol,\n ov.target_json,\n operations.status,\n operations.current_draft_version,\n operations.latest_published_version,\n to_char(operations.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",\n to_char(operations.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"updated_at!\",\n to_char(operations.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as published_at\n from operations\n join operation_versions ov\n on ov.operation_id = operations.id\n and ov.version = operations.current_draft_version\n where operations.workspace_id = $1 and operations.id = $2",
|
"query": "select\n operations.id,\n operations.workspace_id,\n operations.name,\n operations.display_name,\n operations.category,\n operations.protocol,\n ov.target_json,\n operations.status,\n operations.current_draft_version,\n operations.latest_published_version,\n operations.created_at as \"created_at!: time::OffsetDateTime\",\n operations.updated_at as \"updated_at!: time::OffsetDateTime\",\n operations.published_at as \"published_at: time::OffsetDateTime\"\n from operations\n join operation_versions ov\n on ov.operation_id = operations.id\n and ov.version = operations.current_draft_version\n where operations.workspace_id = $1 and operations.id = $2",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@@ -55,18 +55,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 10,
|
"ordinal": 10,
|
||||||
"name": "created_at!",
|
"name": "created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 11,
|
"ordinal": 11,
|
||||||
"name": "updated_at!",
|
"name": "updated_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 12,
|
"ordinal": 12,
|
||||||
"name": "published_at",
|
"name": "published_at: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"parameters": {
|
"parameters": {
|
||||||
@@ -86,10 +86,10 @@
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
null,
|
false,
|
||||||
null,
|
false,
|
||||||
null
|
true
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "d9beed1c482720fbb55525223107474328f347661607f15b248052149625bc78"
|
"hash": "1f20e68fd913f8585dc63f5044cb2aa2572e441a6655a08a9188bbacad893755"
|
||||||
}
|
}
|
||||||
+14
-14
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"db_name": "PostgreSQL",
|
||||||
"query": "select\n o.id,\n o.workspace_id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",\n to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",\n to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",\n ov.created_by\n from operation_versions ov\n join operations o on o.id = ov.operation_id\n where o.workspace_id = $1 and ov.operation_id = $2 and ov.version = $3",
|
"query": "select\n o.id,\n o.workspace_id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n o.created_at as \"operation_created_at!: time::OffsetDateTime\",\n o.updated_at as \"operation_updated_at!: time::OffsetDateTime\",\n o.published_at as \"operation_published_at: time::OffsetDateTime\",\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n ov.created_at as \"created_at!: time::OffsetDateTime\",\n ov.created_by\n from operation_versions ov\n join operations o on o.id = ov.operation_id\n where o.workspace_id = $1 and ov.operation_id = $2 and ov.version = $3",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@@ -35,18 +35,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 6,
|
"ordinal": 6,
|
||||||
"name": "operation_created_at!",
|
"name": "operation_created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 7,
|
"ordinal": 7,
|
||||||
"name": "operation_updated_at!",
|
"name": "operation_updated_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 8,
|
"ordinal": 8,
|
||||||
"name": "operation_published_at",
|
"name": "operation_published_at: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 9,
|
"ordinal": 9,
|
||||||
@@ -115,8 +115,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 22,
|
"ordinal": 22,
|
||||||
"name": "created_at!",
|
"name": "created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 23,
|
"ordinal": 23,
|
||||||
@@ -138,9 +138,9 @@
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
null,
|
false,
|
||||||
null,
|
false,
|
||||||
null,
|
true,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@@ -154,9 +154,9 @@
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
null,
|
false,
|
||||||
true
|
true
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "e093ff52fbbfe4039edec5ea5e5b6ecab4400b9a66ba5ef7408b0797d8b286cf"
|
"hash": "40a5906682a4f90bb250c9b1809866e287f427fda9e28e0bfbff2c42231cf8b1"
|
||||||
}
|
}
|
||||||
+14
-14
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"db_name": "PostgreSQL",
|
||||||
"query": "select\n o.id,\n o.workspace_id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",\n to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",\n to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",\n ov.created_by\n from published_operations po\n join operation_versions ov\n on ov.operation_id = po.operation_id and ov.version = po.version\n join operations o on o.id = po.operation_id\n where po.operation_id = $1",
|
"query": "select\n o.id,\n o.workspace_id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n o.created_at as \"operation_created_at!: time::OffsetDateTime\",\n o.updated_at as \"operation_updated_at!: time::OffsetDateTime\",\n o.published_at as \"operation_published_at: time::OffsetDateTime\",\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n ov.created_at as \"created_at!: time::OffsetDateTime\",\n ov.created_by\n from published_operations po\n join operation_versions ov\n on ov.operation_id = po.operation_id and ov.version = po.version\n join operations o on o.id = po.operation_id\n where po.operation_id = $1",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@@ -35,18 +35,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 6,
|
"ordinal": 6,
|
||||||
"name": "operation_created_at!",
|
"name": "operation_created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 7,
|
"ordinal": 7,
|
||||||
"name": "operation_updated_at!",
|
"name": "operation_updated_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 8,
|
"ordinal": 8,
|
||||||
"name": "operation_published_at",
|
"name": "operation_published_at: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 9,
|
"ordinal": 9,
|
||||||
@@ -115,8 +115,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 22,
|
"ordinal": 22,
|
||||||
"name": "created_at!",
|
"name": "created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 23,
|
"ordinal": 23,
|
||||||
@@ -136,9 +136,9 @@
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
null,
|
false,
|
||||||
null,
|
false,
|
||||||
null,
|
true,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@@ -152,9 +152,9 @@
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
null,
|
false,
|
||||||
true
|
true
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "33071dad43cffdb3bc1a55d07a5aee93f9af115155e319e49acc6f02d006fcc0"
|
"hash": "4402c3661cf519344a81cfcc4e811e789b9a3d827825bc59f3a9cd0036665420"
|
||||||
}
|
}
|
||||||
+14
-14
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"db_name": "PostgreSQL",
|
||||||
"query": "select\n o.id,\n o.workspace_id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",\n to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",\n to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",\n ov.created_by\n from published_operations po\n join operation_versions ov\n on ov.operation_id = po.operation_id and ov.version = po.version\n join operations o on o.id = po.operation_id\n order by o.name asc",
|
"query": "select\n o.id,\n o.workspace_id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n o.created_at as \"operation_created_at!: time::OffsetDateTime\",\n o.updated_at as \"operation_updated_at!: time::OffsetDateTime\",\n o.published_at as \"operation_published_at: time::OffsetDateTime\",\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n ov.created_at as \"created_at!: time::OffsetDateTime\",\n ov.created_by\n from published_operations po\n join operation_versions ov\n on ov.operation_id = po.operation_id and ov.version = po.version\n join operations o on o.id = po.operation_id\n order by o.name asc",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@@ -35,18 +35,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 6,
|
"ordinal": 6,
|
||||||
"name": "operation_created_at!",
|
"name": "operation_created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 7,
|
"ordinal": 7,
|
||||||
"name": "operation_updated_at!",
|
"name": "operation_updated_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 8,
|
"ordinal": 8,
|
||||||
"name": "operation_published_at",
|
"name": "operation_published_at: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 9,
|
"ordinal": 9,
|
||||||
@@ -115,8 +115,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 22,
|
"ordinal": 22,
|
||||||
"name": "created_at!",
|
"name": "created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 23,
|
"ordinal": 23,
|
||||||
@@ -134,9 +134,9 @@
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
null,
|
false,
|
||||||
null,
|
false,
|
||||||
null,
|
true,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@@ -150,9 +150,9 @@
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
null,
|
false,
|
||||||
true
|
true
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "3348d60983e16bac76e81ec2158c1c6b1333ec49067d23bdd3c2fd33caa93a3c"
|
"hash": "8ac15e73f704021c8cd23b3d32ebb215caa6eed07b30f4b3f98b97698e7334ee"
|
||||||
}
|
}
|
||||||
+14
-14
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"db_name": "PostgreSQL",
|
||||||
"query": "select\n w.id as workspace_id,\n w.slug as workspace_slug,\n a.id as agent_id,\n a.slug as agent_slug,\n b.tool_name,\n b.tool_title,\n coalesce(b.tool_description_override, ov.tool_description_json->>'description') as \"tool_description!\",\n o.id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",\n to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",\n to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",\n ov.created_by\n from workspaces w\n join agents a on a.workspace_id = w.id\n join published_agents pa on pa.agent_id = a.id\n join agent_operation_bindings b on b.agent_id = a.id and b.agent_version = pa.version\n join operation_versions ov on ov.operation_id = b.operation_id and ov.version = b.operation_version\n join operations o on o.id = ov.operation_id and o.workspace_id = w.id\n where w.slug = $1 and a.slug = $2 and b.enabled = true\n order by b.tool_name asc",
|
"query": "select\n w.id as workspace_id,\n w.slug as workspace_slug,\n a.id as agent_id,\n a.slug as agent_slug,\n b.tool_name,\n b.tool_title,\n coalesce(b.tool_description_override, ov.tool_description_json->>'description') as \"tool_description!\",\n o.id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n o.created_at as \"operation_created_at!: time::OffsetDateTime\",\n o.updated_at as \"operation_updated_at!: time::OffsetDateTime\",\n o.published_at as \"operation_published_at: time::OffsetDateTime\",\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n ov.created_at as \"created_at!: time::OffsetDateTime\",\n ov.created_by\n from workspaces w\n join agents a on a.workspace_id = w.id\n join published_agents pa on pa.agent_id = a.id\n join agent_operation_bindings b on b.agent_id = a.id and b.agent_version = pa.version\n join operation_versions ov on ov.operation_id = b.operation_id and ov.version = b.operation_version\n join operations o on o.id = ov.operation_id and o.workspace_id = w.id\n where w.slug = $1 and a.slug = $2 and b.enabled = true\n order by b.tool_name asc",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@@ -65,18 +65,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 12,
|
"ordinal": 12,
|
||||||
"name": "operation_created_at!",
|
"name": "operation_created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 13,
|
"ordinal": 13,
|
||||||
"name": "operation_updated_at!",
|
"name": "operation_updated_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 14,
|
"ordinal": 14,
|
||||||
"name": "operation_published_at",
|
"name": "operation_published_at: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 15,
|
"ordinal": 15,
|
||||||
@@ -145,8 +145,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 28,
|
"ordinal": 28,
|
||||||
"name": "created_at!",
|
"name": "created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 29,
|
"ordinal": 29,
|
||||||
@@ -173,9 +173,9 @@
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
null,
|
false,
|
||||||
null,
|
false,
|
||||||
null,
|
true,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@@ -189,9 +189,9 @@
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
null,
|
false,
|
||||||
true
|
true
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "f7b3017dafdc3b8291e4336b2f1c8290985f30802a9c159f75b9387bf44fb611"
|
"hash": "aa5a728d3d53aa0730497e9c75ccf1d385f00c6401ce0b17416b0009cf3f6ff3"
|
||||||
}
|
}
|
||||||
+11
-11
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"db_name": "PostgreSQL",
|
||||||
"query": "select\n operations.id,\n operations.workspace_id,\n operations.name,\n operations.display_name,\n operations.category,\n operations.protocol,\n ov.target_json,\n operations.status,\n operations.current_draft_version,\n operations.latest_published_version,\n to_char(operations.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",\n to_char(operations.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"updated_at!\",\n to_char(operations.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as published_at\n from operations\n join operation_versions ov\n on ov.operation_id = operations.id\n and ov.version = operations.current_draft_version\n where operations.workspace_id = $1\n order by operations.name asc",
|
"query": "select\n operations.id,\n operations.workspace_id,\n operations.name,\n operations.display_name,\n operations.category,\n operations.protocol,\n ov.target_json,\n operations.status,\n operations.current_draft_version,\n operations.latest_published_version,\n operations.created_at as \"created_at!: time::OffsetDateTime\",\n operations.updated_at as \"updated_at!: time::OffsetDateTime\",\n operations.published_at as \"published_at: time::OffsetDateTime\"\n from operations\n join operation_versions ov\n on ov.operation_id = operations.id\n and ov.version = operations.current_draft_version\n where operations.workspace_id = $1\n order by operations.name asc",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@@ -55,18 +55,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 10,
|
"ordinal": 10,
|
||||||
"name": "created_at!",
|
"name": "created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 11,
|
"ordinal": 11,
|
||||||
"name": "updated_at!",
|
"name": "updated_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 12,
|
"ordinal": 12,
|
||||||
"name": "published_at",
|
"name": "published_at: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"parameters": {
|
"parameters": {
|
||||||
@@ -85,10 +85,10 @@
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
null,
|
false,
|
||||||
null,
|
false,
|
||||||
null
|
true
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "dcd602287d6c524b98068b6e95936700b7bfa54d5e5f3d425f4b770193601bdc"
|
"hash": "e4392329cd965b3f5100b38fb26b828f1bce4e6c9951ed6f4701d52cab3b7de5"
|
||||||
}
|
}
|
||||||
+14
-14
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"db_name": "PostgreSQL",
|
||||||
"query": "select\n o.id,\n o.workspace_id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",\n to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",\n to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",\n ov.created_by\n from operation_versions ov\n join operations o on o.id = ov.operation_id\n where o.workspace_id = $1 and ov.operation_id = $2\n order by ov.version asc",
|
"query": "select\n o.id,\n o.workspace_id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n o.created_at as \"operation_created_at!: time::OffsetDateTime\",\n o.updated_at as \"operation_updated_at!: time::OffsetDateTime\",\n o.published_at as \"operation_published_at: time::OffsetDateTime\",\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n ov.created_at as \"created_at!: time::OffsetDateTime\",\n ov.created_by\n from operation_versions ov\n join operations o on o.id = ov.operation_id\n where o.workspace_id = $1 and ov.operation_id = $2\n order by ov.version asc",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@@ -35,18 +35,18 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 6,
|
"ordinal": 6,
|
||||||
"name": "operation_created_at!",
|
"name": "operation_created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 7,
|
"ordinal": 7,
|
||||||
"name": "operation_updated_at!",
|
"name": "operation_updated_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 8,
|
"ordinal": 8,
|
||||||
"name": "operation_published_at",
|
"name": "operation_published_at: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 9,
|
"ordinal": 9,
|
||||||
@@ -115,8 +115,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 22,
|
"ordinal": 22,
|
||||||
"name": "created_at!",
|
"name": "created_at!: time::OffsetDateTime",
|
||||||
"type_info": "Text"
|
"type_info": "Timestamptz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 23,
|
"ordinal": 23,
|
||||||
@@ -137,9 +137,9 @@
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
null,
|
false,
|
||||||
null,
|
false,
|
||||||
null,
|
true,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@@ -153,9 +153,9 @@
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
null,
|
false,
|
||||||
true
|
true
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "01dd17d87f2ad2d3c4cc10e5fb6430838a4556a1d783e452398cd15dfa45b293"
|
"hash": "eeec56487c44b28624364e17778451924b910c56d7be7da9a361f74de9d9d546"
|
||||||
}
|
}
|
||||||
@@ -1726,9 +1726,9 @@ impl AdminService {
|
|||||||
status: summary.status,
|
status: summary.status,
|
||||||
current_draft_version: summary.current_draft_version,
|
current_draft_version: summary.current_draft_version,
|
||||||
latest_published_version: summary.latest_published_version,
|
latest_published_version: summary.latest_published_version,
|
||||||
created_at: summary.created_at,
|
created_at: format_timestamp(summary.created_at),
|
||||||
updated_at: summary.updated_at,
|
updated_at: format_timestamp(summary.updated_at),
|
||||||
published_at: summary.published_at,
|
published_at: summary.published_at.map(format_timestamp),
|
||||||
draft_version_ref: VersionRef {
|
draft_version_ref: VersionRef {
|
||||||
version: summary.current_draft_version,
|
version: summary.current_draft_version,
|
||||||
status: summary.status,
|
status: summary.status,
|
||||||
@@ -1779,7 +1779,7 @@ impl AdminService {
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
let now = now_string()?;
|
let now = OffsetDateTime::now_utc();
|
||||||
let operation_id = OperationId::new(new_prefixed_id("op"));
|
let operation_id = OperationId::new(new_prefixed_id("op"));
|
||||||
let snapshot = RegistryOperation {
|
let snapshot = RegistryOperation {
|
||||||
id: operation_id.clone(),
|
id: operation_id.clone(),
|
||||||
@@ -1802,7 +1802,7 @@ impl AdminService {
|
|||||||
format_version: "1".to_owned(),
|
format_version: "1".to_owned(),
|
||||||
export_mode: ExportMode::Portable,
|
export_mode: ExportMode::Portable,
|
||||||
}),
|
}),
|
||||||
created_at: now.clone(),
|
created_at: now,
|
||||||
updated_at: now,
|
updated_at: now,
|
||||||
published_at: None,
|
published_at: None,
|
||||||
};
|
};
|
||||||
@@ -1817,7 +1817,7 @@ impl AdminService {
|
|||||||
workspace_id: workspace_id.as_str().to_owned(),
|
workspace_id: workspace_id.as_str().to_owned(),
|
||||||
version: 1,
|
version: 1,
|
||||||
status: OperationStatus::Draft,
|
status: OperationStatus::Draft,
|
||||||
updated_at: snapshot.updated_at,
|
updated_at: format_timestamp(snapshot.updated_at),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1830,8 +1830,14 @@ impl AdminService {
|
|||||||
) -> Result<CreatedOperationResponse, ApiError> {
|
) -> Result<CreatedOperationResponse, ApiError> {
|
||||||
self.validate_operation_payload(&payload.operation)?;
|
self.validate_operation_payload(&payload.operation)?;
|
||||||
|
|
||||||
let summary = self.get_operation(workspace_id, operation_id).await?;
|
let summary = self
|
||||||
let now = now_string()?;
|
.registry
|
||||||
|
.get_operation_summary(workspace_id, operation_id)
|
||||||
|
.await?
|
||||||
|
.ok_or_else(|| {
|
||||||
|
ApiError::not_found(format!("operation {} was not found", operation_id.as_str()))
|
||||||
|
})?;
|
||||||
|
let now = OffsetDateTime::now_utc();
|
||||||
let version = summary.current_draft_version + 1;
|
let version = summary.current_draft_version + 1;
|
||||||
let snapshot = RegistryOperation {
|
let snapshot = RegistryOperation {
|
||||||
id: operation_id.clone(),
|
id: operation_id.clone(),
|
||||||
@@ -1874,7 +1880,7 @@ impl AdminService {
|
|||||||
workspace_id: workspace_id.as_str().to_owned(),
|
workspace_id: workspace_id.as_str().to_owned(),
|
||||||
version,
|
version,
|
||||||
status: OperationStatus::Draft,
|
status: OperationStatus::Draft,
|
||||||
updated_at: snapshot.updated_at,
|
updated_at: format_timestamp(snapshot.updated_at),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1895,7 +1901,7 @@ impl AdminService {
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let updated_at = now_string()?;
|
let updated_at = OffsetDateTime::now_utc();
|
||||||
let snapshot = RegistryOperation {
|
let snapshot = RegistryOperation {
|
||||||
id: operation_id.clone(),
|
id: operation_id.clone(),
|
||||||
name: existing.snapshot.name,
|
name: existing.snapshot.name,
|
||||||
@@ -1915,7 +1921,7 @@ impl AdminService {
|
|||||||
generated_draft: existing.snapshot.generated_draft,
|
generated_draft: existing.snapshot.generated_draft,
|
||||||
config_export: existing.snapshot.config_export,
|
config_export: existing.snapshot.config_export,
|
||||||
created_at: existing.snapshot.created_at,
|
created_at: existing.snapshot.created_at,
|
||||||
updated_at: updated_at.clone(),
|
updated_at,
|
||||||
published_at: existing.snapshot.published_at,
|
published_at: existing.snapshot.published_at,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1929,7 +1935,7 @@ impl AdminService {
|
|||||||
workspace_id: workspace_id.as_str().to_owned(),
|
workspace_id: workspace_id.as_str().to_owned(),
|
||||||
version: snapshot.version,
|
version: snapshot.version,
|
||||||
status: snapshot.status,
|
status: snapshot.status,
|
||||||
updated_at,
|
updated_at: format_timestamp(updated_at),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1940,7 +1946,7 @@ impl AdminService {
|
|||||||
operation_id: &OperationId,
|
operation_id: &OperationId,
|
||||||
version: u32,
|
version: u32,
|
||||||
) -> Result<PublishResponse, ApiError> {
|
) -> Result<PublishResponse, ApiError> {
|
||||||
let published_at = now_string()?;
|
let published_at = OffsetDateTime::now_utc();
|
||||||
self.registry
|
self.registry
|
||||||
.publish_operation(PublishRequest {
|
.publish_operation(PublishRequest {
|
||||||
workspace_id,
|
workspace_id,
|
||||||
@@ -1956,7 +1962,7 @@ impl AdminService {
|
|||||||
operation_id: operation_id.as_str().to_owned(),
|
operation_id: operation_id.as_str().to_owned(),
|
||||||
workspace_id: workspace_id.as_str().to_owned(),
|
workspace_id: workspace_id.as_str().to_owned(),
|
||||||
published_version: version,
|
published_version: version,
|
||||||
published_at,
|
published_at: format_timestamp(published_at),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1967,7 +1973,7 @@ impl AdminService {
|
|||||||
operation_id: &OperationId,
|
operation_id: &OperationId,
|
||||||
) -> Result<OperationMutationResult, ApiError> {
|
) -> Result<OperationMutationResult, ApiError> {
|
||||||
let summary = self.get_operation(workspace_id, operation_id).await?;
|
let summary = self.get_operation(workspace_id, operation_id).await?;
|
||||||
let updated_at = now_string()?;
|
let updated_at = OffsetDateTime::now_utc();
|
||||||
self.registry
|
self.registry
|
||||||
.archive_operation(workspace_id, operation_id, &updated_at)
|
.archive_operation(workspace_id, operation_id, &updated_at)
|
||||||
.await?;
|
.await?;
|
||||||
@@ -1977,7 +1983,7 @@ impl AdminService {
|
|||||||
workspace_id: workspace_id.as_str().to_owned(),
|
workspace_id: workspace_id.as_str().to_owned(),
|
||||||
version: summary.current_draft_version,
|
version: summary.current_draft_version,
|
||||||
status: OperationStatus::Archived,
|
status: OperationStatus::Archived,
|
||||||
updated_at,
|
updated_at: format_timestamp(updated_at),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4978,9 +4984,9 @@ fn enrich_operation_summary(
|
|||||||
status: summary.status,
|
status: summary.status,
|
||||||
current_draft_version: summary.current_draft_version,
|
current_draft_version: summary.current_draft_version,
|
||||||
latest_published_version: summary.latest_published_version,
|
latest_published_version: summary.latest_published_version,
|
||||||
created_at: summary.created_at,
|
created_at: format_timestamp(summary.created_at),
|
||||||
updated_at: summary.updated_at,
|
updated_at: format_timestamp(summary.updated_at),
|
||||||
published_at: summary.published_at,
|
published_at: summary.published_at.map(format_timestamp),
|
||||||
usage_summary,
|
usage_summary,
|
||||||
agent_refs,
|
agent_refs,
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-20
@@ -149,7 +149,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: 1,
|
version: 1,
|
||||||
published_at: "2026-03-26T10:00:00Z",
|
published_at: &OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -255,7 +255,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: 1,
|
version: 1,
|
||||||
published_at: "2026-03-26T10:00:00Z",
|
published_at: &OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -319,7 +319,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: 1,
|
version: 1,
|
||||||
published_at: "2026-03-26T10:00:00Z",
|
published_at: &OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -718,7 +718,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: 1,
|
version: 1,
|
||||||
published_at: "2026-03-26T10:00:00Z",
|
published_at: &OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -763,7 +763,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: 1,
|
version: 1,
|
||||||
published_at: "2026-03-26T10:00:00Z",
|
published_at: &OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -876,7 +876,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: 1,
|
version: 1,
|
||||||
published_at: "2026-03-26T10:00:00Z",
|
published_at: &OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -933,7 +933,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: 1,
|
version: 1,
|
||||||
published_at: "2026-03-26T10:00:00Z",
|
published_at: &OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -1079,7 +1079,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: 1,
|
version: 1,
|
||||||
published_at: "2026-03-26T10:00:00Z",
|
published_at: &OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -1173,7 +1173,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: 1,
|
version: 1,
|
||||||
published_at: "2026-03-26T10:00:00Z",
|
published_at: &OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -1265,7 +1265,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: 1,
|
version: 1,
|
||||||
published_at: "2026-03-26T10:00:00Z",
|
published_at: &OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -1412,7 +1412,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: 1,
|
version: 1,
|
||||||
published_at: "2026-03-26T10:00:00Z",
|
published_at: &OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -1799,9 +1799,9 @@ mod tests {
|
|||||||
samples: None,
|
samples: None,
|
||||||
generated_draft: None,
|
generated_draft: None,
|
||||||
config_export: None,
|
config_export: None,
|
||||||
created_at: "2026-03-26T10:00:00Z".to_owned(),
|
created_at: OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
updated_at: "2026-03-26T10:00:00Z".to_owned(),
|
updated_at: OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_at: Some("2026-03-26T10:00:00Z".to_owned()),
|
published_at: Some(OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1864,9 +1864,11 @@ mod tests {
|
|||||||
samples: None,
|
samples: None,
|
||||||
generated_draft: None,
|
generated_draft: None,
|
||||||
config_export: None,
|
config_export: None,
|
||||||
created_at: "2026-03-26T10:00:00Z".to_owned(),
|
created_at: OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
updated_at: "2026-03-26T10:00:00Z".to_owned(),
|
updated_at: OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_at: Some("2026-03-26T10:00:00Z".to_owned()),
|
published_at: Some(
|
||||||
|
OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1928,9 +1930,9 @@ mod tests {
|
|||||||
samples: None,
|
samples: None,
|
||||||
generated_draft: None,
|
generated_draft: None,
|
||||||
config_export: None,
|
config_export: None,
|
||||||
created_at: "2026-03-26T10:00:00Z".to_owned(),
|
created_at: OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
updated_at: "2026-03-26T10:00:00Z".to_owned(),
|
updated_at: OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap(),
|
||||||
published_at: Some("2026-03-26T10:00:00Z".to_owned()),
|
published_at: Some(OffsetDateTime::parse("2026-03-26T10:00:00Z", &Rfc3339).unwrap()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ use std::collections::BTreeMap;
|
|||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
use time::OffsetDateTime;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
ids::{AuthProfileId, DescriptorId, OperationId, SampleId},
|
ids::{AuthProfileId, DescriptorId, OperationId, SampleId},
|
||||||
@@ -231,10 +232,13 @@ pub struct Operation<TSchema, TMapping> {
|
|||||||
pub generated_draft: Option<GeneratedDraft>,
|
pub generated_draft: Option<GeneratedDraft>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub config_export: Option<ConfigExport>,
|
pub config_export: Option<ConfigExport>,
|
||||||
pub created_at: String,
|
#[serde(with = "time::serde::rfc3339")]
|
||||||
pub updated_at: String,
|
pub created_at: OffsetDateTime,
|
||||||
|
#[serde(with = "time::serde::rfc3339")]
|
||||||
|
pub updated_at: OffsetDateTime,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub published_at: Option<String>,
|
#[serde(with = "time::serde::rfc3339::option")]
|
||||||
|
pub published_at: Option<OffsetDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<TSchema, TMapping> Operation<TSchema, TMapping> {
|
impl<TSchema, TMapping> Operation<TSchema, TMapping> {
|
||||||
@@ -419,8 +423,8 @@ mod tests {
|
|||||||
samples: Some(Samples::default()),
|
samples: Some(Samples::default()),
|
||||||
generated_draft: None,
|
generated_draft: None,
|
||||||
config_export: None,
|
config_export: None,
|
||||||
created_at: "2026-03-25T08:00:00Z".to_owned(),
|
created_at: timestamp("2026-03-25T08:00:00Z"),
|
||||||
updated_at: "2026-03-25T08:00:00Z".to_owned(),
|
updated_at: timestamp("2026-03-25T08:00:00Z"),
|
||||||
published_at: None,
|
published_at: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -500,9 +504,9 @@ mod tests {
|
|||||||
format_version: "1".to_owned(),
|
format_version: "1".to_owned(),
|
||||||
export_mode: ExportMode::Portable,
|
export_mode: ExportMode::Portable,
|
||||||
}),
|
}),
|
||||||
created_at: "2026-03-25T08:00:00Z".to_owned(),
|
created_at: timestamp("2026-03-25T08:00:00Z"),
|
||||||
updated_at: "2026-03-25T08:10:00Z".to_owned(),
|
updated_at: timestamp("2026-03-25T08:10:00Z"),
|
||||||
published_at: Some("2026-03-25T08:15:00Z".to_owned()),
|
published_at: Some(timestamp("2026-03-25T08:15:00Z")),
|
||||||
};
|
};
|
||||||
|
|
||||||
let yaml = serde_yaml::to_string(&operation).unwrap();
|
let yaml = serde_yaml::to_string(&operation).unwrap();
|
||||||
|
|||||||
@@ -211,9 +211,9 @@ pub struct OperationSummary {
|
|||||||
pub status: OperationStatus,
|
pub status: OperationStatus,
|
||||||
pub current_draft_version: u32,
|
pub current_draft_version: u32,
|
||||||
pub latest_published_version: Option<u32>,
|
pub latest_published_version: Option<u32>,
|
||||||
pub created_at: String,
|
pub created_at: OffsetDateTime,
|
||||||
pub updated_at: String,
|
pub updated_at: OffsetDateTime,
|
||||||
pub published_at: Option<String>,
|
pub published_at: Option<OffsetDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
@@ -239,7 +239,7 @@ pub struct OperationVersionRecord {
|
|||||||
pub version: u32,
|
pub version: u32,
|
||||||
pub status: OperationStatus,
|
pub status: OperationStatus,
|
||||||
pub change_note: Option<String>,
|
pub change_note: Option<String>,
|
||||||
pub created_at: String,
|
pub created_at: OffsetDateTime,
|
||||||
pub created_by: Option<String>,
|
pub created_by: Option<String>,
|
||||||
pub snapshot: RegistryOperation,
|
pub snapshot: RegistryOperation,
|
||||||
}
|
}
|
||||||
@@ -370,7 +370,7 @@ pub struct PublishRequest<'a> {
|
|||||||
pub workspace_id: &'a WorkspaceId,
|
pub workspace_id: &'a WorkspaceId,
|
||||||
pub operation_id: &'a OperationId,
|
pub operation_id: &'a OperationId,
|
||||||
pub version: u32,
|
pub version: u32,
|
||||||
pub published_at: &'a str,
|
pub published_at: &'a OffsetDateTime,
|
||||||
pub published_by: Option<&'a str>,
|
pub published_by: Option<&'a str>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -452,9 +452,9 @@ impl PostgresRegistry {
|
|||||||
o.display_name,
|
o.display_name,
|
||||||
o.category,
|
o.category,
|
||||||
o.protocol,
|
o.protocol,
|
||||||
to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",
|
o.created_at as \"operation_created_at!: time::OffsetDateTime\",
|
||||||
to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",
|
o.updated_at as \"operation_updated_at!: time::OffsetDateTime\",
|
||||||
to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,
|
o.published_at as \"operation_published_at: time::OffsetDateTime\",
|
||||||
ov.version,
|
ov.version,
|
||||||
ov.status,
|
ov.status,
|
||||||
ov.target_json,
|
ov.target_json,
|
||||||
@@ -468,7 +468,7 @@ impl PostgresRegistry {
|
|||||||
ov.generated_draft_json,
|
ov.generated_draft_json,
|
||||||
ov.config_export_json,
|
ov.config_export_json,
|
||||||
ov.change_note,
|
ov.change_note,
|
||||||
to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",
|
ov.created_at as \"created_at!: time::OffsetDateTime\",
|
||||||
ov.created_by
|
ov.created_by
|
||||||
from workspaces w
|
from workspaces w
|
||||||
join agents a on a.workspace_id = w.id
|
join agents a on a.workspace_id = w.id
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ async fn insert_version_row(
|
|||||||
.bind(serialize_option_json_value(&snapshot.generated_draft)?.map(Json))
|
.bind(serialize_option_json_value(&snapshot.generated_draft)?.map(Json))
|
||||||
.bind(serialize_option_json_value(&snapshot.config_export)?.map(Json))
|
.bind(serialize_option_json_value(&snapshot.config_export)?.map(Json))
|
||||||
.bind(change_note)
|
.bind(change_note)
|
||||||
.bind(&snapshot.updated_at)
|
.bind(snapshot.updated_at)
|
||||||
.bind(created_by)
|
.bind(created_by)
|
||||||
.execute(&mut **tx)
|
.execute(&mut **tx)
|
||||||
.await?;
|
.await?;
|
||||||
@@ -717,9 +717,9 @@ fn build_operation_summary(
|
|||||||
status: String,
|
status: String,
|
||||||
current_draft_version: i32,
|
current_draft_version: i32,
|
||||||
latest_published_version: Option<i32>,
|
latest_published_version: Option<i32>,
|
||||||
created_at: String,
|
created_at: OffsetDateTime,
|
||||||
updated_at: String,
|
updated_at: OffsetDateTime,
|
||||||
published_at: Option<String>,
|
published_at: Option<OffsetDateTime>,
|
||||||
) -> Result<OperationSummary, RegistryError> {
|
) -> Result<OperationSummary, RegistryError> {
|
||||||
let target: Target = deserialize_json_value(target_json)?;
|
let target: Target = deserialize_json_value(target_json)?;
|
||||||
let (target_url, target_action) = target_summary(&target);
|
let (target_url, target_action) = target_summary(&target);
|
||||||
@@ -830,9 +830,9 @@ fn build_operation_version_record(
|
|||||||
display_name: String,
|
display_name: String,
|
||||||
category: String,
|
category: String,
|
||||||
protocol: String,
|
protocol: String,
|
||||||
operation_created_at: String,
|
operation_created_at: OffsetDateTime,
|
||||||
operation_updated_at: String,
|
operation_updated_at: OffsetDateTime,
|
||||||
operation_published_at: Option<String>,
|
operation_published_at: Option<OffsetDateTime>,
|
||||||
version: i32,
|
version: i32,
|
||||||
status: String,
|
status: String,
|
||||||
target_json: Value,
|
target_json: Value,
|
||||||
@@ -846,7 +846,7 @@ fn build_operation_version_record(
|
|||||||
generated_draft_json: Option<Value>,
|
generated_draft_json: Option<Value>,
|
||||||
config_export_json: Option<Value>,
|
config_export_json: Option<Value>,
|
||||||
change_note: Option<String>,
|
change_note: Option<String>,
|
||||||
created_at: String,
|
created_at: OffsetDateTime,
|
||||||
created_by: Option<String>,
|
created_by: Option<String>,
|
||||||
) -> Result<OperationVersionRecord, RegistryError> {
|
) -> Result<OperationVersionRecord, RegistryError> {
|
||||||
let operation_id = OperationId::new(id);
|
let operation_id = OperationId::new(id);
|
||||||
@@ -859,7 +859,7 @@ fn build_operation_version_record(
|
|||||||
version,
|
version,
|
||||||
status,
|
status,
|
||||||
change_note,
|
change_note,
|
||||||
created_at: created_at.clone(),
|
created_at,
|
||||||
created_by,
|
created_by,
|
||||||
snapshot: RegistryOperation {
|
snapshot: RegistryOperation {
|
||||||
id: operation_id,
|
id: operation_id,
|
||||||
@@ -1190,7 +1190,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation_v2.id,
|
operation_id: &operation_v2.id,
|
||||||
version: operation_v2.version,
|
version: operation_v2.version,
|
||||||
published_at: "2026-03-25T12:10:00Z",
|
published_at: ×tamp("2026-03-25T12:10:00Z"),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -1275,7 +1275,7 @@ mod tests {
|
|||||||
operation.generated_draft = None;
|
operation.generated_draft = None;
|
||||||
operation.samples = None;
|
operation.samples = None;
|
||||||
operation.config_export = None;
|
operation.config_export = None;
|
||||||
operation.updated_at = "2026-03-25T12:34:00Z".to_owned();
|
operation.updated_at = timestamp("2026-03-25T12:34:00Z");
|
||||||
|
|
||||||
registry
|
registry
|
||||||
.update_operation_draft(&test_workspace_id(), &operation)
|
.update_operation_draft(&test_workspace_id(), &operation)
|
||||||
@@ -1824,7 +1824,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: operation_v2.version,
|
version: operation_v2.version,
|
||||||
published_at: "2026-03-25T12:10:00Z",
|
published_at: ×tamp("2026-03-25T12:10:00Z"),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -1904,7 +1904,7 @@ mod tests {
|
|||||||
workspace_id: &test_workspace_id(),
|
workspace_id: &test_workspace_id(),
|
||||||
operation_id: &operation.id,
|
operation_id: &operation.id,
|
||||||
version: operation_v2.version,
|
version: operation_v2.version,
|
||||||
published_at: "2026-03-25T12:10:00Z",
|
published_at: ×tamp("2026-03-25T12:10:00Z"),
|
||||||
published_by: Some("alice"),
|
published_by: Some("alice"),
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
@@ -2415,8 +2415,8 @@ mod tests {
|
|||||||
format_version: "v1".to_owned(),
|
format_version: "v1".to_owned(),
|
||||||
export_mode: ExportMode::Portable,
|
export_mode: ExportMode::Portable,
|
||||||
}),
|
}),
|
||||||
created_at: "2026-03-25T11:58:00Z".to_owned(),
|
created_at: timestamp("2026-03-25T11:58:00Z"),
|
||||||
updated_at: format!("2026-03-25T12:{version:02}:00Z"),
|
updated_at: timestamp(&format!("2026-03-25T12:{version:02}:00Z")),
|
||||||
published_at: None,
|
published_at: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,9 +61,9 @@ impl PostgresRegistry {
|
|||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|_| to_db_version(snapshot.version)),
|
.map(|_| to_db_version(snapshot.version)),
|
||||||
)
|
)
|
||||||
.bind(&snapshot.created_at)
|
.bind(snapshot.created_at)
|
||||||
.bind(&snapshot.updated_at)
|
.bind(snapshot.updated_at)
|
||||||
.bind(snapshot.published_at.as_deref())
|
.bind(snapshot.published_at)
|
||||||
.execute(&mut *tx)
|
.execute(&mut *tx)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ impl PostgresRegistry {
|
|||||||
)
|
)
|
||||||
.bind(serialize_enum_text(&request.snapshot.status, "status")?)
|
.bind(serialize_enum_text(&request.snapshot.status, "status")?)
|
||||||
.bind(to_db_version(request.snapshot.version))
|
.bind(to_db_version(request.snapshot.version))
|
||||||
.bind(&request.snapshot.updated_at)
|
.bind(request.snapshot.updated_at)
|
||||||
.bind(request.snapshot.id.as_str())
|
.bind(request.snapshot.id.as_str())
|
||||||
.execute(&mut *tx)
|
.execute(&mut *tx)
|
||||||
.await?;
|
.await?;
|
||||||
@@ -162,7 +162,7 @@ impl PostgresRegistry {
|
|||||||
.bind(&snapshot.display_name)
|
.bind(&snapshot.display_name)
|
||||||
.bind(&snapshot.category)
|
.bind(&snapshot.category)
|
||||||
.bind(serialize_enum_text(&snapshot.status, "status")?)
|
.bind(serialize_enum_text(&snapshot.status, "status")?)
|
||||||
.bind(&snapshot.updated_at)
|
.bind(snapshot.updated_at)
|
||||||
.bind(workspace_id.as_str())
|
.bind(workspace_id.as_str())
|
||||||
.bind(snapshot.id.as_str())
|
.bind(snapshot.id.as_str())
|
||||||
.execute(&mut *tx)
|
.execute(&mut *tx)
|
||||||
@@ -207,7 +207,7 @@ impl PostgresRegistry {
|
|||||||
&self,
|
&self,
|
||||||
workspace_id: &WorkspaceId,
|
workspace_id: &WorkspaceId,
|
||||||
operation_id: &OperationId,
|
operation_id: &OperationId,
|
||||||
archived_at: &str,
|
archived_at: &time::OffsetDateTime,
|
||||||
) -> Result<(), RegistryError> {
|
) -> Result<(), RegistryError> {
|
||||||
let Some(summary) = self
|
let Some(summary) = self
|
||||||
.get_operation_summary(workspace_id, operation_id)
|
.get_operation_summary(workspace_id, operation_id)
|
||||||
@@ -320,9 +320,9 @@ impl PostgresRegistry {
|
|||||||
operations.status,
|
operations.status,
|
||||||
operations.current_draft_version,
|
operations.current_draft_version,
|
||||||
operations.latest_published_version,
|
operations.latest_published_version,
|
||||||
to_char(operations.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",
|
operations.created_at as \"created_at!: time::OffsetDateTime\",
|
||||||
to_char(operations.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"updated_at!\",
|
operations.updated_at as \"updated_at!: time::OffsetDateTime\",
|
||||||
to_char(operations.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as published_at
|
operations.published_at as \"published_at: time::OffsetDateTime\"
|
||||||
from operations
|
from operations
|
||||||
join operation_versions ov
|
join operation_versions ov
|
||||||
on ov.operation_id = operations.id
|
on ov.operation_id = operations.id
|
||||||
@@ -432,9 +432,9 @@ impl PostgresRegistry {
|
|||||||
operations.status,
|
operations.status,
|
||||||
operations.current_draft_version,
|
operations.current_draft_version,
|
||||||
operations.latest_published_version,
|
operations.latest_published_version,
|
||||||
to_char(operations.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",
|
operations.created_at as \"created_at!: time::OffsetDateTime\",
|
||||||
to_char(operations.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"updated_at!\",
|
operations.updated_at as \"updated_at!: time::OffsetDateTime\",
|
||||||
to_char(operations.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as published_at
|
operations.published_at as \"published_at: time::OffsetDateTime\"
|
||||||
from operations
|
from operations
|
||||||
join operation_versions ov
|
join operation_versions ov
|
||||||
on ov.operation_id = operations.id
|
on ov.operation_id = operations.id
|
||||||
@@ -480,9 +480,9 @@ impl PostgresRegistry {
|
|||||||
o.display_name,
|
o.display_name,
|
||||||
o.category,
|
o.category,
|
||||||
o.protocol,
|
o.protocol,
|
||||||
to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",
|
o.created_at as \"operation_created_at!: time::OffsetDateTime\",
|
||||||
to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",
|
o.updated_at as \"operation_updated_at!: time::OffsetDateTime\",
|
||||||
to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,
|
o.published_at as \"operation_published_at: time::OffsetDateTime\",
|
||||||
ov.version,
|
ov.version,
|
||||||
ov.status,
|
ov.status,
|
||||||
ov.target_json,
|
ov.target_json,
|
||||||
@@ -496,7 +496,7 @@ impl PostgresRegistry {
|
|||||||
ov.generated_draft_json,
|
ov.generated_draft_json,
|
||||||
ov.config_export_json,
|
ov.config_export_json,
|
||||||
ov.change_note,
|
ov.change_note,
|
||||||
to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",
|
ov.created_at as \"created_at!: time::OffsetDateTime\",
|
||||||
ov.created_by
|
ov.created_by
|
||||||
from operation_versions ov
|
from operation_versions ov
|
||||||
join operations o on o.id = ov.operation_id
|
join operations o on o.id = ov.operation_id
|
||||||
@@ -552,9 +552,9 @@ impl PostgresRegistry {
|
|||||||
o.display_name,
|
o.display_name,
|
||||||
o.category,
|
o.category,
|
||||||
o.protocol,
|
o.protocol,
|
||||||
to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",
|
o.created_at as \"operation_created_at!: time::OffsetDateTime\",
|
||||||
to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",
|
o.updated_at as \"operation_updated_at!: time::OffsetDateTime\",
|
||||||
to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,
|
o.published_at as \"operation_published_at: time::OffsetDateTime\",
|
||||||
ov.version,
|
ov.version,
|
||||||
ov.status,
|
ov.status,
|
||||||
ov.target_json,
|
ov.target_json,
|
||||||
@@ -568,7 +568,7 @@ impl PostgresRegistry {
|
|||||||
ov.generated_draft_json,
|
ov.generated_draft_json,
|
||||||
ov.config_export_json,
|
ov.config_export_json,
|
||||||
ov.change_note,
|
ov.change_note,
|
||||||
to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",
|
ov.created_at as \"created_at!: time::OffsetDateTime\",
|
||||||
ov.created_by
|
ov.created_by
|
||||||
from operation_versions ov
|
from operation_versions ov
|
||||||
join operations o on o.id = ov.operation_id
|
join operations o on o.id = ov.operation_id
|
||||||
@@ -691,9 +691,9 @@ impl PostgresRegistry {
|
|||||||
o.display_name,
|
o.display_name,
|
||||||
o.category,
|
o.category,
|
||||||
o.protocol,
|
o.protocol,
|
||||||
to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",
|
o.created_at as \"operation_created_at!: time::OffsetDateTime\",
|
||||||
to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",
|
o.updated_at as \"operation_updated_at!: time::OffsetDateTime\",
|
||||||
to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,
|
o.published_at as \"operation_published_at: time::OffsetDateTime\",
|
||||||
ov.version,
|
ov.version,
|
||||||
ov.status,
|
ov.status,
|
||||||
ov.target_json,
|
ov.target_json,
|
||||||
@@ -707,7 +707,7 @@ impl PostgresRegistry {
|
|||||||
ov.generated_draft_json,
|
ov.generated_draft_json,
|
||||||
ov.config_export_json,
|
ov.config_export_json,
|
||||||
ov.change_note,
|
ov.change_note,
|
||||||
to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",
|
ov.created_at as \"created_at!: time::OffsetDateTime\",
|
||||||
ov.created_by
|
ov.created_by
|
||||||
from published_operations po
|
from published_operations po
|
||||||
join operation_versions ov
|
join operation_versions ov
|
||||||
@@ -760,9 +760,9 @@ impl PostgresRegistry {
|
|||||||
o.display_name,
|
o.display_name,
|
||||||
o.category,
|
o.category,
|
||||||
o.protocol,
|
o.protocol,
|
||||||
to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",
|
o.created_at as \"operation_created_at!: time::OffsetDateTime\",
|
||||||
to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",
|
o.updated_at as \"operation_updated_at!: time::OffsetDateTime\",
|
||||||
to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,
|
o.published_at as \"operation_published_at: time::OffsetDateTime\",
|
||||||
ov.version,
|
ov.version,
|
||||||
ov.status,
|
ov.status,
|
||||||
ov.target_json,
|
ov.target_json,
|
||||||
@@ -776,7 +776,7 @@ impl PostgresRegistry {
|
|||||||
ov.generated_draft_json,
|
ov.generated_draft_json,
|
||||||
ov.config_export_json,
|
ov.config_export_json,
|
||||||
ov.change_note,
|
ov.change_note,
|
||||||
to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",
|
ov.created_at as \"created_at!: time::OffsetDateTime\",
|
||||||
ov.created_by
|
ov.created_by
|
||||||
from published_operations po
|
from published_operations po
|
||||||
join operation_versions ov
|
join operation_versions ov
|
||||||
|
|||||||
@@ -521,11 +521,16 @@ mod tests {
|
|||||||
use crank_schema::{Schema, SchemaKind};
|
use crank_schema::{Schema, SchemaKind};
|
||||||
use futures_util::{SinkExt, StreamExt, stream};
|
use futures_util::{SinkExt, StreamExt, stream};
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
use time::{OffsetDateTime, format_description::well_known::Rfc3339};
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
use tokio_tungstenite::accept_async;
|
use tokio_tungstenite::accept_async;
|
||||||
|
|
||||||
use crate::{RuntimeError, RuntimeExecutor, RuntimeOperation};
|
use crate::{RuntimeError, RuntimeExecutor, RuntimeOperation};
|
||||||
|
|
||||||
|
fn timestamp(value: &str) -> OffsetDateTime {
|
||||||
|
OffsetDateTime::parse(value, &Rfc3339).unwrap()
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn executes_rest_operation_end_to_end() {
|
async fn executes_rest_operation_end_to_end() {
|
||||||
let base_url = spawn_runtime_server().await;
|
let base_url = spawn_runtime_server().await;
|
||||||
@@ -1053,9 +1058,9 @@ mod tests {
|
|||||||
warnings: Vec::new(),
|
warnings: Vec::new(),
|
||||||
}),
|
}),
|
||||||
config_export: None,
|
config_export: None,
|
||||||
created_at: "2026-03-25T20:00:00Z".to_owned(),
|
created_at: timestamp("2026-03-25T20:00:00Z"),
|
||||||
updated_at: "2026-03-25T20:00:00Z".to_owned(),
|
updated_at: timestamp("2026-03-25T20:00:00Z"),
|
||||||
published_at: Some("2026-03-25T20:00:00Z".to_owned()),
|
published_at: Some(timestamp("2026-03-25T20:00:00Z")),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1129,9 +1134,9 @@ mod tests {
|
|||||||
warnings: Vec::new(),
|
warnings: Vec::new(),
|
||||||
}),
|
}),
|
||||||
config_export: None,
|
config_export: None,
|
||||||
created_at: "2026-03-25T20:00:00Z".to_owned(),
|
created_at: timestamp("2026-03-25T20:00:00Z"),
|
||||||
updated_at: "2026-03-25T20:00:00Z".to_owned(),
|
updated_at: timestamp("2026-03-25T20:00:00Z"),
|
||||||
published_at: Some("2026-03-25T20:00:00Z".to_owned()),
|
published_at: Some(timestamp("2026-03-25T20:00:00Z")),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1204,9 +1209,9 @@ mod tests {
|
|||||||
warnings: Vec::new(),
|
warnings: Vec::new(),
|
||||||
}),
|
}),
|
||||||
config_export: None,
|
config_export: None,
|
||||||
created_at: "2026-03-25T20:00:00Z".to_owned(),
|
created_at: timestamp("2026-03-25T20:00:00Z"),
|
||||||
updated_at: "2026-03-25T20:00:00Z".to_owned(),
|
updated_at: timestamp("2026-03-25T20:00:00Z"),
|
||||||
published_at: Some("2026-03-25T20:00:00Z".to_owned()),
|
published_at: Some(timestamp("2026-03-25T20:00:00Z")),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1286,9 +1291,9 @@ mod tests {
|
|||||||
samples: None,
|
samples: None,
|
||||||
generated_draft: None,
|
generated_draft: None,
|
||||||
config_export: None,
|
config_export: None,
|
||||||
created_at: "2026-04-06T12:00:00Z".to_owned(),
|
created_at: timestamp("2026-04-06T12:00:00Z"),
|
||||||
updated_at: "2026-04-06T12:00:00Z".to_owned(),
|
updated_at: timestamp("2026-04-06T12:00:00Z"),
|
||||||
published_at: Some("2026-04-06T12:00:00Z".to_owned()),
|
published_at: Some(timestamp("2026-04-06T12:00:00Z")),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1370,9 +1375,9 @@ mod tests {
|
|||||||
warnings: Vec::new(),
|
warnings: Vec::new(),
|
||||||
}),
|
}),
|
||||||
config_export: None,
|
config_export: None,
|
||||||
created_at: "2026-04-06T12:00:00Z".to_owned(),
|
created_at: timestamp("2026-04-06T12:00:00Z"),
|
||||||
updated_at: "2026-04-06T12:00:00Z".to_owned(),
|
updated_at: timestamp("2026-04-06T12:00:00Z"),
|
||||||
published_at: Some("2026-04-06T12:00:00Z".to_owned()),
|
published_at: Some(timestamp("2026-04-06T12:00:00Z")),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1459,9 +1464,9 @@ mod tests {
|
|||||||
samples: None,
|
samples: None,
|
||||||
generated_draft: None,
|
generated_draft: None,
|
||||||
config_export: None,
|
config_export: None,
|
||||||
created_at: "2026-04-06T12:00:00Z".to_owned(),
|
created_at: timestamp("2026-04-06T12:00:00Z"),
|
||||||
updated_at: "2026-04-06T12:00:00Z".to_owned(),
|
updated_at: timestamp("2026-04-06T12:00:00Z"),
|
||||||
published_at: Some("2026-04-06T12:00:00Z".to_owned()),
|
published_at: Some(timestamp("2026-04-06T12:00:00Z")),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1570,9 +1575,9 @@ mod tests {
|
|||||||
samples: None,
|
samples: None,
|
||||||
generated_draft: None,
|
generated_draft: None,
|
||||||
config_export: None,
|
config_export: None,
|
||||||
created_at: "2026-04-06T12:00:00Z".to_owned(),
|
created_at: timestamp("2026-04-06T12:00:00Z"),
|
||||||
updated_at: "2026-04-06T12:00:00Z".to_owned(),
|
updated_at: timestamp("2026-04-06T12:00:00Z"),
|
||||||
published_at: Some("2026-04-06T12:00:00Z".to_owned()),
|
published_at: Some(timestamp("2026-04-06T12:00:00Z")),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user