@ancplua/qyl-api-schema 0.5.3 → 0.5.5

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.
package/api/routes.tsp CHANGED
@@ -166,7 +166,7 @@ interface SessionsApi {
166
166
  ...ProjectScopeHeader,
167
167
  @query startTime?: utcDateTime,
168
168
  @query endTime?: utcDateTime,
169
- ): SessionStats | UnauthorizedError | InternalServerError;
169
+ ): SessionStats | ValidationError | UnauthorizedError | InternalServerError;
170
170
  }
171
171
 
172
172
  // -----------------------------------------------------------------------------
package/api/runner.tsp CHANGED
@@ -28,35 +28,35 @@ namespace Qyl.Api.Contracts.Runner {
28
28
  @tag("Runner resources")
29
29
  interface RunnerResourcesApi {
30
30
  @get
31
- snapshot(): RunnerResourceState[] | InternalServerError;
31
+ snapshot(): RunnerResourceState[] | ForbiddenError | InternalServerError;
32
32
 
33
33
  @get
34
34
  @route("/stream")
35
- stream(): SSEStream<RunnerResourceEvents> | InternalServerError;
35
+ stream(): SSEStream<RunnerResourceEvents> | ForbiddenError | InternalServerError;
36
36
 
37
37
  @get
38
38
  @route("/{resource}/logs")
39
39
  logs(
40
40
  @path resource: string,
41
- ): RunnerLogLine[] | NotFoundError | InternalServerError;
41
+ ): RunnerLogLine[] | ForbiddenError | NotFoundError | InternalServerError;
42
42
 
43
43
  @get
44
44
  @route("/{resource}/logs/stream")
45
45
  streamLogs(
46
46
  @path resource: string,
47
- ): SSEStream<RunnerLogEvents> | NotFoundError | InternalServerError;
47
+ ): SSEStream<RunnerLogEvents> | ForbiddenError | NotFoundError | InternalServerError;
48
48
 
49
49
  @post
50
50
  @route("/{resource}/restart")
51
51
  restart(
52
52
  @path resource: string,
53
- ): RunnerActionAccepted | NotFoundError | ConflictError | InternalServerError;
53
+ ): RunnerActionAccepted | ForbiddenError | NotFoundError | ConflictError | InternalServerError;
54
54
 
55
55
  @post
56
56
  @route("/{resource}/stop")
57
57
  stop(
58
58
  @path resource: string,
59
- ): RunnerActionAccepted | NotFoundError | ConflictError | InternalServerError;
59
+ ): RunnerActionAccepted | ForbiddenError | NotFoundError | ConflictError | InternalServerError;
60
60
  }
61
61
 
62
62
  @route("/runner/mcp/{resource}")
@@ -67,6 +67,7 @@ namespace Qyl.Api.Contracts.Runner {
67
67
  listTools(
68
68
  @path resource: string,
69
69
  ): RunnerMcpToolsResponse
70
+ | ForbiddenError
70
71
  | NotFoundError
71
72
  | ConflictError
72
73
  | BadGatewayError
@@ -79,6 +80,7 @@ namespace Qyl.Api.Contracts.Runner {
79
80
  @body request: RunnerMcpToolCallRequest,
80
81
  ): RunnerMcpToolCallResponse
81
82
  | ValidationError
83
+ | ForbiddenError
82
84
  | NotFoundError
83
85
  | ConflictError
84
86
  | BadGatewayError
@@ -91,6 +93,7 @@ namespace Qyl.Api.Contracts.Runner {
91
93
  @body request: RunnerMcpResourceReadRequest,
92
94
  ): RunnerMcpResourceReadResponse
93
95
  | ValidationError
96
+ | ForbiddenError
94
97
  | NotFoundError
95
98
  | ConflictError
96
99
  | BadGatewayError
package/api/streaming.tsp CHANGED
@@ -45,5 +45,5 @@ interface StreamingApi {
45
45
  @query serviceName?: string,
46
46
  @query @minValue(1) @maxValue(24) minSeverity?: int32,
47
47
  @query query?: string,
48
- ): SSEStream<LogEvents> | UnauthorizedError | InternalServerError;
48
+ ): SSEStream<LogEvents> | ValidationError | UnauthorizedError | InternalServerError;
49
49
  }
