Skip to content

Commit 955ae8e

Browse files
committed
Align request properties with URL spec
1 parent d8863db commit 955ae8e

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/lib/seam/connect/seam-http-request.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ interface SeamHttpRequestParent {
1111
}
1212

1313
export interface SeamHttpRequestConfig<TBody, TResponseKey> {
14-
readonly url?: string
14+
readonly path?: string
1515
readonly method?: Method
16-
readonly params?: any
1716
readonly data?: TBody
1817
readonly responseKey: TResponseKey
1918
readonly options?: Pick<SeamHttpRequestOptions, 'waitForActionAttempt'>
@@ -43,18 +42,14 @@ export class SeamHttpRequest<
4342
return this.#config.responseKey
4443
}
4544

46-
public get url(): string {
47-
return this.#config.url ?? ''
45+
public get path(): string {
46+
return this.#config.path ?? ''
4847
}
4948

5049
public get method(): Method {
5150
return this.#config.method ?? 'get'
5251
}
5352

54-
public get params(): any {
55-
return this.#config.params
56-
}
57-
5853
public get data(): TBody {
5954
return this.#config.data as TBody
6055
}
@@ -64,9 +59,8 @@ export class SeamHttpRequest<
6459
> {
6560
const { client } = this.#parent
6661
const response = await client.request({
67-
url: this.url,
62+
url: this.path,
6863
method: this.method,
69-
params: this.params,
7064
data: this.data,
7165
})
7266
if (this.responseKey === undefined) {

test/seam/connect/seam-http-request.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test('returns a SeamHttpRequest', async (t) => {
1212
const deviceRequest = seam.devices.get({ device_id: seed.august_device_1 })
1313

1414
t.true(deviceRequest instanceof SeamHttpRequest)
15-
t.is(deviceRequest.url, '/devices/get')
15+
t.is(deviceRequest.path, '/devices/get')
1616
t.deepEqual(deviceRequest.data, {
1717
device_id: seed.august_device_1,
1818
})

0 commit comments

Comments
 (0)