@ancplua/qyl-api-schema 9.0.0 → 10.0.1

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/README.md CHANGED
@@ -4,20 +4,16 @@ The TypeSpec source of truth for Qyl's client-visible product API. This reposito
4
4
  emits the public schema and contract artifacts; it does not implement the server,
5
5
  storage engine, or OTLP receiver.
6
6
 
7
- Qyl stores and exposes traces and logs. Metrics are accepted and discarded only by
8
- the collector's OTLP wire-compatibility handlers, so this product contract exposes
9
- no metric DTOs or routes. Profiles are not supported.
7
+ Qyl stores and exposes traces, logs, and metrics. The metric surface is read-only.
8
+ `GET /api/v1/metrics` lists the metric descriptors recorded for a project,
9
+ `GET /api/v1/metrics/{metric_name}/series` lists the distinct attribute streams
10
+ under one metric name, and `GET /api/v1/metrics/{metric_name}/query` aggregates one
11
+ metric over a time range into buckets. Metric points are written over OTLP, which
12
+ this contract does not describe. Profiles are not supported.
10
13
 
11
14
  ## Contract pipeline
12
15
 
13
16
  ```text
14
- Qyl.Telemetry.SemanticConventions
15
- |
16
- | generated semantic key projection
17
- v
18
- generated/otel-keys.gen.tsp
19
- |
20
- v
21
17
  authored Qyl TypeSpec
22
18
  |
23
19
  +----> OpenAPI ----> bundled JSON Schema
@@ -25,9 +21,10 @@ authored Qyl TypeSpec
25
21
  +----> generated TypeScript contracts
26
22
  ```
27
23
 
28
- The semantic-key projection is generated from the sibling conventions repository's
29
- pinned core and GenAI registries. It supplies typed names for telemetry attributes;
30
24
  Qyl domain models, routes, responses, stream events, and errors are authored here.
25
+ The OTel-compatible models target schema `https://opentelemetry.io/schemas/1.44.0`;
26
+ attribute keys cross the wire as open string maps, so this contract carries no
27
+ enumeration of the OpenTelemetry attribute registry.
31
28
 
32
29
  ## Boundary
33
30
 
@@ -91,39 +88,9 @@ contract instead of discovering the mismatch one malformed field at a time. Read
91
88
  current value from a running collector or the generated artifacts; it is derived, never
92
89
  hand-maintained.
93
90
 
94
- ## Develop
95
-
96
- Development and CI use Node.js 24 LTS. Published npm artifacts support maintained
97
- Node.js releases from 22 onward.
98
-
99
- ```bash
100
- npm ci
101
- npm run lint
102
- npm run lint:public
103
- npm run compile
104
- ./build.sh Check
105
- ```
106
-
107
- Important generated outputs include:
108
-
109
- - `generated/openapi/qyl.openapi.json`
110
- - `generated/json-schema/qyl-api-schema.json`
111
- - `generated/contracts/**/*.cs`
112
- - `generated/ts-types/**`
113
-
114
- Generated files are not editing surfaces. OpenAPI comes from the official TypeSpec
115
- emitter; the bundled JSON Schema is a deterministic projection of its component
116
- schemas and exposes inline route bodies as stable
117
- `Operations.<operationId>.Request` and
118
- `Operations.<operationId>.Response.<status>` definitions. Both artifacts preserve
119
- the same wire names. Change TypeSpec or the owning generator and regenerate.
120
-
121
- ## Publish
91
+ ## Contributing
122
92
 
123
- GitHub Actions publishes both registries through OIDC trusted publishing. A release
124
- tag supplies one version for npm and NuGet. The workflow validates and packs first,
125
- publishes in an ordered restartable sequence, waits for indexed artifacts, and then
126
- smokes clean consumers. No long-lived npm or NuGet token is stored.
93
+ How to build, lint, regenerate and publish is in [CONTRIBUTING.md](CONTRIBUTING.md).
127
94
 
128
95
  ## License
129
96
 
package/common/types.tsp CHANGED
@@ -2,7 +2,7 @@
2
2
  // qyl common types and scalars
3
3
  // =============================================================================
4
4
  // Foundational types used across qyl API contracts and OTel-compatible models.