@@ -1089,6 +1089,32 @@
1089
1089
  }
1090
1090
  }
1091
1091
  },
1092
+ "400": {
1093
+ "description": "Bad request - validation failed (400)",
1094
+ "headers": {
1095
+ "X-Trace-Id": {
1096
+ "required": false,
1097
+ "description": "Trace ID for correlation",
1098
+ "schema": {
1099
+ "type": "string"
1100
+ }
1101
+ },
1102
+ "X-Request-Id": {
1103
+ "required": false,
1104
+ "description": "Request ID for support",
1105
+ "schema": {
1106
+ "type": "string"
1107
+ }
1108
+ }
1109
+ },
1110
+ "content": {
1111
+ "application/problem+json": {
1112
+ "schema": {
1113
+ "$ref": "#/components/schemas/Common.Errors.ValidationError"
1114
+ }
1115
+ }
1116
+ }
1117
+ },
1092
1118
  "401": {
1093
1119
  "description": "Unauthorized - authentication required (401)",
1094
1120
  "headers": {
@@ -1519,6 +1545,32 @@
1519
1545
  }
1520
1546
  }
1521
1547
  },
1548
+ "400": {
1549
+ "description": "Bad request - validation failed (400)",
1550
+ "headers": {
1551
+ "X-Trace-Id": {
1552
+ "required": false,
1553
+ "description": "Trace ID for correlation",
1554
+ "schema": {
1555
+ "type": "string"
1556
+ }
1557
+ },
1558
+ "X-Request-Id": {
1559
+ "required": false,
1560
+ "description": "Request ID for support",
1561
+ "schema": {
1562
+ "type": "string"
1563
+ }
1564
+ }
1565
+ },
1566
+ "content": {
1567
+ "application/problem+json": {
1568
+ "schema": {
1569
+ "$ref": "#/components/schemas/Common.Errors.ValidationError"
1570
+ }
1571
+ }
1572
+ }
1573
+ },
1522
1574
  "401": {
1523
1575
  "description": "Unauthorized - authentication required (401)",
1524
1576
  "headers": {
@@ -2096,6 +2148,32 @@
2096
2148
  }
2097
2149
  }
2098
2150
  },
2151
+ "403": {
2152
+ "description": "Forbidden - insufficient permissions (403)",
2153
+ "headers": {
2154
+ "X-Trace-Id": {
2155
+ "required": false,
2156
+ "description": "Trace ID for correlation",
2157
+ "schema": {
2158
+ "type": "string"
2159
+ }
2160
+ },
2161
+ "X-Request-Id": {
2162
+ "required": false,
2163
+ "description": "Request ID for support",
2164
+ "schema": {
2165
+ "type": "string"
2166
+ }
2167
+ }
2168
+ },
2169
+ "content": {
2170
+ "application/problem+json": {
2171
+ "schema": {
2172
+ "$ref": "#/components/schemas/Common.Errors.ForbiddenError"
2173
+ }
2174
+ }
2175
+ }
2176
+ },
2099
2177
  "404": {
2100
2178
  "description": "Resource not found (404)",
2101
2179
  "headers": {
@@ -2240,6 +2318,32 @@
2240
2318
  }
2241
2319
  }
2242
2320
  },
2321
+ "403": {
2322
+ "description": "Forbidden - insufficient permissions (403)",
2323
+ "headers": {
2324
+ "X-Trace-Id": {
2325
+ "required": false,
2326
+ "description": "Trace ID for correlation",
2327
+ "schema": {
2328
+ "type": "string"
2329
+ }
2330
+ },
2331
+ "X-Request-Id": {
2332
+ "required": false,
2333
+ "description": "Request ID for support",
2334
+ "schema": {
2335
+ "type": "string"
2336
+ }
2337
+ }
2338
+ },
2339
+ "content": {
2340
+ "application/problem+json": {
2341
+ "schema": {
2342
+ "$ref": "#/components/schemas/Common.Errors.ForbiddenError"
2343
+ }
2344
+ }
2345
+ }
2346
+ },
2243
2347
  "404": {
2244
2348
  "description": "Resource not found (404)",
2245
2349
  "headers": {
@@ -2400,6 +2504,32 @@
2400
2504
  }
2401
2505
  }
