@glasshome/sync-layer 0.3.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connection/auth.d.ts +5 -5
- package/dist/connection/types.d.ts +0 -10
- package/dist/index.js +1353 -29
- package/dist/worker/worker-main.js +1 -1
- package/package.json +1 -6
- package/dist/demo-data-3LO-p1RV.js +0 -1205
- package/dist/testing/fixtures.d.ts +0 -161
- package/dist/testing/helpers.d.ts +0 -160
- package/dist/testing/index.d.ts +0 -13
- package/dist/testing/index.js +0 -2067
- package/dist/testing/mock-behaviors/base.d.ts +0 -73
- package/dist/testing/mock-behaviors/climate.d.ts +0 -22
- package/dist/testing/mock-behaviors/cover.d.ts +0 -22
- package/dist/testing/mock-behaviors/index.d.ts +0 -11
- package/dist/testing/mock-behaviors/light.d.ts +0 -20
- package/dist/testing/mock-behaviors/lock.d.ts +0 -20
- package/dist/testing/mock-behaviors/media_player.d.ts +0 -42
- package/dist/testing/mock-behaviors/registry.d.ts +0 -55
- package/dist/testing/mock-behaviors/switch.d.ts +0 -17
- package/dist/testing/mock.d.ts +0 -196
- package/dist/testing/types.d.ts +0 -87
- /package/dist/{worker-main-DTbzEKor.js → worker-main-Cf-k4f2N.js} +0 -0
|
@@ -53,18 +53,18 @@ export interface OAuthOptions {
|
|
|
53
53
|
* Authenticate using OAuth flow
|
|
54
54
|
*
|
|
55
55
|
* This function uses `getAuth` from `home-assistant-js-websocket` which:
|
|
56
|
-
* 1.
|
|
56
|
+
* 1. Redirects the whole page to the Home Assistant authorization page
|
|
57
57
|
* 2. Waits for user authorization
|
|
58
|
-
* 3.
|
|
59
|
-
* 4.
|
|
58
|
+
* 3. On return, HA redirects back to the app URL with `?auth_callback=1&code=…`
|
|
59
|
+
* 4. Exchanges the authorization code for tokens and returns an Auth object
|
|
60
60
|
*
|
|
61
61
|
* Note: For a complete OAuth flow, you typically need to:
|
|
62
62
|
* - Set up a redirect URI endpoint in your app
|
|
63
63
|
* - Handle the OAuth callback with the authorization code
|
|
64
64
|
* - Use `getAuthCode` callback to provide the code
|
|
65
65
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
66
|
+
* In browser environments `getAuth` handles this automatically via a full-page
|
|
67
|
+
* redirect (not a popup); native platforms supply `getAuthCode` instead.
|
|
68
68
|
*
|
|
69
69
|
* @param options - OAuth options
|
|
70
70
|
* @returns Authenticated Auth object
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import type { HAEvent } from "@glasshome/ha-types";
|
|
10
|
-
import type { Fixtures } from "../testing/types";
|
|
11
10
|
/**
|
|
12
11
|
* Unified connection interface for Home Assistant connections
|
|
13
12
|
*
|
|
@@ -149,13 +148,4 @@ export interface SyncLayerConnection {
|
|
|
149
148
|
* ```
|
|
150
149
|
*/
|
|
151
150
|
addEventListener(handler: (message: any) => void): () => void;
|
|
152
|
-
/**
|
|
153
|
-
* Get fixtures (MockConnection only)
|
|
154
|
-
*
|
|
155
|
-
* Returns the fixture data for mock connections. SyncLayer uses this
|
|
156
|
-
* to load fixtures into its store during connection setup.
|
|
157
|
-
*
|
|
158
|
-
* @returns Fixture data (entities, registries, etc.)
|
|
159
|
-
*/
|
|
160
|
-
getFixtures?(): Fixtures;
|
|
161
151
|
}
|