-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create offlinePrecomputedInit (#117)
* Create offlinePrecomputedInit method * Adjust config init format to have a precompute object * v3.9.0 * Bump minor version * Test for offlinePrecomputedInit * Fix tests * Update common version * Docs update * Update offline precomputed init to use the configuration wire format * Remove unused IPrecompute import * Add a todo comment * Delete ds store * Update paths to test files * Change test data branch back to main * Fix tests * Change test data branch back to main * v3.9.0 * v3.9.0-alpha.0 * Update lock file * Update to use constructor instead of setters * Update js sdk common dependency * Update common sdk dependency to 4.8.0-alpha.1 * Comply with throwOnFailedInitialization * Remove unneeded reset the static instance before each test * Make documentation consistent with the interface * Remove unnecessary casting to Attribute * Don't include logger prefix in thrown error * Add a shutdown function and test * Remove comment * v3.9.2-alpha.0 * Remove application logger input * Fix test
- Loading branch information
Showing
19 changed files
with
503 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
...dk.iprecomputedclientconfig.subjectkey.md → ...dk.iprecomputedclientconfig.precompute.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@eppo/js-client-sdk](./js-client-sdk.md) > [IPrecomputedClientConfig](./js-client-sdk.iprecomputedclientconfig.md) > [subjectKey](./js-client-sdk.iprecomputedclientconfig.subjectkey.md) | ||
[Home](./index.md) > [@eppo/js-client-sdk](./js-client-sdk.md) > [IPrecomputedClientConfig](./js-client-sdk.iprecomputedclientconfig.md) > [precompute](./js-client-sdk.iprecomputedclientconfig.precompute.md) | ||
|
||
## IPrecomputedClientConfig.subjectKey property | ||
|
||
Subject key to use for precomputed flag assignments. | ||
## IPrecomputedClientConfig.precompute property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
subjectKey: string; | ||
precompute: IPrecompute; | ||
``` |
13 changes: 0 additions & 13 deletions
13
docs/js-client-sdk.iprecomputedclientconfig.subjectattributes.md
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
docs/js-client-sdk.iprecomputedclientconfigsync.assignmentlogger.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@eppo/js-client-sdk](./js-client-sdk.md) > [IPrecomputedClientConfigSync](./js-client-sdk.iprecomputedclientconfigsync.md) > [assignmentLogger](./js-client-sdk.iprecomputedclientconfigsync.assignmentlogger.md) | ||
|
||
## IPrecomputedClientConfigSync.assignmentLogger property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
assignmentLogger?: IAssignmentLogger; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@eppo/js-client-sdk](./js-client-sdk.md) > [IPrecomputedClientConfigSync](./js-client-sdk.iprecomputedclientconfigsync.md) | ||
|
||
## IPrecomputedClientConfigSync interface | ||
|
||
Configuration parameters for initializing the Eppo precomputed client. | ||
|
||
This interface is used for cases where precomputed assignments are available from an external process that can bootstrap the SDK client. | ||
|
||
precomputedConfiguration - The configuration as a string to bootstrap the client. assignmentLogger - Optional logger for assignment events. throwOnFailedInitialization - Optional flag to throw an error if initialization fails. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface IPrecomputedClientConfigSync | ||
``` | ||
|
||
## Properties | ||
|
||
<table><thead><tr><th> | ||
|
||
Property | ||
|
||
|
||
</th><th> | ||
|
||
Modifiers | ||
|
||
|
||
</th><th> | ||
|
||
Type | ||
|
||
|
||
</th><th> | ||
|
||
Description | ||
|
||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
[assignmentLogger?](./js-client-sdk.iprecomputedclientconfigsync.assignmentlogger.md) | ||
|
||
|
||
</td><td> | ||
|
||
|
||
</td><td> | ||
|
||
IAssignmentLogger | ||
|
||
|
||
</td><td> | ||
|
||
_(Optional)_ | ||
|
||
|
||
</td></tr> | ||
<tr><td> | ||
|
||
[precomputedConfiguration](./js-client-sdk.iprecomputedclientconfigsync.precomputedconfiguration.md) | ||
|
||
|
||
</td><td> | ||
|
||
|
||
</td><td> | ||
|
||
string | ||
|
||
|
||
</td><td> | ||
|
||
|
||
</td></tr> | ||
<tr><td> | ||
|
||
[throwOnFailedInitialization?](./js-client-sdk.iprecomputedclientconfigsync.throwonfailedinitialization.md) | ||
|
||
|
||
</td><td> | ||
|
||
|
||
</td><td> | ||
|
||
boolean | ||
|
||
|
||
</td><td> | ||
|
||
_(Optional)_ | ||
|
||
|
||
</td></tr> | ||
</tbody></table> |
11 changes: 11 additions & 0 deletions
11
docs/js-client-sdk.iprecomputedclientconfigsync.precomputedconfiguration.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@eppo/js-client-sdk](./js-client-sdk.md) > [IPrecomputedClientConfigSync](./js-client-sdk.iprecomputedclientconfigsync.md) > [precomputedConfiguration](./js-client-sdk.iprecomputedclientconfigsync.precomputedconfiguration.md) | ||
|
||
## IPrecomputedClientConfigSync.precomputedConfiguration property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
precomputedConfiguration: string; | ||
``` |
11 changes: 11 additions & 0 deletions
11
docs/js-client-sdk.iprecomputedclientconfigsync.throwonfailedinitialization.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@eppo/js-client-sdk](./js-client-sdk.md) > [IPrecomputedClientConfigSync](./js-client-sdk.iprecomputedclientconfigsync.md) > [throwOnFailedInitialization](./js-client-sdk.iprecomputedclientconfigsync.throwonfailedinitialization.md) | ||
|
||
## IPrecomputedClientConfigSync.throwOnFailedInitialization property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
throwOnFailedInitialization?: boolean; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@eppo/js-client-sdk](./js-client-sdk.md) > [offlinePrecomputedInit](./js-client-sdk.offlineprecomputedinit.md) | ||
|
||
## offlinePrecomputedInit() function | ||
|
||
Initializes the Eppo precomputed client with configuration parameters. | ||
|
||
The purpose is for use-cases where the precomputed assignments are available from an external process that can bootstrap the SDK. | ||
|
||
This method should be called once on application startup. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare function offlinePrecomputedInit(config: IPrecomputedClientConfigSync): EppoPrecomputedClient; | ||
``` | ||
|
||
## Parameters | ||
|
||
<table><thead><tr><th> | ||
|
||
Parameter | ||
|
||
|
||
</th><th> | ||
|
||
Type | ||
|
||
|
||
</th><th> | ||
|
||
Description | ||
|
||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
config | ||
|
||
|
||
</td><td> | ||
|
||
[IPrecomputedClientConfigSync](./js-client-sdk.iprecomputedclientconfigsync.md) | ||
|
||
|
||
</td><td> | ||
|
||
precomputed client configuration | ||
|
||
|
||
</td></tr> | ||
</tbody></table> | ||
**Returns:** | ||
|
||
EppoPrecomputedClient | ||
|
||
a singleton precomputed client instance | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.