@seamapi/http 2.1.0 → 2.3.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/README.md +18 -0
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/lib/api-error-types.js.map +1 -0
- package/lib/auth.d.ts +12 -0
- package/lib/auth.js.map +1 -0
- package/lib/client.d.ts +12 -0
- package/lib/client.js +21 -0
- package/lib/client.js.map +1 -0
- package/lib/error-interceptor.js.map +1 -0
- package/lib/index.js.map +1 -0
- package/lib/openapi.js.map +1 -0
- package/lib/options.d.ts +54 -0
- package/lib/options.js +108 -0
- package/lib/options.js.map +1 -0
- package/lib/parse-options.d.ts +17 -0
- package/lib/parse-options.js +118 -0
- package/lib/parse-options.js.map +1 -0
- package/lib/request-options.d.ts +5 -0
- package/lib/request-options.js +7 -0
- package/lib/request-options.js.map +1 -0
- package/lib/resolve-action-attempt.d.ts +31 -0
- package/lib/resolve-action-attempt.js.map +1 -0
- package/lib/resources/access-code.d.ts +934 -0
- package/lib/resources/access-code.js.map +1 -0
- package/lib/resources/access-grant.d.ts +367 -0
- package/lib/resources/access-grant.js.map +1 -0
- package/lib/resources/access-method.d.ts +269 -0
- package/lib/resources/access-method.js.map +1 -0
- package/lib/resources/acs-access-group.d.ts +322 -0
- package/lib/resources/acs-access-group.js.map +1 -0
- package/lib/resources/acs-credential.d.ts +280 -0
- package/lib/resources/acs-credential.js.map +1 -0
- package/lib/resources/acs-encoder.d.ts +59 -0
- package/lib/resources/acs-encoder.js.map +1 -0
- package/lib/resources/acs-entrance.d.ts +406 -0
- package/lib/resources/acs-entrance.js.map +1 -0
- package/lib/resources/acs-system.d.ts +290 -0
- package/lib/resources/acs-system.js.map +1 -0
- package/lib/resources/acs-user.d.ts +523 -0
- package/lib/resources/acs-user.js.map +1 -0
- package/lib/resources/action-attempt.d.ts +1374 -0
- package/lib/resources/action-attempt.js.map +1 -0
- package/lib/resources/batch.d.ts +57 -0
- package/lib/resources/batch.js.map +1 -0
- package/lib/resources/client-session.d.ts +62 -0
- package/lib/resources/client-session.js.map +1 -0
- package/lib/resources/connect-webview.d.ts +91 -0
- package/lib/resources/connect-webview.js.map +1 -0
- package/lib/resources/connected-account.d.ts +367 -0
- package/lib/resources/connected-account.js.map +1 -0
- package/lib/resources/customer-portal.d.ts +29 -0
- package/lib/resources/customer-portal.js.map +1 -0
- package/lib/resources/device-provider.d.ts +98 -0
- package/lib/resources/device-provider.js.map +1 -0
- package/lib/resources/device.d.ts +2785 -0
- package/lib/resources/device.js.map +1 -0
- package/lib/resources/event.d.ts +5627 -0
- package/lib/resources/event.js.map +1 -0
- package/lib/resources/index.js.map +1 -0
- package/lib/resources/instant-key.d.ts +56 -0
- package/lib/resources/instant-key.js.map +1 -0
- package/lib/resources/noise-threshold.d.ts +33 -0
- package/lib/resources/noise-threshold.js.map +1 -0
- package/lib/resources/phone.d.ts +103 -0
- package/lib/resources/phone.js.map +1 -0
- package/lib/resources/space.d.ts +75 -0
- package/lib/resources/space.js.map +1 -0
- package/lib/resources/thermostat-daily-program.d.ts +38 -0
- package/lib/resources/thermostat-daily-program.js.map +1 -0
- package/lib/resources/thermostat-schedule.d.ts +62 -0
- package/lib/resources/thermostat-schedule.js.map +1 -0
- package/lib/resources/unmanaged-access-code.d.ts +746 -0
- package/lib/resources/unmanaged-access-code.js.map +1 -0
- package/lib/resources/unmanaged-access-grant.d.ts +351 -0
- package/lib/resources/unmanaged-access-grant.js.map +1 -0
- package/lib/resources/unmanaged-access-method.d.ts +257 -0
- package/lib/resources/unmanaged-access-method.js.map +1 -0
- package/lib/resources/unmanaged-device.d.ts +939 -0
- package/lib/resources/unmanaged-device.js.map +1 -0
- package/lib/resources/unmanaged-user-identity.d.ts +102 -0
- package/lib/resources/unmanaged-user-identity.js.map +1 -0
- package/lib/resources/user-identity.d.ts +106 -0
- package/lib/resources/user-identity.js.map +1 -0
- package/lib/resources/webhook.d.ts +21 -0
- package/lib/resources/webhook.js.map +1 -0
- package/lib/resources/workspace.d.ts +63 -0
- package/lib/resources/workspace.js.map +1 -0
- package/lib/routes/access-codes/access-codes.d.ts +495 -0
- package/lib/routes/access-codes/access-codes.js +247 -0
- package/lib/routes/access-codes/access-codes.js.map +1 -0
- package/lib/routes/access-codes/index.js.map +1 -0
- package/lib/routes/access-codes/simulate/index.js.map +1 -0
- package/lib/routes/access-codes/simulate/simulate.d.ts +47 -0
- package/lib/routes/access-codes/simulate/simulate.js +101 -0
- package/lib/routes/access-codes/simulate/simulate.js.map +1 -0
- package/lib/routes/access-codes/unmanaged/index.js.map +1 -0
- package/lib/routes/access-codes/unmanaged/unmanaged.d.ts +164 -0
- package/lib/routes/access-codes/unmanaged/unmanaged.js +155 -0
- package/lib/routes/access-codes/unmanaged/unmanaged.js.map +1 -0
- package/lib/routes/access-grants/access-grants.d.ts +339 -0
- package/lib/routes/access-grants/access-grants.js +177 -0
- package/lib/routes/access-grants/access-grants.js.map +1 -0
- package/lib/routes/access-grants/index.js.map +1 -0
- package/lib/routes/access-grants/unmanaged/index.js.map +1 -0
- package/lib/routes/access-grants/unmanaged/unmanaged.d.ts +107 -0
- package/lib/routes/access-grants/unmanaged/unmanaged.js +129 -0
- package/lib/routes/access-grants/unmanaged/unmanaged.js.map +1 -0
- package/lib/routes/access-methods/access-methods.d.ts +202 -0
- package/lib/routes/access-methods/access-methods.js +190 -0
- package/lib/routes/access-methods/access-methods.js.map +1 -0
- package/lib/routes/access-methods/index.js.map +1 -0
- package/lib/routes/access-methods/unmanaged/index.js.map +1 -0
- package/lib/routes/access-methods/unmanaged/unmanaged.d.ts +70 -0
- package/lib/routes/access-methods/unmanaged/unmanaged.js +113 -0
- package/lib/routes/access-methods/unmanaged/unmanaged.js.map +1 -0
- package/lib/routes/acs/access-groups/access-groups.d.ts +177 -0
- package/lib/routes/acs/access-groups/access-groups.js +173 -0
- package/lib/routes/acs/access-groups/access-groups.js.map +1 -0
- package/lib/routes/acs/access-groups/index.js.map +1 -0
- package/lib/routes/acs/acs.d.ts +31 -0
- package/lib/routes/acs/acs.js +112 -0
- package/lib/routes/acs/acs.js.map +1 -0
- package/lib/routes/acs/credentials/credentials.d.ts +281 -0
- package/lib/routes/acs/credentials/credentials.js +185 -0
- package/lib/routes/acs/credentials/credentials.js.map +1 -0
- package/lib/routes/acs/credentials/index.js.map +1 -0
- package/lib/routes/acs/encoders/encoders.d.ts +165 -0
- package/lib/routes/acs/encoders/encoders.js +166 -0
- package/lib/routes/acs/encoders/encoders.js.map +1 -0
- package/lib/routes/acs/encoders/index.js.map +1 -0
- package/lib/routes/acs/encoders/simulate/index.js.map +1 -0
- package/lib/routes/acs/encoders/simulate/simulate.d.ts +109 -0
- package/lib/routes/acs/encoders/simulate/simulate.js +137 -0
- package/lib/routes/acs/encoders/simulate/simulate.js.map +1 -0
- package/lib/routes/acs/entrances/entrances.d.ts +170 -0
- package/lib/routes/acs/entrances/entrances.js +154 -0
- package/lib/routes/acs/entrances/entrances.js.map +1 -0
- package/lib/routes/acs/entrances/index.js.map +1 -0
- package/lib/routes/acs/index.js.map +1 -0
- package/lib/routes/acs/systems/index.js.map +1 -0
- package/lib/routes/acs/systems/systems.d.ts +150 -0
- package/lib/routes/acs/systems/systems.js +141 -0
- package/lib/routes/acs/systems/systems.js.map +1 -0
- package/lib/routes/acs/users/index.js.map +1 -0
- package/lib/routes/acs/users/users.d.ts +382 -0
- package/lib/routes/acs/users/users.js +221 -0
- package/lib/routes/acs/users/users.js.map +1 -0
- package/lib/routes/action-attempts/action-attempts.d.ts +69 -0
- package/lib/routes/action-attempts/action-attempts.js +117 -0
- package/lib/routes/action-attempts/action-attempts.js.map +1 -0
- package/lib/routes/action-attempts/index.js.map +1 -0
- package/lib/routes/client-sessions/client-sessions.d.ts +240 -0
- package/lib/routes/client-sessions/client-sessions.js +174 -0
- package/lib/routes/client-sessions/client-sessions.js.map +1 -0
- package/lib/routes/client-sessions/index.js.map +1 -0
- package/lib/routes/connect-webviews/connect-webviews.d.ts +160 -0
- package/lib/routes/connect-webviews/connect-webviews.js +147 -0
- package/lib/routes/connect-webviews/connect-webviews.js.map +1 -0
- package/lib/routes/connect-webviews/index.js.map +1 -0
- package/lib/routes/connected-accounts/connected-accounts.d.ts +163 -0
- package/lib/routes/connected-accounts/connected-accounts.js +157 -0
- package/lib/routes/connected-accounts/connected-accounts.js.map +1 -0
- package/lib/routes/connected-accounts/index.js.map +1 -0
- package/lib/routes/connected-accounts/simulate/index.js.map +1 -0
- package/lib/routes/connected-accounts/simulate/simulate.d.ts +36 -0
- package/lib/routes/connected-accounts/simulate/simulate.js +101 -0
- package/lib/routes/connected-accounts/simulate/simulate.js.map +1 -0
- package/lib/routes/customers/customers.d.ts +1511 -0
- package/lib/routes/customers/customers.js +126 -0
- package/lib/routes/customers/customers.js.map +1 -0
- package/lib/routes/customers/index.js.map +1 -0
- package/lib/routes/devices/devices.d.ts +242 -0
- package/lib/routes/devices/devices.js +165 -0
- package/lib/routes/devices/devices.js.map +1 -0
- package/lib/routes/devices/index.js.map +1 -0
- package/lib/routes/devices/simulate/index.js.map +1 -0
- package/lib/routes/devices/simulate/simulate.d.ts +128 -0
- package/lib/routes/devices/simulate/simulate.js +170 -0
- package/lib/routes/devices/simulate/simulate.js.map +1 -0
- package/lib/routes/devices/unmanaged/index.js.map +1 -0
- package/lib/routes/devices/unmanaged/unmanaged.d.ts +155 -0
- package/lib/routes/devices/unmanaged/unmanaged.js +133 -0
- package/lib/routes/devices/unmanaged/unmanaged.js.map +1 -0
- package/lib/routes/events/events.d.ts +174 -0
- package/lib/routes/events/events.js +113 -0
- package/lib/routes/events/events.js.map +1 -0
- package/lib/routes/events/index.js.map +1 -0
- package/lib/routes/index.js.map +1 -0
- package/lib/routes/instant-keys/index.js.map +1 -0
- package/lib/routes/instant-keys/instant-keys.d.ts +79 -0
- package/lib/routes/instant-keys/instant-keys.js +125 -0
- package/lib/routes/instant-keys/instant-keys.js.map +1 -0
- package/lib/routes/locks/index.js.map +1 -0
- package/lib/routes/locks/locks.d.ts +188 -0
- package/lib/routes/locks/locks.js +167 -0
- package/lib/routes/locks/locks.js.map +1 -0
- package/lib/routes/locks/simulate/index.js.map +1 -0
- package/lib/routes/locks/simulate/simulate.d.ts +60 -0
- package/lib/routes/locks/simulate/simulate.js +122 -0
- package/lib/routes/locks/simulate/simulate.js.map +1 -0
- package/lib/routes/noise-sensors/index.js.map +1 -0
- package/lib/routes/noise-sensors/noise-sensors.d.ts +103 -0
- package/lib/routes/noise-sensors/noise-sensors.js +109 -0
- package/lib/routes/noise-sensors/noise-sensors.js.map +1 -0
- package/lib/routes/noise-sensors/noise-thresholds/index.js.map +1 -0
- package/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.d.ts +159 -0
- package/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.js +149 -0
- package/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.js.map +1 -0
- package/lib/routes/noise-sensors/simulate/index.js.map +1 -0
- package/lib/routes/noise-sensors/simulate/simulate.d.ts +36 -0
- package/lib/routes/noise-sensors/simulate/simulate.js +101 -0
- package/lib/routes/noise-sensors/simulate/simulate.js.map +1 -0
- package/lib/routes/phones/index.js.map +1 -0
- package/lib/routes/phones/phones.d.ts +81 -0
- package/lib/routes/phones/phones.js +129 -0
- package/lib/routes/phones/phones.js.map +1 -0
- package/lib/routes/phones/simulate/index.js.map +1 -0
- package/lib/routes/phones/simulate/simulate.d.ts +93 -0
- package/lib/routes/phones/simulate/simulate.js +101 -0
- package/lib/routes/phones/simulate/simulate.js.map +1 -0
- package/lib/routes/seam-http-endpoints-without-workspace.d.ts +23 -0
- package/lib/routes/seam-http-endpoints-without-workspace.js +62 -0
- package/lib/routes/seam-http-endpoints-without-workspace.js.map +1 -0
- package/lib/routes/seam-http-endpoints.d.ts +960 -0
- package/lib/routes/seam-http-endpoints.js +2231 -0
- package/lib/routes/seam-http-endpoints.js.map +1 -0
- package/lib/routes/seam-http-without-workspace.d.ts +18 -0
- package/lib/routes/seam-http-without-workspace.js +49 -0
- package/lib/routes/seam-http-without-workspace.js.map +1 -0
- package/lib/routes/seam-http.d.ts +59 -0
- package/lib/routes/seam-http.js +167 -0
- package/lib/routes/seam-http.js.map +1 -0
- package/lib/routes/spaces/index.js.map +1 -0
- package/lib/routes/spaces/spaces.d.ts +363 -0
- package/lib/routes/spaces/spaces.js +233 -0
- package/lib/routes/spaces/spaces.js.map +1 -0
- package/lib/routes/thermostats/daily-programs/daily-programs.d.ts +109 -0
- package/lib/routes/thermostats/daily-programs/daily-programs.js +130 -0
- package/lib/routes/thermostats/daily-programs/daily-programs.js.map +1 -0
- package/lib/routes/thermostats/daily-programs/index.js.map +1 -0
- package/lib/routes/thermostats/index.js.map +1 -0
- package/lib/routes/thermostats/schedules/index.js.map +1 -0
- package/lib/routes/thermostats/schedules/schedules.d.ts +163 -0
- package/lib/routes/thermostats/schedules/schedules.js +149 -0
- package/lib/routes/thermostats/schedules/schedules.js.map +1 -0
- package/lib/routes/thermostats/simulate/index.js.map +1 -0
- package/lib/routes/thermostats/simulate/simulate.d.ts +81 -0
- package/lib/routes/thermostats/simulate/simulate.js +113 -0
- package/lib/routes/thermostats/simulate/simulate.js.map +1 -0
- package/lib/routes/thermostats/thermostats.d.ts +565 -0
- package/lib/routes/thermostats/thermostats.js +302 -0
- package/lib/routes/thermostats/thermostats.js.map +1 -0
- package/lib/routes/user-identities/index.js.map +1 -0
- package/lib/routes/user-identities/unmanaged/index.js.map +1 -0
- package/lib/routes/user-identities/unmanaged/unmanaged.d.ts +97 -0
- package/lib/routes/user-identities/unmanaged/unmanaged.js +127 -0
- package/lib/routes/user-identities/unmanaged/unmanaged.js.map +1 -0
- package/lib/routes/user-identities/user-identities.d.ts +363 -0
- package/lib/routes/user-identities/user-identities.js +265 -0
- package/lib/routes/user-identities/user-identities.js.map +1 -0
- package/lib/routes/webhooks/index.js.map +1 -0
- package/lib/routes/webhooks/webhooks.d.ts +114 -0
- package/lib/routes/webhooks/webhooks.js +149 -0
- package/lib/routes/webhooks/webhooks.js.map +1 -0
- package/lib/routes/workspaces/index.js.map +1 -0
- package/lib/routes/workspaces/workspaces.d.ts +189 -0
- package/lib/routes/workspaces/workspaces.js +154 -0
- package/lib/routes/workspaces/workspaces.js.map +1 -0
- package/lib/seam-http-error.js.map +1 -0
- package/lib/seam-http-request.d.ts +34 -0
- package/lib/seam-http-request.js +101 -0
- package/lib/seam-http-request.js.map +1 -0
- package/lib/seam-paginator.js.map +1 -0
- package/lib/token.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +8 -11
- package/src/index.ts +2 -1
- package/src/lib/auth.ts +280 -0
- package/src/lib/client.ts +36 -0
- package/src/lib/options.ts +242 -0
- package/src/lib/parse-options.ts +182 -0
- package/src/lib/request-options.ts +14 -0
- package/src/lib/resolve-action-attempt.ts +129 -0
- package/src/lib/resources/access-code.ts +1088 -0
- package/src/lib/resources/access-grant.ts +437 -0
- package/src/lib/resources/access-method.ts +312 -0
- package/src/lib/resources/acs-access-group.ts +402 -0
- package/src/lib/resources/acs-credential.ts +332 -0
- package/src/lib/resources/acs-encoder.ts +72 -0
- package/src/lib/resources/acs-entrance.ts +469 -0
- package/src/lib/resources/acs-system.ts +377 -0
- package/src/lib/resources/acs-user.ts +627 -0
- package/src/lib/resources/action-attempt.ts +1672 -0
- package/src/lib/resources/batch.ts +65 -0
- package/src/lib/resources/client-session.ts +75 -0
- package/src/lib/resources/connect-webview.ts +110 -0
- package/src/lib/resources/connected-account.ts +425 -0
- package/src/lib/resources/customer-portal.ts +38 -0
- package/src/lib/resources/device-provider.ts +178 -0
- package/src/lib/resources/device.ts +3217 -0
- package/src/lib/resources/event.ts +6743 -0
- package/src/lib/resources/instant-key.ts +69 -0
- package/src/lib/resources/noise-threshold.ts +43 -0
- package/src/lib/resources/phone.ts +126 -0
- package/src/lib/resources/space.ts +92 -0
- package/src/lib/resources/thermostat-daily-program.ts +48 -0
- package/src/lib/resources/thermostat-schedule.ts +76 -0
- package/src/lib/resources/unmanaged-access-code.ts +870 -0
- package/src/lib/resources/unmanaged-access-grant.ts +420 -0
- package/src/lib/resources/unmanaged-access-method.ts +300 -0
- package/src/lib/resources/unmanaged-device.ts +1157 -0
- package/src/lib/resources/unmanaged-user-identity.ts +124 -0
- package/src/lib/resources/user-identity.ts +128 -0
- package/src/lib/resources/webhook.ts +27 -0
- package/src/lib/resources/workspace.ts +75 -0
- package/src/lib/routes/access-codes/access-codes.ts +818 -0
- package/src/lib/routes/access-codes/simulate/simulate.ts +211 -0
- package/src/lib/routes/access-codes/unmanaged/unmanaged.ts +395 -0
- package/src/lib/routes/access-grants/access-grants.ts +640 -0
- package/src/lib/routes/access-grants/unmanaged/unmanaged.ts +305 -0
- package/src/lib/routes/access-methods/access-methods.ts +523 -0
- package/src/lib/routes/access-methods/unmanaged/unmanaged.ts +250 -0
- package/src/lib/routes/acs/access-groups/access-groups.ts +435 -0
- package/src/lib/routes/acs/acs.ts +193 -0
- package/src/lib/routes/acs/credentials/credentials.ts +569 -0
- package/src/lib/routes/acs/encoders/encoders.ts +429 -0
- package/src/lib/routes/acs/encoders/simulate/simulate.ts +335 -0
- package/src/lib/routes/acs/entrances/entrances.ts +406 -0
- package/src/lib/routes/acs/systems/systems.ts +367 -0
- package/src/lib/routes/acs/users/users.ts +710 -0
- package/src/lib/routes/action-attempts/action-attempts.ts +254 -0
- package/src/lib/routes/client-sessions/client-sessions.ts +495 -0
- package/src/lib/routes/connect-webviews/connect-webviews.ts +452 -0
- package/src/lib/routes/connected-accounts/connected-accounts.ts +399 -0
- package/src/lib/routes/connected-accounts/simulate/simulate.ts +200 -0
- package/src/lib/routes/customers/customers.ts +1838 -0
- package/src/lib/routes/devices/devices.ts +1918 -0
- package/src/lib/routes/devices/simulate/simulate.ts +371 -0
- package/src/lib/routes/devices/unmanaged/unmanaged.ts +486 -0
- package/src/lib/routes/events/events.ts +565 -0
- package/src/lib/routes/instant-keys/instant-keys.ts +269 -0
- package/src/lib/routes/locks/locks.ts +532 -0
- package/src/lib/routes/locks/simulate/simulate.ts +257 -0
- package/src/lib/routes/noise-sensors/noise-sensors.ts +272 -0
- package/src/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.ts +400 -0
- package/src/lib/routes/noise-sensors/simulate/simulate.ts +197 -0
- package/src/lib/routes/phones/phones.ts +269 -0
- package/src/lib/routes/phones/simulate/simulate.ts +256 -0
- package/src/lib/routes/seam-http-endpoints-without-workspace.ts +132 -0
- package/src/lib/routes/seam-http-endpoints.ts +4457 -0
- package/src/lib/routes/seam-http-without-workspace.ts +96 -0
- package/src/lib/routes/seam-http.ts +262 -0
- package/src/lib/routes/spaces/spaces.ts +721 -0
- package/src/lib/routes/thermostats/daily-programs/daily-programs.ts +322 -0
- package/src/lib/routes/thermostats/schedules/schedules.ts +394 -0
- package/src/lib/routes/thermostats/simulate/simulate.ts +263 -0
- package/src/lib/routes/thermostats/thermostats.ts +1067 -0
- package/src/lib/routes/user-identities/unmanaged/unmanaged.ts +299 -0
- package/src/lib/routes/user-identities/user-identities.ts +756 -0
- package/src/lib/routes/webhooks/webhooks.ts +333 -0
- package/src/lib/routes/workspaces/workspaces.ts +425 -0
- package/src/lib/seam-http-request.ts +201 -0
- package/src/lib/version.ts +1 -1
- package/connect.d.ts +0 -2
- package/connect.js +0 -3
- package/connect.js.map +0 -1
- package/lib/seam/connect/api-error-types.js.map +0 -1
- package/lib/seam/connect/auth.d.ts +0 -10
- package/lib/seam/connect/auth.js.map +0 -1
- package/lib/seam/connect/client.d.ts +0 -10
- package/lib/seam/connect/client.js +0 -19
- package/lib/seam/connect/client.js.map +0 -1
- package/lib/seam/connect/error-interceptor.js.map +0 -1
- package/lib/seam/connect/index.js.map +0 -1
- package/lib/seam/connect/openapi.js.map +0 -1
- package/lib/seam/connect/options.d.ts +0 -57
- package/lib/seam/connect/options.js +0 -108
- package/lib/seam/connect/options.js.map +0 -1
- package/lib/seam/connect/parse-options.d.ts +0 -18
- package/lib/seam/connect/parse-options.js +0 -120
- package/lib/seam/connect/parse-options.js.map +0 -1
- package/lib/seam/connect/resolve-action-attempt.d.ts +0 -27
- package/lib/seam/connect/resolve-action-attempt.js.map +0 -1
- package/lib/seam/connect/resources/access-code.d.ts +0 -247
- package/lib/seam/connect/resources/access-code.js.map +0 -1
- package/lib/seam/connect/resources/access-grant.d.ts +0 -98
- package/lib/seam/connect/resources/access-grant.js.map +0 -1
- package/lib/seam/connect/resources/access-method.d.ts +0 -73
- package/lib/seam/connect/resources/access-method.js.map +0 -1
- package/lib/seam/connect/resources/acs-access-group.d.ts +0 -89
- package/lib/seam/connect/resources/acs-access-group.js.map +0 -1
- package/lib/seam/connect/resources/acs-credential.d.ts +0 -74
- package/lib/seam/connect/resources/acs-credential.js.map +0 -1
- package/lib/seam/connect/resources/acs-encoder.d.ts +0 -13
- package/lib/seam/connect/resources/acs-encoder.js.map +0 -1
- package/lib/seam/connect/resources/acs-entrance.d.ts +0 -113
- package/lib/seam/connect/resources/acs-entrance.js.map +0 -1
- package/lib/seam/connect/resources/acs-system.d.ts +0 -74
- package/lib/seam/connect/resources/acs-system.js.map +0 -1
- package/lib/seam/connect/resources/acs-user.d.ts +0 -154
- package/lib/seam/connect/resources/acs-user.js.map +0 -1
- package/lib/seam/connect/resources/action-attempt.d.ts +0 -420
- package/lib/seam/connect/resources/action-attempt.js.map +0 -1
- package/lib/seam/connect/resources/batch.d.ts +0 -54
- package/lib/seam/connect/resources/batch.js.map +0 -1
- package/lib/seam/connect/resources/client-session.d.ts +0 -14
- package/lib/seam/connect/resources/client-session.js.map +0 -1
- package/lib/seam/connect/resources/connect-webview.d.ts +0 -21
- package/lib/seam/connect/resources/connect-webview.js.map +0 -1
- package/lib/seam/connect/resources/connected-account.d.ts +0 -98
- package/lib/seam/connect/resources/connected-account.js.map +0 -1
- package/lib/seam/connect/resources/customer-portal.d.ts +0 -7
- package/lib/seam/connect/resources/customer-portal.js.map +0 -1
- package/lib/seam/connect/resources/device-provider.d.ts +0 -26
- package/lib/seam/connect/resources/device-provider.js.map +0 -1
- package/lib/seam/connect/resources/device.d.ts +0 -763
- package/lib/seam/connect/resources/device.js.map +0 -1
- package/lib/seam/connect/resources/event.d.ts +0 -1613
- package/lib/seam/connect/resources/event.js.map +0 -1
- package/lib/seam/connect/resources/index.js.map +0 -1
- package/lib/seam/connect/resources/instant-key.d.ts +0 -15
- package/lib/seam/connect/resources/instant-key.js.map +0 -1
- package/lib/seam/connect/resources/noise-threshold.d.ts +0 -9
- package/lib/seam/connect/resources/noise-threshold.js.map +0 -1
- package/lib/seam/connect/resources/phone.d.ts +0 -31
- package/lib/seam/connect/resources/phone.js.map +0 -1
- package/lib/seam/connect/resources/space.d.ts +0 -21
- package/lib/seam/connect/resources/space.js.map +0 -1
- package/lib/seam/connect/resources/thermostat-daily-program.d.ts +0 -11
- package/lib/seam/connect/resources/thermostat-daily-program.js.map +0 -1
- package/lib/seam/connect/resources/thermostat-schedule.d.ts +0 -17
- package/lib/seam/connect/resources/thermostat-schedule.js.map +0 -1
- package/lib/seam/connect/resources/unmanaged-access-code.d.ts +0 -194
- package/lib/seam/connect/resources/unmanaged-access-code.js.map +0 -1
- package/lib/seam/connect/resources/unmanaged-access-grant.d.ts +0 -94
- package/lib/seam/connect/resources/unmanaged-access-grant.js.map +0 -1
- package/lib/seam/connect/resources/unmanaged-access-method.d.ts +0 -70
- package/lib/seam/connect/resources/unmanaged-access-method.js.map +0 -1
- package/lib/seam/connect/resources/unmanaged-device.d.ts +0 -249
- package/lib/seam/connect/resources/unmanaged-device.js.map +0 -1
- package/lib/seam/connect/resources/unmanaged-user-identity.d.ts +0 -26
- package/lib/seam/connect/resources/unmanaged-user-identity.js.map +0 -1
- package/lib/seam/connect/resources/user-identity.d.ts +0 -27
- package/lib/seam/connect/resources/user-identity.js.map +0 -1
- package/lib/seam/connect/resources/webhook.d.ts +0 -6
- package/lib/seam/connect/resources/webhook.js.map +0 -1
- package/lib/seam/connect/resources/workspace.d.ts +0 -18
- package/lib/seam/connect/resources/workspace.js.map +0 -1
- package/lib/seam/connect/routes/access-codes/access-codes.d.ts +0 -207
- package/lib/seam/connect/routes/access-codes/access-codes.js +0 -187
- package/lib/seam/connect/routes/access-codes/access-codes.js.map +0 -1
- package/lib/seam/connect/routes/access-codes/index.js.map +0 -1
- package/lib/seam/connect/routes/access-codes/simulate/index.js.map +0 -1
- package/lib/seam/connect/routes/access-codes/simulate/simulate.d.ts +0 -35
- package/lib/seam/connect/routes/access-codes/simulate/simulate.js +0 -98
- package/lib/seam/connect/routes/access-codes/simulate/simulate.js.map +0 -1
- package/lib/seam/connect/routes/access-codes/unmanaged/index.js.map +0 -1
- package/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.d.ts +0 -92
- package/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.js +0 -134
- package/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.js.map +0 -1
- package/lib/seam/connect/routes/access-grants/access-grants.d.ts +0 -162
- package/lib/seam/connect/routes/access-grants/access-grants.js +0 -156
- package/lib/seam/connect/routes/access-grants/access-grants.js.map +0 -1
- package/lib/seam/connect/routes/access-grants/index.js.map +0 -1
- package/lib/seam/connect/routes/access-grants/unmanaged/index.js.map +0 -1
- package/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.d.ts +0 -64
- package/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.js +0 -116
- package/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.js.map +0 -1
- package/lib/seam/connect/routes/access-methods/access-methods.d.ts +0 -124
- package/lib/seam/connect/routes/access-methods/access-methods.js +0 -156
- package/lib/seam/connect/routes/access-methods/access-methods.js.map +0 -1
- package/lib/seam/connect/routes/access-methods/index.js.map +0 -1
- package/lib/seam/connect/routes/access-methods/unmanaged/index.js.map +0 -1
- package/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.d.ts +0 -49
- package/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.js +0 -107
- package/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.js.map +0 -1
- package/lib/seam/connect/routes/acs/access-groups/access-groups.d.ts +0 -114
- package/lib/seam/connect/routes/acs/access-groups/access-groups.js +0 -152
- package/lib/seam/connect/routes/acs/access-groups/access-groups.js.map +0 -1
- package/lib/seam/connect/routes/acs/access-groups/index.js.map +0 -1
- package/lib/seam/connect/routes/acs/acs.d.ts +0 -31
- package/lib/seam/connect/routes/acs/acs.js +0 -112
- package/lib/seam/connect/routes/acs/acs.js.map +0 -1
- package/lib/seam/connect/routes/acs/credentials/credentials.d.ts +0 -155
- package/lib/seam/connect/routes/acs/credentials/credentials.js +0 -161
- package/lib/seam/connect/routes/acs/credentials/credentials.js.map +0 -1
- package/lib/seam/connect/routes/acs/credentials/index.js.map +0 -1
- package/lib/seam/connect/routes/acs/encoders/encoders.d.ts +0 -99
- package/lib/seam/connect/routes/acs/encoders/encoders.js +0 -138
- package/lib/seam/connect/routes/acs/encoders/encoders.js.map +0 -1
- package/lib/seam/connect/routes/acs/encoders/index.js.map +0 -1
- package/lib/seam/connect/routes/acs/encoders/simulate/index.js.map +0 -1
- package/lib/seam/connect/routes/acs/encoders/simulate/simulate.d.ts +0 -70
- package/lib/seam/connect/routes/acs/encoders/simulate/simulate.js +0 -125
- package/lib/seam/connect/routes/acs/encoders/simulate/simulate.js.map +0 -1
- package/lib/seam/connect/routes/acs/entrances/entrances.d.ts +0 -98
- package/lib/seam/connect/routes/acs/entrances/entrances.js +0 -134
- package/lib/seam/connect/routes/acs/entrances/entrances.js.map +0 -1
- package/lib/seam/connect/routes/acs/entrances/index.js.map +0 -1
- package/lib/seam/connect/routes/acs/index.js.map +0 -1
- package/lib/seam/connect/routes/acs/systems/index.js.map +0 -1
- package/lib/seam/connect/routes/acs/systems/systems.d.ts +0 -86
- package/lib/seam/connect/routes/acs/systems/systems.js +0 -125
- package/lib/seam/connect/routes/acs/systems/systems.js.map +0 -1
- package/lib/seam/connect/routes/acs/users/index.js.map +0 -1
- package/lib/seam/connect/routes/acs/users/users.d.ts +0 -193
- package/lib/seam/connect/routes/acs/users/users.js +0 -188
- package/lib/seam/connect/routes/acs/users/users.js.map +0 -1
- package/lib/seam/connect/routes/action-attempts/action-attempts.d.ts +0 -48
- package/lib/seam/connect/routes/action-attempts/action-attempts.js +0 -107
- package/lib/seam/connect/routes/action-attempts/action-attempts.js.map +0 -1
- package/lib/seam/connect/routes/action-attempts/index.js.map +0 -1
- package/lib/seam/connect/routes/client-sessions/client-sessions.d.ts +0 -127
- package/lib/seam/connect/routes/client-sessions/client-sessions.js +0 -151
- package/lib/seam/connect/routes/client-sessions/client-sessions.js.map +0 -1
- package/lib/seam/connect/routes/client-sessions/index.js.map +0 -1
- package/lib/seam/connect/routes/connect-webviews/connect-webviews.d.ts +0 -84
- package/lib/seam/connect/routes/connect-webviews/connect-webviews.js +0 -125
- package/lib/seam/connect/routes/connect-webviews/connect-webviews.js.map +0 -1
- package/lib/seam/connect/routes/connect-webviews/index.js.map +0 -1
- package/lib/seam/connect/routes/connected-accounts/connected-accounts.d.ts +0 -93
- package/lib/seam/connect/routes/connected-accounts/connected-accounts.js +0 -138
- package/lib/seam/connect/routes/connected-accounts/connected-accounts.js.map +0 -1
- package/lib/seam/connect/routes/connected-accounts/index.js.map +0 -1
- package/lib/seam/connect/routes/connected-accounts/simulate/index.js.map +0 -1
- package/lib/seam/connect/routes/connected-accounts/simulate/simulate.d.ts +0 -30
- package/lib/seam/connect/routes/connected-accounts/simulate/simulate.js +0 -98
- package/lib/seam/connect/routes/connected-accounts/simulate/simulate.js.map +0 -1
- package/lib/seam/connect/routes/customers/customers.d.ts +0 -469
- package/lib/seam/connect/routes/customers/customers.js +0 -116
- package/lib/seam/connect/routes/customers/customers.js.map +0 -1
- package/lib/seam/connect/routes/customers/index.js.map +0 -1
- package/lib/seam/connect/routes/devices/devices.d.ts +0 -120
- package/lib/seam/connect/routes/devices/devices.js +0 -142
- package/lib/seam/connect/routes/devices/devices.js.map +0 -1
- package/lib/seam/connect/routes/devices/index.js.map +0 -1
- package/lib/seam/connect/routes/devices/simulate/index.js.map +0 -1
- package/lib/seam/connect/routes/devices/simulate/simulate.d.ts +0 -86
- package/lib/seam/connect/routes/devices/simulate/simulate.js +0 -143
- package/lib/seam/connect/routes/devices/simulate/simulate.js.map +0 -1
- package/lib/seam/connect/routes/devices/unmanaged/index.js.map +0 -1
- package/lib/seam/connect/routes/devices/unmanaged/unmanaged.d.ts +0 -75
- package/lib/seam/connect/routes/devices/unmanaged/unmanaged.js +0 -116
- package/lib/seam/connect/routes/devices/unmanaged/unmanaged.js.map +0 -1
- package/lib/seam/connect/routes/events/events.d.ts +0 -75
- package/lib/seam/connect/routes/events/events.js +0 -107
- package/lib/seam/connect/routes/events/events.js.map +0 -1
- package/lib/seam/connect/routes/events/index.js.map +0 -1
- package/lib/seam/connect/routes/index.js.map +0 -1
- package/lib/seam/connect/routes/instant-keys/index.js.map +0 -1
- package/lib/seam/connect/routes/instant-keys/instant-keys.d.ts +0 -58
- package/lib/seam/connect/routes/instant-keys/instant-keys.js +0 -116
- package/lib/seam/connect/routes/instant-keys/instant-keys.js.map +0 -1
- package/lib/seam/connect/routes/locks/index.js.map +0 -1
- package/lib/seam/connect/routes/locks/locks.d.ts +0 -103
- package/lib/seam/connect/routes/locks/locks.js +0 -138
- package/lib/seam/connect/routes/locks/locks.js.map +0 -1
- package/lib/seam/connect/routes/locks/simulate/index.js.map +0 -1
- package/lib/seam/connect/routes/locks/simulate/simulate.d.ts +0 -45
- package/lib/seam/connect/routes/locks/simulate/simulate.js +0 -107
- package/lib/seam/connect/routes/locks/simulate/simulate.js.map +0 -1
- package/lib/seam/connect/routes/noise-sensors/index.js.map +0 -1
- package/lib/seam/connect/routes/noise-sensors/noise-sensors.d.ts +0 -52
- package/lib/seam/connect/routes/noise-sensors/noise-sensors.js +0 -106
- package/lib/seam/connect/routes/noise-sensors/noise-sensors.js.map +0 -1
- package/lib/seam/connect/routes/noise-sensors/noise-thresholds/index.js.map +0 -1
- package/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.d.ts +0 -93
- package/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.js +0 -134
- package/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.js.map +0 -1
- package/lib/seam/connect/routes/noise-sensors/simulate/index.js.map +0 -1
- package/lib/seam/connect/routes/noise-sensors/simulate/simulate.d.ts +0 -30
- package/lib/seam/connect/routes/noise-sensors/simulate/simulate.js +0 -98
- package/lib/seam/connect/routes/noise-sensors/simulate/simulate.js.map +0 -1
- package/lib/seam/connect/routes/phones/index.js.map +0 -1
- package/lib/seam/connect/routes/phones/phones.d.ts +0 -60
- package/lib/seam/connect/routes/phones/phones.js +0 -120
- package/lib/seam/connect/routes/phones/phones.js.map +0 -1
- package/lib/seam/connect/routes/phones/simulate/index.js.map +0 -1
- package/lib/seam/connect/routes/phones/simulate/simulate.d.ts +0 -48
- package/lib/seam/connect/routes/phones/simulate/simulate.js +0 -98
- package/lib/seam/connect/routes/phones/simulate/simulate.js.map +0 -1
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.d.ts +0 -17
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.js +0 -56
- package/lib/seam/connect/routes/seam-http-endpoints-without-workspace.js.map +0 -1
- package/lib/seam/connect/routes/seam-http-endpoints.d.ts +0 -264
- package/lib/seam/connect/routes/seam-http-endpoints.js +0 -1535
- package/lib/seam/connect/routes/seam-http-endpoints.js.map +0 -1
- package/lib/seam/connect/routes/seam-http-without-workspace.d.ts +0 -18
- package/lib/seam/connect/routes/seam-http-without-workspace.js +0 -49
- package/lib/seam/connect/routes/seam-http-without-workspace.js.map +0 -1
- package/lib/seam/connect/routes/seam-http.d.ts +0 -59
- package/lib/seam/connect/routes/seam-http.js +0 -167
- package/lib/seam/connect/routes/seam-http.js.map +0 -1
- package/lib/seam/connect/routes/spaces/index.js.map +0 -1
- package/lib/seam/connect/routes/spaces/spaces.d.ts +0 -198
- package/lib/seam/connect/routes/spaces/spaces.js +0 -197
- package/lib/seam/connect/routes/spaces/spaces.js.map +0 -1
- package/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.d.ts +0 -67
- package/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.js +0 -116
- package/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.js.map +0 -1
- package/lib/seam/connect/routes/thermostats/daily-programs/index.js.map +0 -1
- package/lib/seam/connect/routes/thermostats/index.js.map +0 -1
- package/lib/seam/connect/routes/thermostats/schedules/index.js.map +0 -1
- package/lib/seam/connect/routes/thermostats/schedules/schedules.d.ts +0 -94
- package/lib/seam/connect/routes/thermostats/schedules/schedules.js +0 -134
- package/lib/seam/connect/routes/thermostats/schedules/schedules.js.map +0 -1
- package/lib/seam/connect/routes/thermostats/simulate/index.js.map +0 -1
- package/lib/seam/connect/routes/thermostats/simulate/simulate.d.ts +0 -48
- package/lib/seam/connect/routes/thermostats/simulate/simulate.js +0 -107
- package/lib/seam/connect/routes/thermostats/simulate/simulate.js.map +0 -1
- package/lib/seam/connect/routes/thermostats/thermostats.d.ts +0 -265
- package/lib/seam/connect/routes/thermostats/thermostats.js +0 -227
- package/lib/seam/connect/routes/thermostats/thermostats.js.map +0 -1
- package/lib/seam/connect/routes/user-identities/index.js.map +0 -1
- package/lib/seam/connect/routes/user-identities/unmanaged/index.js.map +0 -1
- package/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.d.ts +0 -62
- package/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.js +0 -116
- package/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.js.map +0 -1
- package/lib/seam/connect/routes/user-identities/user-identities.d.ts +0 -218
- package/lib/seam/connect/routes/user-identities/user-identities.js +0 -219
- package/lib/seam/connect/routes/user-identities/user-identities.js.map +0 -1
- package/lib/seam/connect/routes/webhooks/index.js.map +0 -1
- package/lib/seam/connect/routes/webhooks/webhooks.d.ts +0 -81
- package/lib/seam/connect/routes/webhooks/webhooks.js +0 -134
- package/lib/seam/connect/routes/webhooks/webhooks.js.map +0 -1
- package/lib/seam/connect/routes/workspaces/index.js.map +0 -1
- package/lib/seam/connect/routes/workspaces/workspaces.d.ts +0 -101
- package/lib/seam/connect/routes/workspaces/workspaces.js +0 -134
- package/lib/seam/connect/routes/workspaces/workspaces.js.map +0 -1
- package/lib/seam/connect/seam-http-error.js.map +0 -1
- package/lib/seam/connect/seam-http-request.d.ts +0 -32
- package/lib/seam/connect/seam-http-request.js +0 -102
- package/lib/seam/connect/seam-http-request.js.map +0 -1
- package/lib/seam/connect/seam-paginator.js.map +0 -1
- package/lib/seam/connect/token.js.map +0 -1
- package/src/connect.ts +0 -2
- package/src/lib/seam/connect/auth.ts +0 -276
- package/src/lib/seam/connect/client.ts +0 -32
- package/src/lib/seam/connect/options.ts +0 -242
- package/src/lib/seam/connect/parse-options.ts +0 -187
- package/src/lib/seam/connect/resolve-action-attempt.ts +0 -126
- package/src/lib/seam/connect/resources/access-code.ts +0 -404
- package/src/lib/seam/connect/resources/access-grant.ts +0 -169
- package/src/lib/seam/connect/resources/access-method.ts +0 -117
- package/src/lib/seam/connect/resources/acs-access-group.ts +0 -169
- package/src/lib/seam/connect/resources/acs-credential.ts +0 -127
- package/src/lib/seam/connect/resources/acs-encoder.ts +0 -26
- package/src/lib/seam/connect/resources/acs-entrance.ts +0 -177
- package/src/lib/seam/connect/resources/acs-system.ts +0 -163
- package/src/lib/seam/connect/resources/acs-user.ts +0 -261
- package/src/lib/seam/connect/resources/action-attempt.ts +0 -716
- package/src/lib/seam/connect/resources/batch.ts +0 -62
- package/src/lib/seam/connect/resources/client-session.ts +0 -27
- package/src/lib/seam/connect/resources/connect-webview.ts +0 -40
- package/src/lib/seam/connect/resources/connected-account.ts +0 -158
- package/src/lib/seam/connect/resources/customer-portal.ts +0 -16
- package/src/lib/seam/connect/resources/device-provider.ts +0 -106
- package/src/lib/seam/connect/resources/device.ts +0 -1197
- package/src/lib/seam/connect/resources/event.ts +0 -2728
- package/src/lib/seam/connect/resources/instant-key.ts +0 -28
- package/src/lib/seam/connect/resources/noise-threshold.ts +0 -19
- package/src/lib/seam/connect/resources/phone.ts +0 -54
- package/src/lib/seam/connect/resources/space.ts +0 -38
- package/src/lib/seam/connect/resources/thermostat-daily-program.ts +0 -21
- package/src/lib/seam/connect/resources/thermostat-schedule.ts +0 -31
- package/src/lib/seam/connect/resources/unmanaged-access-code.ts +0 -320
- package/src/lib/seam/connect/resources/unmanaged-access-grant.ts +0 -164
- package/src/lib/seam/connect/resources/unmanaged-access-method.ts +0 -114
- package/src/lib/seam/connect/resources/unmanaged-device.ts +0 -469
- package/src/lib/seam/connect/resources/unmanaged-user-identity.ts +0 -48
- package/src/lib/seam/connect/resources/user-identity.ts +0 -49
- package/src/lib/seam/connect/resources/webhook.ts +0 -12
- package/src/lib/seam/connect/resources/workspace.ts +0 -29
- package/src/lib/seam/connect/routes/access-codes/access-codes.ts +0 -527
- package/src/lib/seam/connect/routes/access-codes/simulate/simulate.ts +0 -199
- package/src/lib/seam/connect/routes/access-codes/unmanaged/unmanaged.ts +0 -322
- package/src/lib/seam/connect/routes/access-grants/access-grants.ts +0 -460
- package/src/lib/seam/connect/routes/access-grants/unmanaged/unmanaged.ts +0 -262
- package/src/lib/seam/connect/routes/access-methods/access-methods.ts +0 -431
- package/src/lib/seam/connect/routes/access-methods/unmanaged/unmanaged.ts +0 -229
- package/src/lib/seam/connect/routes/acs/access-groups/access-groups.ts +0 -372
- package/src/lib/seam/connect/routes/acs/acs.ts +0 -193
- package/src/lib/seam/connect/routes/acs/credentials/credentials.ts +0 -436
- package/src/lib/seam/connect/routes/acs/encoders/encoders.ts +0 -350
- package/src/lib/seam/connect/routes/acs/encoders/simulate/simulate.ts +0 -295
- package/src/lib/seam/connect/routes/acs/entrances/entrances.ts +0 -329
- package/src/lib/seam/connect/routes/acs/systems/systems.ts +0 -303
- package/src/lib/seam/connect/routes/acs/users/users.ts +0 -521
- package/src/lib/seam/connect/routes/action-attempts/action-attempts.ts +0 -229
- package/src/lib/seam/connect/routes/client-sessions/client-sessions.ts +0 -382
- package/src/lib/seam/connect/routes/connect-webviews/connect-webviews.ts +0 -376
- package/src/lib/seam/connect/routes/connected-accounts/connected-accounts.ts +0 -329
- package/src/lib/seam/connect/routes/connected-accounts/simulate/simulate.ts +0 -194
- package/src/lib/seam/connect/routes/customers/customers.ts +0 -780
- package/src/lib/seam/connect/routes/devices/devices.ts +0 -1795
- package/src/lib/seam/connect/routes/devices/simulate/simulate.ts +0 -329
- package/src/lib/seam/connect/routes/devices/unmanaged/unmanaged.ts +0 -406
- package/src/lib/seam/connect/routes/events/events.ts +0 -466
- package/src/lib/seam/connect/routes/instant-keys/instant-keys.ts +0 -248
- package/src/lib/seam/connect/routes/locks/locks.ts +0 -434
- package/src/lib/seam/connect/routes/locks/simulate/simulate.ts +0 -233
- package/src/lib/seam/connect/routes/noise-sensors/noise-sensors.ts +0 -221
- package/src/lib/seam/connect/routes/noise-sensors/noise-thresholds/noise-thresholds.ts +0 -334
- package/src/lib/seam/connect/routes/noise-sensors/simulate/simulate.ts +0 -191
- package/src/lib/seam/connect/routes/phones/phones.ts +0 -248
- package/src/lib/seam/connect/routes/phones/simulate/simulate.ts +0 -211
- package/src/lib/seam/connect/routes/seam-http-endpoints-without-workspace.ts +0 -126
- package/src/lib/seam/connect/routes/seam-http-endpoints.ts +0 -3761
- package/src/lib/seam/connect/routes/seam-http-without-workspace.ts +0 -96
- package/src/lib/seam/connect/routes/seam-http.ts +0 -262
- package/src/lib/seam/connect/routes/spaces/spaces.ts +0 -555
- package/src/lib/seam/connect/routes/thermostats/daily-programs/daily-programs.ts +0 -275
- package/src/lib/seam/connect/routes/thermostats/schedules/schedules.ts +0 -325
- package/src/lib/seam/connect/routes/thermostats/simulate/simulate.ts +0 -230
- package/src/lib/seam/connect/routes/thermostats/thermostats.ts +0 -734
- package/src/lib/seam/connect/routes/user-identities/unmanaged/unmanaged.ts +0 -264
- package/src/lib/seam/connect/routes/user-identities/user-identities.ts +0 -610
- package/src/lib/seam/connect/routes/webhooks/webhooks.ts +0 -300
- package/src/lib/seam/connect/routes/workspaces/workspaces.ts +0 -332
- package/src/lib/seam/connect/seam-http-request.ts +0 -196
- /package/lib/{seam/connect/api-error-types.d.ts → api-error-types.d.ts} +0 -0
- /package/lib/{seam/connect/api-error-types.js → api-error-types.js} +0 -0
- /package/lib/{seam/connect/auth.js → auth.js} +0 -0
- /package/lib/{seam/connect/error-interceptor.d.ts → error-interceptor.d.ts} +0 -0
- /package/lib/{seam/connect/error-interceptor.js → error-interceptor.js} +0 -0
- /package/lib/{seam/connect/index.d.ts → index.d.ts} +0 -0
- /package/lib/{seam/connect/index.js → index.js} +0 -0
- /package/lib/{seam/connect/openapi.d.ts → openapi.d.ts} +0 -0
- /package/lib/{seam/connect/openapi.js → openapi.js} +0 -0
- /package/lib/{seam/connect/resolve-action-attempt.js → resolve-action-attempt.js} +0 -0
- /package/lib/{seam/connect/resources → resources}/access-code.js +0 -0
- /package/lib/{seam/connect/resources → resources}/access-grant.js +0 -0
- /package/lib/{seam/connect/resources → resources}/access-method.js +0 -0
- /package/lib/{seam/connect/resources → resources}/acs-access-group.js +0 -0
- /package/lib/{seam/connect/resources → resources}/acs-credential.js +0 -0
- /package/lib/{seam/connect/resources → resources}/acs-encoder.js +0 -0
- /package/lib/{seam/connect/resources → resources}/acs-entrance.js +0 -0
- /package/lib/{seam/connect/resources → resources}/acs-system.js +0 -0
- /package/lib/{seam/connect/resources → resources}/acs-user.js +0 -0
- /package/lib/{seam/connect/resources → resources}/action-attempt.js +0 -0
- /package/lib/{seam/connect/resources → resources}/batch.js +0 -0
- /package/lib/{seam/connect/resources → resources}/client-session.js +0 -0
- /package/lib/{seam/connect/resources → resources}/connect-webview.js +0 -0
- /package/lib/{seam/connect/resources → resources}/connected-account.js +0 -0
- /package/lib/{seam/connect/resources → resources}/customer-portal.js +0 -0
- /package/lib/{seam/connect/resources → resources}/device-provider.js +0 -0
- /package/lib/{seam/connect/resources → resources}/device.js +0 -0
- /package/lib/{seam/connect/resources → resources}/event.js +0 -0
- /package/lib/{seam/connect/resources → resources}/index.d.ts +0 -0
- /package/lib/{seam/connect/resources → resources}/index.js +0 -0
- /package/lib/{seam/connect/resources → resources}/instant-key.js +0 -0
- /package/lib/{seam/connect/resources → resources}/noise-threshold.js +0 -0
- /package/lib/{seam/connect/resources → resources}/phone.js +0 -0
- /package/lib/{seam/connect/resources → resources}/space.js +0 -0
- /package/lib/{seam/connect/resources → resources}/thermostat-daily-program.js +0 -0
- /package/lib/{seam/connect/resources → resources}/thermostat-schedule.js +0 -0
- /package/lib/{seam/connect/resources → resources}/unmanaged-access-code.js +0 -0
- /package/lib/{seam/connect/resources → resources}/unmanaged-access-grant.js +0 -0
- /package/lib/{seam/connect/resources → resources}/unmanaged-access-method.js +0 -0
- /package/lib/{seam/connect/resources → resources}/unmanaged-device.js +0 -0
- /package/lib/{seam/connect/resources → resources}/unmanaged-user-identity.js +0 -0
- /package/lib/{seam/connect/resources → resources}/user-identity.js +0 -0
- /package/lib/{seam/connect/resources → resources}/webhook.js +0 -0
- /package/lib/{seam/connect/resources → resources}/workspace.js +0 -0
- /package/lib/{seam/connect/routes → routes}/access-codes/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/access-codes/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/access-codes/simulate/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/access-codes/simulate/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/access-codes/unmanaged/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/access-codes/unmanaged/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/access-grants/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/access-grants/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/access-grants/unmanaged/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/access-grants/unmanaged/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/access-methods/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/access-methods/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/access-methods/unmanaged/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/access-methods/unmanaged/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/access-groups/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/access-groups/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/credentials/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/credentials/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/encoders/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/encoders/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/encoders/simulate/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/encoders/simulate/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/entrances/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/entrances/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/systems/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/systems/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/users/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/acs/users/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/action-attempts/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/action-attempts/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/client-sessions/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/client-sessions/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/connect-webviews/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/connect-webviews/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/connected-accounts/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/connected-accounts/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/connected-accounts/simulate/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/connected-accounts/simulate/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/customers/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/customers/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/devices/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/devices/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/devices/simulate/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/devices/simulate/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/devices/unmanaged/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/devices/unmanaged/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/events/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/events/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/instant-keys/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/instant-keys/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/locks/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/locks/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/locks/simulate/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/locks/simulate/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/noise-sensors/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/noise-sensors/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/noise-sensors/noise-thresholds/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/noise-sensors/noise-thresholds/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/noise-sensors/simulate/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/noise-sensors/simulate/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/phones/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/phones/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/phones/simulate/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/phones/simulate/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/spaces/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/spaces/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/thermostats/daily-programs/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/thermostats/daily-programs/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/thermostats/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/thermostats/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/thermostats/schedules/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/thermostats/schedules/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/thermostats/simulate/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/thermostats/simulate/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/user-identities/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/user-identities/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/user-identities/unmanaged/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/user-identities/unmanaged/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/webhooks/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/webhooks/index.js +0 -0
- /package/lib/{seam/connect/routes → routes}/workspaces/index.d.ts +0 -0
- /package/lib/{seam/connect/routes → routes}/workspaces/index.js +0 -0
- /package/lib/{seam/connect/seam-http-error.d.ts → seam-http-error.d.ts} +0 -0
- /package/lib/{seam/connect/seam-http-error.js → seam-http-error.js} +0 -0
- /package/lib/{seam/connect/seam-paginator.d.ts → seam-paginator.d.ts} +0 -0
- /package/lib/{seam/connect/seam-paginator.js → seam-paginator.js} +0 -0
- /package/lib/{seam/connect/token.d.ts → token.d.ts} +0 -0
- /package/lib/{seam/connect/token.js → token.js} +0 -0
- /package/src/lib/{seam/connect/api-error-types.ts → api-error-types.ts} +0 -0
- /package/src/lib/{seam/connect/env.d.ts → env.d.ts} +0 -0
- /package/src/lib/{seam/connect/error-interceptor.ts → error-interceptor.ts} +0 -0
- /package/src/lib/{seam/connect/index.ts → index.ts} +0 -0
- /package/src/lib/{seam/connect/openapi.ts → openapi.ts} +0 -0
- /package/src/lib/{seam/connect/resources → resources}/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/access-codes/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/access-codes/simulate/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/access-codes/unmanaged/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/access-grants/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/access-grants/unmanaged/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/access-methods/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/access-methods/unmanaged/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/acs/access-groups/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/acs/credentials/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/acs/encoders/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/acs/encoders/simulate/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/acs/entrances/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/acs/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/acs/systems/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/acs/users/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/action-attempts/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/client-sessions/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/connect-webviews/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/connected-accounts/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/connected-accounts/simulate/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/customers/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/devices/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/devices/simulate/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/devices/unmanaged/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/events/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/instant-keys/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/locks/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/locks/simulate/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/noise-sensors/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/noise-sensors/noise-thresholds/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/noise-sensors/simulate/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/phones/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/phones/simulate/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/spaces/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/thermostats/daily-programs/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/thermostats/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/thermostats/schedules/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/thermostats/simulate/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/user-identities/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/user-identities/unmanaged/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/webhooks/index.ts +0 -0
- /package/src/lib/{seam/connect/routes → routes}/workspaces/index.ts +0 -0
- /package/src/lib/{seam/connect/seam-http-error.ts → seam-http-error.ts} +0 -0
- /package/src/lib/{seam/connect/seam-paginator.ts → seam-paginator.ts} +0 -0
- /package/src/lib/{seam/connect/token.ts → token.ts} +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import type { Client, ClientOptions } from './client.js'
|
|
2
|
+
import {
|
|
3
|
+
isSeamHttpRequestOption,
|
|
4
|
+
type SeamHttpRequestOptions,
|
|
5
|
+
} from './request-options.js'
|
|
6
|
+
|
|
7
|
+
export type { SeamHttpRequestOptions } from './request-options.js'
|
|
8
|
+
|
|
9
|
+
export type SeamHttpWithoutWorkspaceOptions =
|
|
10
|
+
| SeamHttpWithoutWorkspaceOptionsFromEnv
|
|
11
|
+
| SeamHttpWithoutWorkspaceOptionsWithClient
|
|
12
|
+
| SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken
|
|
13
|
+
| SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken
|
|
14
|
+
|
|
15
|
+
export type SeamHttpOptions =
|
|
16
|
+
| SeamHttpOptionsFromEnv
|
|
17
|
+
| SeamHttpOptionsWithClient
|
|
18
|
+
| SeamHttpOptionsWithApiKey
|
|
19
|
+
| SeamHttpOptionsWithClientSessionToken
|
|
20
|
+
| SeamHttpOptionsWithConsoleSessionToken
|
|
21
|
+
| SeamHttpOptionsWithPersonalAccessToken
|
|
22
|
+
|
|
23
|
+
interface SeamHttpCommonOptions extends ClientOptions, SeamHttpRequestOptions {
|
|
24
|
+
endpoint?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface SeamHttpFromPublishableKeyOptions extends SeamHttpCommonOptions {}
|
|
28
|
+
|
|
29
|
+
export interface SeamHttpOptionsFromEnv extends SeamHttpCommonOptions {}
|
|
30
|
+
|
|
31
|
+
export interface SeamHttpWithoutWorkspaceOptionsFromEnv extends SeamHttpCommonOptions {}
|
|
32
|
+
|
|
33
|
+
export interface SeamHttpWithoutWorkspaceOptionsWithClient extends SeamHttpCommonOptions {
|
|
34
|
+
client: Client
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const isSeamHttpWithoutWorkspaceOptionsWithClient = (
|
|
38
|
+
options: SeamHttpOptions,
|
|
39
|
+
): options is SeamHttpWithoutWorkspaceOptionsWithClient =>
|
|
40
|
+
isSeamHttpOptionsWithClient(options)
|
|
41
|
+
|
|
42
|
+
export interface SeamHttpOptionsWithClient extends SeamHttpRequestOptions {
|
|
43
|
+
client: Client
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const isSeamHttpOptionsWithClient = (
|
|
47
|
+
options: SeamHttpOptions,
|
|
48
|
+
): options is SeamHttpOptionsWithClient => {
|
|
49
|
+
if (!('client' in options)) return false
|
|
50
|
+
if (options.client == null) return false
|
|
51
|
+
|
|
52
|
+
const keys = Object.keys(options).filter((k) => k !== 'client')
|
|
53
|
+
if (keys.filter((k) => !isSeamHttpRequestOption(k)).length > 0) {
|
|
54
|
+
throw new SeamHttpInvalidOptionsError(
|
|
55
|
+
`The client option cannot be used with any other option, but received: ${keys.join(
|
|
56
|
+
', ',
|
|
57
|
+
)}`,
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return true
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface SeamHttpOptionsWithApiKey extends SeamHttpCommonOptions {
|
|
65
|
+
apiKey: string
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const isSeamHttpOptionsWithApiKey = (
|
|
69
|
+
options: SeamHttpOptions,
|
|
70
|
+
): options is SeamHttpOptionsWithApiKey => {
|
|
71
|
+
if (!('apiKey' in options)) return false
|
|
72
|
+
if (options.apiKey == null) return false
|
|
73
|
+
|
|
74
|
+
if ('clientSessionToken' in options && options.clientSessionToken != null) {
|
|
75
|
+
throw new SeamHttpInvalidOptionsError(
|
|
76
|
+
'The clientSessionToken option cannot be used with the apiKey option',
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if ('consoleSessionToken' in options && options.consoleSessionToken != null) {
|
|
81
|
+
throw new SeamHttpInvalidOptionsError(
|
|
82
|
+
'The consoleSessionToken option cannot be used with the apiKey option',
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if ('personalAccessToken' in options && options.personalAccessToken != null) {
|
|
87
|
+
throw new SeamHttpInvalidOptionsError(
|
|
88
|
+
'The personalAccessToken option cannot be used with the apiKey option',
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return true
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface SeamHttpOptionsWithClientSessionToken extends SeamHttpCommonOptions {
|
|
96
|
+
clientSessionToken: string
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const isSeamHttpOptionsWithClientSessionToken = (
|
|
100
|
+
options: SeamHttpOptions,
|
|
101
|
+
): options is SeamHttpOptionsWithClientSessionToken => {
|
|
102
|
+
if (!('clientSessionToken' in options)) return false
|
|
103
|
+
if (options.clientSessionToken == null) return false
|
|
104
|
+
|
|
105
|
+
if ('apiKey' in options && options.apiKey != null) {
|
|
106
|
+
throw new SeamHttpInvalidOptionsError(
|
|
107
|
+
'The apiKey option cannot be used with the clientSessionToken option',
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if ('consoleSessionToken' in options && options.consoleSessionToken != null) {
|
|
112
|
+
throw new SeamHttpInvalidOptionsError(
|
|
113
|
+
'The consoleSessionToken option cannot be used with the clientSessionToken option',
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if ('personalAccessToken' in options && options.personalAccessToken != null) {
|
|
118
|
+
throw new SeamHttpInvalidOptionsError(
|
|
119
|
+
'The personalAccessToken option cannot be used with the clientSessionToken option',
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return true
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken extends SeamHttpCommonOptions {
|
|
127
|
+
consoleSessionToken: string
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken = (
|
|
131
|
+
options: SeamHttpOptions,
|
|
132
|
+
): options is SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken => {
|
|
133
|
+
if (!('consoleSessionToken' in options)) return false
|
|
134
|
+
if (options.consoleSessionToken == null) return false
|
|
135
|
+
|
|
136
|
+
if ('apiKey' in options && options.apiKey != null) {
|
|
137
|
+
throw new SeamHttpInvalidOptionsError(
|
|
138
|
+
'The apiKey option cannot be used with the consoleSessionToken option',
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if ('clientSessionToken' in options && options.clientSessionToken != null) {
|
|
143
|
+
throw new SeamHttpInvalidOptionsError(
|
|
144
|
+
'The clientSessionToken option cannot be used with the consoleSessionToken option',
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if ('personalAccessToken' in options && options.personalAccessToken != null) {
|
|
149
|
+
throw new SeamHttpInvalidOptionsError(
|
|
150
|
+
'The personalAccessToken option cannot be used with the consoleSessionToken option',
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return true
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface SeamHttpOptionsWithConsoleSessionToken extends SeamHttpCommonOptions {
|
|
158
|
+
consoleSessionToken: string
|
|
159
|
+
workspaceId: string
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export const isSeamHttpOptionsWithConsoleSessionToken = (
|
|
163
|
+
options: SeamHttpOptions,
|
|
164
|
+
): options is SeamHttpOptionsWithConsoleSessionToken => {
|
|
165
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken(options)) {
|
|
166
|
+
return false
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (!('workspaceId' in options) || options.workspaceId == null) {
|
|
170
|
+
throw new SeamHttpInvalidOptionsError(
|
|
171
|
+
'Must pass a workspaceId when using a consoleSessionToken',
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return true
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken extends SeamHttpCommonOptions {
|
|
179
|
+
personalAccessToken: string
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export const isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken = (
|
|
183
|
+
options: SeamHttpOptions,
|
|
184
|
+
): options is SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken => {
|
|
185
|
+
if (!('personalAccessToken' in options)) return false
|
|
186
|
+
if (options.personalAccessToken == null) return false
|
|
187
|
+
|
|
188
|
+
if ('apiKey' in options && options.apiKey != null) {
|
|
189
|
+
throw new SeamHttpInvalidOptionsError(
|
|
190
|
+
'The apiKey option cannot be used with the personalAccessToken option',
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if ('clientSessionToken' in options && options.clientSessionToken != null) {
|
|
195
|
+
throw new SeamHttpInvalidOptionsError(
|
|
196
|
+
'The clientSessionToken option cannot be used with the personalAccessToken option',
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if ('consoleSessionToken' in options && options.consoleSessionToken != null) {
|
|
201
|
+
throw new SeamHttpInvalidOptionsError(
|
|
202
|
+
'The consoleSessionToken option cannot be used with the personalAccessToken option',
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return true
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface SeamHttpOptionsWithPersonalAccessToken extends SeamHttpCommonOptions {
|
|
210
|
+
personalAccessToken: string
|
|
211
|
+
workspaceId: string
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export const isSeamHttpOptionsWithPersonalAccessToken = (
|
|
215
|
+
options: SeamHttpOptions,
|
|
216
|
+
): options is SeamHttpOptionsWithPersonalAccessToken => {
|
|
217
|
+
if (!isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken(options)) {
|
|
218
|
+
return false
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (!('workspaceId' in options) || options.workspaceId == null) {
|
|
222
|
+
throw new SeamHttpInvalidOptionsError(
|
|
223
|
+
'Must pass a workspaceId when using a personalAccessToken',
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return true
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export class SeamHttpInvalidOptionsError extends Error {
|
|
231
|
+
constructor(message: string) {
|
|
232
|
+
super(`SeamHttp received invalid options: ${message}`)
|
|
233
|
+
this.name = this.constructor.name
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export class SeamHttpWithoutWorkspaceInvalidOptionsError extends Error {
|
|
238
|
+
constructor(message: string) {
|
|
239
|
+
super(`SeamHttpWithoutWorkspace received invalid options: ${message}`)
|
|
240
|
+
this.name = this.constructor.name
|
|
241
|
+
}
|
|
242
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { seamApiLtsVersion } from 'lib/lts-version.js'
|
|
2
|
+
import version from 'lib/version.js'
|
|
3
|
+
|
|
4
|
+
import { getAuthHeaders } from './auth.js'
|
|
5
|
+
import { type Client, type ClientOptions, defaultTimeout } from './client.js'
|
|
6
|
+
import {
|
|
7
|
+
isSeamHttpOptionsWithClient,
|
|
8
|
+
isSeamHttpOptionsWithClientSessionToken,
|
|
9
|
+
isSeamHttpWithoutWorkspaceOptionsWithClient,
|
|
10
|
+
SeamHttpInvalidOptionsError,
|
|
11
|
+
type SeamHttpOptions,
|
|
12
|
+
type SeamHttpRequestOptions,
|
|
13
|
+
type SeamHttpWithoutWorkspaceOptions,
|
|
14
|
+
} from './options.js'
|
|
15
|
+
import { isSeamHttpRequestOption } from './request-options.js'
|
|
16
|
+
|
|
17
|
+
export const defaultEndpoint = 'https://connect.getseam.com'
|
|
18
|
+
|
|
19
|
+
export const sdkHeaders = {
|
|
20
|
+
'seam-sdk-name': 'seamapi/javascript-http',
|
|
21
|
+
'seam-sdk-version': version,
|
|
22
|
+
'seam-lts-version': seamApiLtsVersion,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type Options =
|
|
26
|
+
| SeamHttpWithoutWorkspaceOptions
|
|
27
|
+
| (SeamHttpOptions & { publishableKey?: string })
|
|
28
|
+
|
|
29
|
+
type ParsedOptions = Required<
|
|
30
|
+
(ClientOptions | { client: Client }) & SeamHttpRequestOptions
|
|
31
|
+
>
|
|
32
|
+
|
|
33
|
+
export const parseOptions = (
|
|
34
|
+
apiKeyOrOptions: string | Options,
|
|
35
|
+
): ParsedOptions => {
|
|
36
|
+
const options = getNormalizedOptions(apiKeyOrOptions)
|
|
37
|
+
|
|
38
|
+
if (isSeamHttpOptionsWithClient(options)) return options
|
|
39
|
+
if (isSeamHttpWithoutWorkspaceOptionsWithClient(options)) return options
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
...options,
|
|
43
|
+
timeout: options.timeout ?? defaultTimeout,
|
|
44
|
+
axiosOptions: {
|
|
45
|
+
baseURL: options.endpoint ?? getEndpointFromEnv() ?? defaultEndpoint,
|
|
46
|
+
withCredentials: isSeamHttpOptionsWithClientSessionToken(options),
|
|
47
|
+
...options.axiosOptions,
|
|
48
|
+
headers: {
|
|
49
|
+
...getAuthHeaders(options),
|
|
50
|
+
...options.axiosOptions?.headers,
|
|
51
|
+
...sdkHeaders,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
axiosRetryOptions: {
|
|
55
|
+
...options.axiosRetryOptions,
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const getNormalizedOptions = (
|
|
61
|
+
apiKeyOrOptions: string | Options,
|
|
62
|
+
): SeamHttpOptions & Required<SeamHttpRequestOptions> => {
|
|
63
|
+
const options =
|
|
64
|
+
typeof apiKeyOrOptions === 'string'
|
|
65
|
+
? { apiKey: apiKeyOrOptions }
|
|
66
|
+
: apiKeyOrOptions
|
|
67
|
+
|
|
68
|
+
const requestOptions = {
|
|
69
|
+
waitForActionAttempt: options.waitForActionAttempt ?? true,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (isSeamHttpOptionsWithClient(options)) {
|
|
73
|
+
return {
|
|
74
|
+
...options,
|
|
75
|
+
...requestOptions,
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const apiKey =
|
|
80
|
+
'apiKey' in options ? options.apiKey : getApiKeyFromEnv(options)
|
|
81
|
+
|
|
82
|
+
const personalAccessToken =
|
|
83
|
+
'personalAccessToken' in options
|
|
84
|
+
? options.personalAccessToken
|
|
85
|
+
: getPersonalAccessTokenFromEnv(options)
|
|
86
|
+
|
|
87
|
+
const workspaceId =
|
|
88
|
+
'workspaceId' in options ? options.workspaceId : getWorkspaceIdFromEnv()
|
|
89
|
+
|
|
90
|
+
if (
|
|
91
|
+
apiKey != null &&
|
|
92
|
+
personalAccessToken != null &&
|
|
93
|
+
!('apiKey' in options) &&
|
|
94
|
+
!('personalAccessToken' in options)
|
|
95
|
+
) {
|
|
96
|
+
throw new SeamHttpInvalidOptionsError(
|
|
97
|
+
'Both SEAM_API_KEY and SEAM_PERSONAL_ACCESS_TOKEN environment variables are defined. Please use only one authentication method.',
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
...options,
|
|
103
|
+
...(apiKey != null ? { apiKey } : {}),
|
|
104
|
+
...(workspaceId != null ? { workspaceId } : {}),
|
|
105
|
+
...(personalAccessToken != null ? { personalAccessToken } : {}),
|
|
106
|
+
...requestOptions,
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const getApiKeyFromEnv = (
|
|
111
|
+
options: SeamHttpOptions,
|
|
112
|
+
): string | null | undefined => {
|
|
113
|
+
if ('clientSessionToken' in options && options.clientSessionToken != null) {
|
|
114
|
+
return null
|
|
115
|
+
}
|
|
116
|
+
if ('consoleSessionToken' in options && options.consoleSessionToken != null) {
|
|
117
|
+
return null
|
|
118
|
+
}
|
|
119
|
+
if ('personalAccessToken' in options && options.personalAccessToken != null) {
|
|
120
|
+
return null
|
|
121
|
+
}
|
|
122
|
+
return globalThis.process?.env?.SEAM_API_KEY
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const getPersonalAccessTokenFromEnv = (
|
|
126
|
+
options: SeamHttpOptions,
|
|
127
|
+
): string | null | undefined => {
|
|
128
|
+
if ('apiKey' in options && options.apiKey != null) {
|
|
129
|
+
return null
|
|
130
|
+
}
|
|
131
|
+
if ('clientSessionToken' in options && options.clientSessionToken != null) {
|
|
132
|
+
return null
|
|
133
|
+
}
|
|
134
|
+
if ('consoleSessionToken' in options && options.consoleSessionToken != null) {
|
|
135
|
+
return null
|
|
136
|
+
}
|
|
137
|
+
return globalThis.process?.env?.SEAM_PERSONAL_ACCESS_TOKEN
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const getWorkspaceIdFromEnv = (): string | null | undefined => {
|
|
141
|
+
return globalThis.process?.env?.SEAM_WORKSPACE_ID
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const getEndpointFromEnv = (): string | null | undefined => {
|
|
145
|
+
if (globalThis.process?.env?.SEAM_API_URL != null) {
|
|
146
|
+
// eslint-disable-next-line no-console
|
|
147
|
+
console.warn(
|
|
148
|
+
'Using the SEAM_API_URL environment variable is deprecated. Support will be remove in a later major version. Use SEAM_ENDPOINT instead.',
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (
|
|
153
|
+
globalThis.process?.env?.SEAM_API_URL != null &&
|
|
154
|
+
globalThis.process?.env?.SEAM_ENDPOINT != null
|
|
155
|
+
) {
|
|
156
|
+
// eslint-disable-next-line no-console
|
|
157
|
+
console.warn(
|
|
158
|
+
'Detected both the SEAM_API_URL and SEAM_ENDPOINT environment variables. Using SEAM_ENDPOINT.',
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
globalThis.process?.env?.SEAM_ENDPOINT ??
|
|
164
|
+
globalThis.process?.env?.SEAM_API_URL
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export const limitToSeamHttpRequestOptions = (
|
|
169
|
+
options: Required<SeamHttpRequestOptions>,
|
|
170
|
+
): Required<SeamHttpRequestOptions> => {
|
|
171
|
+
return Object.keys(options)
|
|
172
|
+
.filter(isSeamHttpRequestOption)
|
|
173
|
+
.reduce(
|
|
174
|
+
(obj, key) => ({
|
|
175
|
+
...obj,
|
|
176
|
+
[key]: options[key],
|
|
177
|
+
}),
|
|
178
|
+
{},
|
|
179
|
+
) as Required<SeamHttpRequestOptions>
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export { isSeamHttpRequestOption } from './request-options.js'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ResolveActionAttemptOptions } from './resolve-action-attempt.js'
|
|
2
|
+
|
|
3
|
+
export interface SeamHttpRequestOptions {
|
|
4
|
+
waitForActionAttempt?: boolean | ResolveActionAttemptOptions
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const isSeamHttpRequestOption = (
|
|
8
|
+
key: string,
|
|
9
|
+
): key is keyof SeamHttpRequestOptions => {
|
|
10
|
+
const keys: Record<keyof SeamHttpRequestOptions, true> = {
|
|
11
|
+
waitForActionAttempt: true,
|
|
12
|
+
}
|
|
13
|
+
return Object.keys(keys).includes(key)
|
|
14
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { ActionAttempt } from './resources/action-attempt.js'
|
|
2
|
+
|
|
3
|
+
export interface ActionAttemptsClient {
|
|
4
|
+
get(parameters: { action_attempt_id: string }): PromiseLike<ActionAttempt>
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ResolveActionAttemptOptions {
|
|
8
|
+
timeout?: number
|
|
9
|
+
pollingInterval?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const resolveActionAttempt = async <T extends ActionAttempt>(
|
|
13
|
+
actionAttempt: T,
|
|
14
|
+
actionAttempts: ActionAttemptsClient,
|
|
15
|
+
{ timeout = 10_000, pollingInterval = 1_000 }: ResolveActionAttemptOptions,
|
|
16
|
+
): Promise<SucceededActionAttempt<T>> => {
|
|
17
|
+
let timeoutRef
|
|
18
|
+
const timeoutPromise = new Promise<SucceededActionAttempt<T>>(
|
|
19
|
+
(_resolve, reject) => {
|
|
20
|
+
timeoutRef = globalThis.setTimeout(() => {
|
|
21
|
+
reject(new SeamActionAttemptTimeoutError<T>(actionAttempt, timeout))
|
|
22
|
+
}, timeout)
|
|
23
|
+
},
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
return await Promise.race([
|
|
28
|
+
pollActionAttempt<T>(actionAttempt, actionAttempts, { pollingInterval }),
|
|
29
|
+
timeoutPromise,
|
|
30
|
+
])
|
|
31
|
+
} finally {
|
|
32
|
+
if (timeoutRef != null) globalThis.clearTimeout(timeoutRef)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const pollActionAttempt = async <T extends ActionAttempt>(
|
|
37
|
+
actionAttempt: T,
|
|
38
|
+
actionAttempts: ActionAttemptsClient,
|
|
39
|
+
options: Pick<ResolveActionAttemptOptions, 'pollingInterval'>,
|
|
40
|
+
): Promise<SucceededActionAttempt<T>> => {
|
|
41
|
+
if (isSuccessfulActionAttempt(actionAttempt)) {
|
|
42
|
+
return actionAttempt
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (isFailedActionAttempt(actionAttempt)) {
|
|
46
|
+
throw new SeamActionAttemptFailedError(actionAttempt)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
await new Promise((resolve) => setTimeout(resolve, options.pollingInterval))
|
|
50
|
+
|
|
51
|
+
const nextActionAttempt = await actionAttempts.get({
|
|
52
|
+
action_attempt_id: actionAttempt.action_attempt_id,
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
return await pollActionAttempt(
|
|
56
|
+
nextActionAttempt as unknown as T,
|
|
57
|
+
actionAttempts,
|
|
58
|
+
options,
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const isSeamActionAttemptError = <T extends ActionAttempt>(
|
|
63
|
+
error: unknown,
|
|
64
|
+
): error is SeamActionAttemptError<T> => {
|
|
65
|
+
return error instanceof SeamActionAttemptError
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export class SeamActionAttemptError<T extends ActionAttempt> extends Error {
|
|
69
|
+
actionAttempt: T
|
|
70
|
+
|
|
71
|
+
constructor(message: string, actionAttempt: T) {
|
|
72
|
+
super(message)
|
|
73
|
+
this.name = this.constructor.name
|
|
74
|
+
this.actionAttempt = actionAttempt
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const isSeamActionAttemptFailedError = <T extends ActionAttempt>(
|
|
79
|
+
error: unknown,
|
|
80
|
+
): error is SeamActionAttemptFailedError<T> => {
|
|
81
|
+
return error instanceof SeamActionAttemptFailedError
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export class SeamActionAttemptFailedError<
|
|
85
|
+
T extends ActionAttempt,
|
|
86
|
+
> extends SeamActionAttemptError<T> {
|
|
87
|
+
code: string
|
|
88
|
+
|
|
89
|
+
constructor(actionAttempt: FailedActionAttempt<T>) {
|
|
90
|
+
super(actionAttempt.error.message, actionAttempt)
|
|
91
|
+
this.name = this.constructor.name
|
|
92
|
+
this.code = actionAttempt.error.type
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const isSeamActionAttemptTimeoutError = <T extends ActionAttempt>(
|
|
97
|
+
error: unknown,
|
|
98
|
+
): error is SeamActionAttemptTimeoutError<T> => {
|
|
99
|
+
return error instanceof SeamActionAttemptTimeoutError
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export class SeamActionAttemptTimeoutError<
|
|
103
|
+
T extends ActionAttempt,
|
|
104
|
+
> extends SeamActionAttemptError<T> {
|
|
105
|
+
constructor(actionAttempt: T, timeout: number) {
|
|
106
|
+
super(
|
|
107
|
+
`Timed out waiting for action action attempt after ${timeout}ms`,
|
|
108
|
+
actionAttempt,
|
|
109
|
+
)
|
|
110
|
+
this.name = this.constructor.name
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const isSuccessfulActionAttempt = <T extends ActionAttempt>(
|
|
115
|
+
actionAttempt: T,
|
|
116
|
+
): actionAttempt is SucceededActionAttempt<T> =>
|
|
117
|
+
actionAttempt.status === 'success'
|
|
118
|
+
|
|
119
|
+
const isFailedActionAttempt = <T extends ActionAttempt>(
|
|
120
|
+
actionAttempt: T,
|
|
121
|
+
): actionAttempt is FailedActionAttempt<T> => actionAttempt.status === 'error'
|
|
122
|
+
|
|
123
|
+
export type SucceededActionAttempt<T extends ActionAttempt> = T & {
|
|
124
|
+
status: 'success'
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type FailedActionAttempt<T extends ActionAttempt> = T & {
|
|
128
|
+
status: 'error'
|
|
129
|
+
}
|