@sdk-it/runtime 0.0.0-stage → 0.47.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.
@@ -0,0 +1,45 @@
1
+ import { z } from 'zod';
2
+ import type { Interceptor } from './interceptors.ts';
3
+ export type SecurityContext = {
4
+ scheme: string;
5
+ scopes: readonly string[];
6
+ roles: readonly string[];
7
+ };
8
+ export type SecurityCredentialValue = string | true | {
9
+ username: string;
10
+ password: string;
11
+ };
12
+ export type SecurityCredentialProvider<T extends SecurityCredentialValue> = (context: SecurityContext) => T | Promise<T>;
13
+ export type SecurityCredential<T extends SecurityCredentialValue = SecurityCredentialValue> = T | SecurityCredentialProvider<T>;
14
+ export declare const stringCredentialSchema: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<true>, z.ZodCustom<SecurityCredentialProvider<string | true>, SecurityCredentialProvider<string | true>>]>;
15
+ export declare const basicCredentialSchema: z.ZodUnion<readonly [z.ZodObject<{
16
+ username: z.ZodString;
17
+ password: z.ZodString;
18
+ }, z.core.$strip>, z.ZodLiteral<true>, z.ZodCustom<SecurityCredentialProvider<true | {
19
+ username: string;
20
+ password: string;
21
+ }>, SecurityCredentialProvider<true | {
22
+ username: string;
23
+ password: string;
24
+ }>>]>;
25
+ export declare const mutualTlsCredentialSchema: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodCustom<SecurityCredentialProvider<true>, SecurityCredentialProvider<true>>]>;
26
+ export type RuntimeSecurityScheme = {
27
+ type: 'apiKey';
28
+ in: 'header' | 'query' | 'cookie';
29
+ name: string;
30
+ } | {
31
+ type: 'http';
32
+ scheme: string;
33
+ } | {
34
+ type: 'oauth2';
35
+ } | {
36
+ type: 'openIdConnect';
37
+ } | {
38
+ type: 'mutualTLS';
39
+ };
40
+ /** The spec's components.securitySchemes; a requirement can name a scheme it lacks (an unresolved external one). */
41
+ export type RuntimeSecuritySchemes = {
42
+ readonly [name: string]: RuntimeSecurityScheme | undefined;
43
+ };
44
+ export declare function createSecurityInterceptor(requirements: readonly Record<string, readonly string[]>[], credentials: Record<string, SecurityCredential | undefined> | undefined, schemes: RuntimeSecuritySchemes): Interceptor;
45
+ //# sourceMappingURL=security.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.d.ts","sources":["../../src/http/security.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B,CAAC;AACF,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,IAAI,GACJ;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AACN,MAAM,MAAM,0BAA0B,CAAC,CAAC,SAAS,uBAAuB,IAAI,CAC1E,OAAO,EAAE,eAAe,KACrB,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,MAAM,MAAM,kBAAkB,CAC5B,CAAC,SAAS,uBAAuB,GAAG,uBAAuB,IACzD,CAAC,GAAG,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAMtC,eAAO,MAAM,sBAAsB,2JAIjC,CAAC;AAKH,eAAO,MAAM,qBAAqB;;;;cAGL,MAAM;cAAY,MAAM;;;;KACnD,CAAC;AACH,eAAO,MAAM,yBAAyB,4HAGpC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC;AAE1B,oHAAoH;AACpH,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAAC;CAC5D,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,EAAE,EAC1D,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS,CAAC,GAAG,SAAS,EACvE,OAAO,EAAE,sBAAsB,GAC9B,WAAW,CA8Cb"}
@@ -0,0 +1,3 @@
1
+ export type SSEListener = (eventType: string) => AsyncIterable<string>;
2
+ export declare function sse(response: Response): SSEListener;
3
+ //# sourceMappingURL=sse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sse.d.ts","sources":["../../src/http/sse.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,aAAa,CAAC,MAAM,CAAC,CAAC;AAEvE,wBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAkGnD"}
@@ -0,0 +1,11 @@
1
+ export * from './http/client.ts';
2
+ export * from './http/dispatcher.ts';
3
+ export * from './http/interceptors.ts';
4
+ export * from './http/page.ts';
5
+ export * from './http/parse-response.ts';
6
+ export * from './http/parser.ts';
7
+ export * from './http/request.ts';
8
+ export * from './http/response.ts';
9
+ export * from './http/security.ts';
10
+ export * from './http/sse.ts';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}