Skip to content

Commit b55bfe2

Browse files
authored
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
1 parent 1592e91 commit b55bfe2

19 files changed

+503
-125
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ test-data:
3535
mkdir -p $(tempDir)
3636
git clone -b ${branchName} --depth 1 --single-branch ${githubRepoLink} ${gitDataDir}
3737
cp -r ${gitDataDir}ufc ${testDataDir}
38+
cp -r ${gitDataDir}configuration-wire ${testDataDir}
3839
rm -rf ${tempDir}
3940

4041
## prepare
@@ -49,4 +50,4 @@ prepare: test-data
4950
## test
5051
.PHONY: test
5152
test: test test-data
52-
yarn test:unit
53+
yarn test:unit

docs/js-client-sdk.iclientconfig.eventingestionconfig.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ eventIngestionConfig?: {
1515
maxRetryDelayMs?: number;
1616
maxRetries?: number;
1717
batchSize?: number;
18+
maxQueueSize?: number;
1819
};
1920
```

docs/js-client-sdk.iclientconfig.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Description
4646
4747
</td><td>
4848
49-
{ deliveryIntervalMs?: number; retryIntervalMs?: number; maxRetryDelayMs?: number; maxRetries?: number; batchSize?: number; }
49+
{ deliveryIntervalMs?: number; retryIntervalMs?: number; maxRetryDelayMs?: number; maxRetries?: number; batchSize?: number; maxQueueSize?: number; }
5050
5151
5252
</td><td>

docs/js-client-sdk.iprecomputedclientconfig.md

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,40 +38,19 @@ Description
3838
</th></tr></thead>
3939
<tbody><tr><td>
4040
41-
[subjectAttributes?](./js-client-sdk.iprecomputedclientconfig.subjectattributes.md)
41+
[precompute](./js-client-sdk.iprecomputedclientconfig.precompute.md)
4242
4343
4444
</td><td>
4545
4646
4747
</td><td>
4848
49-
Record&lt;string, AttributeType&gt;
49+
IPrecompute
5050
5151
5252
</td><td>
5353
54-
_(Optional)_ Subject attributes to use for precomputed flag assignments.
55-
56-
57-
</td></tr>
58-
<tr><td>
59-
60-
[subjectKey](./js-client-sdk.iprecomputedclientconfig.subjectkey.md)
61-
62-
63-
</td><td>
64-
65-
66-
</td><td>
67-
68-
string
69-
70-
71-
</td><td>
72-
73-
Subject key to use for precomputed flag assignments.
74-
7554
7655
</td></tr>
7756
</tbody></table>
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
22

3-
[Home](./index.md) &gt; [@eppo/js-client-sdk](./js-client-sdk.md) &gt; [IPrecomputedClientConfig](./js-client-sdk.iprecomputedclientconfig.md) &gt; [subjectKey](./js-client-sdk.iprecomputedclientconfig.subjectkey.md)
3+
[Home](./index.md) &gt; [@eppo/js-client-sdk](./js-client-sdk.md) &gt; [IPrecomputedClientConfig](./js-client-sdk.iprecomputedclientconfig.md) &gt; [precompute](./js-client-sdk.iprecomputedclientconfig.precompute.md)
44

5-
## IPrecomputedClientConfig.subjectKey property
6-
7-
Subject key to use for precomputed flag assignments.
5+
## IPrecomputedClientConfig.precompute property
86

97
**Signature:**
108

119
```typescript
12-
subjectKey: string;
10+
precompute: IPrecompute;
1311
```

docs/js-client-sdk.iprecomputedclientconfig.subjectattributes.md

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@eppo/js-client-sdk](./js-client-sdk.md) &gt; [IPrecomputedClientConfigSync](./js-client-sdk.iprecomputedclientconfigsync.md) &gt; [assignmentLogger](./js-client-sdk.iprecomputedclientconfigsync.assignmentlogger.md)
4+
5+
## IPrecomputedClientConfigSync.assignmentLogger property
6+
7+
**Signature:**
8+
9+
```typescript
10+
assignmentLogger?: IAssignmentLogger;
11+
```
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@eppo/js-client-sdk](./js-client-sdk.md) &gt; [IPrecomputedClientConfigSync](./js-client-sdk.iprecomputedclientconfigsync.md)
4+
5+
## IPrecomputedClientConfigSync interface
6+
7+
Configuration parameters for initializing the Eppo precomputed client.
8+
9+
This interface is used for cases where precomputed assignments are available from an external process that can bootstrap the SDK client.
10+
11+
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.
12+
13+
**Signature:**
14+
15+
```typescript
16+
export interface IPrecomputedClientConfigSync
17+
```
18+
19+
## Properties
20+
21+
<table><thead><tr><th>
22+
23+
Property
24+
25+
26+
</th><th>
27+
28+
Modifiers
29+
30+
31+
</th><th>
32+
33+
Type
34+
35+
36+
</th><th>
37+
38+
Description
39+
40+
41+
</th></tr></thead>
42+
<tbody><tr><td>
43+
44+
[assignmentLogger?](./js-client-sdk.iprecomputedclientconfigsync.assignmentlogger.md)
45+
46+
47+
</td><td>
48+
49+
50+
</td><td>
51+
52+
IAssignmentLogger
53+
54+
55+
</td><td>
56+
57+
_(Optional)_
58+
59+
60+
</td></tr>
61+
<tr><td>
62+
63+
[precomputedConfiguration](./js-client-sdk.iprecomputedclientconfigsync.precomputedconfiguration.md)
64+
65+
66+
</td><td>
67+
68+
69+
</td><td>
70+
71+
string
72+
73+
74+
</td><td>
75+
76+
77+
</td></tr>
78+
<tr><td>
79+
80+
[throwOnFailedInitialization?](./js-client-sdk.iprecomputedclientconfigsync.throwonfailedinitialization.md)
81+
82+
83+
</td><td>
84+
85+
86+
</td><td>
87+
88+
boolean
89+
90+
91+
</td><td>
92+
93+
_(Optional)_
94+
95+
96+
</td></tr>
97+
</tbody></table>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@eppo/js-client-sdk](./js-client-sdk.md) &gt; [IPrecomputedClientConfigSync](./js-client-sdk.iprecomputedclientconfigsync.md) &gt; [precomputedConfiguration](./js-client-sdk.iprecomputedclientconfigsync.precomputedconfiguration.md)
4+
5+
## IPrecomputedClientConfigSync.precomputedConfiguration property
6+
7+
**Signature:**
8+
9+
```typescript
10+
precomputedConfiguration: string;
11+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@eppo/js-client-sdk](./js-client-sdk.md) &gt; [IPrecomputedClientConfigSync](./js-client-sdk.iprecomputedclientconfigsync.md) &gt; [throwOnFailedInitialization](./js-client-sdk.iprecomputedclientconfigsync.throwonfailedinitialization.md)
4+
5+
## IPrecomputedClientConfigSync.throwOnFailedInitialization property
6+
7+
**Signature:**
8+
9+
```typescript
10+
throwOnFailedInitialization?: boolean;
11+
```

0 commit comments

Comments
 (0)