Closed carlbrugger closed 1 month ago
The changes in this pull request focus on the FlatfileClient
class located in src/wrapper/FlatfileClient.ts
. Modifications were made to the constructor's handling of the environment
and token
properties, introducing fallback mechanisms. The resolveEnvironment
function was simplified by removing unnecessary fallbacks. The Options
interface remains unchanged, and there were no alterations to exported or public entity declarations.
File | Change Summary |
---|---|
src/wrapper/FlatfileClient.ts | Updated FlatfileClient constructor to improve handling of environment and token properties. Simplified resolveEnvironment function to remove unnecessary fallback to environmentSupplier . |
sequenceDiagram
participant Client
participant EnvironmentSupplier
participant TokenSupplier
Client->>FlatfileClient: Initialize with options
FlatfileClient->>FlatfileClient: Check options.environment
alt if options.environment is undefined
FlatfileClient->>EnvironmentSupplier: Get environment
end
FlatfileClient->>FlatfileClient: Check options.token
alt if options.token is undefined
FlatfileClient->>TokenSupplier: Get token
end
This fixes an issue where the
apiUrl
/environment
value was stored permanently in theFlatfileClient
instead of re-fetching the value from the env valuesCloses https://github.com/FlatFilers/support-triage/issues/1575