@bagelink/sdk 1.15.558 → 1.15.562

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/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { InternalAxiosRequestConfig, AxiosResponse, AxiosRequestConfig } from 'axios';
1
+ import { InternalAxiosRequestConfig, AxiosResponse, AxiosRequestConfig, AxiosInstance } from 'axios';
2
2
  import { Ref } from 'vue';
3
3
 
4
4
  /**
@@ -52,7 +52,7 @@ declare class StreamController<TEventMap extends StreamEventMap = StreamEventMap
52
52
 
53
53
  interface SSEStreamOptions {
54
54
  /** Additional headers to send with the request */
55
- headers?: Record<string, string>;
55
+ headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
56
56
  /** Whether to include credentials (cookies) with the request */
57
57
  withCredentials?: boolean;
58
58
  /**
@@ -520,6 +520,34 @@ declare function extractSSEEventSchemas(operation: OperationObject): Record<stri
520
520
  */
521
521
  declare function extractSSEEventInfo(operation: OperationObject): SSEEventTypeInfo[] | undefined;
522
522
 
523
+ interface ModuleOwnership {
524
+ /** Stable module id and generated directory name. */
525
+ name: string;
526
+ /** Exact OpenAPI tags owned by this module. */
527
+ tags?: string[];
528
+ /** Exact path prefixes owned by this module. */
529
+ pathPrefixes?: string[];
530
+ /** Explicit component schema names additionally owned by this module. */
531
+ schemas?: string[];
532
+ }
533
+ interface ModuleOwnershipManifest {
534
+ version: 1;
535
+ modules: ModuleOwnership[];
536
+ }
537
+ interface ModuleGenerationResult {
538
+ name: string;
539
+ paths: string[];
540
+ schemas: string[];
541
+ code: string;
542
+ types: string;
543
+ }
544
+ interface ConformanceIssue {
545
+ kind: 'invalid-manifest' | 'unowned-operation' | 'multiply-owned-operation' | 'unknown-schema';
546
+ message: string;
547
+ }
548
+ declare function validateOwnershipManifest(openApi: OpenAPIObject, manifest: ModuleOwnershipManifest): ConformanceIssue[];
549
+ declare function generateModules(openApi: OpenAPIObject, manifest: ModuleOwnershipManifest, baseUrl: string): ModuleGenerationResult[];
550
+
523
551
  interface OpenAPIResponse {
524
552
  types: string;
525
553
  code: string;
@@ -670,6 +698,27 @@ interface ApiConfig {
670
698
  };
671
699
  axiosConfig?: AxiosRequestConfig;
672
700
  }
701
+ /**
702
+ * Instance-scoped HTTP and SSE transport used by generated clients.
703
+ */
704
+ interface ApiTransport {
705
+ axios: AxiosInstance;
706
+ config: Ref<ApiConfig | null>;
707
+ lastResponse: Ref<AxiosResponse | null>;
708
+ getStreamBaseURL: () => string;
709
+ createSSEStream: <TEventMap extends StreamEventMap = StreamEventMap>(path: string, options?: SSEStreamOptions) => StreamController<TEventMap>;
710
+ createSSEStreamPost: <TEventMap extends StreamEventMap = StreamEventMap, TBody = any>(path: string, body: TBody, options?: SSEStreamOptions) => StreamController<TEventMap>;
711
+ }
712
+ /**
713
+ * Create an isolated transport. Multiple generated clients can safely use
714
+ * different base URLs, credentials, auth providers, and interceptors.
715
+ */
716
+ declare function createApiTransport(config?: ApiConfig): ApiTransport;
717
+ /**
718
+ * Reconfigure an existing transport without changing its Axios identity.
719
+ * This supports legacy generated `axios` exports while keeping bindings isolated.
720
+ */
721
+ declare function configureApiTransport(transport: ApiTransport, config?: ApiConfig): ApiTransport;
673
722
  /**
674
723
  * Request state for useApiRequest composable
675
724
  */
