Skip to content

Commit d4b9679

Browse files
(chore) export BanditLogger and BanditEvent (#148)
* chore: export BanditLogger and BanditEvent * wire in bandit logger * docs * lock * fix uuid * commons 4.8.2 * add bandit actions logger * docs * 3.9.4-alpha.4
1 parent 041afa8 commit d4b9679

13 files changed

+211
-19
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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; [EppoPrecomputedJSClient](./js-client-sdk.eppoprecomputedjsclient.md) &gt; [getBanditAction](./js-client-sdk.eppoprecomputedjsclient.getbanditaction.md)
4+
5+
## EppoPrecomputedJSClient.getBanditAction() method
6+
7+
**Signature:**
8+
9+
```typescript
10+
getBanditAction(flagKey: string, defaultValue: string): Omit<IAssignmentDetails<string>, 'evaluationDetails'>;
11+
```
12+
13+
## Parameters
14+
15+
<table><thead><tr><th>
16+
17+
Parameter
18+
19+
20+
</th><th>
21+
22+
Type
23+
24+
25+
</th><th>
26+
27+
Description
28+
29+
30+
</th></tr></thead>
31+
<tbody><tr><td>
32+
33+
flagKey
34+
35+
36+
</td><td>
37+
38+
string
39+
40+
41+
</td><td>
42+
43+
44+
</td></tr>
45+
<tr><td>
46+
47+
defaultValue
48+
49+
50+
</td><td>
51+
52+
string
53+
54+
55+
</td><td>
56+
57+
58+
</td></tr>
59+
</tbody></table>
60+
**Returns:**
61+
62+
Omit&lt;IAssignmentDetails&lt;string&gt;, 'evaluationDetails'&gt;
63+

docs/js-client-sdk.eppoprecomputedjsclient.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ Description
9696
</th></tr></thead>
9797
<tbody><tr><td>
9898
99+
[getBanditAction(flagKey, defaultValue)](./js-client-sdk.eppoprecomputedjsclient.getbanditaction.md)
100+
101+
102+
</td><td>
103+
104+
105+
</td><td>
106+
107+
108+
</td></tr>
109+
<tr><td>
110+
99111
[getBooleanAssignment(flagKey, defaultValue)](./js-client-sdk.eppoprecomputedjsclient.getbooleanassignment.md)
100112
101113
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; [IClientConfigSync](./js-client-sdk.iclientconfigsync.md) &gt; [banditLogger](./js-client-sdk.iclientconfigsync.banditlogger.md)
4+
5+
## IClientConfigSync.banditLogger property
6+
7+
**Signature:**
8+
9+
```typescript
10+
banditLogger?: IBanditLogger;
11+
```

docs/js-client-sdk.iclientconfigsync.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,25 @@ IAssignmentLogger
5353
_(Optional)_
5454

5555

56+
</td></tr>
57+
<tr><td>
58+
59+
[banditLogger?](./js-client-sdk.iclientconfigsync.banditlogger.md)
60+
61+
62+
</td><td>
63+
64+
65+
</td><td>
66+
67+
IBanditLogger
68+
69+
70+
</td><td>
71+
72+
_(Optional)_
73+
74+
5675
</td></tr>
5776
<tr><td>
5877

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; [banditLogger](./js-client-sdk.iprecomputedclientconfigsync.banditlogger.md)
4+
5+
## IPrecomputedClientConfigSync.banditLogger property
6+
7+
**Signature:**
8+
9+
```typescript
10+
banditLogger?: IBanditLogger;
11+
```

docs/js-client-sdk.iprecomputedclientconfigsync.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Configuration parameters for initializing the Eppo precomputed client.
88

99
This interface is used for cases where precomputed assignments are available from an external process that can bootstrap the SDK client.
1010

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-
1311
**Signature:**
1412

1513
```typescript
@@ -57,6 +55,25 @@ IAssignmentLogger
5755
_(Optional)_
5856

5957

58+
</td></tr>
59+
<tr><td>
60+
61+
[banditLogger?](./js-client-sdk.iprecomputedclientconfigsync.banditlogger.md)
62+
63+
64+
</td><td>
65+
66+
67+
</td><td>
68+
69+
IBanditLogger
70+
71+
72+
</td><td>
73+
74+
_(Optional)_
75+
76+
6077
</td></tr>
6178
<tr><td>
6279

docs/js-client-sdk.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@ Configuration parameters for initializing the Eppo precomputed client.
224224

225225
This interface is used for cases where precomputed assignments are available from an external process that can bootstrap the SDK client.
226226

227-
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.
228-
229227

230228
</td></tr>
231229
</tbody></table>

jest.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const jestConfig = {
55
'^src/(.*)': ['<rootDir>/src/$1'],
66
'^test/(.*)': ['<rootDir>/test/$1'],
77
'@eppo(.*)': '<rootDir>/node_modules/@eppo/$1',
8-
'^uuid$': '<rootDir>/node_modules/uuid/dist/index.js',
98
},
109
testRegex: '.*\\..*spec\\.ts$',
1110
transform: {

js-client-sdk.api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import { IAssignmentDetails } from '@eppo/js-client-sdk-common';
1717
import { IAssignmentEvent } from '@eppo/js-client-sdk-common';
1818
import { IAssignmentLogger } from '@eppo/js-client-sdk-common';
1919
import { IAsyncStore } from '@eppo/js-client-sdk-common';
20+
import { IBanditEvent } from '@eppo/js-client-sdk-common';
21+
import { IBanditLogger } from '@eppo/js-client-sdk-common';
2022
import { IContainerExperiment } from '@eppo/js-client-sdk-common';
2123
import { ObfuscatedFlag } from '@eppo/js-client-sdk-common';
2224

@@ -77,6 +79,8 @@ export class EppoJSClient extends EppoClient {
7779

7880
// @public
7981
export class EppoPrecomputedJSClient extends EppoPrecomputedClient {
82+
// (undocumented)
83+
getBanditAction(flagKey: string, defaultValue: string): Omit<IAssignmentDetails<string>, 'evaluationDetails'>;
8084
// (undocumented)
8185
getBooleanAssignment(flagKey: string, defaultValue: boolean): boolean;
8286
// (undocumented)
@@ -112,6 +116,10 @@ export { IAssignmentLogger }
112116

113117
export { IAsyncStore }
114118

119+
export { IBanditEvent }
120+
121+
export { IBanditLogger }
122+
115123
// Warning: (ae-forgotten-export) The symbol "IBaseRequestConfig" needs to be exported by the entry point index.d.ts
116124
//
117125
// @public
@@ -138,6 +146,8 @@ export interface IClientConfigSync {
138146
// (undocumented)
139147
assignmentLogger?: IAssignmentLogger;
140148
// (undocumented)
149+
banditLogger?: IBanditLogger;
150+
// (undocumented)
141151
flagsConfiguration: Record<string, Flag | ObfuscatedFlag>;
142152
// (undocumented)
143153
isObfuscated?: boolean;
@@ -161,6 +171,8 @@ export interface IPrecomputedClientConfigSync {
161171
// (undocumented)
162172
assignmentLogger?: IAssignmentLogger;
163173
// (undocumented)
174+
banditLogger?: IBanditLogger;
175+
// (undocumented)
164176
precomputedConfiguration: string;
165177
// (undocumented)
166178
throwOnFailedInitialization?: boolean;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eppo/js-client-sdk",
3-
"version": "3.9.3",
3+
"version": "3.9.4-alpha.4",
44
"description": "Eppo SDK for client-side JavaScript applications",
55
"main": "dist/index.js",
66
"files": [
@@ -60,7 +60,7 @@
6060
"webpack-cli": "^6.0.1"
6161
},
6262
"dependencies": {
63-
"@eppo/js-client-sdk-common": "4.8.1"
63+
"@eppo/js-client-sdk-common": "4.8.2"
6464
},
6565
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
66-
}
66+
}

0 commit comments

Comments
 (0)