@gate-forge/http-contract 0.7.1 → 0.9.0
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/dist/codes.d.ts +13 -1
- package/dist/codes.d.ts.map +1 -1
- package/dist/codes.js +13 -0
- package/dist/codes.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/schema.d.ts +25 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +38 -0
- package/dist/schema.js.map +1 -1
- package/package.json +1 -1
package/dist/codes.d.ts
CHANGED
|
@@ -30,6 +30,18 @@ export declare const FRONTEND_ROUTE_AMBIGUOUS = "FRONTEND_ROUTE_AMBIGUOUS";
|
|
|
30
30
|
export declare const ENDPOINT_SEMANTICS_UNRESOLVED = "ENDPOINT_SEMANTICS_UNRESOLVED";
|
|
31
31
|
/** An endpoint that cannot be linked to exactly one business resource. */
|
|
32
32
|
export declare const ENDPOINT_RESOURCE_LINK_UNRESOLVED = "ENDPOINT_RESOURCE_LINK_UNRESOLVED";
|
|
33
|
+
/**
|
|
34
|
+
* An endpoint whose path-derived resource name names NO discovered
|
|
35
|
+
* business resource. Silence here is what made a real by-id route
|
|
36
|
+
* (`GET /api/v1/reports/logs/{}`, served by a `report_logs` table) look
|
|
37
|
+
* like it did not exist. The entry carries the near matches among the
|
|
38
|
+
* discovered names — last `_`-segment or suffix equal to the candidate,
|
|
39
|
+
* singular/plural variants included — as CANDIDATES for the owner: it
|
|
40
|
+
* never links one. Same posture as its sibling
|
|
41
|
+
* {@link ENDPOINT_RESOURCE_LINK_UNRESOLVED}: a linkage this pass cannot
|
|
42
|
+
* prove is a typed blocking entry, not silence.
|
|
43
|
+
*/
|
|
44
|
+
export declare const ENDPOINT_RESOURCE_CANDIDATE_UNMATCHED = "ENDPOINT_RESOURCE_CANDIDATE_UNMATCHED";
|
|
33
45
|
/**
|
|
34
46
|
* Two `.gateforge/endpoints.json` capability rules match one endpoint
|
|
35
47
|
* identity and assert DIFFERENT capabilities — the declarative channel
|
|
@@ -43,6 +55,6 @@ export declare const ENDPOINT_CAPABILITY_CONTRADICTION = "ENDPOINT_CAPABILITY_CO
|
|
|
43
55
|
*/
|
|
44
56
|
export declare const HTTP_OBSERVATION_UNTRUSTED = "HTTP_OBSERVATION_UNTRUSTED";
|
|
45
57
|
/** Every typed outcome code defined by this package. */
|
|
46
|
-
export declare const HTTP_BLOCK_CODES: readonly ["HTTP_PATH_DYNAMIC", "HTTP_METHOD_DYNAMIC", "FASTAPI_PREFIX_UNRESOLVED", "FRONTEND_CALL_TARGET_UNRESOLVED", "FRONTEND_ROUTE_UNWIRED", "FRONTEND_ROUTE_AMBIGUOUS", "ENDPOINT_SEMANTICS_UNRESOLVED", "ENDPOINT_RESOURCE_LINK_UNRESOLVED", "ENDPOINT_CAPABILITY_CONTRADICTION", "HTTP_OBSERVATION_UNTRUSTED"];
|
|
58
|
+
export declare const HTTP_BLOCK_CODES: readonly ["HTTP_PATH_DYNAMIC", "HTTP_METHOD_DYNAMIC", "FASTAPI_PREFIX_UNRESOLVED", "FRONTEND_CALL_TARGET_UNRESOLVED", "FRONTEND_ROUTE_UNWIRED", "FRONTEND_ROUTE_AMBIGUOUS", "ENDPOINT_SEMANTICS_UNRESOLVED", "ENDPOINT_RESOURCE_LINK_UNRESOLVED", "ENDPOINT_RESOURCE_CANDIDATE_UNMATCHED", "ENDPOINT_CAPABILITY_CONTRADICTION", "HTTP_OBSERVATION_UNTRUSTED"];
|
|
47
59
|
export type HttpBlockCode = (typeof HTTP_BLOCK_CODES)[number];
|
|
48
60
|
//# sourceMappingURL=codes.d.ts.map
|
package/dist/codes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../src/codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,yEAAyE;AACzE,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O,MAAM,iCAAiC,sCAAsC,CAAC;AAErF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,+VAYnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/codes.js
CHANGED
|
@@ -30,6 +30,18 @@ export const FRONTEND_ROUTE_AMBIGUOUS = 'FRONTEND_ROUTE_AMBIGUOUS';
|
|
|
30
30
|
export const ENDPOINT_SEMANTICS_UNRESOLVED = 'ENDPOINT_SEMANTICS_UNRESOLVED';
|
|
31
31
|
/** An endpoint that cannot be linked to exactly one business resource. */
|
|
32
32
|
export const ENDPOINT_RESOURCE_LINK_UNRESOLVED = 'ENDPOINT_RESOURCE_LINK_UNRESOLVED';
|
|
33
|
+
/**
|
|
34
|
+
* An endpoint whose path-derived resource name names NO discovered
|
|
35
|
+
* business resource. Silence here is what made a real by-id route
|
|
36
|
+
* (`GET /api/v1/reports/logs/{}`, served by a `report_logs` table) look
|
|
37
|
+
* like it did not exist. The entry carries the near matches among the
|
|
38
|
+
* discovered names — last `_`-segment or suffix equal to the candidate,
|
|
39
|
+
* singular/plural variants included — as CANDIDATES for the owner: it
|
|
40
|
+
* never links one. Same posture as its sibling
|
|
41
|
+
* {@link ENDPOINT_RESOURCE_LINK_UNRESOLVED}: a linkage this pass cannot
|
|
42
|
+
* prove is a typed blocking entry, not silence.
|
|
43
|
+
*/
|
|
44
|
+
export const ENDPOINT_RESOURCE_CANDIDATE_UNMATCHED = 'ENDPOINT_RESOURCE_CANDIDATE_UNMATCHED';
|
|
33
45
|
/**
|
|
34
46
|
* Two `.gateforge/endpoints.json` capability rules match one endpoint
|
|
35
47
|
* identity and assert DIFFERENT capabilities — the declarative channel
|
|
@@ -52,6 +64,7 @@ export const HTTP_BLOCK_CODES = [
|
|
|
52
64
|
FRONTEND_ROUTE_AMBIGUOUS,
|
|
53
65
|
ENDPOINT_SEMANTICS_UNRESOLVED,
|
|
54
66
|
ENDPOINT_RESOURCE_LINK_UNRESOLVED,
|
|
67
|
+
ENDPOINT_RESOURCE_CANDIDATE_UNMATCHED,
|
|
55
68
|
ENDPOINT_CAPABILITY_CONTRADICTION,
|
|
56
69
|
HTTP_OBSERVATION_UNTRUSTED,
|
|
57
70
|
];
|
package/dist/codes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codes.js","sourceRoot":"","sources":["../src/codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,yEAAyE;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAErD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAEzD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AAErE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,+BAA+B,GAAG,iCAAiC,CAAC;AAEjF,sDAAsD;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAEnE,0EAA0E;AAC1E,MAAM,CAAC,MAAM,6BAA6B,GAAG,+BAA+B,CAAC;AAE7E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,iCAAiC,GAAG,mCAAmC,CAAC;AAErF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,mCAAmC,CAAC;AAErF;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAC;AAEvE,wDAAwD;AACxD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,iBAAiB;IACjB,mBAAmB;IACnB,yBAAyB;IACzB,+BAA+B;IAC/B,sBAAsB;IACtB,wBAAwB;IACxB,6BAA6B;IAC7B,iCAAiC;IACjC,iCAAiC;IACjC,0BAA0B;CAClB,CAAC"}
|
|
1
|
+
{"version":3,"file":"codes.js","sourceRoot":"","sources":["../src/codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,yEAAyE;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAErD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAEzD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AAErE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,+BAA+B,GAAG,iCAAiC,CAAC;AAEjF,sDAAsD;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAEnE,0EAA0E;AAC1E,MAAM,CAAC,MAAM,6BAA6B,GAAG,+BAA+B,CAAC;AAE7E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,iCAAiC,GAAG,mCAAmC,CAAC;AAErF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,uCAAuC,CAAC;AAE7F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,mCAAmC,CAAC;AAErF;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAC;AAEvE,wDAAwD;AACxD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,iBAAiB;IACjB,mBAAmB;IACnB,yBAAyB;IACzB,+BAA+B;IAC/B,sBAAsB;IACtB,wBAAwB;IACxB,6BAA6B;IAC7B,iCAAiC;IACjC,qCAAqC;IACrC,iCAAiC;IACjC,0BAA0B;CAClB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* that), no classification (core owns that), no I/O. Everything is a pure
|
|
8
8
|
* function so identical inputs produce byte-identical outputs.
|
|
9
9
|
*/
|
|
10
|
-
export { FASTAPI_PREFIX_UNRESOLVED, FRONTEND_CALL_TARGET_UNRESOLVED, FRONTEND_ROUTE_AMBIGUOUS, FRONTEND_ROUTE_UNWIRED, ENDPOINT_CAPABILITY_CONTRADICTION, ENDPOINT_RESOURCE_LINK_UNRESOLVED, ENDPOINT_SEMANTICS_UNRESOLVED, HTTP_METHOD_DYNAMIC, HTTP_OBSERVATION_UNTRUSTED, HTTP_PATH_DYNAMIC, HTTP_BLOCK_CODES, type HttpBlockCode, } from './codes.js';
|
|
11
|
-
export { HTTP_CONTRACT_SCHEMA_VERSION, HTTP_CONTRACT_KIND, HTTP_ENDPOINT_KIND, HTTP_METHODS, HttpContractFactSchema, HttpContractRoleSchema, HttpContractSchemaVersionField, HttpLocationSchema, HttpMethodSchema, type HttpContractFact, type HttpContractRole, type HttpLocation, type HttpMethod, } from './schema.js';
|
|
10
|
+
export { FASTAPI_PREFIX_UNRESOLVED, FRONTEND_CALL_TARGET_UNRESOLVED, FRONTEND_ROUTE_AMBIGUOUS, FRONTEND_ROUTE_UNWIRED, ENDPOINT_CAPABILITY_CONTRADICTION, ENDPOINT_RESOURCE_LINK_UNRESOLVED, ENDPOINT_RESOURCE_CANDIDATE_UNMATCHED, ENDPOINT_SEMANTICS_UNRESOLVED, HTTP_METHOD_DYNAMIC, HTTP_OBSERVATION_UNTRUSTED, HTTP_PATH_DYNAMIC, HTTP_BLOCK_CODES, type HttpBlockCode, } from './codes.js';
|
|
11
|
+
export { HTTP_CONTRACT_SCHEMA_VERSION, HTTP_CONTRACT_KIND, HTTP_ENDPOINT_KIND, HTTP_METHODS, HttpContractFactSchema, HttpContractRoleSchema, HttpContractSchemaVersionField, HttpLocationSchema, HttpMethodSchema, ResponseReadSchema, type HttpContractFact, type HttpContractRole, type HttpLocation, type HttpMethod, type ResponseRead, } from './schema.js';
|
|
12
12
|
export { HTTP_CONTRACT_VERSION, } from './version.js';
|
|
13
13
|
export { HTTP_PARAM_SLOT, HTTP_WILDCARD_SLOT, normalizeHttpMethod, normalizeHttpPath, pathSegments, type NormalizePathDynamic, type NormalizePathOk, type NormalizePathOptions, type NormalizePathResult, } from './normalize.js';
|
|
14
14
|
export { canonicalEndpointIdentity, endpointResourceName, joinFrontendCalls, routeMatchKind, routeMatchesCall, type EndpointIdentity, type JoinBlock, type JoinedEndpoint, type JoinResult, type RouteMatchKind, } from './join.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,wBAAwB,EACxB,sBAAsB,EACtB,iCAAiC,EACjC,iCAAiC,EACjC,6BAA6B,EAC7B,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,wBAAwB,EACxB,sBAAsB,EACtB,iCAAiC,EACjC,iCAAiC,EACjC,qCAAqC,EACrC,6BAA6B,EAC7B,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,cAAc,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* that), no classification (core owns that), no I/O. Everything is a pure
|
|
8
8
|
* function so identical inputs produce byte-identical outputs.
|
|
9
9
|
*/
|
|
10
|
-
export { FASTAPI_PREFIX_UNRESOLVED, FRONTEND_CALL_TARGET_UNRESOLVED, FRONTEND_ROUTE_AMBIGUOUS, FRONTEND_ROUTE_UNWIRED, ENDPOINT_CAPABILITY_CONTRADICTION, ENDPOINT_RESOURCE_LINK_UNRESOLVED, ENDPOINT_SEMANTICS_UNRESOLVED, HTTP_METHOD_DYNAMIC, HTTP_OBSERVATION_UNTRUSTED, HTTP_PATH_DYNAMIC, HTTP_BLOCK_CODES, } from './codes.js';
|
|
11
|
-
export { HTTP_CONTRACT_SCHEMA_VERSION, HTTP_CONTRACT_KIND, HTTP_ENDPOINT_KIND, HTTP_METHODS, HttpContractFactSchema, HttpContractRoleSchema, HttpContractSchemaVersionField, HttpLocationSchema, HttpMethodSchema, } from './schema.js';
|
|
10
|
+
export { FASTAPI_PREFIX_UNRESOLVED, FRONTEND_CALL_TARGET_UNRESOLVED, FRONTEND_ROUTE_AMBIGUOUS, FRONTEND_ROUTE_UNWIRED, ENDPOINT_CAPABILITY_CONTRADICTION, ENDPOINT_RESOURCE_LINK_UNRESOLVED, ENDPOINT_RESOURCE_CANDIDATE_UNMATCHED, ENDPOINT_SEMANTICS_UNRESOLVED, HTTP_METHOD_DYNAMIC, HTTP_OBSERVATION_UNTRUSTED, HTTP_PATH_DYNAMIC, HTTP_BLOCK_CODES, } from './codes.js';
|
|
11
|
+
export { HTTP_CONTRACT_SCHEMA_VERSION, HTTP_CONTRACT_KIND, HTTP_ENDPOINT_KIND, HTTP_METHODS, HttpContractFactSchema, HttpContractRoleSchema, HttpContractSchemaVersionField, HttpLocationSchema, HttpMethodSchema, ResponseReadSchema, } from './schema.js';
|
|
12
12
|
export { HTTP_CONTRACT_VERSION, } from './version.js';
|
|
13
13
|
export { HTTP_PARAM_SLOT, HTTP_WILDCARD_SLOT, normalizeHttpMethod, normalizeHttpPath, pathSegments, } from './normalize.js';
|
|
14
14
|
export { canonicalEndpointIdentity, endpointResourceName, joinFrontendCalls, routeMatchKind, routeMatchesCall, } from './join.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,wBAAwB,EACxB,sBAAsB,EACtB,iCAAiC,EACjC,iCAAiC,EACjC,6BAA6B,EAC7B,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,GAEjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,kBAAkB,EAClB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,wBAAwB,EACxB,sBAAsB,EACtB,iCAAiC,EACjC,iCAAiC,EACjC,qCAAqC,EACrC,6BAA6B,EAC7B,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,GAEjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GAMnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,GAKb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,GAMjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/schema.d.ts
CHANGED
|
@@ -43,6 +43,21 @@ export declare const HttpLocationSchema: z.ZodObject<{
|
|
|
43
43
|
col: z.ZodNumber;
|
|
44
44
|
}, z.core.$strict>;
|
|
45
45
|
export type HttpLocation = z.infer<typeof HttpLocationSchema>;
|
|
46
|
+
/**
|
|
47
|
+
* One field a frontend call site reads off a call's response: the field
|
|
48
|
+
* name exactly as the code writes it, and where that read happens. Pure
|
|
49
|
+
* evidence — the fact never decides anything on its own.
|
|
50
|
+
*/
|
|
51
|
+
export declare const ResponseReadSchema: z.ZodObject<{
|
|
52
|
+
field: z.ZodString;
|
|
53
|
+
location: z.ZodObject<{
|
|
54
|
+
file: z.ZodString;
|
|
55
|
+
line: z.ZodNumber;
|
|
56
|
+
col: z.ZodNumber;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
chain: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
export type ResponseRead = z.infer<typeof ResponseReadSchema>;
|
|
46
61
|
/**
|
|
47
62
|
* One discovered HTTP surface. Strict: unknown fields are rejected so a
|
|
48
63
|
* detector cannot smuggle unversioned payloads through the join.
|
|
@@ -69,6 +84,16 @@ export declare const HttpContractFactSchema: z.ZodObject<{
|
|
|
69
84
|
handlerSymbol: z.ZodOptional<z.ZodString>;
|
|
70
85
|
requestSchemaSymbols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
71
86
|
responseSchemaSymbols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
87
|
+
responseModelFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
|
+
responseReads: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
89
|
+
field: z.ZodString;
|
|
90
|
+
location: z.ZodObject<{
|
|
91
|
+
file: z.ZodString;
|
|
92
|
+
line: z.ZodNumber;
|
|
93
|
+
col: z.ZodNumber;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
chain: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
}, z.core.$strict>>>;
|
|
72
97
|
callsites: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
73
98
|
source: z.ZodObject<{
|
|
74
99
|
file: z.ZodString;
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gDAAgD;AACh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MAAM,CAAC,CAAC;AAElE,uEAAuE;AACvE,eAAO,MAAM,kBAAkB;;;;kBAMpB,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;kBAcpB,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAwCxB,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAElD,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,kBAAkB,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -41,6 +41,26 @@ export const HttpLocationSchema = z
|
|
|
41
41
|
col: z.number().int().min(0),
|
|
42
42
|
})
|
|
43
43
|
.strict();
|
|
44
|
+
/**
|
|
45
|
+
* One field a frontend call site reads off a call's response: the field
|
|
46
|
+
* name exactly as the code writes it, and where that read happens. Pure
|
|
47
|
+
* evidence — the fact never decides anything on its own.
|
|
48
|
+
*/
|
|
49
|
+
export const ResponseReadSchema = z
|
|
50
|
+
.object({
|
|
51
|
+
field: z.string().min(1),
|
|
52
|
+
location: HttpLocationSchema,
|
|
53
|
+
/**
|
|
54
|
+
* Index of the `||` / `??` fallback chain this operand belongs to, in
|
|
55
|
+
* source order within the call; absent for a read that stands alone.
|
|
56
|
+
* The operands of one chain are ONE decision about ONE result, so the
|
|
57
|
+
* response-model check judges them together: when a chain reads a
|
|
58
|
+
* declared field, its other operands are the defensive fallbacks and
|
|
59
|
+
* no field is missing.
|
|
60
|
+
*/
|
|
61
|
+
chain: z.number().int().min(0).optional(),
|
|
62
|
+
})
|
|
63
|
+
.strict();
|
|
44
64
|
/**
|
|
45
65
|
* One discovered HTTP surface. Strict: unknown fields are rejected so a
|
|
46
66
|
* detector cannot smuggle unversioned payloads through the join.
|
|
@@ -62,6 +82,24 @@ export const HttpContractFactSchema = z
|
|
|
62
82
|
requestSchemaSymbols: z.array(z.string().min(1)).min(1).optional(),
|
|
63
83
|
/** Response model symbols (server-route facts). */
|
|
64
84
|
responseSchemaSymbols: z.array(z.string().min(1)).min(1).optional(),
|
|
85
|
+
/**
|
|
86
|
+
* Wire names the route's response model answers to (plan 2026-09-25
|
|
87
|
+
* Phase 4b item 5): every pydantic field name plus every declared
|
|
88
|
+
* alias, in declaration order. Present ONLY when the detector proved
|
|
89
|
+
* a concrete model — an unknown/Any/dict model, an unresolvable
|
|
90
|
+
* symbol, or a model with an unprovable base stays absent, never a
|
|
91
|
+
* partial list. A frontend read with no entry here is exactly the
|
|
92
|
+
* dropped-field drift `RESPONSE_FIELD_MISSING_FROM_MODEL` reports.
|
|
93
|
+
*/
|
|
94
|
+
responseModelFields: z.array(z.string().min(1)).min(1).optional(),
|
|
95
|
+
/**
|
|
96
|
+
* Fields the call site reads off this call's response, each with the
|
|
97
|
+
* location of the read (plan 2026-09-25 Phase 4b item 5). Bounded
|
|
98
|
+
* static reads of the detected call's own result — `.data.<field>`
|
|
99
|
+
* and destructuring of the awaited result or its payload — within the
|
|
100
|
+
* enclosing function, same file, never inferred across files.
|
|
101
|
+
*/
|
|
102
|
+
responseReads: z.array(ResponseReadSchema).min(1).optional(),
|
|
65
103
|
/** Frontend callsite identifiers (frontend-call facts only). */
|
|
66
104
|
callsites: z.array(z.string().min(1)).min(1).optional(),
|
|
67
105
|
/** Where the fact was found. */
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAA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CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvD,gCAAgC;IAChC,MAAM,EAAE,kBAAkB;CAC3B,CAAC;KACD,MAAM,EAAE,CAAC;AAIZ,kFAAkF;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAElD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gate-forge/http-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Framework-neutral canonical HTTP contract: HttpContractFact schema, typed block codes, path/method normalization, and the deterministic frontend-call <-> server-route join engine (ADR 0004 D1-D4).",
|
|
6
6
|
"type": "module",
|