@seamapi/http 0.0.2 → 0.1.0
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/dist/connect.cjs +1386 -61
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +420 -7
- package/lib/seam/connect/auth.d.ts +1 -1
- package/lib/seam/connect/auth.js +7 -7
- package/lib/seam/connect/auth.js.map +1 -1
- package/lib/seam/connect/axios.js +3 -1
- package/lib/seam/connect/axios.js.map +1 -1
- package/lib/seam/connect/client-options.d.ts +7 -3
- package/lib/seam/connect/client-options.js +18 -3
- package/lib/seam/connect/client-options.js.map +1 -1
- package/lib/seam/connect/client.d.ts +16 -4
- package/lib/seam/connect/client.js +55 -28
- package/lib/seam/connect/client.js.map +1 -1
- package/lib/seam/connect/parse-options.d.ts +1 -1
- package/lib/seam/connect/parse-options.js +8 -1
- package/lib/seam/connect/parse-options.js.map +1 -1
- package/lib/seam/connect/routes/access-codes-unmanaged.d.ts +26 -0
- package/lib/seam/connect/routes/access-codes-unmanaged.js +72 -0
- package/lib/seam/connect/routes/access-codes-unmanaged.js.map +1 -0
- package/lib/seam/connect/routes/access-codes.d.ts +37 -0
- package/lib/seam/connect/routes/access-codes.js +101 -0
- package/lib/seam/connect/routes/access-codes.js.map +1 -0
- package/lib/seam/connect/routes/acs-access-groups.d.ts +35 -0
- package/lib/seam/connect/routes/acs-access-groups.js +95 -0
- package/lib/seam/connect/routes/acs-access-groups.js.map +1 -0
- package/lib/seam/connect/routes/acs-credentials.d.ts +23 -0
- package/lib/seam/connect/routes/acs-credentials.js +66 -0
- package/lib/seam/connect/routes/acs-credentials.js.map +1 -0
- package/lib/seam/connect/routes/acs-systems.d.ts +17 -0
- package/lib/seam/connect/routes/acs-systems.js +51 -0
- package/lib/seam/connect/routes/acs-systems.js.map +1 -0
- package/lib/seam/connect/routes/acs-users.d.ts +32 -0
- package/lib/seam/connect/routes/acs-users.js +87 -0
- package/lib/seam/connect/routes/acs-users.js.map +1 -0
- package/lib/seam/connect/routes/acs.d.ts +17 -0
- package/lib/seam/connect/routes/acs.js +51 -0
- package/lib/seam/connect/routes/acs.js.map +1 -0
- package/lib/seam/connect/routes/action-attempts.d.ts +17 -0
- package/lib/seam/connect/routes/action-attempts.js +51 -0
- package/lib/seam/connect/routes/action-attempts.js.map +1 -0
- package/lib/seam/connect/routes/client-sessions.d.ts +26 -0
- package/lib/seam/connect/routes/client-sessions.js +74 -0
- package/lib/seam/connect/routes/client-sessions.js.map +1 -0
- package/lib/seam/connect/routes/connect-webviews.d.ts +26 -0
- package/lib/seam/connect/routes/connect-webviews.js +73 -0
- package/lib/seam/connect/routes/connect-webviews.js.map +1 -0
- package/lib/seam/connect/routes/connected-accounts.d.ts +20 -0
- package/lib/seam/connect/routes/connected-accounts.js +58 -0
- package/lib/seam/connect/routes/connected-accounts.js.map +1 -0
- package/lib/seam/connect/routes/devices-unmanaged.d.ts +20 -0
- package/lib/seam/connect/routes/devices-unmanaged.js +58 -0
- package/lib/seam/connect/routes/devices-unmanaged.js.map +1 -0
- package/lib/seam/connect/routes/devices.d.ts +28 -0
- package/lib/seam/connect/routes/devices.js +77 -0
- package/lib/seam/connect/routes/devices.js.map +1 -0
- package/lib/seam/connect/routes/events.d.ts +17 -0
- package/lib/seam/connect/routes/events.js +51 -0
- package/lib/seam/connect/routes/events.js.map +1 -0
- package/lib/seam/connect/routes/index.d.ts +21 -0
- package/lib/seam/connect/routes/index.js +22 -0
- package/lib/seam/connect/routes/index.js.map +1 -0
- package/lib/seam/connect/routes/locks.d.ts +23 -0
- package/lib/seam/connect/routes/locks.js +67 -0
- package/lib/seam/connect/routes/locks.js.map +1 -0
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +26 -0
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js +72 -0
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -0
- package/lib/seam/connect/routes/noise-sensors.d.ts +11 -0
- package/lib/seam/connect/routes/noise-sensors.js +39 -0
- package/lib/seam/connect/routes/noise-sensors.js.map +1 -0
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.d.ts +26 -0
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js +73 -0
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js.map +1 -0
- package/lib/seam/connect/routes/thermostats.d.ts +37 -0
- package/lib/seam/connect/routes/thermostats.js +97 -0
- package/lib/seam/connect/routes/thermostats.js.map +1 -0
- package/lib/seam/connect/routes/webhooks.d.ts +23 -0
- package/lib/seam/connect/routes/webhooks.js +66 -0
- package/lib/seam/connect/routes/webhooks.js.map +1 -0
- package/lib/seam/connect/routes/workspaces.d.ts +14 -5
- package/lib/seam/connect/routes/workspaces.js +48 -10
- package/lib/seam/connect/routes/workspaces.js.map +1 -1
- package/package.json +4 -1
- package/src/lib/seam/connect/auth.ts +7 -7
- package/src/lib/seam/connect/axios.ts +2 -0
- package/src/lib/seam/connect/client-options.ts +32 -4
- package/src/lib/seam/connect/client.ts +88 -15
- package/src/lib/seam/connect/parse-options.ts +16 -2
- package/src/lib/seam/connect/routes/access-codes-unmanaged.ts +157 -0
- package/src/lib/seam/connect/routes/access-codes.ts +226 -0
- package/src/lib/seam/connect/routes/acs-access-groups.ts +207 -0
- package/src/lib/seam/connect/routes/acs-credentials.ts +139 -0
- package/src/lib/seam/connect/routes/acs-systems.ts +108 -0
- package/src/lib/seam/connect/routes/acs-users.ts +187 -0
- package/src/lib/seam/connect/routes/acs.ts +85 -0
- package/src/lib/seam/connect/routes/action-attempts.ts +104 -0
- package/src/lib/seam/connect/routes/client-sessions.ts +159 -0
- package/src/lib/seam/connect/routes/connect-webviews.ts +159 -0
- package/src/lib/seam/connect/routes/connected-accounts.ts +124 -0
- package/src/lib/seam/connect/routes/devices-unmanaged.ts +120 -0
- package/src/lib/seam/connect/routes/devices.ts +158 -0
- package/src/lib/seam/connect/routes/events.ts +100 -0
- package/src/lib/seam/connect/routes/index.ts +21 -0
- package/src/lib/seam/connect/routes/locks.ts +138 -0
- package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +154 -0
- package/src/lib/seam/connect/routes/noise-sensors.ts +70 -0
- package/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts +176 -0
- package/src/lib/seam/connect/routes/thermostats.ts +206 -0
- package/src/lib/seam/connect/routes/webhooks.ts +141 -0
- package/src/lib/seam/connect/routes/workspaces.ts +100 -17
- package/lib/seam/connect/legacy/workspaces.d.ts +0 -8
- package/lib/seam/connect/legacy/workspaces.js +0 -10
- package/lib/seam/connect/legacy/workspaces.js.map +0 -1
- package/src/lib/seam/connect/legacy/workspaces.ts +0 -26
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by generate-routes.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
RouteRequestBody,
|
|
8
|
+
RouteRequestParams,
|
|
9
|
+
RouteResponse,
|
|
10
|
+
} from '@seamapi/types/connect'
|
|
11
|
+
import type { Axios } from 'axios'
|
|
12
|
+
import type { SetNonNullable } from 'type-fest'
|
|
13
|
+
|
|
14
|
+
import { createAxiosClient } from 'lib/seam/connect/axios.js'
|
|
15
|
+
import {
|
|
16
|
+
isSeamHttpOptionsWithApiKey,
|
|
17
|
+
isSeamHttpOptionsWithClient,
|
|
18
|
+
isSeamHttpOptionsWithClientSessionToken,
|
|
19
|
+
SeamHttpInvalidOptionsError,
|
|
20
|
+
type SeamHttpOptions,
|
|
21
|
+
type SeamHttpOptionsWithApiKey,
|
|
22
|
+
type SeamHttpOptionsWithClient,
|
|
23
|
+
type SeamHttpOptionsWithClientSessionToken,
|
|
24
|
+
} from 'lib/seam/connect/client-options.js'
|
|
25
|
+
import { parseOptions } from 'lib/seam/connect/parse-options.js'
|
|
26
|
+
|
|
27
|
+
import { SeamHttpAccessCodesUnmanaged } from './access-codes-unmanaged.js'
|
|
28
|
+
|
|
29
|
+
export class SeamHttpAccessCodes {
|
|
30
|
+
client: Axios
|
|
31
|
+
|
|
32
|
+
constructor(apiKeyOrOptions: string | SeamHttpOptions) {
|
|
33
|
+
const options = parseOptions(apiKeyOrOptions)
|
|
34
|
+
this.client = createAxiosClient(options)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static fromClient(
|
|
38
|
+
client: SeamHttpOptionsWithClient['client'],
|
|
39
|
+
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
40
|
+
): SeamHttpAccessCodes {
|
|
41
|
+
const opts = { ...options, client }
|
|
42
|
+
if (!isSeamHttpOptionsWithClient(opts)) {
|
|
43
|
+
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
44
|
+
}
|
|
45
|
+
return new SeamHttpAccessCodes(opts)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static fromApiKey(
|
|
49
|
+
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
50
|
+
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
51
|
+
): SeamHttpAccessCodes {
|
|
52
|
+
const opts = { ...options, apiKey }
|
|
53
|
+
if (!isSeamHttpOptionsWithApiKey(opts)) {
|
|
54
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
55
|
+
}
|
|
56
|
+
return new SeamHttpAccessCodes(opts)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static fromClientSessionToken(
|
|
60
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
61
|
+
options: Omit<
|
|
62
|
+
SeamHttpOptionsWithClientSessionToken,
|
|
63
|
+
'clientSessionToken'
|
|
64
|
+
> = {},
|
|
65
|
+
): SeamHttpAccessCodes {
|
|
66
|
+
const opts = { ...options, clientSessionToken }
|
|
67
|
+
if (!isSeamHttpOptionsWithClientSessionToken(opts)) {
|
|
68
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
69
|
+
}
|
|
70
|
+
return new SeamHttpAccessCodes(opts)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
get unmanaged(): SeamHttpAccessCodesUnmanaged {
|
|
74
|
+
return SeamHttpAccessCodesUnmanaged.fromClient(this.client)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async create(
|
|
78
|
+
body: AccessCodesCreateBody,
|
|
79
|
+
): Promise<AccessCodesCreateResponse['access_code']> {
|
|
80
|
+
const { data } = await this.client.request<AccessCodesCreateResponse>({
|
|
81
|
+
url: '/access_codes/create',
|
|
82
|
+
method: 'post',
|
|
83
|
+
data: body,
|
|
84
|
+
})
|
|
85
|
+
return data.access_code
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async createMultiple(
|
|
89
|
+
body: AccessCodesCreateMultipleBody,
|
|
90
|
+
): Promise<AccessCodesCreateMultipleResponse['access_codes']> {
|
|
91
|
+
const { data } =
|
|
92
|
+
await this.client.request<AccessCodesCreateMultipleResponse>({
|
|
93
|
+
url: '/access_codes/create_multiple',
|
|
94
|
+
method: 'post',
|
|
95
|
+
data: body,
|
|
96
|
+
})
|
|
97
|
+
return data.access_codes
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async delete(body: AccessCodesDeleteBody): Promise<void> {
|
|
101
|
+
await this.client.request<AccessCodesDeleteResponse>({
|
|
102
|
+
url: '/access_codes/delete',
|
|
103
|
+
method: 'post',
|
|
104
|
+
data: body,
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async generateCode(
|
|
109
|
+
params?: AccessCodesGenerateCodeParams,
|
|
110
|
+
): Promise<AccessCodesGenerateCodeResponse['generated_code']> {
|
|
111
|
+
const { data } = await this.client.request<AccessCodesGenerateCodeResponse>(
|
|
112
|
+
{
|
|
113
|
+
url: '/access_codes/generate_code',
|
|
114
|
+
method: 'get',
|
|
115
|
+
params,
|
|
116
|
+
},
|
|
117
|
+
)
|
|
118
|
+
return data.generated_code
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async get(
|
|
122
|
+
body: AccessCodesGetBody,
|
|
123
|
+
): Promise<AccessCodesGetResponse['access_code']> {
|
|
124
|
+
const { data } = await this.client.request<AccessCodesGetResponse>({
|
|
125
|
+
url: '/access_codes/get',
|
|
126
|
+
method: 'post',
|
|
127
|
+
data: body,
|
|
128
|
+
})
|
|
129
|
+
return data.access_code
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async list(
|
|
133
|
+
body: AccessCodesListBody,
|
|
134
|
+
): Promise<AccessCodesListResponse['access_codes']> {
|
|
135
|
+
const { data } = await this.client.request<AccessCodesListResponse>({
|
|
136
|
+
url: '/access_codes/list',
|
|
137
|
+
method: 'post',
|
|
138
|
+
data: body,
|
|
139
|
+
})
|
|
140
|
+
return data.access_codes
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async pullBackupAccessCode(
|
|
144
|
+
body: AccessCodesPullBackupAccessCodeBody,
|
|
145
|
+
): Promise<AccessCodesPullBackupAccessCodeResponse['backup_access_code']> {
|
|
146
|
+
const { data } =
|
|
147
|
+
await this.client.request<AccessCodesPullBackupAccessCodeResponse>({
|
|
148
|
+
url: '/access_codes/pull_backup_access_code',
|
|
149
|
+
method: 'post',
|
|
150
|
+
data: body,
|
|
151
|
+
})
|
|
152
|
+
return data.backup_access_code
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async update(body: AccessCodesUpdateBody): Promise<void> {
|
|
156
|
+
await this.client.request<AccessCodesUpdateResponse>({
|
|
157
|
+
url: '/access_codes/update',
|
|
158
|
+
method: 'post',
|
|
159
|
+
data: body,
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export type AccessCodesCreateBody = SetNonNullable<
|
|
165
|
+
Required<RouteRequestBody<'/access_codes/create'>>
|
|
166
|
+
>
|
|
167
|
+
|
|
168
|
+
export type AccessCodesCreateResponse = SetNonNullable<
|
|
169
|
+
Required<RouteResponse<'/access_codes/create'>>
|
|
170
|
+
>
|
|
171
|
+
|
|
172
|
+
export type AccessCodesCreateMultipleBody = SetNonNullable<
|
|
173
|
+
Required<RouteRequestBody<'/access_codes/create_multiple'>>
|
|
174
|
+
>
|
|
175
|
+
|
|
176
|
+
export type AccessCodesCreateMultipleResponse = SetNonNullable<
|
|
177
|
+
Required<RouteResponse<'/access_codes/create_multiple'>>
|
|
178
|
+
>
|
|
179
|
+
|
|
180
|
+
export type AccessCodesDeleteBody = SetNonNullable<
|
|
181
|
+
Required<RouteRequestBody<'/access_codes/delete'>>
|
|
182
|
+
>
|
|
183
|
+
|
|
184
|
+
export type AccessCodesDeleteResponse = SetNonNullable<
|
|
185
|
+
Required<RouteResponse<'/access_codes/delete'>>
|
|
186
|
+
>
|
|
187
|
+
|
|
188
|
+
export type AccessCodesGenerateCodeParams = SetNonNullable<
|
|
189
|
+
Required<RouteRequestParams<'/access_codes/generate_code'>>
|
|
190
|
+
>
|
|
191
|
+
|
|
192
|
+
export type AccessCodesGenerateCodeResponse = SetNonNullable<
|
|
193
|
+
Required<RouteResponse<'/access_codes/generate_code'>>
|
|
194
|
+
>
|
|
195
|
+
|
|
196
|
+
export type AccessCodesGetBody = SetNonNullable<
|
|
197
|
+
Required<RouteRequestBody<'/access_codes/get'>>
|
|
198
|
+
>
|
|
199
|
+
|
|
200
|
+
export type AccessCodesGetResponse = SetNonNullable<
|
|
201
|
+
Required<RouteResponse<'/access_codes/get'>>
|
|
202
|
+
>
|
|
203
|
+
|
|
204
|
+
export type AccessCodesListBody = SetNonNullable<
|
|
205
|
+
Required<RouteRequestBody<'/access_codes/list'>>
|
|
206
|
+
>
|
|
207
|
+
|
|
208
|
+
export type AccessCodesListResponse = SetNonNullable<
|
|
209
|
+
Required<RouteResponse<'/access_codes/list'>>
|
|
210
|
+
>
|
|
211
|
+
|
|
212
|
+
export type AccessCodesPullBackupAccessCodeBody = SetNonNullable<
|
|
213
|
+
Required<RouteRequestBody<'/access_codes/pull_backup_access_code'>>
|
|
214
|
+
>
|
|
215
|
+
|
|
216
|
+
export type AccessCodesPullBackupAccessCodeResponse = SetNonNullable<
|
|
217
|
+
Required<RouteResponse<'/access_codes/pull_backup_access_code'>>
|
|
218
|
+
>
|
|
219
|
+
|
|
220
|
+
export type AccessCodesUpdateBody = SetNonNullable<
|
|
221
|
+
Required<RouteRequestBody<'/access_codes/update'>>
|
|
222
|
+
>
|
|
223
|
+
|
|
224
|
+
export type AccessCodesUpdateResponse = SetNonNullable<
|
|
225
|
+
Required<RouteResponse<'/access_codes/update'>>
|
|
226
|
+
>
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by generate-routes.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
+
import type { Axios } from 'axios'
|
|
8
|
+
import type { SetNonNullable } from 'type-fest'
|
|
9
|
+
|
|
10
|
+
import { createAxiosClient } from 'lib/seam/connect/axios.js'
|
|
11
|
+
import {
|
|
12
|
+
isSeamHttpOptionsWithApiKey,
|
|
13
|
+
isSeamHttpOptionsWithClient,
|
|
14
|
+
isSeamHttpOptionsWithClientSessionToken,
|
|
15
|
+
SeamHttpInvalidOptionsError,
|
|
16
|
+
type SeamHttpOptions,
|
|
17
|
+
type SeamHttpOptionsWithApiKey,
|
|
18
|
+
type SeamHttpOptionsWithClient,
|
|
19
|
+
type SeamHttpOptionsWithClientSessionToken,
|
|
20
|
+
} from 'lib/seam/connect/client-options.js'
|
|
21
|
+
import { parseOptions } from 'lib/seam/connect/parse-options.js'
|
|
22
|
+
|
|
23
|
+
export class SeamHttpAcsAccessGroups {
|
|
24
|
+
client: Axios
|
|
25
|
+
|
|
26
|
+
constructor(apiKeyOrOptions: string | SeamHttpOptions) {
|
|
27
|
+
const options = parseOptions(apiKeyOrOptions)
|
|
28
|
+
this.client = createAxiosClient(options)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static fromClient(
|
|
32
|
+
client: SeamHttpOptionsWithClient['client'],
|
|
33
|
+
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
34
|
+
): SeamHttpAcsAccessGroups {
|
|
35
|
+
const opts = { ...options, client }
|
|
36
|
+
if (!isSeamHttpOptionsWithClient(opts)) {
|
|
37
|
+
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
38
|
+
}
|
|
39
|
+
return new SeamHttpAcsAccessGroups(opts)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static fromApiKey(
|
|
43
|
+
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
44
|
+
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
45
|
+
): SeamHttpAcsAccessGroups {
|
|
46
|
+
const opts = { ...options, apiKey }
|
|
47
|
+
if (!isSeamHttpOptionsWithApiKey(opts)) {
|
|
48
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
49
|
+
}
|
|
50
|
+
return new SeamHttpAcsAccessGroups(opts)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static fromClientSessionToken(
|
|
54
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
55
|
+
options: Omit<
|
|
56
|
+
SeamHttpOptionsWithClientSessionToken,
|
|
57
|
+
'clientSessionToken'
|
|
58
|
+
> = {},
|
|
59
|
+
): SeamHttpAcsAccessGroups {
|
|
60
|
+
const opts = { ...options, clientSessionToken }
|
|
61
|
+
if (!isSeamHttpOptionsWithClientSessionToken(opts)) {
|
|
62
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
63
|
+
}
|
|
64
|
+
return new SeamHttpAcsAccessGroups(opts)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async addUser(body: AcsAccessGroupsAddUserBody): Promise<void> {
|
|
68
|
+
await this.client.request<AcsAccessGroupsAddUserResponse>({
|
|
69
|
+
url: '/acs/access_groups/add_user',
|
|
70
|
+
method: 'post',
|
|
71
|
+
data: body,
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async create(
|
|
76
|
+
body: AcsAccessGroupsCreateBody,
|
|
77
|
+
): Promise<AcsAccessGroupsCreateResponse['acs_access_group']> {
|
|
78
|
+
const { data } = await this.client.request<AcsAccessGroupsCreateResponse>({
|
|
79
|
+
url: '/acs/access_groups/create',
|
|
80
|
+
method: 'post',
|
|
81
|
+
data: body,
|
|
82
|
+
})
|
|
83
|
+
return data.acs_access_group
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async delete(body: AcsAccessGroupsDeleteBody): Promise<void> {
|
|
87
|
+
await this.client.request<AcsAccessGroupsDeleteResponse>({
|
|
88
|
+
url: '/acs/access_groups/delete',
|
|
89
|
+
method: 'post',
|
|
90
|
+
data: body,
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async get(
|
|
95
|
+
body: AcsAccessGroupsGetBody,
|
|
96
|
+
): Promise<AcsAccessGroupsGetResponse['acs_access_group']> {
|
|
97
|
+
const { data } = await this.client.request<AcsAccessGroupsGetResponse>({
|
|
98
|
+
url: '/acs/access_groups/get',
|
|
99
|
+
method: 'post',
|
|
100
|
+
data: body,
|
|
101
|
+
})
|
|
102
|
+
return data.acs_access_group
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async list(
|
|
106
|
+
body: AcsAccessGroupsListBody,
|
|
107
|
+
): Promise<AcsAccessGroupsListResponse['acs_access_groups']> {
|
|
108
|
+
const { data } = await this.client.request<AcsAccessGroupsListResponse>({
|
|
109
|
+
url: '/acs/access_groups/list',
|
|
110
|
+
method: 'post',
|
|
111
|
+
data: body,
|
|
112
|
+
})
|
|
113
|
+
return data.acs_access_groups
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async listUsers(
|
|
117
|
+
body: AcsAccessGroupsListUsersBody,
|
|
118
|
+
): Promise<AcsAccessGroupsListUsersResponse['acs_users']> {
|
|
119
|
+
const { data } =
|
|
120
|
+
await this.client.request<AcsAccessGroupsListUsersResponse>({
|
|
121
|
+
url: '/acs/access_groups/list_users',
|
|
122
|
+
method: 'post',
|
|
123
|
+
data: body,
|
|
124
|
+
})
|
|
125
|
+
return data.acs_users
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async removeUser(body: AcsAccessGroupsRemoveUserBody): Promise<void> {
|
|
129
|
+
await this.client.request<AcsAccessGroupsRemoveUserResponse>({
|
|
130
|
+
url: '/acs/access_groups/remove_user',
|
|
131
|
+
method: 'post',
|
|
132
|
+
data: body,
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
async update(body: AcsAccessGroupsUpdateBody): Promise<void> {
|
|
137
|
+
await this.client.request<AcsAccessGroupsUpdateResponse>({
|
|
138
|
+
url: '/acs/access_groups/update',
|
|
139
|
+
method: 'post',
|
|
140
|
+
data: body,
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type AcsAccessGroupsAddUserBody = SetNonNullable<
|
|
146
|
+
Required<RouteRequestBody<'/acs/access_groups/add_user'>>
|
|
147
|
+
>
|
|
148
|
+
|
|
149
|
+
export type AcsAccessGroupsAddUserResponse = SetNonNullable<
|
|
150
|
+
Required<RouteResponse<'/acs/access_groups/add_user'>>
|
|
151
|
+
>
|
|
152
|
+
|
|
153
|
+
export type AcsAccessGroupsCreateBody = SetNonNullable<
|
|
154
|
+
Required<RouteRequestBody<'/acs/access_groups/create'>>
|
|
155
|
+
>
|
|
156
|
+
|
|
157
|
+
export type AcsAccessGroupsCreateResponse = SetNonNullable<
|
|
158
|
+
Required<RouteResponse<'/acs/access_groups/create'>>
|
|
159
|
+
>
|
|
160
|
+
|
|
161
|
+
export type AcsAccessGroupsDeleteBody = SetNonNullable<
|
|
162
|
+
Required<RouteRequestBody<'/acs/access_groups/delete'>>
|
|
163
|
+
>
|
|
164
|
+
|
|
165
|
+
export type AcsAccessGroupsDeleteResponse = SetNonNullable<
|
|
166
|
+
Required<RouteResponse<'/acs/access_groups/delete'>>
|
|
167
|
+
>
|
|
168
|
+
|
|
169
|
+
export type AcsAccessGroupsGetBody = SetNonNullable<
|
|
170
|
+
Required<RouteRequestBody<'/acs/access_groups/get'>>
|
|
171
|
+
>
|
|
172
|
+
|
|
173
|
+
export type AcsAccessGroupsGetResponse = SetNonNullable<
|
|
174
|
+
Required<RouteResponse<'/acs/access_groups/get'>>
|
|
175
|
+
>
|
|
176
|
+
|
|
177
|
+
export type AcsAccessGroupsListBody = SetNonNullable<
|
|
178
|
+
Required<RouteRequestBody<'/acs/access_groups/list'>>
|
|
179
|
+
>
|
|
180
|
+
|
|
181
|
+
export type AcsAccessGroupsListResponse = SetNonNullable<
|
|
182
|
+
Required<RouteResponse<'/acs/access_groups/list'>>
|
|
183
|
+
>
|
|
184
|
+
|
|
185
|
+
export type AcsAccessGroupsListUsersBody = SetNonNullable<
|
|
186
|
+
Required<RouteRequestBody<'/acs/access_groups/list_users'>>
|
|
187
|
+
>
|
|
188
|
+
|
|
189
|
+
export type AcsAccessGroupsListUsersResponse = SetNonNullable<
|
|
190
|
+
Required<RouteResponse<'/acs/access_groups/list_users'>>
|
|
191
|
+
>
|
|
192
|
+
|
|
193
|
+
export type AcsAccessGroupsRemoveUserBody = SetNonNullable<
|
|
194
|
+
Required<RouteRequestBody<'/acs/access_groups/remove_user'>>
|
|
195
|
+
>
|
|
196
|
+
|
|
197
|
+
export type AcsAccessGroupsRemoveUserResponse = SetNonNullable<
|
|
198
|
+
Required<RouteResponse<'/acs/access_groups/remove_user'>>
|
|
199
|
+
>
|
|
200
|
+
|
|
201
|
+
export type AcsAccessGroupsUpdateBody = SetNonNullable<
|
|
202
|
+
Required<RouteRequestBody<'/acs/access_groups/update'>>
|
|
203
|
+
>
|
|
204
|
+
|
|
205
|
+
export type AcsAccessGroupsUpdateResponse = SetNonNullable<
|
|
206
|
+
Required<RouteResponse<'/acs/access_groups/update'>>
|
|
207
|
+
>
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by generate-routes.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect'
|
|
7
|
+
import type { Axios } from 'axios'
|
|
8
|
+
import type { SetNonNullable } from 'type-fest'
|
|
9
|
+
|
|
10
|
+
import { createAxiosClient } from 'lib/seam/connect/axios.js'
|
|
11
|
+
import {
|
|
12
|
+
isSeamHttpOptionsWithApiKey,
|
|
13
|
+
isSeamHttpOptionsWithClient,
|
|
14
|
+
isSeamHttpOptionsWithClientSessionToken,
|
|
15
|
+
SeamHttpInvalidOptionsError,
|
|
16
|
+
type SeamHttpOptions,
|
|
17
|
+
type SeamHttpOptionsWithApiKey,
|
|
18
|
+
type SeamHttpOptionsWithClient,
|
|
19
|
+
type SeamHttpOptionsWithClientSessionToken,
|
|
20
|
+
} from 'lib/seam/connect/client-options.js'
|
|
21
|
+
import { parseOptions } from 'lib/seam/connect/parse-options.js'
|
|
22
|
+
|
|
23
|
+
export class SeamHttpAcsCredentials {
|
|
24
|
+
client: Axios
|
|
25
|
+
|
|
26
|
+
constructor(apiKeyOrOptions: string | SeamHttpOptions) {
|
|
27
|
+
const options = parseOptions(apiKeyOrOptions)
|
|
28
|
+
this.client = createAxiosClient(options)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static fromClient(
|
|
32
|
+
client: SeamHttpOptionsWithClient['client'],
|
|
33
|
+
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
34
|
+
): SeamHttpAcsCredentials {
|
|
35
|
+
const opts = { ...options, client }
|
|
36
|
+
if (!isSeamHttpOptionsWithClient(opts)) {
|
|
37
|
+
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
38
|
+
}
|
|
39
|
+
return new SeamHttpAcsCredentials(opts)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static fromApiKey(
|
|
43
|
+
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
44
|
+
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
45
|
+
): SeamHttpAcsCredentials {
|
|
46
|
+
const opts = { ...options, apiKey }
|
|
47
|
+
if (!isSeamHttpOptionsWithApiKey(opts)) {
|
|
48
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
49
|
+
}
|
|
50
|
+
return new SeamHttpAcsCredentials(opts)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static fromClientSessionToken(
|
|
54
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
55
|
+
options: Omit<
|
|
56
|
+
SeamHttpOptionsWithClientSessionToken,
|
|
57
|
+
'clientSessionToken'
|
|
58
|
+
> = {},
|
|
59
|
+
): SeamHttpAcsCredentials {
|
|
60
|
+
const opts = { ...options, clientSessionToken }
|
|
61
|
+
if (!isSeamHttpOptionsWithClientSessionToken(opts)) {
|
|
62
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
63
|
+
}
|
|
64
|
+
return new SeamHttpAcsCredentials(opts)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async create(
|
|
68
|
+
body: AcsCredentialsCreateBody,
|
|
69
|
+
): Promise<AcsCredentialsCreateResponse['acs_credential']> {
|
|
70
|
+
const { data } = await this.client.request<AcsCredentialsCreateResponse>({
|
|
71
|
+
url: '/acs/credentials/create',
|
|
72
|
+
method: 'post',
|
|
73
|
+
data: body,
|
|
74
|
+
})
|
|
75
|
+
return data.acs_credential
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async delete(body: AcsCredentialsDeleteBody): Promise<void> {
|
|
79
|
+
await this.client.request<AcsCredentialsDeleteResponse>({
|
|
80
|
+
url: '/acs/credentials/delete',
|
|
81
|
+
method: 'post',
|
|
82
|
+
data: body,
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async get(
|
|
87
|
+
body: AcsCredentialsGetBody,
|
|
88
|
+
): Promise<AcsCredentialsGetResponse['acs_credential']> {
|
|
89
|
+
const { data } = await this.client.request<AcsCredentialsGetResponse>({
|
|
90
|
+
url: '/acs/credentials/get',
|
|
91
|
+
method: 'post',
|
|
92
|
+
data: body,
|
|
93
|
+
})
|
|
94
|
+
return data.acs_credential
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async list(
|
|
98
|
+
body: AcsCredentialsListBody,
|
|
99
|
+
): Promise<AcsCredentialsListResponse['acs_credentials']> {
|
|
100
|
+
const { data } = await this.client.request<AcsCredentialsListResponse>({
|
|
101
|
+
url: '/acs/credentials/list',
|
|
102
|
+
method: 'post',
|
|
103
|
+
data: body,
|
|
104
|
+
})
|
|
105
|
+
return data.acs_credentials
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type AcsCredentialsCreateBody = SetNonNullable<
|
|
110
|
+
Required<RouteRequestBody<'/acs/credentials/create'>>
|
|
111
|
+
>
|
|
112
|
+
|
|
113
|
+
export type AcsCredentialsCreateResponse = SetNonNullable<
|
|
114
|
+
Required<RouteResponse<'/acs/credentials/create'>>
|
|
115
|
+
>
|
|
116
|
+
|
|
117
|
+
export type AcsCredentialsDeleteBody = SetNonNullable<
|
|
118
|
+
Required<RouteRequestBody<'/acs/credentials/delete'>>
|
|
119
|
+
>
|
|
120
|
+
|
|
121
|
+
export type AcsCredentialsDeleteResponse = SetNonNullable<
|
|
122
|
+
Required<RouteResponse<'/acs/credentials/delete'>>
|
|
123
|
+
>
|
|
124
|
+
|
|
125
|
+
export type AcsCredentialsGetBody = SetNonNullable<
|
|
126
|
+
Required<RouteRequestBody<'/acs/credentials/get'>>
|
|
127
|
+
>
|
|
128
|
+
|
|
129
|
+
export type AcsCredentialsGetResponse = SetNonNullable<
|
|
130
|
+
Required<RouteResponse<'/acs/credentials/get'>>
|
|
131
|
+
>
|
|
132
|
+
|
|
133
|
+
export type AcsCredentialsListBody = SetNonNullable<
|
|
134
|
+
Required<RouteRequestBody<'/acs/credentials/list'>>
|
|
135
|
+
>
|
|
136
|
+
|
|
137
|
+
export type AcsCredentialsListResponse = SetNonNullable<
|
|
138
|
+
Required<RouteResponse<'/acs/credentials/list'>>
|
|
139
|
+
>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by generate-routes.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
RouteRequestBody,
|
|
8
|
+
RouteRequestParams,
|
|
9
|
+
RouteResponse,
|
|
10
|
+
} from '@seamapi/types/connect'
|
|
11
|
+
import type { Axios } from 'axios'
|
|
12
|
+
import type { SetNonNullable } from 'type-fest'
|
|
13
|
+
|
|
14
|
+
import { createAxiosClient } from 'lib/seam/connect/axios.js'
|
|
15
|
+
import {
|
|
16
|
+
isSeamHttpOptionsWithApiKey,
|
|
17
|
+
isSeamHttpOptionsWithClient,
|
|
18
|
+
isSeamHttpOptionsWithClientSessionToken,
|
|
19
|
+
SeamHttpInvalidOptionsError,
|
|
20
|
+
type SeamHttpOptions,
|
|
21
|
+
type SeamHttpOptionsWithApiKey,
|
|
22
|
+
type SeamHttpOptionsWithClient,
|
|
23
|
+
type SeamHttpOptionsWithClientSessionToken,
|
|
24
|
+
} from 'lib/seam/connect/client-options.js'
|
|
25
|
+
import { parseOptions } from 'lib/seam/connect/parse-options.js'
|
|
26
|
+
|
|
27
|
+
export class SeamHttpAcsSystems {
|
|
28
|
+
client: Axios
|
|
29
|
+
|
|
30
|
+
constructor(apiKeyOrOptions: string | SeamHttpOptions) {
|
|
31
|
+
const options = parseOptions(apiKeyOrOptions)
|
|
32
|
+
this.client = createAxiosClient(options)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static fromClient(
|
|
36
|
+
client: SeamHttpOptionsWithClient['client'],
|
|
37
|
+
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
38
|
+
): SeamHttpAcsSystems {
|
|
39
|
+
const opts = { ...options, client }
|
|
40
|
+
if (!isSeamHttpOptionsWithClient(opts)) {
|
|
41
|
+
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
42
|
+
}
|
|
43
|
+
return new SeamHttpAcsSystems(opts)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static fromApiKey(
|
|
47
|
+
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
48
|
+
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
49
|
+
): SeamHttpAcsSystems {
|
|
50
|
+
const opts = { ...options, apiKey }
|
|
51
|
+
if (!isSeamHttpOptionsWithApiKey(opts)) {
|
|
52
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
53
|
+
}
|
|
54
|
+
return new SeamHttpAcsSystems(opts)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static fromClientSessionToken(
|
|
58
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
59
|
+
options: Omit<
|
|
60
|
+
SeamHttpOptionsWithClientSessionToken,
|
|
61
|
+
'clientSessionToken'
|
|
62
|
+
> = {},
|
|
63
|
+
): SeamHttpAcsSystems {
|
|
64
|
+
const opts = { ...options, clientSessionToken }
|
|
65
|
+
if (!isSeamHttpOptionsWithClientSessionToken(opts)) {
|
|
66
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
67
|
+
}
|
|
68
|
+
return new SeamHttpAcsSystems(opts)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async get(
|
|
72
|
+
body: AcsSystemsGetBody,
|
|
73
|
+
): Promise<AcsSystemsGetResponse['acs_system']> {
|
|
74
|
+
const { data } = await this.client.request<AcsSystemsGetResponse>({
|
|
75
|
+
url: '/acs/systems/get',
|
|
76
|
+
method: 'post',
|
|
77
|
+
data: body,
|
|
78
|
+
})
|
|
79
|
+
return data.acs_system
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async list(
|
|
83
|
+
params?: AcsSystemsListParams,
|
|
84
|
+
): Promise<AcsSystemsListResponse['acs_systems']> {
|
|
85
|
+
const { data } = await this.client.request<AcsSystemsListResponse>({
|
|
86
|
+
url: '/acs/systems/list',
|
|
87
|
+
method: 'get',
|
|
88
|
+
params,
|
|
89
|
+
})
|
|
90
|
+
return data.acs_systems
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type AcsSystemsGetBody = SetNonNullable<
|
|
95
|
+
Required<RouteRequestBody<'/acs/systems/get'>>
|
|
96
|
+
>
|
|
97
|
+
|
|
98
|
+
export type AcsSystemsGetResponse = SetNonNullable<
|
|
99
|
+
Required<RouteResponse<'/acs/systems/get'>>
|
|
100
|
+
>
|
|
101
|
+
|
|
102
|
+
export type AcsSystemsListParams = SetNonNullable<
|
|
103
|
+
Required<RouteRequestParams<'/acs/systems/list'>>
|
|
104
|
+
>
|
|
105
|
+
|
|
106
|
+
export type AcsSystemsListResponse = SetNonNullable<
|
|
107
|
+
Required<RouteResponse<'/acs/systems/list'>>
|
|
108
|
+
>
|