@@ -817,5 +866,5 @@ declare function createOptionsGetter<T>(fetchFn: () => Promise<T[]>, mapFn?: (it
817
866
  value: string;
818
867
  }[]>;
819
868
 
820
- export { ApiResponse, Bagel, StreamController, createOptionsGetter, createSSEStream, createSSEStreamPost, dereference, extractSSEEventInfo, extractSSEEventSchemas, extractSSEEventTypes, formatAPIErrorMessage, formatFieldErrors, getPath, isReferenceObject, isSSEStream, isSchemaObject, _default as openAPI, parseApiError, unwrap, useApiRequest, useCancellableRequest, wrapApiForDirectReturn };
821
- export type { ApiConfig, ApiRequestState, BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, FastAPIErrorResponse, FastAPIValidationError, HeaderObject, HeadersObject, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, ParsedError, PathItemObject, PathsObject, ReferenceObject, RequestBodyObject, RequestInterceptor, ResponseInterceptor, ResponseMetadata, ResponseObject, ResponsesObject, SSEEventTypeInfo, SSEStreamOptions, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, StreamEventMap, TableToTypeMapping, Tables, TagObject, TypeFormatT, Unwrap, Unwrapped, UploadOptions, User, XmlObject };
869
+ export { ApiResponse, Bagel, StreamController, configureApiTransport, createApiTransport, createOptionsGetter, createSSEStream, createSSEStreamPost, dereference, extractSSEEventInfo, extractSSEEventSchemas, extractSSEEventTypes, formatAPIErrorMessage, formatFieldErrors, generateModules, getPath, isReferenceObject, isSSEStream, isSchemaObject, _default as openAPI, parseApiError, unwrap, useApiRequest, useCancellableRequest, validateOwnershipManifest, wrapApiForDirectReturn };
870
+ export type { ApiConfig, ApiRequestState, ApiTransport, BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ConformanceIssue, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, FastAPIErrorResponse, FastAPIValidationError, HeaderObject, HeadersObject, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, ModuleGenerationResult, ModuleOwnership, ModuleOwnershipManifest, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, ParsedError, PathItemObject, PathsObject, ReferenceObject, RequestBodyObject, RequestInterceptor, ResponseInterceptor, ResponseMetadata, ResponseObject, ResponsesObject, SSEEventTypeInfo, SSEStreamOptions, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, StreamEventMap, TableToTypeMapping, Tables, TagObject, TypeFormatT, Unwrap, Unwrapped, UploadOptions, User, XmlObject };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { InternalAxiosRequestConfig, AxiosResponse, AxiosRequestConfig } from 'axios';
1
+ import { InternalAxiosRequestConfig, AxiosResponse, AxiosRequestConfig, AxiosInstance } from 'axios';
2
2
  import { Ref } from 'vue';
3
3
 
4
4
  /**
@@ -52,7 +52,7 @@ declare class StreamController<TEventMap extends StreamEventMap = StreamEventMap
52
52
 
53
53
  interface SSEStreamOptions {
54
54
  /** Additional headers to send with the request */
55
- headers?: Record<string, string>;
55
+ headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
56
56
  /** Whether to include credentials (cookies) with the request */
57
57
  withCredentials?: boolean;
58
58
  /**
@@ -520,6 +520,34 @@ declare function extractSSEEventSchemas(operation: OperationObject): Record<stri
520
520
  */
521
521
  declare function extractSSEEventInfo(operation: OperationObject): SSEEventTypeInfo[] | undefined;
522
522
 
523
+ interface ModuleOwnership {
524
+ /** Stable module id and generated directory name. */
525
+ name: string;
526
+ /** Exact OpenAPI tags owned by this module. */
527
+ tags?: string[];
528
+ /** Exact path prefixes owned by this module. */
529
+ pathPrefixes?: string[];
530
+ /** Explicit component schema names additionally owned by this module. */
531
+ schemas?: string[];
532
+ }
533
+ interface ModuleOwnershipManifest {
534
+ version: 1;
535
+ modules: ModuleOwnership[];
536
+ }
537
+ interface ModuleGenerationResult {
538
+ name: string;
539
+ paths: string[];
540
+ schemas: string[];
541
+ code: string;
542
+ types: string;
543
+ }
544
+ interface ConformanceIssue {
545
+ kind: 'invalid-manifest' | 'unowned-operation' | 'multiply-owned-operation' | 'unknown-schema';
546
+ message: string;
547
+ }
548
+ declare function validateOwnershipManifest(openApi: OpenAPIObject, manifest: ModuleOwnershipManifest): ConformanceIssue[];
549
+ declare function generateModules(openApi: OpenAPIObject, manifest: ModuleOwnershipManifest, baseUrl: string): ModuleGenerationResult[];
550
+
523
551
  interface OpenAPIResponse {
524
552
  types: string;
525
553
  code: string;
@@ -670,6 +698,27 @@ interface ApiConfig {
670
698
  };
671
699
  axiosConfig?: AxiosRequestConfig;
672
700
  }
701
+ /**
702
+ * Instance-scoped HTTP and SSE transport used by generated clients.
703
+ */
704
+ interface ApiTransport {
705
+ axios: AxiosInstance;
706
+ config: Ref<ApiConfig | null>;
707
+ lastResponse: Ref<AxiosResponse | null>;
708
+ getStreamBaseURL: () => string;
709
+ createSSEStream: <TEventMap extends StreamEventMap = StreamEventMap>(path: string, options?: SSEStreamOptions) => StreamController<TEventMap>;
710
+ createSSEStreamPost: <TEventMap extends StreamEventMap = StreamEventMap, TBody = any>(path: string, body: TBody, options?: SSEStreamOptions) => StreamController<TEventMap>;
711
+ }
712
+ /**
713
+ * Create an isolated transport. Multiple generated clients can safely use
714
+ * different base URLs, credentials, auth providers, and interceptors.
715
+ */
716
+ declare function createApiTransport(config?: ApiConfig): ApiTransport;
717
+ /**
718
+ * Reconfigure an existing transport without changing its Axios identity.
719
+ * This supports legacy generated `axios` exports while keeping bindings isolated.
720
+ */
721
+ declare function configureApiTransport(transport: ApiTransport, config?: ApiConfig): ApiTransport;
673
722
  /**
674
723
  * Request state for useApiRequest composable
675
724
  */
@@ -817,5 +866,5 @@ declare function createOptionsGetter<T>(fetchFn: () => Promise<T[]>, mapFn?: (it
817
866
  value: string;
818
867
  }[]>;
819
868
 
820
- export { ApiResponse, Bagel, StreamController, createOptionsGetter, createSSEStream, createSSEStreamPost, dereference, extractSSEEventInfo, extractSSEEventSchemas, extractSSEEventTypes, formatAPIErrorMessage, formatFieldErrors, getPath, isReferenceObject, isSSEStream, isSchemaObject, _default as openAPI, parseApiError, unwrap, useApiRequest, useCancellableRequest, wrapApiForDirectReturn };
821
- export type { ApiConfig, ApiRequestState, BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, FastAPIErrorResponse, FastAPIValidationError, HeaderObject, HeadersObject, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, ParsedError, PathItemObject, PathsObject, ReferenceObject, RequestBodyObject, RequestInterceptor, ResponseInterceptor, ResponseMetadata, ResponseObject, ResponsesObject, SSEEventTypeInfo, SSEStreamOptions, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, StreamEventMap, TableToTypeMapping, Tables, TagObject, TypeFormatT, Unwrap, Unwrapped, UploadOptions, User, XmlObject };
869
+ export { ApiResponse, Bagel, StreamController, configureApiTransport, createApiTransport, createOptionsGetter, createSSEStream, createSSEStreamPost, dereference, extractSSEEventInfo, extractSSEEventSchemas, extractSSEEventTypes, formatAPIErrorMessage, formatFieldErrors, generateModules, getPath, isReferenceObject, isSSEStream, isSchemaObject, _default as openAPI, parseApiError, unwrap, useApiRequest, useCancellableRequest, validateOwnershipManifest, wrapApiForDirectReturn };
870
+ export type { ApiConfig, ApiRequestState, ApiTransport, BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ConformanceIssue, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, FastAPIErrorResponse, FastAPIValidationError, HeaderObject, HeadersObject, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, ModuleGenerationResult, ModuleOwnership, ModuleOwnershipManifest, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, ParsedError, PathItemObject, PathsObject, ReferenceObject, RequestBodyObject, RequestInterceptor, ResponseInterceptor, ResponseMetadata, ResponseObject, ResponsesObject, SSEEventTypeInfo, SSEStreamOptions, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, StreamEventMap, TableToTypeMapping, Tables, TagObject, TypeFormatT, Unwrap, Unwrapped, UploadOptions, User, XmlObject };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { InternalAxiosRequestConfig, AxiosResponse, AxiosRequestConfig } from 'axios';
1
+ import { InternalAxiosRequestConfig, AxiosResponse, AxiosRequestConfig, AxiosInstance } from 'axios';
2
2
  import { Ref } from 'vue';
3
3
 
4
4
  /**
@@ -52,7 +52,7 @@ declare class StreamController<TEventMap extends StreamEventMap = StreamEventMap
52
52
 
53
53
  interface SSEStreamOptions {
54
54
  /** Additional headers to send with the request */
55
- headers?: Record<string, string>;
55
+ headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
56
56
  /** Whether to include credentials (cookies) with the request */
57
57
  withCredentials?: boolean;
58
58
  /**
@@ -520,6 +520,34 @@ declare function extractSSEEventSchemas(operation: OperationObject): Record<stri
520
520
  */
521
521
  declare function extractSSEEventInfo(operation: OperationObject): SSEEventTypeInfo[] | undefined;
522
522
 
523
+ interface ModuleOwnership {
524
+ /** Stable module id and generated directory name. */
525
+ name: string;
526
+ /** Exact OpenAPI tags owned by this module. */
527
+ tags?: string[];
528
+ /** Exact path prefixes owned by this module. */
529
+ pathPrefixes?: string[];
530
+ /** Explicit component schema names additionally owned by this module. */
531
+ schemas?: string[];
532
+ }
533
+ interface ModuleOwnershipManifest {
534
+ version: 1;
535
+ modules: ModuleOwnership[];
536
+ }
537
+ interface ModuleGenerationResult {
538
+ name: string;
539
+ paths: string[];
540
+ schemas: string[];
541
+ code: string;
542
+ types: string;
543
+ }
544
+ interface ConformanceIssue {
545
+ kind: 'invalid-manifest' | 'unowned-operation' | 'multiply-owned-operation' | 'unknown-schema';
546
+ message: string;
547
+ }
548
+ declare function validateOwnershipManifest(openApi: OpenAPIObject, manifest: ModuleOwnershipManifest): ConformanceIssue[];
549
+ declare function generateModules(openApi: OpenAPIObject, manifest: ModuleOwnershipManifest, baseUrl: string): ModuleGenerationResult[];
550
+
523
551
  interface OpenAPIResponse {
524
552
  types: string;
525
553
  code: string;
@@ -670,6 +698,27 @@ interface ApiConfig {
670
698
  };
671
699
  axiosConfig?: AxiosRequestConfig;
672
700
  }
701
+ /**
702
+ * Instance-scoped HTTP and SSE transport used by generated clients.
703
+ */
704
+ interface ApiTransport {
705
+ axios: AxiosInstance;
706
+ config: Ref<ApiConfig | null>;
707
+ lastResponse: Ref<AxiosResponse | null>;
708
+ getStreamBaseURL: () => string;
709
+ createSSEStream: <TEventMap extends StreamEventMap = StreamEventMap>(path: string, options?: SSEStreamOptions) => StreamController<TEventMap>;
710
+ createSSEStreamPost: <TEventMap extends StreamEventMap = StreamEventMap, TBody = any>(path: string, body: TBody, options?: SSEStreamOptions) => StreamController<TEventMap>;
711
+ }
712
+ /**
713
+ * Create an isolated transport. Multiple generated clients can safely use
714
+ * different base URLs, credentials, auth providers, and interceptors.
715
+ */
716
+ declare function createApiTransport(config?: ApiConfig): ApiTransport;
717
+ /**
718
+ * Reconfigure an existing transport without changing its Axios identity.
719
+ * This supports legacy generated `axios` exports while keeping bindings isolated.
720
+ */
721
+ declare function configureApiTransport(transport: ApiTransport, config?: ApiConfig): ApiTransport;
673
722
  /**
674
723
  * Request state for useApiRequest composable
675
724
  */
@@ -817,5 +866,5 @@ declare function createOptionsGetter<T>(fetchFn: () => Promise<T[]>, mapFn?: (it
817
866
  value: string;
818
867
  }[]>;
819
868
 
820
- export { ApiResponse, Bagel, StreamController, createOptionsGetter, createSSEStream, createSSEStreamPost, dereference, extractSSEEventInfo, extractSSEEventSchemas, extractSSEEventTypes, formatAPIErrorMessage, formatFieldErrors, getPath, isReferenceObject, isSSEStream, isSchemaObject, _default as openAPI, parseApiError, unwrap, useApiRequest, useCancellableRequest, wrapApiForDirectReturn };
821
- export type { ApiConfig, ApiRequestState, BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, FastAPIErrorResponse, FastAPIValidationError, HeaderObject, HeadersObject, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, ParsedError, PathItemObject, PathsObject, ReferenceObject, RequestBodyObject, RequestInterceptor, ResponseInterceptor, ResponseMetadata, ResponseObject, ResponsesObject, SSEEventTypeInfo, SSEStreamOptions, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, StreamEventMap, TableToTypeMapping, Tables, TagObject, TypeFormatT, Unwrap, Unwrapped, UploadOptions, User, XmlObject };
869
+ export { ApiResponse, Bagel, StreamController, configureApiTransport, createApiTransport, createOptionsGetter, createSSEStream, createSSEStreamPost, dereference, extractSSEEventInfo, extractSSEEventSchemas, extractSSEEventTypes, formatAPIErrorMessage, formatFieldErrors, generateModules, getPath, isReferenceObject, isSSEStream, isSchemaObject, _default as openAPI, parseApiError, unwrap, useApiRequest, useCancellableRequest, validateOwnershipManifest, wrapApiForDirectReturn };
870
+ export type { ApiConfig, ApiRequestState, ApiTransport, BaseParameterObject, CallbackObject, CallbacksObject, ComponentsObject, ConformanceIssue, ContactObject, ContentObject, DiscriminatorObject, EncodingObject, EncodingPropertyObject, ExampleObject, ExamplesObject, ExternalDocumentationObject, FastAPIErrorResponse, FastAPIValidationError, HeaderObject, HeadersObject, InfoObject, LicenseObject, LinkObject, LinkParametersObject, LinksObject, MediaTypeObject, ModuleGenerationResult, ModuleOwnership, ModuleOwnershipManifest, OAuthFlowObject, OAuthFlowsObject, OpenAPIObject, OperationObject, ParameterLocation, ParameterObject, ParameterStyle, ParsedError, PathItemObject, PathsObject, ReferenceObject, RequestBodyObject, RequestInterceptor, ResponseInterceptor, ResponseMetadata, ResponseObject, ResponsesObject, SSEEventTypeInfo, SSEStreamOptions, SchemaObject, SchemaObjectType, SchemasObject, ScopesObject, SecurityRequirementObject, SecuritySchemeObject, SecuritySchemeType, ServerObject, ServerVariableObject, StreamEventMap, TableToTypeMapping, Tables, TagObject, TypeFormatT, Unwrap, Unwrapped, UploadOptions, User, XmlObject };