@cushin/api-codegen
Advanced tools
+20
-8
@@ -567,3 +567,3 @@ #!/usr/bin/env node | ||
| /** | ||
| * Initialize API client with auth callbacks | ||
| * Initialize API client with auth callbacks and optional global headers | ||
| * Call this function in your auth provider setup | ||
@@ -580,6 +580,12 @@ * | ||
| * | ||
| * initializeAPIClient(authCallbacks); | ||
| * initializeAPIClient(authCallbacks, { | ||
| * 'X-Client-ID': 'my-app', | ||
| * 'X-Environment': 'production', | ||
| * }); | ||
| */ | ||
| export const initializeAPIClient = (authCallbacks: AuthCallbacks) => { | ||
| baseClient = createAPIClient(apiConfig, authCallbacks) as any; | ||
| export const initializeAPIClient = ( | ||
| authCallbacks: AuthCallbacks, | ||
| globalHeaders?: Record<string, string>, | ||
| ) => { | ||
| baseClient = createAPIClient(apiConfig, authCallbacks, globalHeaders) as any; | ||
| return baseClient; | ||
@@ -617,3 +623,3 @@ }; | ||
| /** | ||
| * Initialize server-side API client with auth callbacks | ||
| * Initialize server-side API client with auth callbacks and optional global headers | ||
| * Call this in Server Actions or Route Handlers where you need authentication | ||
@@ -635,6 +641,12 @@ * | ||
| * | ||
| * initializeServerClient(authCallbacks); | ||
| * initializeServerClient(authCallbacks, { | ||
| * 'X-Server-ID': 'server-1', | ||
| * 'X-Request-ID': requestId, | ||
| * }); | ||
| */ | ||
| export const initializeServerClient = (authCallbacks: AuthCallbacks) => { | ||
| serverClient = createAPIClient(apiConfig, authCallbacks) as any; | ||
| export const initializeServerClient = ( | ||
| authCallbacks: AuthCallbacks, | ||
| globalHeaders?: Record<string, string>, | ||
| ) => { | ||
| serverClient = createAPIClient(apiConfig, authCallbacks, globalHeaders) as any; | ||
| return serverClient; | ||
@@ -641,0 +653,0 @@ }; |
+20
-8
@@ -564,3 +564,3 @@ // src/index.ts | ||
| /** | ||
| * Initialize API client with auth callbacks | ||
| * Initialize API client with auth callbacks and optional global headers | ||
| * Call this function in your auth provider setup | ||
@@ -577,6 +577,12 @@ * | ||
| * | ||
| * initializeAPIClient(authCallbacks); | ||
| * initializeAPIClient(authCallbacks, { | ||
| * 'X-Client-ID': 'my-app', | ||
| * 'X-Environment': 'production', | ||
| * }); | ||
| */ | ||
| export const initializeAPIClient = (authCallbacks: AuthCallbacks) => { | ||
| baseClient = createAPIClient(apiConfig, authCallbacks) as any; | ||
| export const initializeAPIClient = ( | ||
| authCallbacks: AuthCallbacks, | ||
| globalHeaders?: Record<string, string>, | ||
| ) => { | ||
| baseClient = createAPIClient(apiConfig, authCallbacks, globalHeaders) as any; | ||
| return baseClient; | ||
@@ -614,3 +620,3 @@ }; | ||
| /** | ||
| * Initialize server-side API client with auth callbacks | ||
| * Initialize server-side API client with auth callbacks and optional global headers | ||
| * Call this in Server Actions or Route Handlers where you need authentication | ||
@@ -632,6 +638,12 @@ * | ||
| * | ||
| * initializeServerClient(authCallbacks); | ||
| * initializeServerClient(authCallbacks, { | ||
| * 'X-Server-ID': 'server-1', | ||
| * 'X-Request-ID': requestId, | ||
| * }); | ||
| */ | ||
| export const initializeServerClient = (authCallbacks: AuthCallbacks) => { | ||
| serverClient = createAPIClient(apiConfig, authCallbacks) as any; | ||
| export const initializeServerClient = ( | ||
| authCallbacks: AuthCallbacks, | ||
| globalHeaders?: Record<string, string>, | ||
| ) => { | ||
| serverClient = createAPIClient(apiConfig, authCallbacks, globalHeaders) as any; | ||
| return serverClient; | ||
@@ -638,0 +650,0 @@ }; |
+2
-2
| { | ||
| "name": "@cushin/api-codegen", | ||
| "version": "5.0.7", | ||
| "version": "5.0.8", | ||
| "description": "Type-safe API client generator for React/Next.js with automatic hooks and server actions generation", | ||
@@ -63,3 +63,3 @@ "type": "module", | ||
| "ora": "^8.0.0", | ||
| "@cushin/api-runtime": "5.0.7", | ||
| "@cushin/api-runtime": "5.0.8", | ||
| "@cushin/codegen-cli": "5.0.0" | ||
@@ -66,0 +66,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
220576
0.66%2142
1.13%+ Added
- Removed
Updated