@seamapi/http 1.69.0 → 1.71.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/LICENSE.txt +1 -1
- package/dist/connect.cjs +728 -546
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +258 -2384
- package/dist/index.cjs +730 -545
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/lib/seam/connect/resolve-action-attempt.d.ts +4 -2882
- package/lib/seam/connect/resolve-action-attempt.js +2 -0
- package/lib/seam/connect/resolve-action-attempt.js.map +1 -1
- package/lib/seam/connect/routes/access-codes/access-codes.js +4 -2
- package/lib/seam/connect/routes/access-codes/access-codes.js.map +1 -1
- package/lib/seam/connect/routes/access-codes/simulate/simulate.js +4 -2
- package/lib/seam/connect/routes/access-codes/simulate/simulate.js.map +1 -1
- package/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.js +4 -2
- package/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/access-grants/access-grants.js +4 -2
- package/lib/seam/connect/routes/access-grants/access-grants.js.map +1 -1
- package/lib/seam/connect/routes/access-methods/access-methods.js +4 -2
- package/lib/seam/connect/routes/access-methods/access-methods.js.map +1 -1
- package/lib/seam/connect/routes/acs/access-groups/access-groups.js +4 -2
- package/lib/seam/connect/routes/acs/access-groups/access-groups.js.map +1 -1
- package/lib/seam/connect/routes/acs/access-groups/unmanaged/unmanaged.js +4 -2
- package/lib/seam/connect/routes/acs/access-groups/unmanaged/unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/acs/acs.js +4 -2
- package/lib/seam/connect/routes/acs/acs.js.map +1 -1
- package/lib/seam/connect/routes/acs/credential-pools/credential-pools.js +4 -2
- package/lib/seam/connect/routes/acs/credential-pools/credential-pools.js.map +1 -1
- package/lib/seam/connect/routes/acs/credential-provisioning-automations/credential-provisioning-automations.js +4 -2
- package/lib/seam/connect/routes/acs/credential-provisioning-automations/credential-provisioning-automations.js.map +1 -1
- package/lib/seam/connect/routes/acs/credentials/credentials.js +4 -2
- package/lib/seam/connect/routes/acs/credentials/credentials.js.map +1 -1
- package/lib/seam/connect/routes/acs/credentials/unmanaged/unmanaged.js +4 -2
- package/lib/seam/connect/routes/acs/credentials/unmanaged/unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/acs/encoders/encoders.js +4 -2
- package/lib/seam/connect/routes/acs/encoders/encoders.js.map +1 -1
- package/lib/seam/connect/routes/acs/encoders/simulate/simulate.js +4 -2
- package/lib/seam/connect/routes/acs/encoders/simulate/simulate.js.map +1 -1
- package/lib/seam/connect/routes/acs/entrances/entrances.js +4 -2
- package/lib/seam/connect/routes/acs/entrances/entrances.js.map +1 -1
- package/lib/seam/connect/routes/acs/systems/systems.js +4 -2
- package/lib/seam/connect/routes/acs/systems/systems.js.map +1 -1
- package/lib/seam/connect/routes/acs/users/unmanaged/unmanaged.js +4 -2
- package/lib/seam/connect/routes/acs/users/unmanaged/unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/acs/users/users.js +4 -2
- package/lib/seam/connect/routes/acs/users/users.js.map +1 -1
- package/lib/seam/connect/routes/action-attempts/action-attempts.js +4 -2
- package/lib/seam/connect/routes/action-attempts/action-attempts.js.map +1 -1
- package/lib/seam/connect/routes/bridges/bridges.js +4 -2
- package/lib/seam/connect/routes/bridges/bridges.js.map +1 -1
- package/lib/seam/connect/routes/client-sessions/client-sessions.js +4 -2
- package/lib/seam/connect/routes/client-sessions/client-sessions.js.map +1 -1
- package/lib/seam/connect/routes/connect-webviews/connect-webviews.js +4 -2
- package/lib/seam/connect/routes/connect-webviews/connect-webviews.js.map +1 -1
- package/lib/seam/connect/routes/connected-accounts/connected-accounts.js +4 -2
- package/lib/seam/connect/routes/connected-accounts/connected-accounts.js.map +1 -1
- package/lib/seam/connect/routes/customers/customers.js +4 -2
- package/lib/seam/connect/routes/customers/customers.js.map +1 -1
- package/lib/seam/connect/routes/devices/devices.js +4 -2
- package/lib/seam/connect/routes/devices/devices.js.map +1 -1
- package/lib/seam/connect/routes/devices/simulate/simulate.js +4 -2
- package/lib/seam/connect/routes/devices/simulate/simulate.js.map +1 -1
- package/lib/seam/connect/routes/devices/unmanaged/unmanaged.js +4 -2
- package/lib/seam/connect/routes/devices/unmanaged/unmanaged.js.map +1 -1
- package/lib/seam/connect/routes/events/events.js +4 -2
- package/lib/seam/connect/routes/events/events.js.map +1 -1
- package/lib/seam/connect/routes/instant-keys/instant-keys.js +4 -2
- package/lib/seam/connect/routes/instant-keys/instant-keys.js.map +1 -1
- package/lib/seam/connect/routes/locks/locks.js +4 -2
- package/lib/seam/connect/routes/locks/locks.js.map +1 -1
- package/lib/seam/connect/routes/locks/simulate/simulate.js +4 -2
- package/lib/seam/connect/routes/locks/simulate/simulate.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors/noise-sensors.js +4 -2
- package/lib/seam/connect/routes/noise-sensors/noise-sensors.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.js +4 -2
- package/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.js.map +1 -1
- package/lib/seam/connect/routes/noise-sensors/simulate/simulate.js +4 -2
- package/lib/seam/connect/routes/noise-sensors/simulate/simulate.js.map +1 -1
- package/lib/seam/connect/routes/phones/phones.js +4 -2
- package/lib/seam/connect/routes/phones/phones.js.map +1 -1
- package/lib/seam/connect/routes/phones/simulate/simulate.js +4 -2
- package/lib/seam/connect/routes/phones/simulate/simulate.js.map +1 -1
- package/lib/seam/connect/routes/seam/console/console.js +4 -2
- package/lib/seam/connect/routes/seam/console/console.js.map +1 -1
- package/lib/seam/connect/routes/seam/console/v1/timelines/timelines.js +4 -2
- package/lib/seam/connect/routes/seam/console/v1/timelines/timelines.js.map +1 -1
- package/lib/seam/connect/routes/seam/console/v1/v1.js +4 -2
- package/lib/seam/connect/routes/seam/console/v1/v1.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.js +4 -2
- package/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/automations/automations.js +4 -2
- package/lib/seam/connect/routes/seam/customer/v1/automations/automations.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/events/events.js +4 -2
- package/lib/seam/connect/routes/seam/customer/v1/events/events.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.js +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/portals/portals.js +4 -2
- package/lib/seam/connect/routes/seam/customer/v1/portals/portals.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/reservations/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/reservations/index.js +6 -0
- package/lib/seam/connect/routes/seam/customer/v1/reservations/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.d.ts +34 -0
- package/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.js +104 -0
- package/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/settings/settings.js +4 -2
- package/lib/seam/connect/routes/seam/customer/v1/settings/settings.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/v1.d.ts +2 -0
- package/lib/seam/connect/routes/seam/customer/v1/v1.js +8 -2
- package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -1
- package/lib/seam/connect/routes/seam/partner/v1/building-blocks/building-blocks.js +4 -2
- package/lib/seam/connect/routes/seam/partner/v1/building-blocks/building-blocks.js.map +1 -1
- package/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/spaces.js +4 -2
- package/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/spaces.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.d.ts +2 -2
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.js +6 -4
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints.d.ts +222 -220
- package/lib/seam/connect/routes/seam-http-endpoints.js +233 -220
- package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-without-workspace.js +4 -2
- package/lib/seam/connect/routes/seam-http-without-workspace.js.map +1 -1
- package/lib/seam/connect/routes/seam-http.js +4 -2
- package/lib/seam/connect/routes/seam-http.js.map +1 -1
- package/lib/seam/connect/routes/spaces/spaces.js +4 -2
- package/lib/seam/connect/routes/spaces/spaces.js.map +1 -1
- package/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.js +4 -2
- package/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.js.map +1 -1
- package/lib/seam/connect/routes/thermostats/schedules/schedules.js +4 -2
- package/lib/seam/connect/routes/thermostats/schedules/schedules.js.map +1 -1
- package/lib/seam/connect/routes/thermostats/simulate/simulate.js +4 -2
- package/lib/seam/connect/routes/thermostats/simulate/simulate.js.map +1 -1
- package/lib/seam/connect/routes/thermostats/thermostats.js +4 -2
- package/lib/seam/connect/routes/thermostats/thermostats.js.map +1 -1
- package/lib/seam/connect/routes/unstable-partner/building-blocks/building-blocks.js +4 -2
- package/lib/seam/connect/routes/unstable-partner/building-blocks/building-blocks.js.map +1 -1
- package/lib/seam/connect/routes/unstable-partner/unstable-partner.js +4 -2
- package/lib/seam/connect/routes/unstable-partner/unstable-partner.js.map +1 -1
- package/lib/seam/connect/routes/user-identities/enrollment-automations/enrollment-automations.js +4 -2
- package/lib/seam/connect/routes/user-identities/enrollment-automations/enrollment-automations.js.map +1 -1
- package/lib/seam/connect/routes/user-identities/user-identities.js +4 -2
- package/lib/seam/connect/routes/user-identities/user-identities.js.map +1 -1
- package/lib/seam/connect/routes/webhooks/webhooks.js +4 -2
- package/lib/seam/connect/routes/webhooks/webhooks.js.map +1 -1
- package/lib/seam/connect/routes/workspaces/customization-profiles/customization-profiles.js +4 -2
- package/lib/seam/connect/routes/workspaces/customization-profiles/customization-profiles.js.map +1 -1
- package/lib/seam/connect/routes/workspaces/workspaces.js +4 -2
- package/lib/seam/connect/routes/workspaces/workspaces.js.map +1 -1
- package/lib/seam/connect/seam-http-error.js +10 -16
- package/lib/seam/connect/seam-http-error.js.map +1 -1
- package/lib/seam/connect/seam-http-request.js +18 -31
- package/lib/seam/connect/seam-http-request.js.map +1 -1
- package/lib/seam/connect/seam-paginator.js +41 -53
- package/lib/seam/connect/seam-paginator.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +17 -17
- package/src/lib/seam/connect/routes/access-codes/access-codes.ts +0 -10
- package/src/lib/seam/connect/routes/access-codes/simulate/simulate.ts +0 -1
- package/src/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.ts +0 -5
- package/src/lib/seam/connect/routes/access-grants/access-grants.ts +0 -6
- package/src/lib/seam/connect/routes/access-methods/access-methods.ts +0 -4
- package/src/lib/seam/connect/routes/acs/access-groups/access-groups.ts +0 -6
- package/src/lib/seam/connect/routes/acs/access-groups/unmanaged/unmanaged.ts +0 -2
- package/src/lib/seam/connect/routes/acs/credential-pools/credential-pools.ts +0 -1
- package/src/lib/seam/connect/routes/acs/credential-provisioning-automations/credential-provisioning-automations.ts +0 -1
- package/src/lib/seam/connect/routes/acs/credentials/credentials.ts +0 -9
- package/src/lib/seam/connect/routes/acs/credentials/unmanaged/unmanaged.ts +0 -2
- package/src/lib/seam/connect/routes/acs/encoders/encoders.ts +0 -2
- package/src/lib/seam/connect/routes/acs/encoders/simulate/simulate.ts +0 -4
- package/src/lib/seam/connect/routes/acs/entrances/entrances.ts +0 -4
- package/src/lib/seam/connect/routes/acs/systems/systems.ts +0 -3
- package/src/lib/seam/connect/routes/acs/users/unmanaged/unmanaged.ts +0 -2
- package/src/lib/seam/connect/routes/acs/users/users.ts +0 -11
- package/src/lib/seam/connect/routes/action-attempts/action-attempts.ts +0 -1
- package/src/lib/seam/connect/routes/bridges/bridges.ts +0 -2
- package/src/lib/seam/connect/routes/client-sessions/client-sessions.ts +0 -7
- package/src/lib/seam/connect/routes/connect-webviews/connect-webviews.ts +0 -4
- package/src/lib/seam/connect/routes/connected-accounts/connected-accounts.ts +0 -5
- package/src/lib/seam/connect/routes/customers/customers.ts +0 -3
- package/src/lib/seam/connect/routes/devices/devices.ts +0 -5
- package/src/lib/seam/connect/routes/devices/simulate/simulate.ts +0 -6
- package/src/lib/seam/connect/routes/devices/unmanaged/unmanaged.ts +0 -3
- package/src/lib/seam/connect/routes/events/events.ts +0 -2
- package/src/lib/seam/connect/routes/instant-keys/instant-keys.ts +0 -3
- package/src/lib/seam/connect/routes/locks/locks.ts +0 -2
- package/src/lib/seam/connect/routes/noise-sensors/noise-sensors.ts +0 -1
- package/src/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.ts +0 -5
- package/src/lib/seam/connect/routes/noise-sensors/simulate/simulate.ts +0 -1
- package/src/lib/seam/connect/routes/phones/phones.ts +0 -3
- package/src/lib/seam/connect/routes/phones/simulate/simulate.ts +0 -1
- package/src/lib/seam/connect/routes/seam/console/v1/timelines/timelines.ts +0 -1
- package/src/lib/seam/connect/routes/seam/console/v1/v1.ts +0 -1
- package/src/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.ts +0 -1
- package/src/lib/seam/connect/routes/seam/customer/v1/automations/automations.ts +0 -3
- package/src/lib/seam/connect/routes/seam/customer/v1/events/events.ts +0 -1
- package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +1 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/portals/portals.ts +0 -1
- package/src/lib/seam/connect/routes/seam/customer/v1/reservations/index.ts +6 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.ts +214 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/settings/settings.ts +0 -2
- package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +8 -0
- package/src/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/spaces.ts +0 -1
- package/src/lib/seam/connect/routes/seam-http-endpoints-without-workspace.ts +2 -2
- package/src/lib/seam/connect/routes/seam-http-endpoints.ts +247 -218
- package/src/lib/seam/connect/routes/spaces/spaces.ts +0 -10
- package/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts +0 -2
- package/src/lib/seam/connect/routes/thermostats/schedules/schedules.ts +0 -5
- package/src/lib/seam/connect/routes/thermostats/simulate/simulate.ts +0 -2
- package/src/lib/seam/connect/routes/thermostats/thermostats.ts +0 -7
- package/src/lib/seam/connect/routes/unstable-partner/building-blocks/building-blocks.ts +0 -4
- package/src/lib/seam/connect/routes/user-identities/enrollment-automations/enrollment-automations.ts +0 -4
- package/src/lib/seam/connect/routes/user-identities/user-identities.ts +0 -13
- package/src/lib/seam/connect/routes/webhooks/webhooks.ts +0 -5
- package/src/lib/seam/connect/routes/workspaces/customization-profiles/customization-profiles.ts +0 -5
- package/src/lib/seam/connect/routes/workspaces/workspaces.ts +0 -5
- package/src/lib/version.ts +1 -1
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by codegen/smith.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
|
+
|
|
8
|
+
import { seamApiLtsVersion } from 'lib/lts-version.js'
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeadersForClientSessionToken,
|
|
11
|
+
warnOnInsecureuserIdentifierKey,
|
|
12
|
+
} from 'lib/seam/connect/auth.js'
|
|
13
|
+
import { type Client, createClient } from 'lib/seam/connect/client.js'
|
|
14
|
+
import {
|
|
15
|
+
isSeamHttpOptionsWithApiKey,
|
|
16
|
+
isSeamHttpOptionsWithClient,
|
|
17
|
+
isSeamHttpOptionsWithClientSessionToken,
|
|
18
|
+
isSeamHttpOptionsWithConsoleSessionToken,
|
|
19
|
+
isSeamHttpOptionsWithPersonalAccessToken,
|
|
20
|
+
type SeamHttpFromPublishableKeyOptions,
|
|
21
|
+
SeamHttpInvalidOptionsError,
|
|
22
|
+
type SeamHttpOptions,
|
|
23
|
+
type SeamHttpOptionsWithApiKey,
|
|
24
|
+
type SeamHttpOptionsWithClient,
|
|
25
|
+
type SeamHttpOptionsWithClientSessionToken,
|
|
26
|
+
type SeamHttpOptionsWithConsoleSessionToken,
|
|
27
|
+
type SeamHttpOptionsWithPersonalAccessToken,
|
|
28
|
+
type SeamHttpRequestOptions,
|
|
29
|
+
} from 'lib/seam/connect/options.js'
|
|
30
|
+
import {
|
|
31
|
+
limitToSeamHttpRequestOptions,
|
|
32
|
+
parseOptions,
|
|
33
|
+
} from 'lib/seam/connect/parse-options.js'
|
|
34
|
+
import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js'
|
|
35
|
+
import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js'
|
|
36
|
+
import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js'
|
|
37
|
+
import type { SetNonNullable } from 'lib/types.js'
|
|
38
|
+
|
|
39
|
+
export class SeamHttpSeamCustomerV1Reservations {
|
|
40
|
+
client: Client
|
|
41
|
+
readonly defaults: Required<SeamHttpRequestOptions>
|
|
42
|
+
readonly ltsVersion = seamApiLtsVersion
|
|
43
|
+
static ltsVersion = seamApiLtsVersion
|
|
44
|
+
|
|
45
|
+
constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
|
|
46
|
+
const options = parseOptions(apiKeyOrOptions)
|
|
47
|
+
if (!options.isUndocumentedApiEnabled) {
|
|
48
|
+
throw new Error(
|
|
49
|
+
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
this.client = 'client' in options ? options.client : createClient(options)
|
|
53
|
+
this.defaults = limitToSeamHttpRequestOptions(options)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static fromClient(
|
|
57
|
+
client: SeamHttpOptionsWithClient['client'],
|
|
58
|
+
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
59
|
+
): SeamHttpSeamCustomerV1Reservations {
|
|
60
|
+
const constructorOptions = { ...options, client }
|
|
61
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
62
|
+
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
63
|
+
}
|
|
64
|
+
return new SeamHttpSeamCustomerV1Reservations(constructorOptions)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static fromApiKey(
|
|
68
|
+
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
69
|
+
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
70
|
+
): SeamHttpSeamCustomerV1Reservations {
|
|
71
|
+
const constructorOptions = { ...options, apiKey }
|
|
72
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
73
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
74
|
+
}
|
|
75
|
+
return new SeamHttpSeamCustomerV1Reservations(constructorOptions)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
static fromClientSessionToken(
|
|
79
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
80
|
+
options: Omit<
|
|
81
|
+
SeamHttpOptionsWithClientSessionToken,
|
|
82
|
+
'clientSessionToken'
|
|
83
|
+
> = {},
|
|
84
|
+
): SeamHttpSeamCustomerV1Reservations {
|
|
85
|
+
const constructorOptions = { ...options, clientSessionToken }
|
|
86
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
87
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
88
|
+
}
|
|
89
|
+
return new SeamHttpSeamCustomerV1Reservations(constructorOptions)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
static async fromPublishableKey(
|
|
93
|
+
publishableKey: string,
|
|
94
|
+
userIdentifierKey: string,
|
|
95
|
+
options: SeamHttpFromPublishableKeyOptions = {},
|
|
96
|
+
): Promise<SeamHttpSeamCustomerV1Reservations> {
|
|
97
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey)
|
|
98
|
+
const clientOptions = parseOptions({ ...options, publishableKey })
|
|
99
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
100
|
+
throw new SeamHttpInvalidOptionsError(
|
|
101
|
+
'The client option cannot be used with SeamHttpSeamCustomerV1Reservations.fromPublishableKey',
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
const client = createClient(clientOptions)
|
|
105
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client)
|
|
106
|
+
const { token } = await clientSessions.getOrCreate({
|
|
107
|
+
user_identifier_key: userIdentifierKey,
|
|
108
|
+
})
|
|
109
|
+
return SeamHttpSeamCustomerV1Reservations.fromClientSessionToken(
|
|
110
|
+
token,
|
|
111
|
+
options,
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static fromConsoleSessionToken(
|
|
116
|
+
consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
117
|
+
workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
|
|
118
|
+
options: Omit<
|
|
119
|
+
SeamHttpOptionsWithConsoleSessionToken,
|
|
120
|
+
'consoleSessionToken' | 'workspaceId'
|
|
121
|
+
> = {},
|
|
122
|
+
): SeamHttpSeamCustomerV1Reservations {
|
|
123
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId }
|
|
124
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
125
|
+
throw new SeamHttpInvalidOptionsError(
|
|
126
|
+
'Missing consoleSessionToken or workspaceId',
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
return new SeamHttpSeamCustomerV1Reservations(constructorOptions)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
static fromPersonalAccessToken(
|
|
133
|
+
personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
134
|
+
workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
|
|
135
|
+
options: Omit<
|
|
136
|
+
SeamHttpOptionsWithPersonalAccessToken,
|
|
137
|
+
'personalAccessToken' | 'workspaceId'
|
|
138
|
+
> = {},
|
|
139
|
+
): SeamHttpSeamCustomerV1Reservations {
|
|
140
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId }
|
|
141
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
142
|
+
throw new SeamHttpInvalidOptionsError(
|
|
143
|
+
'Missing personalAccessToken or workspaceId',
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
return new SeamHttpSeamCustomerV1Reservations(constructorOptions)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
150
|
+
request: SeamHttpRequest<TResponse, TResponseKey>,
|
|
151
|
+
): SeamPaginator<TResponse, TResponseKey> {
|
|
152
|
+
return new SeamPaginator<TResponse, TResponseKey>(this, request)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async updateClientSessionToken(
|
|
156
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
157
|
+
): Promise<void> {
|
|
158
|
+
const { headers } = this.client.defaults
|
|
159
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
160
|
+
clientSessionToken,
|
|
161
|
+
})
|
|
162
|
+
for (const key of Object.keys(authHeaders)) {
|
|
163
|
+
if (headers[key] == null) {
|
|
164
|
+
throw new Error(
|
|
165
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
170
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
171
|
+
await clientSessions.get()
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
list(
|
|
175
|
+
parameters?: SeamCustomerV1ReservationsListParameters,
|
|
176
|
+
options: SeamCustomerV1ReservationsListOptions = {},
|
|
177
|
+
): SeamCustomerV1ReservationsListRequest {
|
|
178
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
179
|
+
throw new Error(
|
|
180
|
+
'Cannot use undocumented API without isUndocumentedApiEnabled',
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
return new SeamHttpRequest(this, {
|
|
184
|
+
pathname: '/seam/customer/v1/reservations/list',
|
|
185
|
+
method: 'POST',
|
|
186
|
+
body: parameters,
|
|
187
|
+
responseKey: 'reservations',
|
|
188
|
+
options,
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export type SeamCustomerV1ReservationsListParameters =
|
|
194
|
+
RouteRequestBody<'/seam/customer/v1/reservations/list'>
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @deprecated Use SeamCustomerV1ReservationsListParameters instead.
|
|
198
|
+
*/
|
|
199
|
+
export type SeamCustomerV1ReservationsListParams =
|
|
200
|
+
SeamCustomerV1ReservationsListParameters
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* @deprecated Use SeamCustomerV1ReservationsListRequest instead.
|
|
204
|
+
*/
|
|
205
|
+
export type SeamCustomerV1ReservationsListResponse = SetNonNullable<
|
|
206
|
+
Required<RouteResponse<'/seam/customer/v1/reservations/list'>>
|
|
207
|
+
>
|
|
208
|
+
|
|
209
|
+
export type SeamCustomerV1ReservationsListRequest = SeamHttpRequest<
|
|
210
|
+
SeamCustomerV1ReservationsListResponse,
|
|
211
|
+
'reservations'
|
|
212
|
+
>
|
|
213
|
+
|
|
214
|
+
export interface SeamCustomerV1ReservationsListOptions {}
|
|
@@ -230,7 +230,6 @@ export type SeamCustomerV1SettingsGetRequest = SeamHttpRequest<
|
|
|
230
230
|
'business_vertical'
|
|
231
231
|
>
|
|
232
232
|
|
|
233
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
234
233
|
export interface SeamCustomerV1SettingsGetOptions {}
|
|
235
234
|
|
|
236
235
|
export type SeamCustomerV1SettingsUpdateParameters =
|
|
@@ -254,5 +253,4 @@ export type SeamCustomerV1SettingsUpdateRequest = SeamHttpRequest<
|
|
|
254
253
|
undefined
|
|
255
254
|
>
|
|
256
255
|
|
|
257
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
258
256
|
export interface SeamCustomerV1SettingsUpdateOptions {}
|
|
@@ -37,6 +37,7 @@ import { SeamHttpSeamCustomerV1AutomationRuns } from './automation-runs/index.js
|
|
|
37
37
|
import { SeamHttpSeamCustomerV1Automations } from './automations/index.js'
|
|
38
38
|
import { SeamHttpSeamCustomerV1Events } from './events/index.js'
|
|
39
39
|
import { SeamHttpSeamCustomerV1Portals } from './portals/index.js'
|
|
40
|
+
import { SeamHttpSeamCustomerV1Reservations } from './reservations/index.js'
|
|
40
41
|
import { SeamHttpSeamCustomerV1Settings } from './settings/index.js'
|
|
41
42
|
|
|
42
43
|
export class SeamHttpSeamCustomerV1 {
|
|
@@ -193,6 +194,13 @@ export class SeamHttpSeamCustomerV1 {
|
|
|
193
194
|
return SeamHttpSeamCustomerV1Portals.fromClient(this.client, this.defaults)
|
|
194
195
|
}
|
|
195
196
|
|
|
197
|
+
get reservations(): SeamHttpSeamCustomerV1Reservations {
|
|
198
|
+
return SeamHttpSeamCustomerV1Reservations.fromClient(
|
|
199
|
+
this.client,
|
|
200
|
+
this.defaults,
|
|
201
|
+
)
|
|
202
|
+
}
|
|
203
|
+
|
|
196
204
|
get settings(): SeamHttpSeamCustomerV1Settings {
|
|
197
205
|
return SeamHttpSeamCustomerV1Settings.fromClient(this.client, this.defaults)
|
|
198
206
|
}
|
|
@@ -94,7 +94,7 @@ export class SeamHttpEndpointsWithoutWorkspace {
|
|
|
94
94
|
return new SeamHttpEndpointsWithoutWorkspace(constructorOptions)
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
get
|
|
97
|
+
get '/workspaces/create'(): (
|
|
98
98
|
parameters?: WorkspacesCreateParameters,
|
|
99
99
|
options?: WorkspacesCreateOptions,
|
|
100
100
|
) => WorkspacesCreateRequest {
|
|
@@ -107,7 +107,7 @@ export class SeamHttpEndpointsWithoutWorkspace {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
get
|
|
110
|
+
get '/workspaces/list'(): (
|
|
111
111
|
parameters?: WorkspacesListParameters,
|
|
112
112
|
options?: WorkspacesListOptions,
|
|
113
113
|
) => WorkspacesListRequest {
|