2402
2506
  },
2507
+ "403": {
2508
+ "description": "Forbidden - insufficient permissions (403)",
2509
+ "headers": {
2510
+ "X-Trace-Id": {
2511
+ "required": false,
2512
+ "description": "Trace ID for correlation",
2513
+ "schema": {
2514
+ "type": "string"
2515
+ }
2516
+ },
2517
+ "X-Request-Id": {
2518
+ "required": false,
2519
+ "description": "Request ID for support",
2520
+ "schema": {
2521
+ "type": "string"
2522
+ }
2523
+ }
2524
+ },
2525
+ "content": {
2526
+ "application/problem+json": {
2527
+ "schema": {
2528
+ "$ref": "#/components/schemas/Common.Errors.ForbiddenError"
2529
+ }
2530
+ }
2531
+ }
2532
+ },
2403
2533
  "404": {
2404
2534
  "description": "Resource not found (404)",
2405
2535
  "headers": {
@@ -2538,6 +2668,32 @@
2538
2668
  }
2539
2669
  }
2540
2670
  },
2671
+ "403": {
2672
+ "description": "Forbidden - insufficient permissions (403)",
2673
+ "headers": {
2674
+ "X-Trace-Id": {
2675
+ "required": false,
2676
+ "description": "Trace ID for correlation",
2677
+ "schema": {
2678
+ "type": "string"
2679
+ }
2680
+ },
2681
+ "X-Request-Id": {
2682
+ "required": false,
2683
+ "description": "Request ID for support",
2684
+ "schema": {
2685
+ "type": "string"
2686
+ }
2687
+ }
2688
+ },
2689
+ "content": {
2690
+ "application/problem+json": {
2691
+ "schema": {
2692
+ "$ref": "#/components/schemas/Common.Errors.ForbiddenError"
2693
+ }
2694
+ }
2695
+ }
2696
+ },
2541
2697
  "500": {
2542
2698
  "description": "Internal server error (500)",
2543
2699
  "headers": {
@@ -2611,6 +2767,32 @@
2611
2767
  }
2612
2768
  }
2613
2769
  },
2770
+ "403": {
2771
+ "description": "Forbidden - insufficient permissions (403)",
2772
+ "headers": {
2773
+ "X-Trace-Id": {
2774
+ "required": false,
2775
+ "description": "Trace ID for correlation",
2776
+ "schema": {
2777
+ "type": "string"
2778
+ }
2779
+ },
2780
+ "X-Request-Id": {
2781
+ "required": false,
2782
+ "description": "Request ID for support",
2783
+ "schema": {
2784
+ "type": "string"
2785
+ }
2786
+ }
2787
+ },
2788
+ "content": {
2789
+ "application/problem+json": {
2790
+ "schema": {
2791
+ "$ref": "#/components/schemas/Common.Errors.ForbiddenError"
2792
+ }
2793
+ }
2794
+ }
2795
+ },
2614
2796
  "500": {
2615
2797
  "description": "Internal server error (500)",
2616
2798
  "headers": {
@@ -2670,6 +2852,32 @@
2670
2852
  }
2671
2853
  }
2672
2854
  },
2855
+ "403": {
2856
+ "description": "Forbidden - insufficient permissions (403)",
2857
+ "headers": {
2858
+ "X-Trace-Id": {
2859
+ "required": false,
2860
+ "description": "Trace ID for correlation",
2861
+ "schema": {
2862
+ "type": "string"
2863
+ }
2864
+ },
2865
+ "X-Request-Id": {
2866
+ "required": false,
2867
+ "description": "Request ID for support",
2868
+ "schema": {
2869
+ "type": "string"
2870
+ }
2871
+ }
2872
+ },
2873
+ "content": {
2874
+ "application/problem+json": {
2875
+ "schema": {
2876
+ "$ref": "#/components/schemas/Common.Errors.ForbiddenError"
2877
+ }
2878
+ }
2879
+ }
2880
+ },
2673
2881
  "404": {
2674
2882
  "description": "Resource not found (404)",
2675
2883
  "headers": {
@@ -2778,6 +2986,32 @@
2778
2986
  }
2779
2987
  }
