seam 2.0.0b5 → 2.0.0.prerelease.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +53 -49
- data/README.md +3 -323
- data/Rakefile +1 -4
- data/lib/seam/client.rb +129 -0
- data/lib/seam/clients/access_codes.rb +95 -0
- data/lib/seam/clients/access_codes_simulate.rb +17 -0
- data/lib/seam/clients/access_codes_unmanaged.rb +57 -0
- data/lib/seam/clients/acs.rb +35 -0
- data/lib/seam/clients/acs_access_groups.rb +57 -0
- data/lib/seam/clients/acs_credential_pools.rb +17 -0
- data/lib/seam/clients/acs_credential_provisioning_automations.rb +17 -0
- data/lib/seam/clients/acs_credentials.rb +77 -0
- data/lib/seam/clients/acs_entrances.rb +47 -0
- data/lib/seam/clients/acs_systems.rb +27 -0
- data/lib/seam/clients/acs_users.rb +117 -0
- data/lib/seam/clients/action_attempts.rb +30 -0
- data/lib/seam/clients/base_client.rb +21 -0
- data/lib/seam/clients/client_sessions.rb +77 -0
- data/lib/seam/clients/connect_webviews.rb +47 -0
- data/lib/seam/clients/connected_accounts.rb +47 -0
- data/lib/seam/clients/devices.rb +65 -0
- data/lib/seam/clients/devices_simulate.rb +17 -0
- data/lib/seam/clients/devices_unmanaged.rb +37 -0
- data/lib/seam/clients/events.rb +27 -0
- data/lib/seam/clients/locks.rb +53 -0
- data/lib/seam/clients/networks.rb +27 -0
- data/lib/seam/clients/noise_sensors.rb +15 -0
- data/lib/seam/clients/noise_sensors_noise_thresholds.rb +57 -0
- data/lib/seam/clients/noise_sensors_simulate.rb +17 -0
- data/lib/seam/clients/phones.rb +31 -0
- data/lib/seam/clients/phones_simulate.rb +17 -0
- data/lib/seam/clients/thermostats.rb +106 -0
- data/lib/seam/clients/thermostats_climate_setting_schedules.rb +57 -0
- data/lib/seam/clients/user_identities.rb +131 -0
- data/lib/seam/clients/user_identities_enrollment_automations.rb +47 -0
- data/lib/seam/clients/webhooks.rb +57 -0
- data/lib/seam/clients/workspaces.rb +50 -0
- data/lib/seam/logger.rb +12 -0
- data/lib/seam/request.rb +51 -84
- data/lib/seam/resources/access_code.rb +12 -0
- data/lib/seam/resources/acs_access_group.rb +9 -0
- data/lib/seam/resources/acs_credential.rb +12 -0
- data/lib/seam/resources/acs_credential_pool.rb +9 -0
- data/lib/seam/resources/acs_credential_provisioning_automation.rb +9 -0
- data/lib/seam/resources/acs_entrance.rb +9 -0
- data/lib/seam/resources/acs_system.rb +9 -0
- data/lib/seam/resources/acs_user.rb +9 -0
- data/lib/seam/resources/action_attempt.rb +46 -0
- data/lib/seam/resources/base_resource.rb +58 -0
- data/lib/seam/resources/client_session.rb +9 -0
- data/lib/seam/resources/climate_setting_schedule.rb +11 -0
- data/lib/seam/resources/connect_webview.rb +9 -0
- data/lib/seam/resources/connected_account.rb +12 -0
- data/lib/seam/resources/device.rb +12 -0
- data/lib/seam/resources/device_provider.rb +7 -0
- data/lib/seam/resources/enrollment_automation.rb +9 -0
- data/lib/seam/resources/event.rb +9 -0
- data/lib/seam/resources/network.rb +9 -0
- data/lib/seam/resources/noise_threshold.rb +7 -0
- data/lib/seam/resources/phone.rb +12 -0
- data/lib/seam/resources/resource_error.rb +9 -0
- data/lib/seam/resources/resource_errors_support.rb +9 -0
- data/lib/seam/resources/resource_warning.rb +9 -0
- data/lib/seam/resources/resource_warnings_support.rb +9 -0
- data/lib/seam/resources/service_health.rb +7 -0
- data/lib/seam/resources/unmanaged_access_code.rb +12 -0
- data/lib/seam/resources/unmanaged_device.rb +12 -0
- data/lib/seam/resources/user_identity.rb +9 -0
- data/lib/seam/resources/webhook.rb +7 -0
- data/lib/seam/resources/workspace.rb +7 -0
- data/lib/seam/version.rb +1 -1
- data/lib/seam.rb +68 -19
- metadata +71 -115
- data/lib/seam/auth.rb +0 -118
- data/lib/seam/base_resource.rb +0 -65
- data/lib/seam/deep_hash_accessor.rb +0 -37
- data/lib/seam/default_endpoint.rb +0 -5
- data/lib/seam/helpers/action_attempt.rb +0 -47
- data/lib/seam/http.rb +0 -52
- data/lib/seam/http_multi_workspace.rb +0 -66
- data/lib/seam/http_single_workspace.rb +0 -46
- data/lib/seam/options.rb +0 -64
- data/lib/seam/parse_options.rb +0 -23
- data/lib/seam/routes/clients/access_codes.rb +0 -74
- data/lib/seam/routes/clients/access_codes_simulate.rb +0 -18
- data/lib/seam/routes/clients/access_codes_unmanaged.rb +0 -42
- data/lib/seam/routes/clients/acs.rb +0 -44
- data/lib/seam/routes/clients/acs_access_groups.rb +0 -48
- data/lib/seam/routes/clients/acs_access_groups_unmanaged.rb +0 -24
- data/lib/seam/routes/clients/acs_credential_pools.rb +0 -18
- data/lib/seam/routes/clients/acs_credential_provisioning_automations.rb +0 -18
- data/lib/seam/routes/clients/acs_credentials.rb +0 -60
- data/lib/seam/routes/clients/acs_credentials_unmanaged.rb +0 -24
- data/lib/seam/routes/clients/acs_encoders.rb +0 -36
- data/lib/seam/routes/clients/acs_entrances.rb +0 -36
- data/lib/seam/routes/clients/acs_systems.rb +0 -30
- data/lib/seam/routes/clients/acs_users.rb +0 -78
- data/lib/seam/routes/clients/acs_users_unmanaged.rb +0 -24
- data/lib/seam/routes/clients/action_attempts.rb +0 -28
- data/lib/seam/routes/clients/client_sessions.rb +0 -54
- data/lib/seam/routes/clients/connect_webviews.rb +0 -36
- data/lib/seam/routes/clients/connected_accounts.rb +0 -36
- data/lib/seam/routes/clients/devices.rb +0 -50
- data/lib/seam/routes/clients/devices_simulate.rb +0 -30
- data/lib/seam/routes/clients/devices_unmanaged.rb +0 -30
- data/lib/seam/routes/clients/events.rb +0 -24
- data/lib/seam/routes/clients/index.rb +0 -38
- data/lib/seam/routes/clients/locks.rb +0 -42
- data/lib/seam/routes/clients/networks.rb +0 -24
- data/lib/seam/routes/clients/noise_sensors.rb +0 -26
- data/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb +0 -42
- data/lib/seam/routes/clients/noise_sensors_simulate.rb +0 -18
- data/lib/seam/routes/clients/phones.rb +0 -28
- data/lib/seam/routes/clients/phones_simulate.rb +0 -18
- data/lib/seam/routes/clients/thermostats.rb +0 -108
- data/lib/seam/routes/clients/thermostats_schedules.rb +0 -42
- data/lib/seam/routes/clients/user_identities.rb +0 -88
- data/lib/seam/routes/clients/user_identities_enrollment_automations.rb +0 -36
- data/lib/seam/routes/clients/webhooks.rb +0 -42
- data/lib/seam/routes/clients/workspaces.rb +0 -40
- data/lib/seam/routes/resources/access_code.rb +0 -14
- data/lib/seam/routes/resources/acs_access_group.rb +0 -11
- data/lib/seam/routes/resources/acs_credential.rb +0 -14
- data/lib/seam/routes/resources/acs_credential_pool.rb +0 -11
- data/lib/seam/routes/resources/acs_credential_provisioning_automation.rb +0 -11
- data/lib/seam/routes/resources/acs_entrance.rb +0 -13
- data/lib/seam/routes/resources/acs_system.rb +0 -14
- data/lib/seam/routes/resources/acs_user.rb +0 -14
- data/lib/seam/routes/resources/action_attempt.rb +0 -9
- data/lib/seam/routes/resources/client_session.rb +0 -11
- data/lib/seam/routes/resources/connect_webview.rb +0 -11
- data/lib/seam/routes/resources/connected_account.rb +0 -14
- data/lib/seam/routes/resources/device.rb +0 -14
- data/lib/seam/routes/resources/device_provider.rb +0 -9
- data/lib/seam/routes/resources/enrollment_automation.rb +0 -11
- data/lib/seam/routes/resources/event.rb +0 -11
- data/lib/seam/routes/resources/index.rb +0 -33
- data/lib/seam/routes/resources/network.rb +0 -11
- data/lib/seam/routes/resources/noise_threshold.rb +0 -9
- data/lib/seam/routes/resources/phone.rb +0 -14
- data/lib/seam/routes/resources/resource_error.rb +0 -11
- data/lib/seam/routes/resources/resource_errors_support.rb +0 -11
- data/lib/seam/routes/resources/resource_warning.rb +0 -11
- data/lib/seam/routes/resources/resource_warnings_support.rb +0 -11
- data/lib/seam/routes/resources/service_health.rb +0 -9
- data/lib/seam/routes/resources/thermostat_schedule.rb +0 -13
- data/lib/seam/routes/resources/unmanaged_access_code.rb +0 -14
- data/lib/seam/routes/resources/unmanaged_device.rb +0 -14
- data/lib/seam/routes/resources/user_identity.rb +0 -11
- data/lib/seam/routes/resources/webhook.rb +0 -9
- data/lib/seam/routes/resources/workspace.rb +0 -9
- data/lib/seam/routes/routes.rb +0 -94
- data/lib/seam/token.rb +0 -53
- data/lib/seam/wait_for_action_attempt.rb +0 -32
- data/lib/seam/webhook.rb +0 -23
data/lib/seam/webhook.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "svix/webhook"
|
4
|
-
require "svix/errors"
|
5
|
-
require_relative "base_resource"
|
6
|
-
require_relative "routes/resources/event"
|
7
|
-
|
8
|
-
module Seam
|
9
|
-
WebhookVerificationError = Svix::WebhookVerificationError
|
10
|
-
|
11
|
-
class Webhook
|
12
|
-
def initialize(secret)
|
13
|
-
@webhook = Svix::Webhook.new(secret)
|
14
|
-
end
|
15
|
-
|
16
|
-
def verify(payload, headers)
|
17
|
-
normalized_headers = headers.transform_keys(&:downcase)
|
18
|
-
res = @webhook.verify(payload, normalized_headers)
|
19
|
-
|
20
|
-
Seam::Resources::SeamEvent.load_from_response(res)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|