5
- // OpenTelemetry registry provenance is owned by generated/otel-keys.gen.tsp.
5
+ // The contract targets OpenTelemetry semantic conventions schema https://opentelemetry.io/schemas/1.44.0.
6
6
  // =============================================================================
7
7
 
8
8
  import "@typespec/openapi";
@@ -14,16 +14,12 @@ namespace Qyl.Api.Contracts.Common;
14
14
  // =============================================================================
15
15
  // Identifier Scalars - Strongly Typed IDs
16
16
  // =============================================================================
17
- // The semantic-conventions pin lives in the generated keys header and is
18
- // machine-checked; a hand-maintained enum of upstream releases would only drift.
19
17
 
20
18
  @doc("Unique trace identifier (32 lowercase hex characters)")
21
19
  @pattern("^[a-f0-9]{32}$")
22
20
  @minLength(32)
23
21
  @maxLength(32)
24
22
  @example("0af7651916cd43dd8448eb211c80319c")
25
- @TypeSpec.OpenAPI.extension("x-csharp-struct", true)
26
- @TypeSpec.OpenAPI.extension("x-csharp-type", "TraceId")
27
23
  scalar TraceId extends string;
28
24
 
29
25
  @doc("Unique span identifier (16 lowercase hex characters)")
@@ -31,8 +27,6 @@ scalar TraceId extends string;
31
27
  @minLength(16)
32
28
  @maxLength(16)
33
29
  @example("b7ad6b7169203331")
34
- @TypeSpec.OpenAPI.extension("x-csharp-struct", true)
35
- @TypeSpec.OpenAPI.extension("x-csharp-type", "SpanId")
36
30
  scalar SpanId extends string;
37
31
 
38
32
  @doc("W3C Trace Context traceparent header format")
@@ -47,8 +41,6 @@ scalar TraceState extends string;
47
41
  @doc("Unique session identifier")
48
42
  @minLength(1)
49
43
  @maxLength(128)
50
- @TypeSpec.OpenAPI.extension("x-csharp-struct", true)
51
- @TypeSpec.OpenAPI.extension("x-csharp-type", "SessionId")
52
44
  scalar SessionId extends string;
53
45
 
54
46
  @doc("User identifier (pseudonymized for privacy)")
@@ -911,9 +911,7 @@
911
911
  "type": "string",
912
912
  "minLength": 1,
913
913
  "maxLength": 128,
914
- "description": "Unique session identifier",
915
- "x-csharp-type": "SessionId",
916
- "x-csharp-struct": true
914
+ "description": "Unique session identifier"
917
915
  },
918
916
  "Common.Sha256Hash": {
919
917
  "type": "string",
@@ -930,9 +928,7 @@
930
928
  "description": "Unique span identifier (16 lowercase hex characters)",
931
929
  "examples": [
932
930
  "b7ad6b7169203331"
933
- ],
934
- "x-csharp-type": "SpanId",
935
- "x-csharp-struct": true
931
+ ]
936
932
  },
937
933
  "Common.Temperature": {
938
934
  "type": "number",
@@ -962,9 +958,7 @@
962
958
  "description": "Unique trace identifier (32 lowercase hex characters)",
963
959
  "examples": [
964
960
  "0af7651916cd43dd8448eb211c80319c"
965
- ],
966
- "x-csharp-type": "TraceId",
967
- "x-csharp-struct": true
961
+ ]
968
962
  },
969
963
  "Common.TraceParent": {
970
964
  "type": "string",
@@ -13892,9 +13892,7 @@
13892
13892
  "type": "string",
13893
13893
  "minLength": 1,
13894
13894
  "maxLength": 128,
13895
- "description": "Unique session identifier",
13896
- "x-csharp-type": "SessionId",
13897
- "x-csharp-struct": true
13895
+ "description": "Unique session identifier"
13898
13896
  },
13899
13897
  "Common.Sha256Hash": {
13900
13898
  "type": "string",
@@ -13911,9 +13909,7 @@
13911
13909
  "description": "Unique span identifier (16 lowercase hex characters)",
13912
13910
  "examples": [
13913
13911
  "b7ad6b7169203331"
13914
- ],
13915
- "x-csharp-type": "SpanId",
13916
- "x-csharp-struct": true
13912
+ ]
13917
13913
  },
