@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,425 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by codegen/smith.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
getAuthHeadersForClientSessionToken,
|
|
8
|
+
warnOnInsecureuserIdentifierKey,
|
|
9
|
+
} from 'lib/auth.js'
|
|
10
|
+
import { type Client, createClient } from 'lib/client.js'
|
|
11
|
+
import { seamApiLtsVersion } from 'lib/lts-version.js'
|
|
12
|
+
import {
|
|
13
|
+
isSeamHttpOptionsWithApiKey,
|
|
14
|
+
isSeamHttpOptionsWithClient,
|
|
15
|
+
isSeamHttpOptionsWithClientSessionToken,
|
|
16
|
+
isSeamHttpOptionsWithConsoleSessionToken,
|
|
17
|
+
isSeamHttpOptionsWithPersonalAccessToken,
|
|
18
|
+
type SeamHttpFromPublishableKeyOptions,
|
|
19
|
+
SeamHttpInvalidOptionsError,
|
|
20
|
+
type SeamHttpOptions,
|
|
21
|
+
type SeamHttpOptionsWithApiKey,
|
|
22
|
+
type SeamHttpOptionsWithClient,
|
|
23
|
+
type SeamHttpOptionsWithClientSessionToken,
|
|
24
|
+
type SeamHttpOptionsWithConsoleSessionToken,
|
|
25
|
+
type SeamHttpOptionsWithPersonalAccessToken,
|
|
26
|
+
type SeamHttpRequestOptions,
|
|
27
|
+
} from 'lib/options.js'
|
|
28
|
+
import {
|
|
29
|
+
limitToSeamHttpRequestOptions,
|
|
30
|
+
parseOptions,
|
|
31
|
+
} from 'lib/parse-options.js'
|
|
32
|
+
import type { ActionAttempt } from 'lib/resources/action-attempt.js'
|
|
33
|
+
import type { Workspace } from 'lib/resources/workspace.js'
|
|
34
|
+
import { SeamHttpActionAttempts } from 'lib/routes/action-attempts/index.js'
|
|
35
|
+
import { SeamHttpClientSessions } from 'lib/routes/client-sessions/index.js'
|
|
36
|
+
import { SeamHttpRequest } from 'lib/seam-http-request.js'
|
|
37
|
+
import { SeamPaginator } from 'lib/seam-paginator.js'
|
|
38
|
+
|
|
39
|
+
export class SeamHttpWorkspaces {
|
|
40
|
+
client: Client
|
|
41
|
+
readonly defaults: Required<SeamHttpRequestOptions>
|
|
42
|
+
readonly ltsVersion = seamApiLtsVersion
|
|
43
|
+
static ltsVersion = seamApiLtsVersion
|
|
44
|
+
|
|
45
|
+
constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
|
|
46
|
+
const options = parseOptions(apiKeyOrOptions)
|
|
47
|
+
this.client = 'client' in options ? options.client : createClient(options)
|
|
48
|
+
this.defaults = limitToSeamHttpRequestOptions(options)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static fromClient(
|
|
52
|
+
client: SeamHttpOptionsWithClient['client'],
|
|
53
|
+
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
54
|
+
): SeamHttpWorkspaces {
|
|
55
|
+
const constructorOptions = { ...options, client }
|
|
56
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
57
|
+
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
58
|
+
}
|
|
59
|
+
return new SeamHttpWorkspaces(constructorOptions)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static fromApiKey(
|
|
63
|
+
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
64
|
+
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
65
|
+
): SeamHttpWorkspaces {
|
|
66
|
+
const constructorOptions = { ...options, apiKey }
|
|
67
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
68
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
69
|
+
}
|
|
70
|
+
return new SeamHttpWorkspaces(constructorOptions)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static fromClientSessionToken(
|
|
74
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
75
|
+
options: Omit<
|
|
76
|
+
SeamHttpOptionsWithClientSessionToken,
|
|
77
|
+
'clientSessionToken'
|
|
78
|
+
> = {},
|
|
79
|
+
): SeamHttpWorkspaces {
|
|
80
|
+
const constructorOptions = { ...options, clientSessionToken }
|
|
81
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
82
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
83
|
+
}
|
|
84
|
+
return new SeamHttpWorkspaces(constructorOptions)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static async fromPublishableKey(
|
|
88
|
+
publishableKey: string,
|
|
89
|
+
userIdentifierKey: string,
|
|
90
|
+
options: SeamHttpFromPublishableKeyOptions = {},
|
|
91
|
+
): Promise<SeamHttpWorkspaces> {
|
|
92
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey)
|
|
93
|
+
const clientOptions = parseOptions({ ...options, publishableKey })
|
|
94
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
95
|
+
throw new SeamHttpInvalidOptionsError(
|
|
96
|
+
'The client option cannot be used with SeamHttpWorkspaces.fromPublishableKey',
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
const client = createClient(clientOptions)
|
|
100
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client)
|
|
101
|
+
const { token } = await clientSessions.getOrCreate({
|
|
102
|
+
user_identifier_key: userIdentifierKey,
|
|
103
|
+
})
|
|
104
|
+
return SeamHttpWorkspaces.fromClientSessionToken(token, options)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
static fromConsoleSessionToken(
|
|
108
|
+
consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
109
|
+
workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
|
|
110
|
+
options: Omit<
|
|
111
|
+
SeamHttpOptionsWithConsoleSessionToken,
|
|
112
|
+
'consoleSessionToken' | 'workspaceId'
|
|
113
|
+
> = {},
|
|
114
|
+
): SeamHttpWorkspaces {
|
|
115
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId }
|
|
116
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
117
|
+
throw new SeamHttpInvalidOptionsError(
|
|
118
|
+
'Missing consoleSessionToken or workspaceId',
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
return new SeamHttpWorkspaces(constructorOptions)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static fromPersonalAccessToken(
|
|
125
|
+
personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
126
|
+
workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
|
|
127
|
+
options: Omit<
|
|
128
|
+
SeamHttpOptionsWithPersonalAccessToken,
|
|
129
|
+
'personalAccessToken' | 'workspaceId'
|
|
130
|
+
> = {},
|
|
131
|
+
): SeamHttpWorkspaces {
|
|
132
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId }
|
|
133
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
134
|
+
throw new SeamHttpInvalidOptionsError(
|
|
135
|
+
'Missing personalAccessToken or workspaceId',
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
return new SeamHttpWorkspaces(constructorOptions)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
142
|
+
request: SeamHttpRequest<TResponse, TResponseKey>,
|
|
143
|
+
): SeamPaginator<TResponse, TResponseKey> {
|
|
144
|
+
return new SeamPaginator<TResponse, TResponseKey>(this, request)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async updateClientSessionToken(
|
|
148
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
149
|
+
): Promise<void> {
|
|
150
|
+
const { headers } = this.client.defaults
|
|
151
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
152
|
+
clientSessionToken,
|
|
153
|
+
})
|
|
154
|
+
for (const key of Object.keys(authHeaders)) {
|
|
155
|
+
if (headers[key] == null) {
|
|
156
|
+
throw new Error(
|
|
157
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
162
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
163
|
+
await clientSessions.get()
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Creates a new [workspace](https://docs.seam.co/core-concepts/workspaces).
|
|
168
|
+
*/
|
|
169
|
+
create(
|
|
170
|
+
parameters: WorkspacesCreateParameters,
|
|
171
|
+
options: WorkspacesCreateOptions = {},
|
|
172
|
+
): WorkspacesCreateRequest {
|
|
173
|
+
return new SeamHttpRequest(this, {
|
|
174
|
+
pathname: '/workspaces/create',
|
|
175
|
+
method: 'POST',
|
|
176
|
+
body: parameters,
|
|
177
|
+
responseKey: 'workspace',
|
|
178
|
+
options,
|
|
179
|
+
})
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Returns the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value.
|
|
184
|
+
*/
|
|
185
|
+
get(
|
|
186
|
+
parameters?: WorkspacesGetParameters,
|
|
187
|
+
options: WorkspacesGetOptions = {},
|
|
188
|
+
): WorkspacesGetRequest {
|
|
189
|
+
return new SeamHttpRequest(this, {
|
|
190
|
+
pathname: '/workspaces/get',
|
|
191
|
+
method: 'GET',
|
|
192
|
+
params: parameters,
|
|
193
|
+
responseKey: 'workspace',
|
|
194
|
+
options,
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Returns a list of [workspaces](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value.
|
|
200
|
+
*/
|
|
201
|
+
list(
|
|
202
|
+
parameters?: WorkspacesListParameters,
|
|
203
|
+
options: WorkspacesListOptions = {},
|
|
204
|
+
): WorkspacesListRequest {
|
|
205
|
+
return new SeamHttpRequest(this, {
|
|
206
|
+
pathname: '/workspaces/list',
|
|
207
|
+
method: 'GET',
|
|
208
|
+
params: parameters,
|
|
209
|
+
responseKey: 'workspaces',
|
|
210
|
+
options,
|
|
211
|
+
})
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Resets the [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) associated with the authentication value. Note that this endpoint is only available for sandbox workspaces.
|
|
216
|
+
*/
|
|
217
|
+
resetSandbox(
|
|
218
|
+
parameters?: WorkspacesResetSandboxParameters,
|
|
219
|
+
options: WorkspacesResetSandboxOptions = {},
|
|
220
|
+
): WorkspacesResetSandboxRequest {
|
|
221
|
+
return new SeamHttpRequest(this, {
|
|
222
|
+
pathname: '/workspaces/reset_sandbox',
|
|
223
|
+
method: 'POST',
|
|
224
|
+
body: parameters,
|
|
225
|
+
responseKey: 'action_attempt',
|
|
226
|
+
options,
|
|
227
|
+
actionAttempts: SeamHttpActionAttempts.fromClient(this.client, {
|
|
228
|
+
...this.defaults,
|
|
229
|
+
waitForActionAttempt: false,
|
|
230
|
+
}),
|
|
231
|
+
})
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Updates the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value.
|
|
236
|
+
*/
|
|
237
|
+
update(
|
|
238
|
+
parameters?: WorkspacesUpdateParameters,
|
|
239
|
+
options: WorkspacesUpdateOptions = {},
|
|
240
|
+
): WorkspacesUpdateRequest {
|
|
241
|
+
return new SeamHttpRequest(this, {
|
|
242
|
+
pathname: '/workspaces/update',
|
|
243
|
+
method: 'PATCH',
|
|
244
|
+
body: parameters,
|
|
245
|
+
responseKey: undefined,
|
|
246
|
+
options,
|
|
247
|
+
})
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export type WorkspacesCreateParameters = {
|
|
252
|
+
/**
|
|
253
|
+
* Company name for the new workspace.
|
|
254
|
+
*/
|
|
255
|
+
company_name?: string | undefined
|
|
256
|
+
/**
|
|
257
|
+
* Connect partner name for the new workspace.
|
|
258
|
+
* @deprecated Use `company_name` instead.
|
|
259
|
+
*/
|
|
260
|
+
connect_partner_name?: string | undefined
|
|
261
|
+
/**
|
|
262
|
+
* [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) customizations for the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
|
|
263
|
+
*/
|
|
264
|
+
connect_webview_customization?:
|
|
265
|
+
| {
|
|
266
|
+
/**
|
|
267
|
+
* Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
|
|
268
|
+
*/
|
|
269
|
+
logo_shape?: 'circle' | 'square' | undefined
|
|
270
|
+
/**
|
|
271
|
+
* Primary button color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
|
|
272
|
+
*/
|
|
273
|
+
primary_button_color?: string | undefined
|
|
274
|
+
/**
|
|
275
|
+
* Primary button text color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
|
|
276
|
+
*/
|
|
277
|
+
primary_button_text_color?: string | undefined
|
|
278
|
+
/**
|
|
279
|
+
* Success message for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
|
|
280
|
+
*/
|
|
281
|
+
success_message?: string | undefined
|
|
282
|
+
}
|
|
283
|
+
| undefined
|
|
284
|
+
/**
|
|
285
|
+
* Indicates whether the new workspace is a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces).
|
|
286
|
+
*/
|
|
287
|
+
is_sandbox?: boolean | undefined
|
|
288
|
+
/**
|
|
289
|
+
* Name of the new workspace.
|
|
290
|
+
*/
|
|
291
|
+
name: string
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* ID of the organization to associate with the new workspace.
|
|
295
|
+
*/
|
|
296
|
+
organization_id?: string | undefined
|
|
297
|
+
/**
|
|
298
|
+
* @deprecated Use `connect_webview_customization.webview_logo_shape` instead.
|
|
299
|
+
*/
|
|
300
|
+
webview_logo_shape?: 'circle' | 'square' | undefined
|
|
301
|
+
/**
|
|
302
|
+
* @deprecated Use `connect_webview_customization.webview_primary_button_color` instead.
|
|
303
|
+
*/
|
|
304
|
+
webview_primary_button_color?: string | undefined
|
|
305
|
+
/**
|
|
306
|
+
* @deprecated Use `connect_webview_customization.webview_primary_button_text_color` instead.
|
|
307
|
+
*/
|
|
308
|
+
webview_primary_button_text_color?: string | undefined
|
|
309
|
+
/**
|
|
310
|
+
* @deprecated Use `connect_webview_customization.webview_success_message` instead.
|
|
311
|
+
*/
|
|
312
|
+
webview_success_message?: string | undefined
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @deprecated Use WorkspacesCreateRequest instead.
|
|
317
|
+
*/
|
|
318
|
+
export type WorkspacesCreateResponse = { workspace: Workspace }
|
|
319
|
+
|
|
320
|
+
export type WorkspacesCreateRequest = SeamHttpRequest<
|
|
321
|
+
WorkspacesCreateResponse,
|
|
322
|
+
'workspace'
|
|
323
|
+
>
|
|
324
|
+
|
|
325
|
+
export interface WorkspacesCreateOptions {}
|
|
326
|
+
|
|
327
|
+
export type WorkspacesGetParameters = {}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @deprecated Use WorkspacesGetRequest instead.
|
|
331
|
+
*/
|
|
332
|
+
export type WorkspacesGetResponse = { workspace: Workspace }
|
|
333
|
+
|
|
334
|
+
export type WorkspacesGetRequest = SeamHttpRequest<
|
|
335
|
+
WorkspacesGetResponse,
|
|
336
|
+
'workspace'
|
|
337
|
+
>
|
|
338
|
+
|
|
339
|
+
export interface WorkspacesGetOptions {}
|
|
340
|
+
|
|
341
|
+
export type WorkspacesListParameters = {}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* @deprecated Use WorkspacesListRequest instead.
|
|
345
|
+
*/
|
|
346
|
+
export type WorkspacesListResponse = { workspaces: Array<Workspace> }
|
|
347
|
+
|
|
348
|
+
export type WorkspacesListRequest = SeamHttpRequest<
|
|
349
|
+
WorkspacesListResponse,
|
|
350
|
+
'workspaces'
|
|
351
|
+
>
|
|
352
|
+
|
|
353
|
+
export interface WorkspacesListOptions {}
|
|
354
|
+
|
|
355
|
+
export type WorkspacesResetSandboxParameters = {}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* @deprecated Use WorkspacesResetSandboxRequest instead.
|
|
359
|
+
*/
|
|
360
|
+
export type WorkspacesResetSandboxResponse = { action_attempt: ActionAttempt }
|
|
361
|
+
|
|
362
|
+
export type WorkspacesResetSandboxRequest = SeamHttpRequest<
|
|
363
|
+
WorkspacesResetSandboxResponse,
|
|
364
|
+
'action_attempt'
|
|
365
|
+
>
|
|
366
|
+
|
|
367
|
+
export type WorkspacesResetSandboxOptions = Pick<
|
|
368
|
+
SeamHttpRequestOptions,
|
|
369
|
+
'waitForActionAttempt'
|
|
370
|
+
>
|
|
371
|
+
|
|
372
|
+
export type WorkspacesUpdateParameters = {
|
|
373
|
+
/**
|
|
374
|
+
* Connect partner name for the workspace.
|
|
375
|
+
*/
|
|
376
|
+
connect_partner_name?: string | undefined
|
|
377
|
+
/**
|
|
378
|
+
* [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) customizations for the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
|
|
379
|
+
*/
|
|
380
|
+
connect_webview_customization?:
|
|
381
|
+
| {
|
|
382
|
+
/**
|
|
383
|
+
* Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
|
|
384
|
+
*/
|
|
385
|
+
logo_shape?: 'circle' | 'square' | undefined
|
|
386
|
+
/**
|
|
387
|
+
* Primary button color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
|
|
388
|
+
*/
|
|
389
|
+
primary_button_color?: string | undefined
|
|
390
|
+
/**
|
|
391
|
+
* Primary button text color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
|
|
392
|
+
*/
|
|
393
|
+
primary_button_text_color?: string | undefined
|
|
394
|
+
/**
|
|
395
|
+
* Success message for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
|
|
396
|
+
*/
|
|
397
|
+
success_message?: string | undefined
|
|
398
|
+
}
|
|
399
|
+
| undefined
|
|
400
|
+
/**
|
|
401
|
+
* Indicates whether publishable key authentication is enabled for this workspace.
|
|
402
|
+
*/
|
|
403
|
+
is_publishable_key_auth_enabled?: boolean | undefined
|
|
404
|
+
/**
|
|
405
|
+
* Indicates whether the workspace is suspended.
|
|
406
|
+
*/
|
|
407
|
+
is_suspended?: boolean | undefined
|
|
408
|
+
/**
|
|
409
|
+
* Name of the workspace.
|
|
410
|
+
*/
|
|
411
|
+
name?: string | undefined
|
|
412
|
+
/**
|
|
413
|
+
* ID of the organization to assign the workspace to. The authenticated user must be the owner of the workspace and an admin of the target organization.
|
|
414
|
+
*/
|
|
415
|
+
organization_id?: string | undefined
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* @deprecated Use WorkspacesUpdateRequest instead.
|
|
420
|
+
*/
|
|
421
|
+
export type WorkspacesUpdateResponse = void
|
|
422
|
+
|
|
423
|
+
export type WorkspacesUpdateRequest = SeamHttpRequest<void, undefined>
|
|
424
|
+
|
|
425
|
+
export interface WorkspacesUpdateOptions {}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { serializeUrlSearchParams } from '@seamapi/url-search-params-serializer'
|
|
2
|
+
import type { Method } from 'axios'
|
|
3
|
+
|
|
4
|
+
import type { Client } from './client.js'
|
|
5
|
+
import type { SeamHttpRequestOptions } from './options.js'
|
|
6
|
+
import {
|
|
7
|
+
type ActionAttemptsClient,
|
|
8
|
+
resolveActionAttempt,
|
|
9
|
+
} from './resolve-action-attempt.js'
|
|
10
|
+
import type { ActionAttempt } from './resources/action-attempt.js'
|
|
11
|
+
|
|
12
|
+
interface SeamHttpRequestParent {
|
|
13
|
+
readonly client: Client
|
|
14
|
+
readonly defaults: Required<SeamHttpRequestOptions>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface SeamHttpRequestConfig<TResponseKey> {
|
|
18
|
+
readonly pathname: string
|
|
19
|
+
readonly method: Method
|
|
20
|
+
readonly body?: unknown
|
|
21
|
+
readonly params?: undefined | Record<string, unknown>
|
|
22
|
+
readonly responseKey: TResponseKey
|
|
23
|
+
readonly options?: Pick<SeamHttpRequestOptions, 'waitForActionAttempt'>
|
|
24
|
+
readonly actionAttempts?: ActionAttemptsClient
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class SeamHttpRequest<
|
|
28
|
+
const TResponse,
|
|
29
|
+
const TResponseKey extends keyof TResponse | undefined,
|
|
30
|
+
> implements Promise<
|
|
31
|
+
TResponseKey extends keyof TResponse ? TResponse[TResponseKey] : undefined
|
|
32
|
+
> {
|
|
33
|
+
readonly [Symbol.toStringTag]: string = 'SeamHttpRequest'
|
|
34
|
+
|
|
35
|
+
readonly #parent: SeamHttpRequestParent
|
|
36
|
+
readonly #config: SeamHttpRequestConfig<TResponseKey>
|
|
37
|
+
|
|
38
|
+
constructor(
|
|
39
|
+
parent: SeamHttpRequestParent,
|
|
40
|
+
config: SeamHttpRequestConfig<TResponseKey>,
|
|
41
|
+
) {
|
|
42
|
+
this.#parent = parent
|
|
43
|
+
this.#config = config
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public get responseKey(): TResponseKey {
|
|
47
|
+
return this.#config.responseKey
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public get url(): URL {
|
|
51
|
+
const { client } = this.#parent
|
|
52
|
+
|
|
53
|
+
const serializer =
|
|
54
|
+
typeof client.defaults.paramsSerializer === 'function'
|
|
55
|
+
? client.defaults.paramsSerializer
|
|
56
|
+
: serializeUrlSearchParams
|
|
57
|
+
|
|
58
|
+
const origin = getUrlPrefix(client.defaults.baseURL ?? '')
|
|
59
|
+
|
|
60
|
+
const path =
|
|
61
|
+
this.params == null
|
|
62
|
+
? this.pathname
|
|
63
|
+
: `${this.pathname}?${serializer(this.params)}`
|
|
64
|
+
|
|
65
|
+
return new URL(`${origin}${path}`)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public get pathname(): string {
|
|
69
|
+
return this.#config.pathname.startsWith('/')
|
|
70
|
+
? this.#config.pathname
|
|
71
|
+
: `/${this.#config.pathname}`
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public get method(): Method {
|
|
75
|
+
return this.#config.method
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public get params(): undefined | Record<string, unknown> {
|
|
79
|
+
return this.#config.params
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public get body(): unknown {
|
|
83
|
+
return this.#config.body
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async execute(): Promise<
|
|
87
|
+
TResponseKey extends keyof TResponse ? TResponse[TResponseKey] : undefined
|
|
88
|
+
> {
|
|
89
|
+
const response = await this.fetchResponse()
|
|
90
|
+
|
|
91
|
+
type Response = TResponseKey extends keyof TResponse
|
|
92
|
+
? TResponse[TResponseKey]
|
|
93
|
+
: undefined
|
|
94
|
+
|
|
95
|
+
if (this.responseKey === undefined) {
|
|
96
|
+
return undefined as Response
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const data = response[this.responseKey] as unknown as Response
|
|
100
|
+
|
|
101
|
+
if (this.responseKey === 'action_attempt') {
|
|
102
|
+
const waitForActionAttempt =
|
|
103
|
+
this.#config.options?.waitForActionAttempt ??
|
|
104
|
+
this.#parent.defaults.waitForActionAttempt
|
|
105
|
+
|
|
106
|
+
if (waitForActionAttempt !== false) {
|
|
107
|
+
if (this.#config.actionAttempts == null) {
|
|
108
|
+
throw new Error(
|
|
109
|
+
'Cannot wait for an action attempt without an action attempts client',
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
const actionAttempt = await resolveActionAttempt(
|
|
113
|
+
data as unknown as ActionAttempt,
|
|
114
|
+
this.#config.actionAttempts,
|
|
115
|
+
typeof waitForActionAttempt === 'boolean' ? {} : waitForActionAttempt,
|
|
116
|
+
)
|
|
117
|
+
return actionAttempt as Response
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return data
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
async fetchResponse(): Promise<TResponse> {
|
|
125
|
+
const { client } = this.#parent
|
|
126
|
+
const response = await client.request({
|
|
127
|
+
url: this.pathname,
|
|
128
|
+
method: this.method,
|
|
129
|
+
data: this.body,
|
|
130
|
+
params: this.params,
|
|
131
|
+
})
|
|
132
|
+
return response.data as unknown as TResponse
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async then<
|
|
136
|
+
TResult1 = TResponseKey extends keyof TResponse
|
|
137
|
+
? TResponse[TResponseKey]
|
|
138
|
+
: undefined,
|
|
139
|
+
TResult2 = never,
|
|
140
|
+
>(
|
|
141
|
+
onfulfilled?:
|
|
142
|
+
| ((
|
|
143
|
+
value: TResponseKey extends keyof TResponse
|
|
144
|
+
? TResponse[TResponseKey]
|
|
145
|
+
: undefined,
|
|
146
|
+
) => TResult1 | PromiseLike<TResult1>)
|
|
147
|
+
| null
|
|
148
|
+
| undefined,
|
|
149
|
+
onrejected?:
|
|
150
|
+
| ((reason: unknown) => TResult2 | PromiseLike<TResult2>)
|
|
151
|
+
| null
|
|
152
|
+
| undefined,
|
|
153
|
+
): Promise<TResult1 | TResult2> {
|
|
154
|
+
return await this.execute().then(onfulfilled, onrejected)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
async catch<TResult = never>(
|
|
158
|
+
onrejected?:
|
|
159
|
+
((reason: unknown) => TResult | PromiseLike<TResult>) | null | undefined,
|
|
160
|
+
): Promise<
|
|
161
|
+
| (TResponseKey extends keyof TResponse
|
|
162
|
+
? TResponse[TResponseKey]
|
|
163
|
+
: undefined)
|
|
164
|
+
| TResult
|
|
165
|
+
> {
|
|
166
|
+
return await this.execute().catch(onrejected)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async finally(
|
|
170
|
+
onfinally?: (() => void) | null | undefined,
|
|
171
|
+
): Promise<
|
|
172
|
+
TResponseKey extends keyof TResponse ? TResponse[TResponseKey] : undefined
|
|
173
|
+
> {
|
|
174
|
+
return await this.execute().finally(onfinally)
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const getUrlPrefix = (input: string): string => {
|
|
179
|
+
if (canParseUrl(input)) {
|
|
180
|
+
const url = new URL(input).toString()
|
|
181
|
+
if (url.endsWith('/')) return url.slice(0, -1)
|
|
182
|
+
return url
|
|
183
|
+
}
|
|
184
|
+
if (globalThis.location != null) {
|
|
185
|
+
const pathname = input.startsWith('/') ? input : `/${input}`
|
|
186
|
+
return new URL(`${globalThis.location.origin}${pathname}`).toString()
|
|
187
|
+
}
|
|
188
|
+
throw new Error(
|
|
189
|
+
`Cannot resolve origin from ${input} in a non-browser environment`,
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// UPSTREAM: Prefer URL.canParse when it has wider support.
|
|
194
|
+
// https://caniuse.com/mdn-api_url_canparse_static
|
|
195
|
+
const canParseUrl = (input: string): boolean => {
|
|
196
|
+
try {
|
|
197
|
+
return new URL(input) != null
|
|
198
|
+
} catch {
|
|
199
|
+
return false
|
|
200
|
+
}
|
|
201
|
+
}
|
package/src/lib/version.ts
CHANGED
package/connect.d.ts
DELETED
package/connect.js
DELETED
package/connect.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["src/connect.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uCAAuC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-error-types.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/api-error-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type SeamHttpOptionsWithClientSessionToken } from './options.js';
|
|
2
|
-
import type { Options } from './parse-options.js';
|
|
3
|
-
type Headers = Record<string, string>;
|
|
4
|
-
export declare const getAuthHeaders: (options: Options) => Headers;
|
|
5
|
-
export declare const getAuthHeadersForClientSessionToken: ({ clientSessionToken, }: SeamHttpOptionsWithClientSessionToken) => Headers;
|
|
6
|
-
export declare class SeamHttpInvalidTokenError extends Error {
|
|
7
|
-
constructor(message: string);
|
|
8
|
-
}
|
|
9
|
-
export declare const warnOnInsecureuserIdentifierKey: (userIdentifierKey: string) => void;
|
|
10
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,uCAAuC,EACvC,wCAAwC,EACxC,wCAAwC,EACxC,wDAAwD,EACxD,wDAAwD,EACxD,2BAA2B,GAO5B,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,aAAa,EACb,oBAAoB,EACpB,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,yBAAyB,EACzB,WAAW,GACZ,MAAM,YAAY,CAAA;AAInB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAW,EAAE;IAC1D,IAAI,gBAAgB,IAAI,OAAO,IAAI,OAAO,CAAC,cAAc,IAAI,IAAI,EAAE,CAAC;QAClE,OAAO,+BAA+B,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;IAChE,CAAC;IAED,IAAI,2BAA2B,CAAC,OAAO,CAAC,EAAE,CAAC;QACzC,OAAO,uBAAuB,CAAC,OAAO,CAAC,CAAA;IACzC,CAAC;IAED,IAAI,uCAAuC,CAAC,OAAO,CAAC,EAAE,CAAC;QACrD,OAAO,mCAAmC,CAAC,OAAO,CAAC,CAAA;IACrD,CAAC;IAED,IACE,wDAAwD,CAAC,OAAO,CAAC;QACjE,wCAAwC,CAAC,OAAO,CAAC,EACjD,CAAC;QACD,OAAO,oCAAoC,CAAC,OAAO,CAAC,CAAA;IACtD,CAAC;IAED,IACE,wDAAwD,CAAC,OAAO,CAAC;QACjE,wCAAwC,CAAC,OAAO,CAAC,EACjD,CAAC;QACD,OAAO,oCAAoC,CAAC,OAAO,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,IAAI,2BAA2B,CACnC;QACE,cAAc;QACd,YAAY;QACZ,qBAAqB;QACrB,iBAAiB;QACjB,qBAAqB;QACrB,yBAAyB;QACzB,6GAA6G;KAC9G,CAAC,IAAI,CAAC,GAAG,CAAC,CACZ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,uBAAuB,GAAG,CAAC,EAC/B,MAAM,GACoB,EAAW,EAAE;IACvC,IAAI,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,yBAAyB,CACjC,oDAAoD,CACrD,CAAA;IACH,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QAClB,MAAM,IAAI,yBAAyB,CAAC,mCAAmC,CAAC,CAAA;IAC1E,CAAC;IAED,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,yBAAyB,CACjC,6CAA6C,CAC9C,CAAA;IACH,CAAC;IAED,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,yBAAyB,CACjC,+CAA+C,CAChD,CAAA;IACH,CAAC;IAED,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,yBAAyB,CACjC,kEAAkE,WAAW,EAAE,CAChF,CAAA;IACH,CAAC;IAED,OAAO;QACL,aAAa,EAAE,UAAU,MAAM,EAAE;KAClC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,EAClD,kBAAkB,GACoB,EAAW,EAAE;IACnD,IAAI,KAAK,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,yBAAyB,CACjC,8CAA8C,CAC/C,CAAA;IACH,CAAC;IAED,IAAI,aAAa,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,yBAAyB,CACjC,wDAAwD,CACzD,CAAA;IACH,CAAC;IAED,IAAI,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,yBAAyB,CACjC,0DAA0D,CAC3D,CAAA;IACH,CAAC;IAED,IAAI,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,yBAAyB,CACjC,8EAA8E,wBAAwB,EAAE,CACzG,CAAA;IACH,CAAC;IAED,OAAO;QACL,aAAa,EAAE,UAAU,kBAAkB,EAAE;QAC7C,sBAAsB,EAAE,kBAAkB;KAC3C,CAAA;AACH,CAAC,CAAA;AAED,MAAM,oCAAoC,GAAG,CAAC,EAC5C,mBAAmB,EACnB,GAAG,OAAO,EAG8B,EAAW,EAAE;IACrD,MAAM,WAAW,GAAG,aAAa,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAA;IAE9E,IAAI,aAAa,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,yBAAyB,CACjC,yDAAyD,CAC1D,CAAA;IACH,CAAC;IAED,IAAI,oBAAoB,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,yBAAyB,CACjC,gEAAgE,CACjE,CAAA;IACH,CAAC;IAED,IAAI,gBAAgB,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,yBAAyB,CACjC,2DAA2D,CAC5D,CAAA;IACH,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,yBAAyB,CACjC,mFAAmF,SAAS,EAAE,CAC/F,CAAA;IACH,CAAC;IAED,OAAO;QACL,aAAa,EAAE,UAAU,mBAAmB,EAAE;QAC9C,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClE,CAAA;AACH,CAAC,CAAA;AAED,MAAM,oCAAoC,GAAG,CAAC,EAC5C,mBAAmB,EACnB,GAAG,OAAO,EAG8B,EAAW,EAAE;IACrD,MAAM,WAAW,GAAG,aAAa,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAA;IAE9E,IAAI,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,yBAAyB,CACjC,+CAA+C,CAChD,CAAA;IACH,CAAC;IAED,IAAI,oBAAoB,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,yBAAyB,CACjC,gEAAgE,CACjE,CAAA;IACH,CAAC;IAED,IAAI,gBAAgB,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,yBAAyB,CACjC,2DAA2D,CAC5D,CAAA;IACH,CAAC;IAED,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,yBAAyB,CACjC,+EAA+E,iBAAiB,EAAE,CACnG,CAAA;IACH,CAAC;IAED,OAAO;QACL,aAAa,EAAE,UAAU,mBAAmB,EAAE;QAC9C,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClE,CAAA;AACH,CAAC,CAAA;AAED,MAAM,+BAA+B,GAAG,CAAC,cAAsB,EAAW,EAAE;IAC1E,IAAI,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,yBAAyB,CACjC,0CAA0C,CAC3C,CAAA;IACH,CAAC;IAED,IAAI,aAAa,CAAC,cAAc,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,yBAAyB,CACjC,oDAAoD,CACrD,CAAA;IACH,CAAC;IAED,IAAI,oBAAoB,CAAC,cAAc,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,yBAAyB,CACjC,+DAA+D,CAChE,CAAA;IACH,CAAC;IAED,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,yBAAyB,CACjC,0EAA0E,yBAAyB,EAAE,CACtG,CAAA;IACH,CAAC;IAED,OAAO;QACL,sBAAsB,EAAE,cAAc;KACvC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD,YAAY,OAAe;QACzB,KAAK,CAAC,uCAAuC,OAAO,EAAE,CAAC,CAAA;QACvD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;IACnC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,iBAAyB,EACnB,EAAE;IACR,IAAI,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC/B,sCAAsC;QACtC,OAAO,CAAC,IAAI,CACV,GAAG;YACD,6FAA6F;YAC7F,0EAA0E;YAC1E,sFAAsF;YACtF,6CAA6C;YAC7C,6HAA6H;SAC9H,CACF,CAAA;IACH,CAAC;AACH,CAAC,CAAA;AAED,4CAA4C;AAC5C,MAAM,OAAO,GAAG,CAAC,KAAa,EAAW,EAAE;IACzC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACrC,4FAA4F;IAC5F,OAAO,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACjD,CAAC,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type AxiosInstance, type AxiosRequestConfig } from 'axios';
|
|
2
|
-
import { type AxiosRetry } from 'axios-retry';
|
|
3
|
-
export type Client = AxiosInstance;
|
|
4
|
-
export interface ClientOptions {
|
|
5
|
-
axiosOptions?: AxiosRequestConfig;
|
|
6
|
-
axiosRetryOptions?: AxiosRetryConfig;
|
|
7
|
-
}
|
|
8
|
-
type AxiosRetryConfig = Parameters<AxiosRetry>[1];
|
|
9
|
-
export declare const createClient: (options: ClientOptions) => AxiosInstance;
|
|
10
|
-
export {};
|