@seamapi/http 2.24.0 → 2.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/routes/access-codes/access-codes.js +1 -1
- package/lib/routes/access-codes/access-codes.js.map +1 -1
- package/lib/routes/access-codes/simulate/simulate.js +1 -1
- package/lib/routes/access-codes/simulate/simulate.js.map +1 -1
- package/lib/routes/access-codes/unmanaged/unmanaged.js +1 -1
- package/lib/routes/access-codes/unmanaged/unmanaged.js.map +1 -1
- package/lib/routes/access-grants/access-grants.js +1 -1
- package/lib/routes/access-grants/access-grants.js.map +1 -1
- package/lib/routes/access-grants/unmanaged/unmanaged.js +1 -1
- package/lib/routes/access-grants/unmanaged/unmanaged.js.map +1 -1
- package/lib/routes/access-methods/access-methods.js +1 -1
- package/lib/routes/access-methods/access-methods.js.map +1 -1
- package/lib/routes/access-methods/unmanaged/unmanaged.js +1 -1
- package/lib/routes/access-methods/unmanaged/unmanaged.js.map +1 -1
- package/lib/routes/acs/access-groups/access-groups.js +1 -1
- package/lib/routes/acs/access-groups/access-groups.js.map +1 -1
- package/lib/routes/acs/acs.js +1 -1
- package/lib/routes/acs/acs.js.map +1 -1
- package/lib/routes/acs/credentials/credentials.js +1 -1
- package/lib/routes/acs/credentials/credentials.js.map +1 -1
- package/lib/routes/acs/encoders/encoders.js +1 -1
- package/lib/routes/acs/encoders/encoders.js.map +1 -1
- package/lib/routes/acs/encoders/simulate/simulate.js +1 -1
- package/lib/routes/acs/encoders/simulate/simulate.js.map +1 -1
- package/lib/routes/acs/entrances/entrances.js +1 -1
- package/lib/routes/acs/entrances/entrances.js.map +1 -1
- package/lib/routes/acs/systems/systems.js +1 -1
- package/lib/routes/acs/systems/systems.js.map +1 -1
- package/lib/routes/acs/users/users.js +1 -1
- package/lib/routes/acs/users/users.js.map +1 -1
- package/lib/routes/action-attempts/action-attempts.js +1 -1
- package/lib/routes/action-attempts/action-attempts.js.map +1 -1
- package/lib/routes/client-sessions/client-sessions.js +1 -1
- package/lib/routes/client-sessions/client-sessions.js.map +1 -1
- package/lib/routes/connect-webviews/connect-webviews.js +1 -1
- package/lib/routes/connect-webviews/connect-webviews.js.map +1 -1
- package/lib/routes/connected-accounts/connected-accounts.js +1 -1
- package/lib/routes/connected-accounts/connected-accounts.js.map +1 -1
- package/lib/routes/connected-accounts/simulate/simulate.js +1 -1
- package/lib/routes/connected-accounts/simulate/simulate.js.map +1 -1
- package/lib/routes/customers/customers.js +1 -1
- package/lib/routes/customers/customers.js.map +1 -1
- package/lib/routes/devices/devices.js +1 -1
- package/lib/routes/devices/devices.js.map +1 -1
- package/lib/routes/devices/simulate/simulate.js +1 -1
- package/lib/routes/devices/simulate/simulate.js.map +1 -1
- package/lib/routes/devices/unmanaged/unmanaged.js +1 -1
- package/lib/routes/devices/unmanaged/unmanaged.js.map +1 -1
- package/lib/routes/events/events.js +1 -1
- package/lib/routes/events/events.js.map +1 -1
- package/lib/routes/instant-keys/instant-keys.js +1 -1
- package/lib/routes/instant-keys/instant-keys.js.map +1 -1
- package/lib/routes/locks/locks.js +1 -1
- package/lib/routes/locks/locks.js.map +1 -1
- package/lib/routes/locks/simulate/simulate.js +1 -1
- package/lib/routes/locks/simulate/simulate.js.map +1 -1
- package/lib/routes/noise-sensors/noise-sensors.js +1 -1
- package/lib/routes/noise-sensors/noise-sensors.js.map +1 -1
- package/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.js +1 -1
- package/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.js.map +1 -1
- package/lib/routes/noise-sensors/simulate/simulate.js +1 -1
- package/lib/routes/noise-sensors/simulate/simulate.js.map +1 -1
- package/lib/routes/phones/phones.js +1 -1
- package/lib/routes/phones/phones.js.map +1 -1
- package/lib/routes/phones/simulate/simulate.js +1 -1
- package/lib/routes/phones/simulate/simulate.js.map +1 -1
- package/lib/routes/seam-http-endpoints.js +1 -1
- package/lib/routes/seam-http-endpoints.js.map +1 -1
- package/lib/routes/seam-http.js +1 -1
- package/lib/routes/seam-http.js.map +1 -1
- package/lib/routes/spaces/spaces.js +1 -1
- package/lib/routes/spaces/spaces.js.map +1 -1
- package/lib/routes/thermostats/daily-programs/daily-programs.js +1 -1
- package/lib/routes/thermostats/daily-programs/daily-programs.js.map +1 -1
- package/lib/routes/thermostats/schedules/schedules.js +1 -1
- package/lib/routes/thermostats/schedules/schedules.js.map +1 -1
- package/lib/routes/thermostats/simulate/simulate.js +1 -1
- package/lib/routes/thermostats/simulate/simulate.js.map +1 -1
- package/lib/routes/thermostats/thermostats.js +1 -1
- package/lib/routes/thermostats/thermostats.js.map +1 -1
- package/lib/routes/user-identities/unmanaged/unmanaged.js +1 -1
- package/lib/routes/user-identities/unmanaged/unmanaged.js.map +1 -1
- package/lib/routes/user-identities/user-identities.js +1 -1
- package/lib/routes/user-identities/user-identities.js.map +1 -1
- package/lib/routes/webhooks/webhooks.js +1 -1
- package/lib/routes/webhooks/webhooks.js.map +1 -1
- package/lib/routes/workspaces/workspaces.js +1 -1
- package/lib/routes/workspaces/workspaces.js.map +1 -1
- package/lib/seam-http-request.d.ts +4 -0
- package/lib/seam-http-request.js +18 -0
- package/lib/seam-http-request.js.map +1 -1
- package/lib/seam-paginator.d.ts +1 -7
- package/lib/seam-paginator.js +3 -19
- package/lib/seam-paginator.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/lib/routes/access-codes/access-codes.ts +1 -1
- package/src/lib/routes/access-codes/simulate/simulate.ts +1 -1
- package/src/lib/routes/access-codes/unmanaged/unmanaged.ts +1 -1
- package/src/lib/routes/access-grants/access-grants.ts +1 -1
- package/src/lib/routes/access-grants/unmanaged/unmanaged.ts +1 -1
- package/src/lib/routes/access-methods/access-methods.ts +1 -1
- package/src/lib/routes/access-methods/unmanaged/unmanaged.ts +1 -1
- package/src/lib/routes/acs/access-groups/access-groups.ts +1 -1
- package/src/lib/routes/acs/acs.ts +1 -1
- package/src/lib/routes/acs/credentials/credentials.ts +1 -1
- package/src/lib/routes/acs/encoders/encoders.ts +1 -1
- package/src/lib/routes/acs/encoders/simulate/simulate.ts +1 -1
- package/src/lib/routes/acs/entrances/entrances.ts +1 -1
- package/src/lib/routes/acs/systems/systems.ts +1 -1
- package/src/lib/routes/acs/users/users.ts +1 -1
- package/src/lib/routes/action-attempts/action-attempts.ts +1 -1
- package/src/lib/routes/client-sessions/client-sessions.ts +1 -1
- package/src/lib/routes/connect-webviews/connect-webviews.ts +1 -1
- package/src/lib/routes/connected-accounts/connected-accounts.ts +1 -1
- package/src/lib/routes/connected-accounts/simulate/simulate.ts +1 -1
- package/src/lib/routes/customers/customers.ts +1 -1
- package/src/lib/routes/devices/devices.ts +1 -1
- package/src/lib/routes/devices/simulate/simulate.ts +1 -1
- package/src/lib/routes/devices/unmanaged/unmanaged.ts +1 -1
- package/src/lib/routes/events/events.ts +1 -1
- package/src/lib/routes/instant-keys/instant-keys.ts +1 -1
- package/src/lib/routes/locks/locks.ts +1 -1
- package/src/lib/routes/locks/simulate/simulate.ts +1 -1
- package/src/lib/routes/noise-sensors/noise-sensors.ts +1 -1
- package/src/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.ts +1 -1
- package/src/lib/routes/noise-sensors/simulate/simulate.ts +1 -1
- package/src/lib/routes/phones/phones.ts +1 -1
- package/src/lib/routes/phones/simulate/simulate.ts +1 -1
- package/src/lib/routes/seam-http-endpoints.ts +1 -1
- package/src/lib/routes/seam-http.ts +1 -1
- package/src/lib/routes/spaces/spaces.ts +1 -1
- package/src/lib/routes/thermostats/daily-programs/daily-programs.ts +1 -1
- package/src/lib/routes/thermostats/schedules/schedules.ts +1 -1
- package/src/lib/routes/thermostats/simulate/simulate.ts +1 -1
- package/src/lib/routes/thermostats/thermostats.ts +1 -1
- package/src/lib/routes/user-identities/unmanaged/unmanaged.ts +1 -1
- package/src/lib/routes/user-identities/user-identities.ts +1 -1
- package/src/lib/routes/webhooks/webhooks.ts +1 -1
- package/src/lib/routes/workspaces/workspaces.ts +1 -1
- package/src/lib/seam-http-request.ts +23 -0
- package/src/lib/seam-paginator.ts +2 -33
- package/src/lib/version.ts +1 -1
|
@@ -142,7 +142,7 @@ export class SeamHttpNoiseSensors {
|
|
|
142
142
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
143
143
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
144
144
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
145
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
145
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
async updateClientSessionToken(
|
|
@@ -142,7 +142,7 @@ export class SeamHttpNoiseSensorsNoiseThresholds {
|
|
|
142
142
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
143
143
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
144
144
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
145
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
145
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
async updateClientSessionToken(
|
|
@@ -138,7 +138,7 @@ export class SeamHttpNoiseSensorsSimulate {
|
|
|
138
138
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
139
139
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
140
140
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
141
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
141
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
async updateClientSessionToken(
|
|
@@ -141,7 +141,7 @@ export class SeamHttpPhones {
|
|
|
141
141
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
142
142
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
143
143
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
144
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
144
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
async updateClientSessionToken(
|
|
@@ -139,7 +139,7 @@ export class SeamHttpPhonesSimulate {
|
|
|
139
139
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
140
140
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
141
141
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
142
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
142
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
async updateClientSessionToken(
|
|
@@ -864,7 +864,7 @@ export class SeamHttpEndpoints {
|
|
|
864
864
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
865
865
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
866
866
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
867
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
867
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
868
868
|
}
|
|
869
869
|
|
|
870
870
|
async updateClientSessionToken(
|
|
@@ -155,7 +155,7 @@ export class SeamHttp {
|
|
|
155
155
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
156
156
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
157
157
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
158
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
158
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
async updateClientSessionToken(
|
|
@@ -141,7 +141,7 @@ export class SeamHttpSpaces {
|
|
|
141
141
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
142
142
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
143
143
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
144
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
144
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
async updateClientSessionToken(
|
|
@@ -144,7 +144,7 @@ export class SeamHttpThermostatsDailyPrograms {
|
|
|
144
144
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
145
145
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
146
146
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
147
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
147
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
async updateClientSessionToken(
|
|
@@ -139,7 +139,7 @@ export class SeamHttpThermostatsSchedules {
|
|
|
139
139
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
140
140
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
141
141
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
142
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
142
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
async updateClientSessionToken(
|
|
@@ -138,7 +138,7 @@ export class SeamHttpThermostatsSimulate {
|
|
|
138
138
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
139
139
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
140
140
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
141
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
141
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
async updateClientSessionToken(
|
|
@@ -145,7 +145,7 @@ export class SeamHttpThermostats {
|
|
|
145
145
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
146
146
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
147
147
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
148
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
148
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
async updateClientSessionToken(
|
|
@@ -142,7 +142,7 @@ export class SeamHttpUserIdentitiesUnmanaged {
|
|
|
142
142
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
143
143
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
144
144
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
145
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
145
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
async updateClientSessionToken(
|
|
@@ -147,7 +147,7 @@ export class SeamHttpUserIdentities {
|
|
|
147
147
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
148
148
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
149
149
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
150
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
150
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
async updateClientSessionToken(
|
|
@@ -139,7 +139,7 @@ export class SeamHttpWebhooks {
|
|
|
139
139
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
140
140
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
141
141
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
142
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
142
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
async updateClientSessionToken(
|
|
@@ -141,7 +141,7 @@ export class SeamHttpWorkspaces {
|
|
|
141
141
|
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
142
142
|
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
143
143
|
): SeamPaginator<TResponse, TResponseKey> {
|
|
144
|
-
return new SeamPaginator<TResponse, TResponseKey>(
|
|
144
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
async updateClientSessionToken(
|
|
@@ -124,6 +124,29 @@ export class SeamHttpRequest<
|
|
|
124
124
|
return this.#config.body
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Returns a copy of this request with the page cursor set.
|
|
129
|
+
*/
|
|
130
|
+
withPageCursor(
|
|
131
|
+
pageCursor?: string,
|
|
132
|
+
): SeamHttpRequest<TResponse, TResponseKey> {
|
|
133
|
+
const usesParams = ['GET', 'DELETE'].includes(this.method.toUpperCase())
|
|
134
|
+
|
|
135
|
+
const requestData = {
|
|
136
|
+
...(usesParams
|
|
137
|
+
? (this.#config.params ?? {})
|
|
138
|
+
: ((this.#config.body as Record<string, unknown> | null) ?? {})),
|
|
139
|
+
page_cursor: pageCursor,
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return new SeamHttpRequest(this.#parent, {
|
|
143
|
+
...this.#config,
|
|
144
|
+
parameters: requestData,
|
|
145
|
+
params: usesParams ? requestData : undefined,
|
|
146
|
+
body: usesParams ? undefined : requestData,
|
|
147
|
+
})
|
|
148
|
+
}
|
|
149
|
+
|
|
127
150
|
/**
|
|
128
151
|
* Sends the request and returns the response data.
|
|
129
152
|
* If the response contains an action attempt,
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import type { Client } from './client.js'
|
|
2
|
-
import type { SeamHttpRequestOptions } from './options.js'
|
|
3
1
|
import { SeamHttpInvalidResponseError } from './seam-http-error.js'
|
|
4
2
|
import {
|
|
5
3
|
readResponseData,
|
|
6
|
-
SeamHttpRequest,
|
|
7
4
|
type SeamPaginatedRequest,
|
|
8
5
|
} from './seam-http-request.js'
|
|
9
6
|
|
|
10
|
-
interface SeamPaginatorParent {
|
|
11
|
-
readonly client: Client
|
|
12
|
-
readonly defaults: Required<SeamHttpRequestOptions>
|
|
13
|
-
}
|
|
14
|
-
|
|
15
7
|
declare const $brand: unique symbol
|
|
16
8
|
|
|
17
9
|
/**
|
|
@@ -39,18 +31,13 @@ export class SeamPaginator<
|
|
|
39
31
|
const TResponseKey extends keyof TResponse,
|
|
40
32
|
> implements AsyncIterable<EnsureReadonlyArray<TResponse[TResponseKey]>> {
|
|
41
33
|
readonly #request: SeamPaginatedRequest<TResponse, TResponseKey>
|
|
42
|
-
readonly #parent: SeamPaginatorParent
|
|
43
34
|
|
|
44
|
-
constructor(
|
|
45
|
-
parent: SeamPaginatorParent,
|
|
46
|
-
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
47
|
-
) {
|
|
35
|
+
constructor(request: SeamPaginatedRequest<TResponse, TResponseKey>) {
|
|
48
36
|
if (!request.hasPagination) {
|
|
49
37
|
throw new Error(
|
|
50
38
|
`The ${request.pathname} endpoint does not support pagination`,
|
|
51
39
|
)
|
|
52
40
|
}
|
|
53
|
-
this.#parent = parent
|
|
54
41
|
this.#request = request
|
|
55
42
|
}
|
|
56
43
|
|
|
@@ -86,22 +73,7 @@ export class SeamPaginator<
|
|
|
86
73
|
throw new Error('Cannot paginate a response without a responseKey')
|
|
87
74
|
}
|
|
88
75
|
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
const requestData = {
|
|
92
|
-
...(usesParams(method)
|
|
93
|
-
? (this.#request.params ?? {})
|
|
94
|
-
: ((this.#request.body as Record<string, unknown> | null) ?? {})),
|
|
95
|
-
page_cursor: nextPageCursor,
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const request = new SeamHttpRequest<TResponse, TResponseKey>(this.#parent, {
|
|
99
|
-
pathname: this.#request.pathname,
|
|
100
|
-
method,
|
|
101
|
-
responseKey,
|
|
102
|
-
params: usesParams(method) ? requestData : undefined,
|
|
103
|
-
body: usesParams(method) ? undefined : requestData,
|
|
104
|
-
})
|
|
76
|
+
const request = this.#request.withPageCursor(nextPageCursor ?? undefined)
|
|
105
77
|
|
|
106
78
|
const response = await request.fetchResponse()
|
|
107
79
|
const data = readResponseData(response, responseKey, request.pathname)
|
|
@@ -193,9 +165,6 @@ export class SeamPaginator<
|
|
|
193
165
|
}
|
|
194
166
|
}
|
|
195
167
|
|
|
196
|
-
const usesParams = (method: string): boolean =>
|
|
197
|
-
['GET', 'DELETE'].includes(method.toUpperCase())
|
|
198
|
-
|
|
199
168
|
type EnsureReadonlyArray<T> = T extends readonly any[] ? T : never
|
|
200
169
|
type EnsureMutableArray<T> = T extends any[] ? T : never
|
|
201
170
|
type ElementOfArray<T> =
|
package/src/lib/version.ts
CHANGED