@centia-io/mcp-server 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/centia-api.json +360 -29
  2. package/package.json +1 -1
package/centia-api.json CHANGED
@@ -170,7 +170,7 @@
170
170
  }
171
171
  },
172
172
  "responses": {
173
- "204": {
173
+ "303": {
174
174
  "description": "Client updated"
175
175
  },
176
176
  "400": {
@@ -468,7 +468,7 @@
468
468
  }
469
469
  },
470
470
  "responses": {
471
- "204": {
471
+ "303": {
472
472
  "description": "Column updated"
473
473
  },
474
474
  "400": {
@@ -713,7 +713,17 @@
713
713
  "content": {
714
714
  "application/json": {
715
715
  "schema": {
716
- "$ref": "#/components/schemas/Events"
716
+ "oneOf": [
717
+ {
718
+ "$ref": "#/components/schemas/Client"
719
+ },
720
+ {
721
+ "type": "array",
722
+ "items": {
723
+ "$ref": "#/components/schemas/Client"
724
+ }
725
+ }
726
+ ]
717
727
  }
718
728
  }
719
729
  }
@@ -748,19 +758,28 @@
748
758
  "example": "my_table"
749
759
  }
750
760
  ],
751
- "requestBody": {
752
- "description": "Privileges.",
753
- "required": true,
754
- "content": {
755
- "application/json": {
756
- "schema": {
757
- "$ref": "#/components/schemas/Events"
761
+ "responses": {
762
+ "200": {
763
+ "description": "Ok",
764
+ "content": {
765
+ "application/json": {
766
+ "schema": {
767
+ "oneOf": [
768
+ {
769
+ "$ref": "#/components/schemas/Event"
770
+ },
771
+ {
772
+ "type": "array",
773
+ "items": {
774
+ "$ref": "#/components/schemas/Event"
775
+ }
776
+ }
777
+ ]
778
+ }
758
779
  }
759
780
  }
760
- }
761
- },
762
- "responses": {
763
- "201": {
781
+ },
782
+ "303": {
764
783
  "description": "Event trigger installed."
765
784
  },
766
785
  "400": {
@@ -942,7 +961,7 @@
942
961
  }
943
962
  },
944
963
  "responses": {
945
- "204": {
964
+ "303": {
946
965
  "description": "Rule updated"
947
966
  },
948
967
  "400": {
@@ -1258,6 +1277,16 @@
1258
1277
  "schema": {
1259
1278
  "type": "string"
1260
1279
  }
1280
+ },
1281
+ {
1282
+ "name": "noRestriction",
1283
+ "in": "query",
1284
+ "description": "Leaves out column restrictions on the returned metadata. Restrictions can be quite extensive.",
1285
+ "required": false,
1286
+ "schema": {
1287
+ "type": "boolean"
1288
+ },
1289
+ "example": true
1261
1290
  }
1262
1291
  ],
1263
1292
  "responses": {
@@ -1298,7 +1327,7 @@
1298
1327
  }
1299
1328
  },
1300
1329
  "responses": {
1301
- "204": {
1330
+ "303": {
1302
1331
  "description": "Metadata updated"
1303
1332
  },
1304
1333
  "400": {
@@ -1414,7 +1443,7 @@
1414
1443
  }
1415
1444
  },
1416
1445
  "responses": {
1417
- "204": {
1446
+ "303": {
1418
1447
  "description": "Method updated"
1419
1448
  },
1420
1449
  "400": {
@@ -1630,7 +1659,7 @@
1630
1659
  }
1631
1660
  },
1632
1661
  "responses": {
1633
- "204": {
1662
+ "303": {
1634
1663
  "description": "Privileges updated"
1635
1664
  },
1636
1665
  "400": {
@@ -1800,8 +1829,8 @@
1800
1829
  }
1801
1830
  },
1802
1831
  "responses": {
1803
- "201": {
1804
- "description": "Created"
1832
+ "303": {
1833
+ "description": "Renamed"
1805
1834
  },
1806
1835
  "400": {
1807
1836
  "description": "Bad request"
@@ -1982,7 +2011,7 @@
1982
2011
  }
1983
2012
  },
1984
2013
  "responses": {
1985
- "204": {
2014
+ "303": {
1986
2015
  "description": "Sequence updated"
1987
2016
  },
1988
2017
  "400": {
@@ -2060,7 +2089,7 @@
2060
2089
  "content": {
2061
2090
  "application/json": {
2062
2091
  "schema": {
2063
- "$ref": "#/components/schemas/Sql"
2092
+ "$ref": "#/components/schemas/SqlRequest"
2064
2093
  }
2065
2094
  }
2066
2095
  }
@@ -2075,7 +2104,14 @@
2075
2104
  }
2076
2105
  },
2077
2106
  "500": {
2078
- "description": "Internal error. Most likely an SQL error."
2107
+ "description": "Internal error. Most likely an SQL error.",
2108
+ "content": {
2109
+ "application/json": {
2110
+ "schema": {
2111
+ "$ref": "#/components/schemas/SqlResponse"
2112
+ }
2113
+ }
2114
+ }
2079
2115
  }
2080
2116
  }
2081
2117
  }
@@ -2351,7 +2387,7 @@
2351
2387
  }
2352
2388
  },
2353
2389
  "responses": {
2354
- "204": {
2390
+ "303": {
2355
2391
  "description": "Table updated"
2356
2392
  },
2357
2393
  "400": {
@@ -2515,7 +2551,7 @@
2515
2551
  }
2516
2552
  },
2517
2553
  "responses": {
2518
- "204": {
2554
+ "303": {
2519
2555
  "description": "User updated"
2520
2556
  },
2521
2557
  "400": {
@@ -2567,6 +2603,141 @@
2567
2603
  }
2568
2604
  }
2569
2605
  }
2606
+ },
2607
+ "/api/v4/views/backup": {
2608
+ "post": {
2609
+ "tags": [
2610
+ "View"
2611
+ ],
2612
+ "description": "Store all view definitions from the given schema(s) into the view store.",
2613
+ "operationId": "postViewBackup",
2614
+ "requestBody": {
2615
+ "description": "List of schema names to back up.",
2616
+ "required": true,
2617
+ "content": {
2618
+ "application/json": {
2619
+ "schema": {
2620
+ "type": "array",
2621
+ "items": {
2622
+ "type": "string"
2623
+ }
2624
+ },
2625
+ "example": [
2626
+ "my_schema"
2627
+ ]
2628
+ }
2629
+ }
2630
+ },
2631
+ "responses": {
2632
+ "200": {
2633
+ "description": "Ok",
2634
+ "content": {
2635
+ "application/json": {
2636
+ "schema": {
2637
+ "properties": {
2638
+ "count": {
2639
+ "description": "Number of views stored.",
2640
+ "type": "integer",
2641
+ "example": 5
2642
+ }
2643
+ },
2644
+ "type": "object"
2645
+ }
2646
+ }
2647
+ }
2648
+ },
2649
+ "400": {
2650
+ "description": "Bad request"
2651
+ },
2652
+ "404": {
2653
+ "description": "Not found"
2654
+ }
2655
+ }
2656
+ }
2657
+ },
2658
+ "/api/v4/views/restore": {
2659
+ "post": {
2660
+ "tags": [
2661
+ "View"
2662
+ ],
2663
+ "description": "Recreate stored star views into the target schema(s).",
2664
+ "operationId": "postViewRestore",
2665
+ "requestBody": {
2666
+ "description": "Restore instructions.",
2667
+ "required": true,
2668
+ "content": {
2669
+ "application/json": {
2670
+ "schema": {
2671
+ "$ref": "#/components/schemas/ViewRestore"
2672
+ }
2673
+ }
2674
+ }
2675
+ },
2676
+ "responses": {
2677
+ "200": {
2678
+ "description": "Ok",
2679
+ "content": {
2680
+ "application/json": {
2681
+ "schema": {
2682
+ "properties": {
2683
+ "count": {
2684
+ "description": "Number of views created.",
2685
+ "type": "integer",
2686
+ "example": 5
2687
+ }
2688
+ },
2689
+ "type": "object"
2690
+ }
2691
+ }
2692
+ }
2693
+ },
2694
+ "400": {
2695
+ "description": "Bad request"
2696
+ },
2697
+ "404": {
2698
+ "description": "Not found"
2699
+ }
2700
+ }
2701
+ }
2702
+ },
2703
+ "/api/v4/schemas/{schema}/views/{view}": {
2704
+ "get": {
2705
+ "tags": [
2706
+ "View"
2707
+ ],
2708
+ "description": "Get stored star view definitions for a schema.",
2709
+ "operationId": "getViews",
2710
+ "parameters": [
2711
+ {
2712
+ "name": "schema",
2713
+ "in": "query",
2714
+ "description": "Schema name to read stored views for.",
2715
+ "required": true,
2716
+ "schema": {
2717
+ "type": "string"
2718
+ },
2719
+ "example": "my_schema"
2720
+ }
2721
+ ],
2722
+ "responses": {
2723
+ "200": {
2724
+ "description": "Ok",
2725
+ "content": {
2726
+ "application/json": {
2727
+ "schema": {
2728
+ "type": "array",
2729
+ "items": {
2730
+ "$ref": "#/components/schemas/View"
2731
+ }
2732
+ }
2733
+ }
2734
+ }
2735
+ },
2736
+ "400": {
2737
+ "description": "Bad request"
2738
+ }
2739
+ }
2740
+ }
2570
2741
  }
2571
2742
  },
2572
2743
  "components": {
@@ -2850,8 +3021,8 @@
2850
3021
  },
2851
3022
  "type": "object"
2852
3023
  },
2853
- "Events": {
2854
- "description": "Events for a table.",
3024
+ "Event": {
3025
+ "description": "Event for a table.",
2855
3026
  "required": [
2856
3027
  "enabled"
2857
3028
  ],
@@ -3618,10 +3789,18 @@
3618
3789
  },
3619
3790
  "type": "object"
3620
3791
  },
3621
- "Sql": {
3792
+ "SqlRequest": {
3622
3793
  "description": "Execute SQL statements. Supports SELECT, INSERT, UPDATE, DELETE, and MERGE (no DDL or transaction control).",
3623
- "required": [],
3794
+ "required": [
3795
+ "q"
3796
+ ],
3624
3797
  "properties": {
3798
+ "id": {
3799
+ "title": "Id",
3800
+ "description": "Unique identifier for the request. The server will return the same identifier in the response. \n Useful for tracking requests in a websocket context. If omitted the server will generate a random UUID in the response.",
3801
+ "type": "string",
3802
+ "example": "my_id"
3803
+ },
3625
3804
  "q": {
3626
3805
  "title": "Query",
3627
3806
  "description": "SQL statement to run. Allowed: SELECT, INSERT, UPDATE, DELETE, MERGE. Not allowed: DDL, transaction control.",
@@ -3677,6 +3856,82 @@
3677
3856
  },
3678
3857
  "type": "object"
3679
3858
  },
3859
+ "SqlResponse": {
3860
+ "description": "Response from executing SQL statements where output format is set to 'json'. Contains the result of the query and metadata.",
3861
+ "required": [],
3862
+ "properties": {
3863
+ "id": {
3864
+ "title": "Id",
3865
+ "description": "Unique identifier for the request, which is the same as the one in the request payload.\n Useful for tracking requests in a websocket context.",
3866
+ "type": "string",
3867
+ "example": "my_id"
3868
+ },
3869
+ "statement": {
3870
+ "title": "Statement",
3871
+ "description": "The actual SQL statement that was executed after access rules was applied.",
3872
+ "type": "string",
3873
+ "example": "SELECT :my_date::date as my_date'"
3874
+ },
3875
+ "affected_rows": {
3876
+ "title": "Affected rows",
3877
+ "description": "If the query was an INSERT, UPDATE, or DELETE, the number of rows affected.",
3878
+ "type": "integer",
3879
+ "example": 1
3880
+ },
3881
+ "data": {
3882
+ "title": "Data",
3883
+ "description": "Rows returned by the query.",
3884
+ "type": "array",
3885
+ "items": {
3886
+ "type": "object"
3887
+ },
3888
+ "example": [
3889
+ {
3890
+ "my_date": "2011-04-01",
3891
+ "my_string": "hello world"
3892
+ }
3893
+ ]
3894
+ },
3895
+ "schema": {
3896
+ "title": "Schema",
3897
+ "description": "Column names and types of the query result.",
3898
+ "type": "object",
3899
+ "example": {
3900
+ "my_date": {
3901
+ "type": "date",
3902
+ "array": false
3903
+ },
3904
+ "my_string": {
3905
+ "type": "string",
3906
+ "array": false
3907
+ }
3908
+ },
3909
+ "additionalProperties": {
3910
+ "$ref": "#/components/schemas/SqlSchema"
3911
+ }
3912
+ }
3913
+ },
3914
+ "type": "object"
3915
+ },
3916
+ "SqlSchema": {
3917
+ "description": "",
3918
+ "required": [],
3919
+ "properties": {
3920
+ "type": {
3921
+ "title": "Type",
3922
+ "description": "Type of the column.",
3923
+ "type": "string",
3924
+ "example": "date"
3925
+ },
3926
+ "array": {
3927
+ "title": "Is array",
3928
+ "description": "Is the column an array?",
3929
+ "type": "boolean",
3930
+ "example": false
3931
+ }
3932
+ },
3933
+ "type": "object"
3934
+ },
3680
3935
  "Stats": {
3681
3936
  "description": "Database-level statistics, including sizes and per-table stats.",
3682
3937
  "required": [
@@ -3879,6 +4134,78 @@
3879
4134
  }
3880
4135
  },
3881
4136
  "type": "object"
4137
+ },
4138
+ "ViewRestore": {
4139
+ "description": "Instructions for recreating stored star views into target schema(s).",
4140
+ "required": [
4141
+ "from"
4142
+ ],
4143
+ "properties": {
4144
+ "from": {
4145
+ "title": "From",
4146
+ "description": "Source schema name(s) to read stored view definitions from.",
4147
+ "type": "array",
4148
+ "items": {
4149
+ "type": "string"
4150
+ },
4151
+ "example": [
4152
+ "my_schema"
4153
+ ]
4154
+ },
4155
+ "to": {
4156
+ "title": "To",
4157
+ "description": "Target schema name(s) the views are (re)created in. Must have the same number of entries as 'from'. Defaults to 'from' when omitted.",
4158
+ "type": "array",
4159
+ "items": {
4160
+ "type": "string"
4161
+ },
4162
+ "example": [
4163
+ "my_other_schema"
4164
+ ]
4165
+ },
4166
+ "include": {
4167
+ "title": "Include",
4168
+ "description": "Optional allow-list of view names. When supplied, only views with these names are recreated.",
4169
+ "type": "array",
4170
+ "items": {
4171
+ "type": "string"
4172
+ },
4173
+ "example": [
4174
+ "my_view"
4175
+ ]
4176
+ }
4177
+ },
4178
+ "type": "object"
4179
+ },
4180
+ "View": {
4181
+ "description": "A stored star view definition. Star views are SELECT-* views whose definitions are kept in the view store so they can be re-created in other schemas.",
4182
+ "properties": {
4183
+ "name": {
4184
+ "title": "Name",
4185
+ "description": "Name of the view.",
4186
+ "type": "string",
4187
+ "example": "my_view"
4188
+ },
4189
+ "schemaname": {
4190
+ "title": "Schema name",
4191
+ "description": "Name of the schema the view belongs to.",
4192
+ "type": "string",
4193
+ "example": "my_schema"
4194
+ },
4195
+ "definition": {
4196
+ "title": "Definition",
4197
+ "description": "The view's SQL definition, with the SELECT list rewritten as a star (*) projection.",
4198
+ "type": "string",
4199
+ "example": "SELECT my_table.* FROM my_schema.my_table"
4200
+ },
4201
+ "ismat": {
4202
+ "title": "Is materialized",
4203
+ "description": "Whether the view is a materialized view.",
4204
+ "type": "boolean",
4205
+ "example": false
4206
+ }
4207
+ },
4208
+ "type": "object"
3882
4209
  }
3883
4210
  },
3884
4211
  "securitySchemes": {
@@ -3952,6 +4279,10 @@
3952
4279
  {
3953
4280
  "name": "Users",
3954
4281
  "description": "Users"
4282
+ },
4283
+ {
4284
+ "name": "View",
4285
+ "description": "View"
3955
4286
  }
3956
4287
  ]
3957
4288
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centia-io/mcp-server",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },