Skip to content

Commit 90089e7

Browse files
committed
update HOPRd SDK to be compatible with 2.0.1
1 parent 2bdebbc commit 90089e7

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/api/settings/getSettings.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ describe('test getSettings', function () {
1111
});
1212
it('handles successful response', async function () {
1313
nock(API_ENDPOINT).get(`/api/v3/settings`).reply(200, {
14-
includeRecipient: true,
15-
strategy: 'passive'
14+
includeRecipient: true
1615
});
1716

1817
const response = await getSettings({
1918
apiToken: API_TOKEN,
2019
apiEndpoint: API_ENDPOINT
2120
});
2221

23-
expect(response.strategy).toEqual('passive');
22+
expect(response.includeRecipient).toEqual(true);
2423
});
2524
it('throws a custom error when hoprd api response is an 400 error', async function () {
2625
nock(API_ENDPOINT).get(`/api/v3/settings`).reply(400, {

src/api/settings/setSetting.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { setSetting } from './setSetting';
44

55
const API_ENDPOINT = 'http://localhost:3001';
66
const API_TOKEN = 'S3CR3T-T0K3N';
7-
const SETTING = 'strategy';
7+
const SETTING = 'includeRecipient';
88

99
describe('test getSettings', function () {
1010
beforeEach(function () {
@@ -17,7 +17,7 @@ describe('test getSettings', function () {
1717
apiToken: API_TOKEN,
1818
apiEndpoint: API_ENDPOINT,
1919
setting: SETTING,
20-
settingValue: 'passive'
20+
settingValue: true
2121
});
2222

2323
expect(response).toEqual(true);
@@ -32,7 +32,7 @@ describe('test getSettings', function () {
3232
apiToken: API_TOKEN,
3333
apiEndpoint: API_ENDPOINT,
3434
setting: SETTING,
35-
settingValue: 'passive'
35+
settingValue: false
3636
})
3737
).rejects.toThrow(APIError);
3838
});
@@ -47,7 +47,7 @@ describe('test getSettings', function () {
4747
apiToken: API_TOKEN,
4848
apiEndpoint: API_ENDPOINT,
4949
setting: SETTING,
50-
settingValue: 'passive'
50+
settingValue: false
5151
})
5252
).rejects.toThrow(APIError);
5353
});
@@ -62,7 +62,7 @@ describe('test getSettings', function () {
6262
apiToken: API_TOKEN,
6363
apiEndpoint: API_ENDPOINT,
6464
setting: SETTING,
65-
settingValue: 'passive'
65+
settingValue: false
6666
})
6767
).rejects.toThrow(APIError);
6868
});
@@ -77,7 +77,7 @@ describe('test getSettings', function () {
7777
apiToken: API_TOKEN,
7878
apiEndpoint: API_ENDPOINT,
7979
setting: SETTING,
80-
settingValue: 'passive'
80+
settingValue: false
8181
})
8282
).rejects.toThrow(APIError);
8383
});

src/types/settings.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import { BasePayload } from './general';
66
*/
77

88
export const GetSettingsResponse = z.object({
9-
includeRecipient: z.boolean(),
10-
strategy: z.string().optional()
9+
includeRecipient: z.boolean()
1110
});
1211

1312
export type GetSettingsResponseType = z.infer<typeof GetSettingsResponse>;

0 commit comments

Comments
 (0)