13918
13914
  "Common.Temperature": {
13919
13915
  "type": "number",
@@ -13943,9 +13939,7 @@
13943
13939
  "description": "Unique trace identifier (32 lowercase hex characters)",
13944
13940
  "examples": [
13945
13941
  "0af7651916cd43dd8448eb211c80319c"
13946
- ],
13947
- "x-csharp-type": "TraceId",
13948
- "x-csharp-struct": true
13942
+ ]
13949
13943
  },
13950
13944
  "Common.TraceParent": {
13951
13945
  "type": "string",
@@ -320,4 +320,4 @@ export const FetchTelemetryViewValues = {
320
320
  };
321
321
  // --- contract revision (scripts/emit-contract-revision.mjs) ---
322
322
  /** Revision of the API contract these types were emitted from; compare against HealthReport.contract_revision. */
323
- export const CONTRACT_REVISION = "sha256:d1c859393b628164";
323
+ export const CONTRACT_REVISION = "sha256:cd69d9c37a41916c";
package/index.tsp CHANGED
@@ -6,8 +6,6 @@ import "@typespec/http";
6
6
  import "@typespec/openapi";
7
7
  import "@typespec/sse";
8
8
 
9
- import "./generated/otel-keys.gen.tsp";
10
-
11
9
  import "./common/types.tsp";
12
10
  import "./common/errors.tsp";
13
11
  import "./common/pagination.tsp";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancplua/qyl-api-schema",
3
- "version": "9.0.0",
3
+ "version": "10.0.1",
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": {
@@ -32,10 +32,6 @@
32
32
  "typespec": "./otel/otel-conventions.tsp",
33
33
  "default": "./otel/otel-conventions.tsp"
34
34
  },
35
- "./generated/otel-keys": {
36
- "typespec": "./generated/otel-keys.gen.tsp",
37
- "default": "./generated/otel-keys.gen.tsp"
38
- },
39
35
  "./types": {
40
36
  "types": "./generated/ts-runtime/api.d.ts",
41
37
  "import": "./generated/ts-runtime/api.js",
@@ -72,7 +68,6 @@
72
68
  "otel/otel-conventions.tsp",
73
69
  "otel/resource.tsp",
74
70
  "otel/span.tsp",
75
- "generated/otel-keys.gen.tsp",
76
71
  "generated/ts-runtime/api.d.ts",
77
72
  "generated/ts-runtime/api.js",
78
73
  "generated/openapi/qyl.openapi.json",
@@ -107,11 +102,11 @@
107
102
  },
108
103
  "peerDependencies": {
109
104
  "@typespec/compiler": "^1.13.0 || >=1.13.0-dev.0",
110
- "@typespec/events": "^0.83.0 || ^0.84.0 || ^0.85.0",
105
+ "@typespec/events": "^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.86.0",
111
106
  "@typespec/http": "^1.13.0",
112
107
  "@typespec/openapi": "^1.13.0",
113
108
  "@typespec/openapi3": "^1.13.0",
114
- "@typespec/sse": ">=0.83.0 <0.86.0",
109
+ "@typespec/sse": ">=0.83.0 <0.87.0",
115
110
  "zod": ">=4.5.0 <5"
116
111
  },
117
112
  "peerDependenciesMeta": {
@@ -141,13 +136,13 @@
141
136
  "@ancplua/typespec-emit-csharp": "file:./emitters/csharp",
142
137
  "@ancplua/typespec-emit-ts-types": "file:./emitters/ts-types",
143
138
  "@ancplua/typespec-qyl-lint": "file:./emitters/qyl-lint",
144
- "@types/node": "26.3.0",
145
- "@typespec/compiler": "1.15.0",
146
- "@typespec/events": "0.85.0",
147
- "@typespec/http": "1.15.0",
148
- "@typespec/openapi": "1.15.0",
149
- "@typespec/openapi3": "1.15.0",
150
- "@typespec/sse": "0.85.0",
139
+ "@types/node": "26.4.1",
140
+ "@typespec/compiler": "1.16.0",
141
+ "@typespec/events": "0.86.0",
142
+ "@typespec/http": "1.16.0",
143
+ "@typespec/openapi": "1.16.0",
144
+ "@typespec/openapi3": "1.16.0",
145
+ "@typespec/sse": "0.86.0",
151
146
  "ajv": "8.20.0",
152
147
  "typescript": "7.0.2",
153
148
  "zod": "4.5.4"