2780
2988
  },
2989
+ "403": {
2990
+ "description": "Forbidden - insufficient permissions (403)",
2991
+ "headers": {
2992
+ "X-Trace-Id": {
2993
+ "required": false,
2994
+ "description": "Trace ID for correlation",
2995
+ "schema": {
2996
+ "type": "string"
2997
+ }
2998
+ },
2999
+ "X-Request-Id": {
3000
+ "required": false,
3001
+ "description": "Request ID for support",
3002
+ "schema": {
3003
+ "type": "string"
3004
+ }
3005
+ }
3006
+ },
3007
+ "content": {
3008
+ "application/problem+json": {
3009
+ "schema": {
3010
+ "$ref": "#/components/schemas/Common.Errors.ForbiddenError"
3011
+ }
3012
+ }
3013
+ }
3014
+ },
2781
3015
  "404": {
2782
3016
  "description": "Resource not found (404)",
2783
3017
  "headers": {
@@ -2853,6 +3087,32 @@
2853
3087
  "202": {
2854
3088
  "description": "A runner lifecycle action was accepted and continues asynchronously."
2855
3089
  },
3090
+ "403": {
3091
+ "description": "Forbidden - insufficient permissions (403)",
3092
+ "headers": {
3093
+ "X-Trace-Id": {
3094
+ "required": false,
3095
+ "description": "Trace ID for correlation",
3096
+ "schema": {
3097
+ "type": "string"
3098
+ }
3099
+ },
3100
+ "X-Request-Id": {
3101
+ "required": false,
3102
+ "description": "Request ID for support",
3103
+ "schema": {
3104
+ "type": "string"
3105
+ }
3106
+ }
3107
+ },
3108
+ "content": {
3109
+ "application/problem+json": {
3110
+ "schema": {
3111
+ "$ref": "#/components/schemas/Common.Errors.ForbiddenError"
3112
+ }
3113
+ }
3114
+ }
3115
+ },
2856
3116
  "404": {
2857
3117
  "description": "Resource not found (404)",
2858
3118
  "headers": {
@@ -2954,6 +3214,32 @@
2954
3214
  "202": {
2955
3215
  "description": "A runner lifecycle action was accepted and continues asynchronously."
2956
3216
  },
3217
+ "403": {
3218
+ "description": "Forbidden - insufficient permissions (403)",
3219
+ "headers": {
3220
+ "X-Trace-Id": {
3221
+ "required": false,
3222
+ "description": "Trace ID for correlation",
3223
+ "schema": {
3224
+ "type": "string"
3225
+ }
3226
+ },
3227
+ "X-Request-Id": {
3228
+ "required": false,
3229
+ "description": "Request ID for support",
3230
+ "schema": {
3231
+ "type": "string"
3232
+ }
3233
+ }
3234
+ },
3235
+ "content": {
3236
+ "application/problem+json": {
3237
+ "schema": {
3238
+ "$ref": "#/components/schemas/Common.Errors.ForbiddenError"
3239
+ }
3240
+ }
3241
+ }
3242
+ },
2957
3243
  "404": {
2958
3244
  "description": "Resource not found (404)",
2959
3245
  "headers": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancplua/qyl-api-schema",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "TypeSpec source of truth for qyl API contracts. Emits OpenAPI, JSON Schema, Qyl.Api.Contracts DTOs, and TypeScript contract types; not an OpenTelemetry package, storage schema, or server implementation.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -88,7 +88,8 @@
88
88
  "watch": "tsp compile main.tsp --watch",
89
89
  "format": "tsp format **/*.tsp",
90
90
  "lint": "npm run build:emitters && tsp compile main.tsp --no-emit --warn-as-error",
91
- "lint:public": "tsp compile index.tsp --no-emit --warn-as-error"
91
+ "lint:public": "tsp compile index.tsp --no-emit --warn-as-error",
92
+ "verify:routes": "node scripts/verify-route-contracts.mjs"
92
93
  },
93
94
  "peerDependencies": {
94
95
  "@typespec/compiler": "^1.13.0 || >=1.13.0-dev.0",