@stackwright-pro/openapi 0.2.1 → 0.2.2-alpha.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/index.d.mts CHANGED
@@ -728,6 +728,24 @@ declare class OpenAPIPlugin implements PrebuildPlugin {
728
728
  */
729
729
  declare function createOpenAPIPlugin(): PrebuildPlugin;
730
730
 
731
+ /**
732
+ * NOTE: Validates the URL structure and hostname at call time.
733
+ * Does NOT re-validate after DNS resolution (DNS rebinding).
734
+ * This is acceptable for build-time prebuild use.
735
+ * DO NOT reuse this function for runtime server-side request proxying
736
+ * without adding post-resolution IP validation.
737
+ */
738
+ /**
739
+ * Validates that a URL is safe to fetch (SSRF prevention).
740
+ * Exported for use by external consumers and tests.
741
+ *
742
+ * @throws Error if URL targets internal networks or disallowed protocols
743
+ */
744
+ declare function validateUrlSafe(baseUrl: string): URL;
745
+ /**
746
+ * Alias for validateUrlSafe — backward compatibility export
747
+ */
748
+ declare const isUrlSafe: typeof validateUrlSafe;
731
749
  /**
732
750
  * Configuration for OpenAPI source adapter
733
751
  */
@@ -960,4 +978,4 @@ declare class ApprovedSpecsValidator {
960
978
  clearCache(): void;
961
979
  }
962
980
 
963
- export { type ApprovedSpec, ApprovedSpecsValidator, type ClientGenerationOptions, ClientGenerator, type CollectionConfig, CollectionProviderGenerator, EndpointFilter, OpenAPICollectionProvider, type OpenAPICompilationResult, type OpenAPIConfig, type OpenAPIDocument, OpenAPIParser, OpenAPIPlugin, type OpenAPISourceConfig, type ParseOptions, type ParseResult, type PrebuildSecurityConfig, type ProviderGenerationOptions, type SchemaMapping, SchemaResolver, type SiteConfig, type TypeGenerationOptions, TypeGenerator, type ValidationResult, type ZodGenerationOptions, ZodSchemaGenerator, createOpenAPIFetcher, createOpenAPIPlugin };
981
+ export { type ApprovedSpec, ApprovedSpecsValidator, type ClientGenerationOptions, ClientGenerator, type CollectionConfig, CollectionProviderGenerator, EndpointFilter, OpenAPICollectionProvider, type OpenAPICompilationResult, type OpenAPIConfig, type OpenAPIDocument, OpenAPIParser, OpenAPIPlugin, type OpenAPISourceConfig, type ParseOptions, type ParseResult, type PrebuildSecurityConfig, type ProviderGenerationOptions, type SchemaMapping, SchemaResolver, type SiteConfig, type TypeGenerationOptions, TypeGenerator, type ValidationResult, type ZodGenerationOptions, ZodSchemaGenerator, createOpenAPIFetcher, createOpenAPIPlugin, isUrlSafe, validateUrlSafe };
package/dist/index.d.ts CHANGED
@@ -728,6 +728,24 @@ declare class OpenAPIPlugin implements PrebuildPlugin {
728
728
  */
729
729
  declare function createOpenAPIPlugin(): PrebuildPlugin;
730
730
 
731
+ /**
732
+ * NOTE: Validates the URL structure and hostname at call time.
733
+ * Does NOT re-validate after DNS resolution (DNS rebinding).
734
+ * This is acceptable for build-time prebuild use.
735
+ * DO NOT reuse this function for runtime server-side request proxying
736
+ * without adding post-resolution IP validation.
737
+ */
738
+ /**
739
+ * Validates that a URL is safe to fetch (SSRF prevention).
740
+ * Exported for use by external consumers and tests.
741
+ *
742
+ * @throws Error if URL targets internal networks or disallowed protocols
743
+ */
744
+ declare function validateUrlSafe(baseUrl: string): URL;
745
+ /**
746
+ * Alias for validateUrlSafe — backward compatibility export
747
+ */
748
+ declare const isUrlSafe: typeof validateUrlSafe;
731
749
  /**
732
750
  * Configuration for OpenAPI source adapter
733
751
  */
@@ -960,4 +978,4 @@ declare class ApprovedSpecsValidator {
960
978
  clearCache(): void;
961
979
  }
962
980
 
963
- export { type ApprovedSpec, ApprovedSpecsValidator, type ClientGenerationOptions, ClientGenerator, type CollectionConfig, CollectionProviderGenerator, EndpointFilter, OpenAPICollectionProvider, type OpenAPICompilationResult, type OpenAPIConfig, type OpenAPIDocument, OpenAPIParser, OpenAPIPlugin, type OpenAPISourceConfig, type ParseOptions, type ParseResult, type PrebuildSecurityConfig, type ProviderGenerationOptions, type SchemaMapping, SchemaResolver, type SiteConfig, type TypeGenerationOptions, TypeGenerator, type ValidationResult, type ZodGenerationOptions, ZodSchemaGenerator, createOpenAPIFetcher, createOpenAPIPlugin };
981
+ export { type ApprovedSpec, ApprovedSpecsValidator, type ClientGenerationOptions, ClientGenerator, type CollectionConfig, CollectionProviderGenerator, EndpointFilter, OpenAPICollectionProvider, type OpenAPICompilationResult, type OpenAPIConfig, type OpenAPIDocument, OpenAPIParser, OpenAPIPlugin, type OpenAPISourceConfig, type ParseOptions, type ParseResult, type PrebuildSecurityConfig, type ProviderGenerationOptions, type SchemaMapping, SchemaResolver, type SiteConfig, type TypeGenerationOptions, TypeGenerator, type ValidationResult, type ZodGenerationOptions, ZodSchemaGenerator, createOpenAPIFetcher, createOpenAPIPlugin, isUrlSafe, validateUrlSafe };