@flopflip/types
Advanced tools
Comparing version 4.1.1 to 4.1.2
# @flopflip/types | ||
## 4.1.2 | ||
### Patch Changes | ||
- [`0fbcac4`](https://github.com/tdeekens/flopflip/commit/0fbcac4d42568dda5fad6f1e33ff605b954301ee) [#1378](https://github.com/tdeekens/flopflip/pull/1378) Thanks [@tdeekens](https://github.com/tdeekens)! - refactor(adapters): to split out sdk options | ||
This release splits the `adapterArgs` or adapters which use an underlying SDK. Prior `adapterArgs` bound to `@flopflip`'s adapter and the underlying SDK (e.g. by LauncDarkly) were mixed. | ||
This release introduces a new `sdk` field on the `adapterArgs` which contain only fields forwarded to an underlying SDK. This also allows the nested `adapterConfiguration` field to become top-level as it is bound to the adapter. | ||
In essenence: `adapterConfiguration` is now directly flat out on `adapterArgs` while any SDK fields are nested into the `sdk` field. | ||
**splitio-adapter** | ||
- `sdk.authorizationKey`: Authorization key for splitio | ||
- `sdk.options`: General attributes passed to splitio SDK | ||
- `sdk.treatmentAttributes`: The treatment attributes passed to splitio | ||
Over `adapterArgs.{authorizationKey, options, treatmentAttributes}` | ||
**launchdarkly-adapter** | ||
- `sdk.clientSideId` | ||
- `sdk.clientOptions` | ||
Over `adapterArgs.{clientSideId, clientOptions}`. | ||
**graphql-adapter** | ||
All fields are now top-level not under `adapterConfiguration` | ||
**localstorage-adapter** | ||
All fields are now top-level not under `adapterConfiguration` while it is now `pollingInteralMs` not `pollingInteral`. | ||
## 4.1.1 | ||
@@ -4,0 +39,0 @@ |
@@ -46,7 +46,9 @@ /// <reference types="react" /> | ||
export declare type TLaunchDarklyAdapterArgs = TBaseAdapterArgs & { | ||
clientSideId: string; | ||
sdk: { | ||
clientSideId: string; | ||
clientOptions?: { | ||
fetchGoals?: boolean; | ||
}; | ||
}; | ||
flags: TFlags; | ||
clientOptions?: { | ||
fetchGoals?: boolean; | ||
}; | ||
subscribeToFlagChanges?: boolean; | ||
@@ -56,28 +58,24 @@ throwOnInitializationFailure?: boolean; | ||
}; | ||
export declare type TLocalStorageAdapterSubscriptionOptions = { | ||
pollingInteral?: number; | ||
}; | ||
export declare type TGraphQLAdapterArgs = TBaseAdapterArgs & { | ||
adapterConfiguration: TGraphQLAdapterSubscriptionOptions; | ||
cacheIdentifier?: TCacheIdentifiers; | ||
}; | ||
export declare type TGraphQLAdapterSubscriptionOptions = { | ||
fetcher?: typeof fetch; | ||
uri: string; | ||
query: string; | ||
pollingInteral?: number; | ||
pollingInteralMs?: number; | ||
getQueryVariables?: (adapterArgs: TGraphQLAdapterArgs) => unknown; | ||
getRequestHeaders?: (adapterArgs: TGraphQLAdapterArgs) => Record<string, string>; | ||
parseFlags?: (fetchedFlags: unknown) => TFlags; | ||
cacheIdentifier?: TCacheIdentifiers; | ||
}; | ||
export declare type TLocalStorageAdapterArgs = TBaseAdapterArgs & { | ||
adapterConfiguration?: TLocalStorageAdapterSubscriptionOptions; | ||
pollingInteralMs?: number; | ||
}; | ||
export declare type TMemoryAdapterArgs = TBaseAdapterArgs; | ||
export declare type TSplitioAdapterArgs = TBaseAdapterArgs & { | ||
authorizationKey: string; | ||
options?: Record<string, unknown> & { | ||
core?: Record<string, string>; | ||
sdk: { | ||
authorizationKey: string; | ||
options?: Record<string, unknown> & { | ||
core?: Record<string, string>; | ||
}; | ||
treatmentAttributes?: Record<string, string | number | boolean | Array<string | number>>; | ||
}; | ||
treatmentAttributes?: Record<string, string | number | boolean | Array<string | number>>; | ||
}; | ||
@@ -84,0 +82,0 @@ export declare type TCombinedAdapterArgs = TBaseAdapterArgs & { |
{ | ||
"name": "@flopflip/types", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "Type definitions for flipflop", | ||
@@ -5,0 +5,0 @@ "main": "dist/flopflip-types.cjs.js", |
30275
349