@seamapi/http 0.0.2 → 0.2.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 +1807 -96
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +472 -15
- package/lib/params-serializer.d.ts +5 -0
- package/lib/params-serializer.js +42 -0
- package/lib/params-serializer.js.map +1 -0
- package/lib/seam/connect/auth.d.ts +4 -3
- package/lib/seam/connect/auth.js +59 -8
- package/lib/seam/connect/auth.js.map +1 -1
- package/lib/seam/connect/client.d.ts +10 -10
- package/lib/seam/connect/client.js +16 -49
- package/lib/seam/connect/client.js.map +1 -1
- package/lib/seam/connect/index.d.ts +2 -1
- package/lib/seam/connect/index.js +2 -1
- package/lib/seam/connect/index.js.map +1 -1
- package/lib/seam/connect/options.d.ts +23 -0
- package/lib/seam/connect/options.js +39 -0
- package/lib/seam/connect/options.js.map +1 -0
- package/lib/seam/connect/parse-options.d.ts +6 -2
- package/lib/seam/connect/parse-options.js +35 -10
- package/lib/seam/connect/parse-options.js.map +1 -1
- package/lib/seam/connect/routes/access-codes-unmanaged.d.ts +27 -0
- package/lib/seam/connect/routes/access-codes-unmanaged.js +84 -0
- package/lib/seam/connect/routes/access-codes-unmanaged.js.map +1 -0
- package/lib/seam/connect/routes/access-codes.d.ts +38 -0
- package/lib/seam/connect/routes/access-codes.js +113 -0
- package/lib/seam/connect/routes/access-codes.js.map +1 -0
- package/lib/seam/connect/routes/acs-access-groups.d.ts +36 -0
- package/lib/seam/connect/routes/acs-access-groups.js +107 -0
- package/lib/seam/connect/routes/acs-access-groups.js.map +1 -0
- package/lib/seam/connect/routes/acs-credentials.d.ts +24 -0
- package/lib/seam/connect/routes/acs-credentials.js +78 -0
- package/lib/seam/connect/routes/acs-credentials.js.map +1 -0
- package/lib/seam/connect/routes/acs-systems.d.ts +18 -0
- package/lib/seam/connect/routes/acs-systems.js +63 -0
- package/lib/seam/connect/routes/acs-systems.js.map +1 -0
- package/lib/seam/connect/routes/acs-users.d.ts +39 -0
- package/lib/seam/connect/routes/acs-users.js +113 -0
- package/lib/seam/connect/routes/acs-users.js.map +1 -0
- package/lib/seam/connect/routes/acs.d.ts +18 -0
- package/lib/seam/connect/routes/acs.js +63 -0
- package/lib/seam/connect/routes/acs.js.map +1 -0
- package/lib/seam/connect/routes/action-attempts.d.ts +18 -0
- package/lib/seam/connect/routes/action-attempts.js +63 -0
- package/lib/seam/connect/routes/action-attempts.js.map +1 -0
- package/lib/seam/connect/routes/client-sessions.d.ts +30 -0
- package/lib/seam/connect/routes/client-sessions.js +93 -0
- package/lib/seam/connect/routes/client-sessions.js.map +1 -0
- package/lib/seam/connect/routes/connect-webviews.d.ts +27 -0
- package/lib/seam/connect/routes/connect-webviews.js +85 -0
- package/lib/seam/connect/routes/connect-webviews.js.map +1 -0
- package/lib/seam/connect/routes/connected-accounts.d.ts +21 -0
- package/lib/seam/connect/routes/connected-accounts.js +70 -0
- package/lib/seam/connect/routes/connected-accounts.js.map +1 -0
- package/lib/seam/connect/routes/devices-unmanaged.d.ts +21 -0
- package/lib/seam/connect/routes/devices-unmanaged.js +70 -0
- package/lib/seam/connect/routes/devices-unmanaged.js.map +1 -0
- package/lib/seam/connect/routes/devices.d.ts +29 -0
- package/lib/seam/connect/routes/devices.js +89 -0
- package/lib/seam/connect/routes/devices.js.map +1 -0
- package/lib/seam/connect/routes/events.d.ts +18 -0
- package/lib/seam/connect/routes/events.js +63 -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 +24 -0
- package/lib/seam/connect/routes/locks.js +79 -0
- package/lib/seam/connect/routes/locks.js.map +1 -0
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +27 -0
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js +84 -0
- package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -0
- package/lib/seam/connect/routes/noise-sensors.d.ts +12 -0
- package/lib/seam/connect/routes/noise-sensors.js +51 -0
- package/lib/seam/connect/routes/noise-sensors.js.map +1 -0
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.d.ts +27 -0
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js +85 -0
- package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js.map +1 -0
- package/lib/seam/connect/routes/thermostats.d.ts +38 -0
- package/lib/seam/connect/routes/thermostats.js +109 -0
- package/lib/seam/connect/routes/thermostats.js.map +1 -0
- package/lib/seam/connect/routes/webhooks.d.ts +24 -0
- package/lib/seam/connect/routes/webhooks.js +78 -0
- package/lib/seam/connect/routes/webhooks.js.map +1 -0
- package/lib/seam/connect/routes/workspaces.d.ts +17 -7
- package/lib/seam/connect/routes/workspaces.js +61 -11
- package/lib/seam/connect/routes/workspaces.js.map +1 -1
- package/lib/seam/connect/seam-http.d.ts +24 -0
- package/lib/seam/connect/seam-http.js +82 -0
- package/lib/seam/connect/seam-http.js.map +1 -0
- package/package.json +9 -3
- package/src/lib/params-serializer.ts +55 -0
- package/src/lib/seam/connect/auth.ts +101 -13
- package/src/lib/seam/connect/client.ts +30 -62
- package/src/lib/seam/connect/env.d.ts +11 -0
- package/src/lib/seam/connect/index.ts +2 -1
- package/src/lib/seam/connect/{client-options.ts → options.ts} +37 -15
- package/src/lib/seam/connect/parse-options.ts +55 -14
- package/src/lib/seam/connect/routes/access-codes-unmanaged.ts +170 -0
- package/src/lib/seam/connect/routes/access-codes.ts +226 -0
- package/src/lib/seam/connect/routes/acs-access-groups.ts +216 -0
- package/src/lib/seam/connect/routes/acs-credentials.ts +151 -0
- package/src/lib/seam/connect/routes/acs-systems.ts +118 -0
- package/src/lib/seam/connect/routes/acs-users.ts +221 -0
- package/src/lib/seam/connect/routes/acs.ts +101 -0
- package/src/lib/seam/connect/routes/action-attempts.ts +118 -0
- package/src/lib/seam/connect/routes/client-sessions.ts +187 -0
- package/src/lib/seam/connect/routes/connect-webviews.ts +170 -0
- package/src/lib/seam/connect/routes/connected-accounts.ts +139 -0
- package/src/lib/seam/connect/routes/devices-unmanaged.ts +134 -0
- package/src/lib/seam/connect/routes/devices.ts +166 -0
- package/src/lib/seam/connect/routes/events.ts +114 -0
- package/src/lib/seam/connect/routes/index.ts +21 -0
- package/src/lib/seam/connect/routes/locks.ts +148 -0
- package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +170 -0
- package/src/lib/seam/connect/routes/noise-sensors.ts +86 -0
- package/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts +192 -0
- package/src/lib/seam/connect/routes/thermostats.ts +208 -0
- package/src/lib/seam/connect/routes/webhooks.ts +151 -0
- package/src/lib/seam/connect/routes/workspaces.ts +118 -22
- package/src/lib/seam/connect/seam-http.ts +141 -0
- package/lib/seam/connect/axios.d.ts +0 -3
- package/lib/seam/connect/axios.js +0 -17
- package/lib/seam/connect/axios.js.map +0 -1
- package/lib/seam/connect/client-options.d.ts +0 -19
- package/lib/seam/connect/client-options.js +0 -29
- package/lib/seam/connect/client-options.js.map +0 -1
- 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/axios.ts +0 -23
- package/src/lib/seam/connect/legacy/workspaces.ts +0 -26
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by generate-routes.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
import { warnOnInsecureuserIdentifierKey } from '../../../../lib/seam/connect/auth.js';
|
|
6
|
+
import { createClient } from '../../../../lib/seam/connect/client.js';
|
|
7
|
+
import { isSeamHttpOptionsWithApiKey, isSeamHttpOptionsWithClient, isSeamHttpOptionsWithClientSessionToken, SeamHttpInvalidOptionsError, } from '../../../../lib/seam/connect/options.js';
|
|
8
|
+
import { parseOptions } from '../../../../lib/seam/connect/parse-options.js';
|
|
9
|
+
import { SeamHttpClientSessions } from './client-sessions.js';
|
|
10
|
+
export class SeamHttpThermostatsClimateSettingSchedules {
|
|
11
|
+
constructor(apiKeyOrOptions = {}) {
|
|
12
|
+
const clientOptions = parseOptions(apiKeyOrOptions);
|
|
13
|
+
this.client = createClient(clientOptions);
|
|
14
|
+
}
|
|
15
|
+
static fromClient(client, options = {}) {
|
|
16
|
+
const constructorOptions = { ...options, client };
|
|
17
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
18
|
+
throw new SeamHttpInvalidOptionsError('Missing client');
|
|
19
|
+
}
|
|
20
|
+
return new SeamHttpThermostatsClimateSettingSchedules(constructorOptions);
|
|
21
|
+
}
|
|
22
|
+
static fromApiKey(apiKey, options = {}) {
|
|
23
|
+
const constructorOptions = { ...options, apiKey };
|
|
24
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
25
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey');
|
|
26
|
+
}
|
|
27
|
+
return new SeamHttpThermostatsClimateSettingSchedules(constructorOptions);
|
|
28
|
+
}
|
|
29
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
30
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
31
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
32
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken');
|
|
33
|
+
}
|
|
34
|
+
return new SeamHttpThermostatsClimateSettingSchedules(constructorOptions);
|
|
35
|
+
}
|
|
36
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
37
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
38
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
39
|
+
const client = createClient(clientOptions);
|
|
40
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
41
|
+
const { token } = await clientSessions.getOrCreate({
|
|
42
|
+
user_identifier_key: userIdentifierKey,
|
|
43
|
+
});
|
|
44
|
+
return SeamHttpThermostatsClimateSettingSchedules.fromClientSessionToken(token, options);
|
|
45
|
+
}
|
|
46
|
+
async create(body) {
|
|
47
|
+
const { data } = await this.client.request({
|
|
48
|
+
url: '/thermostats/climate_setting_schedules/create',
|
|
49
|
+
method: 'post',
|
|
50
|
+
data: body,
|
|
51
|
+
});
|
|
52
|
+
return data.climate_setting_schedule;
|
|
53
|
+
}
|
|
54
|
+
async delete(body) {
|
|
55
|
+
await this.client.request({
|
|
56
|
+
url: '/thermostats/climate_setting_schedules/delete',
|
|
57
|
+
method: 'post',
|
|
58
|
+
data: body,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async get(body) {
|
|
62
|
+
const { data } = await this.client.request({
|
|
63
|
+
url: '/thermostats/climate_setting_schedules/get',
|
|
64
|
+
method: 'post',
|
|
65
|
+
data: body,
|
|
66
|
+
});
|
|
67
|
+
return data.climate_setting_schedule;
|
|
68
|
+
}
|
|
69
|
+
async list(body) {
|
|
70
|
+
const { data } = await this.client.request({
|
|
71
|
+
url: '/thermostats/climate_setting_schedules/list',
|
|
72
|
+
method: 'post',
|
|
73
|
+
data: body,
|
|
74
|
+
});
|
|
75
|
+
return data.climate_setting_schedules;
|
|
76
|
+
}
|
|
77
|
+
async update(body) {
|
|
78
|
+
await this.client.request({
|
|
79
|
+
url: '/thermostats/climate_setting_schedules/update',
|
|
80
|
+
method: 'post',
|
|
81
|
+
data: body,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=thermostats-climate-setting-schedules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thermostats-climate-setting-schedules.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts"],"names":[],"mappings":"AAAA;;;GAGG;A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C,OAAO,CAAgD;YACvE,GAAG,EAAE,4CAA4C;YACjD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;QACJ,OAAO,IAAI,CAAC,wBAAwB,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,IAAI,CACR,IAAgD;QAIhD,MAAM,EAAE,IAAI,EAAE,GACZ,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACvB;YACE,GAAG,EAAE,6CAA6C;YAClD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CACF,CAAA;QACH,OAAO,IAAI,CAAC,yBAAyB,CAAA;IACvC,CAAC;IAED,KAAK,CAAC,MAAM,CACV,IAAkD;QAElD,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACvB;YACE,GAAG,EAAE,+CAA+C;YACpD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CACF,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { RouteRequestBody, RouteResponse } from '@seamapi/types/connect';
|
|
2
|
+
import type { SetNonNullable } from 'type-fest';
|
|
3
|
+
import { type Client } from '../../../../lib/seam/connect/client.js';
|
|
4
|
+
import { type SeamHttpFromPublishableKeyOptions, type SeamHttpOptions, type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClient, type SeamHttpOptionsWithClientSessionToken } from '../../../../lib/seam/connect/options.js';
|
|
5
|
+
import { SeamHttpThermostatsClimateSettingSchedules } from './thermostats-climate-setting-schedules.js';
|
|
6
|
+
export declare class SeamHttpThermostats {
|
|
7
|
+
client: Client;
|
|
8
|
+
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
9
|
+
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpThermostats;
|
|
10
|
+
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpThermostats;
|
|
11
|
+
static fromClientSessionToken(clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], options?: Omit<SeamHttpOptionsWithClientSessionToken, 'clientSessionToken'>): SeamHttpThermostats;
|
|
12
|
+
static fromPublishableKey(publishableKey: string, userIdentifierKey: string, options?: SeamHttpFromPublishableKeyOptions): Promise<SeamHttpThermostats>;
|
|
13
|
+
get climateSettingSchedules(): SeamHttpThermostatsClimateSettingSchedules;
|
|
14
|
+
cool(body: ThermostatsCoolBody): Promise<void>;
|
|
15
|
+
get(body: ThermostatsGetBody): Promise<ThermostatsGetResponse['thermostat']>;
|
|
16
|
+
heat(body: ThermostatsHeatBody): Promise<void>;
|
|
17
|
+
heatCool(body: ThermostatsHeatCoolBody): Promise<void>;
|
|
18
|
+
list(body: ThermostatsListBody): Promise<ThermostatsListResponse['thermostats']>;
|
|
19
|
+
off(body: ThermostatsOffBody): Promise<void>;
|
|
20
|
+
setFanMode(body: ThermostatsSetFanModeBody): Promise<void>;
|
|
21
|
+
update(body: ThermostatsUpdateBody): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export type ThermostatsCoolBody = RouteRequestBody<'/thermostats/cool'>;
|
|
24
|
+
export type ThermostatsCoolResponse = SetNonNullable<Required<RouteResponse<'/thermostats/cool'>>>;
|
|
25
|
+
export type ThermostatsGetBody = RouteRequestBody<'/thermostats/get'>;
|
|
26
|
+
export type ThermostatsGetResponse = SetNonNullable<Required<RouteResponse<'/thermostats/get'>>>;
|
|
27
|
+
export type ThermostatsHeatBody = RouteRequestBody<'/thermostats/heat'>;
|
|
28
|
+
export type ThermostatsHeatResponse = SetNonNullable<Required<RouteResponse<'/thermostats/heat'>>>;
|
|
29
|
+
export type ThermostatsHeatCoolBody = RouteRequestBody<'/thermostats/heat_cool'>;
|
|
30
|
+
export type ThermostatsHeatCoolResponse = SetNonNullable<Required<RouteResponse<'/thermostats/heat_cool'>>>;
|
|
31
|
+
export type ThermostatsListBody = RouteRequestBody<'/thermostats/list'>;
|
|
32
|
+
export type ThermostatsListResponse = SetNonNullable<Required<RouteResponse<'/thermostats/list'>>>;
|
|
33
|
+
export type ThermostatsOffBody = RouteRequestBody<'/thermostats/off'>;
|
|
34
|
+
export type ThermostatsOffResponse = SetNonNullable<Required<RouteResponse<'/thermostats/off'>>>;
|
|
35
|
+
export type ThermostatsSetFanModeBody = RouteRequestBody<'/thermostats/set_fan_mode'>;
|
|
36
|
+
export type ThermostatsSetFanModeResponse = SetNonNullable<Required<RouteResponse<'/thermostats/set_fan_mode'>>>;
|
|
37
|
+
export type ThermostatsUpdateBody = RouteRequestBody<'/thermostats/update'>;
|
|
38
|
+
export type ThermostatsUpdateResponse = SetNonNullable<Required<RouteResponse<'/thermostats/update'>>>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by generate-routes.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
import { warnOnInsecureuserIdentifierKey } from '../../../../lib/seam/connect/auth.js';
|
|
6
|
+
import { createClient } from '../../../../lib/seam/connect/client.js';
|
|
7
|
+
import { isSeamHttpOptionsWithApiKey, isSeamHttpOptionsWithClient, isSeamHttpOptionsWithClientSessionToken, SeamHttpInvalidOptionsError, } from '../../../../lib/seam/connect/options.js';
|
|
8
|
+
import { parseOptions } from '../../../../lib/seam/connect/parse-options.js';
|
|
9
|
+
import { SeamHttpClientSessions } from './client-sessions.js';
|
|
10
|
+
import { SeamHttpThermostatsClimateSettingSchedules } from './thermostats-climate-setting-schedules.js';
|
|
11
|
+
export class SeamHttpThermostats {
|
|
12
|
+
constructor(apiKeyOrOptions = {}) {
|
|
13
|
+
const clientOptions = parseOptions(apiKeyOrOptions);
|
|
14
|
+
this.client = createClient(clientOptions);
|
|
15
|
+
}
|
|
16
|
+
static fromClient(client, options = {}) {
|
|
17
|
+
const constructorOptions = { ...options, client };
|
|
18
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
19
|
+
throw new SeamHttpInvalidOptionsError('Missing client');
|
|
20
|
+
}
|
|
21
|
+
return new SeamHttpThermostats(constructorOptions);
|
|
22
|
+
}
|
|
23
|
+
static fromApiKey(apiKey, options = {}) {
|
|
24
|
+
const constructorOptions = { ...options, apiKey };
|
|
25
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
26
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey');
|
|
27
|
+
}
|
|
28
|
+
return new SeamHttpThermostats(constructorOptions);
|
|
29
|
+
}
|
|
30
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
31
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
32
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
33
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken');
|
|
34
|
+
}
|
|
35
|
+
return new SeamHttpThermostats(constructorOptions);
|
|
36
|
+
}
|
|
37
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
38
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
39
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
40
|
+
const client = createClient(clientOptions);
|
|
41
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
42
|
+
const { token } = await clientSessions.getOrCreate({
|
|
43
|
+
user_identifier_key: userIdentifierKey,
|
|
44
|
+
});
|
|
45
|
+
return SeamHttpThermostats.fromClientSessionToken(token, options);
|
|
46
|
+
}
|
|
47
|
+
get climateSettingSchedules() {
|
|
48
|
+
return SeamHttpThermostatsClimateSettingSchedules.fromClient(this.client);
|
|
49
|
+
}
|
|
50
|
+
async cool(body) {
|
|
51
|
+
await this.client.request({
|
|
52
|
+
url: '/thermostats/cool',
|
|
53
|
+
method: 'post',
|
|
54
|
+
data: body,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async get(body) {
|
|
58
|
+
const { data } = await this.client.request({
|
|
59
|
+
url: '/thermostats/get',
|
|
60
|
+
method: 'post',
|
|
61
|
+
data: body,
|
|
62
|
+
});
|
|
63
|
+
return data.thermostat;
|
|
64
|
+
}
|
|
65
|
+
async heat(body) {
|
|
66
|
+
await this.client.request({
|
|
67
|
+
url: '/thermostats/heat',
|
|
68
|
+
method: 'post',
|
|
69
|
+
data: body,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
async heatCool(body) {
|
|
73
|
+
await this.client.request({
|
|
74
|
+
url: '/thermostats/heat_cool',
|
|
75
|
+
method: 'post',
|
|
76
|
+
data: body,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
async list(body) {
|
|
80
|
+
const { data } = await this.client.request({
|
|
81
|
+
url: '/thermostats/list',
|
|
82
|
+
method: 'post',
|
|
83
|
+
data: body,
|
|
84
|
+
});
|
|
85
|
+
return data.thermostats;
|
|
86
|
+
}
|
|
87
|
+
async off(body) {
|
|
88
|
+
await this.client.request({
|
|
89
|
+
url: '/thermostats/off',
|
|
90
|
+
method: 'post',
|
|
91
|
+
data: body,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
async setFanMode(body) {
|
|
95
|
+
await this.client.request({
|
|
96
|
+
url: '/thermostats/set_fan_mode',
|
|
97
|
+
method: 'post',
|
|
98
|
+
data: body,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
async update(body) {
|
|
102
|
+
await this.client.request({
|
|
103
|
+
url: '/thermostats/update',
|
|
104
|
+
method: 'post',
|
|
105
|
+
data: body,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=thermostats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thermostats.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/routes/thermostats.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0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0,0 +1,24 @@
|
|
|
1
|
+
import type { RouteRequestBody, RouteRequestParams, RouteResponse } from '@seamapi/types/connect';
|
|
2
|
+
import type { SetNonNullable } from 'type-fest';
|
|
3
|
+
import { type Client } from '../../../../lib/seam/connect/client.js';
|
|
4
|
+
import { type SeamHttpFromPublishableKeyOptions, type SeamHttpOptions, type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClient, type SeamHttpOptionsWithClientSessionToken } from '../../../../lib/seam/connect/options.js';
|
|
5
|
+
export declare class SeamHttpWebhooks {
|
|
6
|
+
client: Client;
|
|
7
|
+
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
8
|
+
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpWebhooks;
|
|
9
|
+
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpWebhooks;
|
|
10
|
+
static fromClientSessionToken(clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], options?: Omit<SeamHttpOptionsWithClientSessionToken, 'clientSessionToken'>): SeamHttpWebhooks;
|
|
11
|
+
static fromPublishableKey(publishableKey: string, userIdentifierKey: string, options?: SeamHttpFromPublishableKeyOptions): Promise<SeamHttpWebhooks>;
|
|
12
|
+
create(body: WebhooksCreateBody): Promise<WebhooksCreateResponse['webhook']>;
|
|
13
|
+
delete(body: WebhooksDeleteBody): Promise<void>;
|
|
14
|
+
get(body: WebhooksGetBody): Promise<WebhooksGetResponse['webhook']>;
|
|
15
|
+
list(params?: WebhooksListParams): Promise<WebhooksListResponse['webhooks']>;
|
|
16
|
+
}
|
|
17
|
+
export type WebhooksCreateBody = RouteRequestBody<'/webhooks/create'>;
|
|
18
|
+
export type WebhooksCreateResponse = SetNonNullable<Required<RouteResponse<'/webhooks/create'>>>;
|
|
19
|
+
export type WebhooksDeleteBody = RouteRequestBody<'/webhooks/delete'>;
|
|
20
|
+
export type WebhooksDeleteResponse = SetNonNullable<Required<RouteResponse<'/webhooks/delete'>>>;
|
|
21
|
+
export type WebhooksGetBody = RouteRequestBody<'/webhooks/get'>;
|
|
22
|
+
export type WebhooksGetResponse = SetNonNullable<Required<RouteResponse<'/webhooks/get'>>>;
|
|
23
|
+
export type WebhooksListParams = RouteRequestParams<'/webhooks/list'>;
|
|
24
|
+
export type WebhooksListResponse = SetNonNullable<Required<RouteResponse<'/webhooks/list'>>>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by generate-routes.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
import { warnOnInsecureuserIdentifierKey } from '../../../../lib/seam/connect/auth.js';
|
|
6
|
+
import { createClient } from '../../../../lib/seam/connect/client.js';
|
|
7
|
+
import { isSeamHttpOptionsWithApiKey, isSeamHttpOptionsWithClient, isSeamHttpOptionsWithClientSessionToken, SeamHttpInvalidOptionsError, } from '../../../../lib/seam/connect/options.js';
|
|
8
|
+
import { parseOptions } from '../../../../lib/seam/connect/parse-options.js';
|
|
9
|
+
import { SeamHttpClientSessions } from './client-sessions.js';
|
|
10
|
+
export class SeamHttpWebhooks {
|
|
11
|
+
constructor(apiKeyOrOptions = {}) {
|
|
12
|
+
const clientOptions = parseOptions(apiKeyOrOptions);
|
|
13
|
+
this.client = createClient(clientOptions);
|
|
14
|
+
}
|
|
15
|
+
static fromClient(client, options = {}) {
|
|
16
|
+
const constructorOptions = { ...options, client };
|
|
17
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
18
|
+
throw new SeamHttpInvalidOptionsError('Missing client');
|
|
19
|
+
}
|
|
20
|
+
return new SeamHttpWebhooks(constructorOptions);
|
|
21
|
+
}
|
|
22
|
+
static fromApiKey(apiKey, options = {}) {
|
|
23
|
+
const constructorOptions = { ...options, apiKey };
|
|
24
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
25
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey');
|
|
26
|
+
}
|
|
27
|
+
return new SeamHttpWebhooks(constructorOptions);
|
|
28
|
+
}
|
|
29
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
30
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
31
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
32
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken');
|
|
33
|
+
}
|
|
34
|
+
return new SeamHttpWebhooks(constructorOptions);
|
|
35
|
+
}
|
|
36
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
37
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
38
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
39
|
+
const client = createClient(clientOptions);
|
|
40
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
41
|
+
const { token } = await clientSessions.getOrCreate({
|
|
42
|
+
user_identifier_key: userIdentifierKey,
|
|
43
|
+
});
|
|
44
|
+
return SeamHttpWebhooks.fromClientSessionToken(token, options);
|
|
45
|
+
}
|
|
46
|
+
async create(body) {
|
|
47
|
+
const { data } = await this.client.request({
|
|
48
|
+
url: '/webhooks/create',
|
|
49
|
+
method: 'post',
|
|
50
|
+
data: body,
|
|
51
|
+
});
|
|
52
|
+
return data.webhook;
|
|
53
|
+
}
|
|
54
|
+
async delete(body) {
|
|
55
|
+
await this.client.request({
|
|
56
|
+
url: '/webhooks/delete',
|
|
57
|
+
method: 'post',
|
|
58
|
+
data: body,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async get(body) {
|
|
62
|
+
const { data } = await this.client.request({
|
|
63
|
+
url: '/webhooks/get',
|
|
64
|
+
method: 'post',
|
|
65
|
+
data: body,
|
|
66
|
+
});
|
|
67
|
+
return data.webhook;
|
|
68
|
+
}
|
|
69
|
+
async list(params) {
|
|
70
|
+
const { data } = await this.client.request({
|
|
71
|
+
url: '/webhooks/list',
|
|
72
|
+
method: 'get',
|
|
73
|
+
params,
|
|
74
|
+
});
|
|
75
|
+
return data.webhooks;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/routes/webhooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAC1E,OAAO,EAAe,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,uCAAuC,EAEvC,2BAA2B,GAK5B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAEhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,MAAM,OAAO,gBAAgB;IAG3B,YAAY,kBAA4C,EAAE;QACxD,MAAM,aAAa,GAAG,YAAY,CAAC,eAAe,CAAC,CAAA;QACnD,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,aAAa,CAAC,CAAA;IAC3C,CAAC;IAED,MAAM,CAAC,UAAU,CACf,MAA2C,EAC3C,UAAqD,EAAE;QAEvD,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAA;QACjD,IAAI,CAAC,2BAA2B,CAAC,kBAAkB,CAAC,EAAE;YACpD,MAAM,IAAI,2BAA2B,CAAC,gBAAgB,CAAC,CAAA;SACxD;QACD,OAAO,IAAI,gBAAgB,CAAC,kBAAkB,CAAC,CAAA;IACjD,CAAC;IAED,MAAM,CAAC,UAAU,CACf,MAA2C,EAC3C,UAAqD,EAAE;QAEvD,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAA;QACjD,I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C,OAAO,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAwB;QACnC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAyB;YAChD,GAAG,EAAE,kBAAkB;YACvB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAqB;QAC7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAsB;YAC9D,GAAG,EAAE,eAAe;YACpB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,IAAI,CACR,MAA2B;QAE3B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAuB;YAC/D,GAAG,EAAE,gBAAgB;YACrB,MAAM,EAAE,KAAK;YACb,MAAM;SACP,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;CACF"}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import type { RouteRequestParams, RouteResponse } from '@seamapi/types/connect';
|
|
2
|
-
import { Axios } from 'axios';
|
|
1
|
+
import type { RouteRequestBody, RouteRequestParams, RouteResponse } from '@seamapi/types/connect';
|
|
3
2
|
import type { SetNonNullable } from 'type-fest';
|
|
4
|
-
import type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { type Client } from '../../../../lib/seam/connect/client.js';
|
|
4
|
+
import { type SeamHttpFromPublishableKeyOptions, type SeamHttpOptions, type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClient, type SeamHttpOptionsWithClientSessionToken } from '../../../../lib/seam/connect/options.js';
|
|
5
|
+
export declare class SeamHttpWorkspaces {
|
|
6
|
+
client: Client;
|
|
7
|
+
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
8
|
+
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpWorkspaces;
|
|
9
|
+
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpWorkspaces;
|
|
10
|
+
static fromClientSessionToken(clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], options?: Omit<SeamHttpOptionsWithClientSessionToken, 'clientSessionToken'>): SeamHttpWorkspaces;
|
|
11
|
+
static fromPublishableKey(publishableKey: string, userIdentifierKey: string, options?: SeamHttpFromPublishableKeyOptions): Promise<SeamHttpWorkspaces>;
|
|
8
12
|
get(params?: WorkspacesGetParams): Promise<WorkspacesGetResponse['workspace']>;
|
|
13
|
+
list(params?: WorkspacesListParams): Promise<WorkspacesListResponse['workspaces']>;
|
|
14
|
+
resetSandbox(body: WorkspacesResetSandboxBody): Promise<void>;
|
|
9
15
|
}
|
|
10
|
-
export type WorkspacesGetParams =
|
|
16
|
+
export type WorkspacesGetParams = RouteRequestParams<'/workspaces/get'>;
|
|
11
17
|
export type WorkspacesGetResponse = SetNonNullable<Required<RouteResponse<'/workspaces/get'>>>;
|
|
18
|
+
export type WorkspacesListParams = RouteRequestParams<'/workspaces/list'>;
|
|
19
|
+
export type WorkspacesListResponse = SetNonNullable<Required<RouteResponse<'/workspaces/list'>>>;
|
|
20
|
+
export type WorkspacesResetSandboxBody = RouteRequestBody<'/workspaces/reset_sandbox'>;
|
|
21
|
+
export type WorkspacesResetSandboxResponse = SetNonNullable<Required<RouteResponse<'/workspaces/reset_sandbox'>>>;
|
|
@@ -1,20 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by generate-routes.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
import { warnOnInsecureuserIdentifierKey } from '../../../../lib/seam/connect/auth.js';
|
|
6
|
+
import { createClient } from '../../../../lib/seam/connect/client.js';
|
|
7
|
+
import { isSeamHttpOptionsWithApiKey, isSeamHttpOptionsWithClient, isSeamHttpOptionsWithClientSessionToken, SeamHttpInvalidOptionsError, } from '../../../../lib/seam/connect/options.js';
|
|
3
8
|
import { parseOptions } from '../../../../lib/seam/connect/parse-options.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
import { SeamHttpClientSessions } from './client-sessions.js';
|
|
10
|
+
export class SeamHttpWorkspaces {
|
|
11
|
+
constructor(apiKeyOrOptions = {}) {
|
|
12
|
+
const clientOptions = parseOptions(apiKeyOrOptions);
|
|
13
|
+
this.client = createClient(clientOptions);
|
|
14
|
+
}
|
|
15
|
+
static fromClient(client, options = {}) {
|
|
16
|
+
const constructorOptions = { ...options, client };
|
|
17
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
18
|
+
throw new SeamHttpInvalidOptionsError('Missing client');
|
|
19
|
+
}
|
|
20
|
+
return new SeamHttpWorkspaces(constructorOptions);
|
|
21
|
+
}
|
|
22
|
+
static fromApiKey(apiKey, options = {}) {
|
|
23
|
+
const constructorOptions = { ...options, apiKey };
|
|
24
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
25
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey');
|
|
9
26
|
}
|
|
10
|
-
|
|
11
|
-
|
|
27
|
+
return new SeamHttpWorkspaces(constructorOptions);
|
|
28
|
+
}
|
|
29
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
30
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
31
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
32
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken');
|
|
33
|
+
}
|
|
34
|
+
return new SeamHttpWorkspaces(constructorOptions);
|
|
35
|
+
}
|
|
36
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
37
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
38
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
39
|
+
const client = createClient(clientOptions);
|
|
40
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
41
|
+
const { token } = await clientSessions.getOrCreate({
|
|
42
|
+
user_identifier_key: userIdentifierKey,
|
|
43
|
+
});
|
|
44
|
+
return SeamHttpWorkspaces.fromClientSessionToken(token, options);
|
|
12
45
|
}
|
|
13
|
-
async get(params
|
|
14
|
-
const { data } = await this.client.
|
|
46
|
+
async get(params) {
|
|
47
|
+
const { data } = await this.client.request({
|
|
48
|
+
url: '/workspaces/get',
|
|
49
|
+
method: 'get',
|
|
15
50
|
params,
|
|
16
51
|
});
|
|
17
52
|
return data.workspace;
|
|
18
53
|
}
|
|
54
|
+
async list(params) {
|
|
55
|
+
const { data } = await this.client.request({
|
|
56
|
+
url: '/workspaces/list',
|
|
57
|
+
method: 'get',
|
|
58
|
+
params,
|
|
59
|
+
});
|
|
60
|
+
return data.workspaces;
|
|
61
|
+
}
|
|
62
|
+
async resetSandbox(body) {
|
|
63
|
+
await this.client.request({
|
|
64
|
+
url: '/workspaces/reset_sandbox',
|
|
65
|
+
method: 'post',
|
|
66
|
+
data: body,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
19
69
|
}
|
|
20
70
|
//# sourceMappingURL=workspaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/routes/workspaces.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/routes/workspaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAC1E,OAAO,EAAe,YAAY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E,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Client } from './client.js';
|
|
2
|
+
import { type SeamHttpFromPublishableKeyOptions, type SeamHttpOptions, type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClient, type SeamHttpOptionsWithClientSessionToken } from './options.js';
|
|
3
|
+
import { SeamHttpAccessCodes, SeamHttpAcs, SeamHttpActionAttempts, SeamHttpClientSessions, SeamHttpConnectedAccounts, SeamHttpConnectWebviews, SeamHttpDevices, SeamHttpEvents, SeamHttpLocks, SeamHttpNoiseSensors, SeamHttpThermostats, SeamHttpWebhooks, SeamHttpWorkspaces } from './routes/index.js';
|
|
4
|
+
export declare class SeamHttp {
|
|
5
|
+
client: Client;
|
|
6
|
+
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
7
|
+
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttp;
|
|
8
|
+
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttp;
|
|
9
|
+
static fromClientSessionToken(clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], options?: Omit<SeamHttpOptionsWithClientSessionToken, 'clientSessionToken'>): SeamHttp;
|
|
10
|
+
static fromPublishableKey(publishableKey: string, userIdentifierKey: string, options?: SeamHttpFromPublishableKeyOptions): Promise<SeamHttp>;
|
|
11
|
+
get accessCodes(): SeamHttpAccessCodes;
|
|
12
|
+
get acs(): SeamHttpAcs;
|
|
13
|
+
get actionAttempts(): SeamHttpActionAttempts;
|
|
14
|
+
get clientSessions(): SeamHttpClientSessions;
|
|
15
|
+
get connectedAccounts(): SeamHttpConnectedAccounts;
|
|
16
|
+
get connectWebviews(): SeamHttpConnectWebviews;
|
|
17
|
+
get devices(): SeamHttpDevices;
|
|
18
|
+
get events(): SeamHttpEvents;
|
|
19
|
+
get locks(): SeamHttpLocks;
|
|
20
|
+
get noiseSensors(): SeamHttpNoiseSensors;
|
|
21
|
+
get thermostats(): SeamHttpThermostats;
|
|
22
|
+
get webhooks(): SeamHttpWebhooks;
|
|
23
|
+
get workspaces(): SeamHttpWorkspaces;
|
|
24
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { warnOnInsecureuserIdentifierKey } from './auth.js';
|
|
2
|
+
import { createClient } from './client.js';
|
|
3
|
+
import { isSeamHttpOptionsWithApiKey, isSeamHttpOptionsWithClient, isSeamHttpOptionsWithClientSessionToken, SeamHttpInvalidOptionsError, } from './options.js';
|
|
4
|
+
import { parseOptions } from './parse-options.js';
|
|
5
|
+
import { SeamHttpAccessCodes, SeamHttpAcs, SeamHttpActionAttempts, SeamHttpClientSessions, SeamHttpConnectedAccounts, SeamHttpConnectWebviews, SeamHttpDevices, SeamHttpEvents, SeamHttpLocks, SeamHttpNoiseSensors, SeamHttpThermostats, SeamHttpWebhooks, SeamHttpWorkspaces, } from './routes/index.js';
|
|
6
|
+
export class SeamHttp {
|
|
7
|
+
constructor(apiKeyOrOptions = {}) {
|
|
8
|
+
const clientOptions = parseOptions(apiKeyOrOptions);
|
|
9
|
+
this.client = createClient(clientOptions);
|
|
10
|
+
}
|
|
11
|
+
static fromClient(client, options = {}) {
|
|
12
|
+
const constructorOptions = { ...options, client };
|
|
13
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
14
|
+
throw new SeamHttpInvalidOptionsError('Missing client');
|
|
15
|
+
}
|
|
16
|
+
return new SeamHttp(constructorOptions);
|
|
17
|
+
}
|
|
18
|
+
static fromApiKey(apiKey, options = {}) {
|
|
19
|
+
const constructorOptions = { ...options, apiKey };
|
|
20
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
21
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey');
|
|
22
|
+
}
|
|
23
|
+
return new SeamHttp(constructorOptions);
|
|
24
|
+
}
|
|
25
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
26
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
27
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
28
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken');
|
|
29
|
+
}
|
|
30
|
+
return new SeamHttp(constructorOptions);
|
|
31
|
+
}
|
|
32
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
33
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
34
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
35
|
+
const client = createClient(clientOptions);
|
|
36
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
37
|
+
const { token } = await clientSessions.getOrCreate({
|
|
38
|
+
user_identifier_key: userIdentifierKey,
|
|
39
|
+
});
|
|
40
|
+
return SeamHttp.fromClientSessionToken(token, options);
|
|
41
|
+
}
|
|
42
|
+
get accessCodes() {
|
|
43
|
+
return SeamHttpAccessCodes.fromClient(this.client);
|
|
44
|
+
}
|
|
45
|
+
get acs() {
|
|
46
|
+
return SeamHttpAcs.fromClient(this.client);
|
|
47
|
+
}
|
|
48
|
+
get actionAttempts() {
|
|
49
|
+
return SeamHttpActionAttempts.fromClient(this.client);
|
|
50
|
+
}
|
|
51
|
+
get clientSessions() {
|
|
52
|
+
return SeamHttpClientSessions.fromClient(this.client);
|
|
53
|
+
}
|
|
54
|
+
get connectedAccounts() {
|
|
55
|
+
return SeamHttpConnectedAccounts.fromClient(this.client);
|
|
56
|
+
}
|
|
57
|
+
get connectWebviews() {
|
|
58
|
+
return SeamHttpConnectWebviews.fromClient(this.client);
|
|
59
|
+
}
|
|
60
|
+
get devices() {
|
|
61
|
+
return SeamHttpDevices.fromClient(this.client);
|
|
62
|
+
}
|
|
63
|
+
get events() {
|
|
64
|
+
return SeamHttpEvents.fromClient(this.client);
|
|
65
|
+
}
|
|
66
|
+
get locks() {
|
|
67
|
+
return SeamHttpLocks.fromClient(this.client);
|
|
68
|
+
}
|
|
69
|
+
get noiseSensors() {
|
|
70
|
+
return SeamHttpNoiseSensors.fromClient(this.client);
|
|
71
|
+
}
|
|
72
|
+
get thermostats() {
|
|
73
|
+
return SeamHttpThermostats.fromClient(this.client);
|
|
74
|
+
}
|
|
75
|
+
get webhooks() {
|
|
76
|
+
return SeamHttpWebhooks.fromClient(this.client);
|
|
77
|
+
}
|
|
78
|
+
get workspaces() {
|
|
79
|
+
return SeamHttpWorkspaces.fromClient(this.client);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=seam-http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seam-http.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/seam-http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAe,YAAY,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,uCAAuC,EAEvC,2BAA2B,GAK5B,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,OAAO,QAAQ;IAGnB,YAAY,kBAA4C,EAAE;QACxD,MAAM,aAAa,GAAG,YAAY,CAAC,eAAe,CAAC,CAAA;QACnD,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,aAAa,CAAC,CAAA;IAC3C,CAAC;IAED,MAAM,CAAC,UAAU,CACf,MAA2C,EAC3C,U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