@lokalise/api-contracts 6.5.3 → 6.6.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod/v4';
|
|
2
|
-
import type { RoutePathResolver } from '../apiContracts.ts';
|
|
2
|
+
import type { CommonRouteDefinitionMetadata, RoutePathResolver } from '../apiContracts.ts';
|
|
3
3
|
import type { HttpStatusCode } from '../HttpStatusCodes.ts';
|
|
4
4
|
import type { SSEMethod } from './sseContracts.ts';
|
|
5
5
|
import type { SSEEventSchemas } from './sseTypes.ts';
|
|
@@ -42,6 +42,10 @@ export type DualModeContractDefinition<Method extends SSEMethod = SSEMethod, Par
|
|
|
42
42
|
responseBodySchemasByStatusCode?: ResponseSchemasByStatusCode;
|
|
43
43
|
serverSentEventSchemas: Events;
|
|
44
44
|
isDualMode: true;
|
|
45
|
+
metadata?: CommonRouteDefinitionMetadata;
|
|
46
|
+
description?: string;
|
|
47
|
+
summary?: string;
|
|
48
|
+
tags?: readonly string[];
|
|
45
49
|
};
|
|
46
50
|
/**
|
|
47
51
|
* Type representing any dual-mode route definition (for use in generic constraints).
|
|
@@ -60,4 +64,8 @@ export type AnyDualModeContractDefinition = {
|
|
|
60
64
|
responseBodySchemasByStatusCode?: Partial<Record<HttpStatusCode, z.ZodTypeAny>>;
|
|
61
65
|
serverSentEventSchemas: SSEEventSchemas;
|
|
62
66
|
isDualMode: true;
|
|
67
|
+
metadata?: CommonRouteDefinitionMetadata;
|
|
68
|
+
description?: string;
|
|
69
|
+
summary?: string;
|
|
70
|
+
tags?: readonly string[];
|
|
63
71
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod/v4';
|
|
2
|
-
import type { RoutePathResolver } from '../apiContracts.ts';
|
|
2
|
+
import type { CommonRouteDefinitionMetadata, RoutePathResolver } from '../apiContracts.ts';
|
|
3
3
|
import type { HttpStatusCode } from '../HttpStatusCodes.ts';
|
|
4
4
|
import type { DualModeContractDefinition } from './dualModeContracts.ts';
|
|
5
5
|
import type { SSEContractDefinition } from './sseContracts.ts';
|
|
@@ -31,6 +31,10 @@ export type SSEGetContractConfig<Params extends z.ZodTypeAny, Query extends z.Zo
|
|
|
31
31
|
responseBodySchemasByStatusCode?: ResponseSchemasByStatusCode;
|
|
32
32
|
requestBodySchema?: never;
|
|
33
33
|
successResponseBodySchema?: never;
|
|
34
|
+
metadata?: CommonRouteDefinitionMetadata;
|
|
35
|
+
description?: string;
|
|
36
|
+
summary?: string;
|
|
37
|
+
tags?: readonly string[];
|
|
34
38
|
};
|
|
35
39
|
/**
|
|
36
40
|
* Configuration for building a POST/PUT/PATCH SSE route with request body.
|
|
@@ -59,6 +63,10 @@ export type SSEPayloadContractConfig<Params extends z.ZodTypeAny, Query extends
|
|
|
59
63
|
*/
|
|
60
64
|
responseBodySchemasByStatusCode?: ResponseSchemasByStatusCode;
|
|
61
65
|
successResponseBodySchema?: never;
|
|
66
|
+
metadata?: CommonRouteDefinitionMetadata;
|
|
67
|
+
description?: string;
|
|
68
|
+
summary?: string;
|
|
69
|
+
tags?: readonly string[];
|
|
62
70
|
};
|
|
63
71
|
/**
|
|
64
72
|
* Configuration for building a GET dual-mode route.
|
|
@@ -100,6 +108,10 @@ export type DualModeGetContractConfig<Params extends z.ZodTypeAny, Query extends
|
|
|
100
108
|
responseBodySchemasByStatusCode?: ResponseSchemasByStatusCode;
|
|
101
109
|
serverSentEventSchemas: Events;
|
|
102
110
|
requestBodySchema?: never;
|
|
111
|
+
metadata?: CommonRouteDefinitionMetadata;
|
|
112
|
+
description?: string;
|
|
113
|
+
summary?: string;
|
|
114
|
+
tags?: readonly string[];
|
|
103
115
|
};
|
|
104
116
|
/**
|
|
105
117
|
* Configuration for building a POST/PUT/PATCH dual-mode route with request body.
|
|
@@ -141,6 +153,10 @@ export type DualModePayloadContractConfig<Params extends z.ZodTypeAny, Query ext
|
|
|
141
153
|
*/
|
|
142
154
|
responseBodySchemasByStatusCode?: ResponseSchemasByStatusCode;
|
|
143
155
|
serverSentEventSchemas: Events;
|
|
156
|
+
metadata?: CommonRouteDefinitionMetadata;
|
|
157
|
+
description?: string;
|
|
158
|
+
summary?: string;
|
|
159
|
+
tags?: readonly string[];
|
|
144
160
|
};
|
|
145
161
|
export declare function buildSseContract<Params extends z.ZodTypeAny, Query extends z.ZodTypeAny, RequestHeaders extends z.ZodTypeAny, JsonResponse extends z.ZodTypeAny, Events extends SSEEventSchemas, ResponseHeaders extends z.ZodTypeAny | undefined = undefined, ResponseSchemasByStatusCode extends Partial<Record<HttpStatusCode, z.ZodTypeAny>> | undefined = undefined>(config: DualModeGetContractConfig<Params, Query, RequestHeaders, JsonResponse, Events, ResponseHeaders, ResponseSchemasByStatusCode>): DualModeContractDefinition<'get', Params, Query, RequestHeaders, undefined, JsonResponse, Events, ResponseHeaders, ResponseSchemasByStatusCode>;
|
|
146
162
|
export declare function buildSseContract<Params extends z.ZodTypeAny, Query extends z.ZodTypeAny, RequestHeaders extends z.ZodTypeAny, Events extends SSEEventSchemas, ResponseSchemasByStatusCode extends Partial<Record<HttpStatusCode, z.ZodTypeAny>> | undefined = undefined>(config: SSEGetContractConfig<Params, Query, RequestHeaders, Events, ResponseSchemasByStatusCode>): SSEContractDefinition<'get', Params, Query, RequestHeaders, undefined, Events, ResponseSchemasByStatusCode>;
|
|
@@ -62,6 +62,10 @@ function buildBaseFields(config, hasBody) {
|
|
|
62
62
|
requestHeaderSchema: config.requestHeaderSchema,
|
|
63
63
|
requestBodySchema: hasBody ? config.requestBodySchema : undefined,
|
|
64
64
|
serverSentEventSchemas: config.serverSentEventSchemas,
|
|
65
|
+
metadata: config.metadata,
|
|
66
|
+
description: config.description,
|
|
67
|
+
summary: config.summary,
|
|
68
|
+
tags: config.tags,
|
|
65
69
|
};
|
|
66
70
|
}
|
|
67
71
|
// Helper to determine method
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sseContractBuilders.js","sourceRoot":"","sources":["../../src/sse/sseContractBuilders.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sseContractBuilders.js","sourceRoot":"","sources":["../../src/sse/sseContractBuilders.ts"],"names":[],"mappings":"AA2MA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,uCAAuC;AACvC,gEAAgE;AAChE,SAAS,eAAe,CAAC,MAAW,EAAE,OAAgB;IACpD,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;QACvD,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;QAC7C,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS;QACjE,sBAAsB,EAAE,MAAM,CAAC,sBAAsB;QACrD,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,IAAI,EAAE,MAAM,CAAC,IAAI;KAClB,CAAA;AACH,CAAC;AAED,6BAA6B;AAC7B,SAAS,eAAe,CAAC,MAA0B;IACjD,OAAO,MAAM,CAAC,MAAM,CAAA;AACtB,CAAC;AAwHD,iBAAiB;AACjB,MAAM,UAAU,gBAAgB,CAC9B,MAOiD;IAGjD,MAAM,mBAAmB,GACvB,2BAA2B,IAAI,MAAM,IAAI,MAAM,CAAC,yBAAyB,KAAK,SAAS,CAAA;IACzF,MAAM,OAAO,GAAG,mBAAmB,IAAI,MAAM,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS,CAAA;IACvF,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAE7C,IAAI,mBAAmB,EAAE,CAAC;QACxB,qBAAqB;QACrB,OAAO;YACL,GAAG,IAAI;YACP,MAAM,EAAE,eAAe,CAAC,MAA4B,CAAC;YACrD,yBAAyB,EAAG,MAAiD;iBAC1E,yBAAyB;YAC5B,oBAAoB,EAAG,MAA6C,CAAC,oBAAoB;YACzF,+BAA+B,EAAG,MAAwD;iBACvF,+BAA+B;YAClC,UAAU,EAAE,IAAI;SACjB,CAAA;IACH,CAAC;IAED,oBAAoB;IACpB,OAAO;QACL,GAAG,IAAI;QACP,MAAM,EAAE,eAAe,CAAC,MAA4B,CAAC;QACrD,+BAA+B,EAAG,MAAwD;aACvF,+BAA+B;QAClC,KAAK,EAAE,IAAI;KACZ,CAAA;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod/v4';
|
|
2
|
-
import type { RoutePathResolver } from '../apiContracts.ts';
|
|
2
|
+
import type { CommonRouteDefinitionMetadata, RoutePathResolver } from '../apiContracts.ts';
|
|
3
3
|
import type { HttpStatusCode } from '../HttpStatusCodes.ts';
|
|
4
4
|
import type { SSEEventSchemas } from './sseTypes.ts';
|
|
5
5
|
/**
|
|
@@ -46,6 +46,10 @@ export type SSEContractDefinition<Method extends SSEMethod = SSEMethod, Params e
|
|
|
46
46
|
*/
|
|
47
47
|
responseBodySchemasByStatusCode?: ResponseSchemasByStatusCode;
|
|
48
48
|
isSSE: true;
|
|
49
|
+
metadata?: CommonRouteDefinitionMetadata;
|
|
50
|
+
description?: string;
|
|
51
|
+
summary?: string;
|
|
52
|
+
tags?: readonly string[];
|
|
49
53
|
};
|
|
50
54
|
/**
|
|
51
55
|
* Type representing any SSE route definition (for use in generic constraints).
|
|
@@ -61,4 +65,8 @@ export type AnySSEContractDefinition = {
|
|
|
61
65
|
serverSentEventSchemas: SSEEventSchemas;
|
|
62
66
|
responseBodySchemasByStatusCode?: Partial<Record<HttpStatusCode, z.ZodTypeAny>>;
|
|
63
67
|
isSSE: true;
|
|
68
|
+
metadata?: CommonRouteDefinitionMetadata;
|
|
69
|
+
description?: string;
|
|
70
|
+
summary?: string;
|
|
71
|
+
tags?: readonly string[];
|
|
64
72
|
};
|