@typed-assistant/builder 0.0.7 → 0.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typed-assistant/builder",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "exports": {
5
5
  "./appProcess": "./src/appProcess.tsx",
6
6
  "./bunInstall": "./src/bunInstall.tsx",
@@ -18,9 +18,9 @@
18
18
  "home-assistant-js-websocket": "^8.2.0",
19
19
  "typescript": "^5.3.3",
20
20
  "@typed-assistant/eslint-config": "0.0.4",
21
- "@typed-assistant/logger": "0.0.5",
22
21
  "@typed-assistant/typescript-config": "0.0.4",
23
- "@typed-assistant/utils": "0.0.6"
22
+ "@typed-assistant/logger": "0.0.5",
23
+ "@typed-assistant/utils": "0.0.7"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "home-assistant-js-websocket": "^8.2.0"
@@ -5,7 +5,7 @@ import { readFileSync, watch } from "fs"
5
5
  import { join, relative } from "path"
6
6
  import ignore from "ignore"
7
7
  import { ONE_SECOND } from "@typed-assistant/utils/durations"
8
- import { fetchWithAuth, getHassAPI } from "@typed-assistant/utils/getHassAPI"
8
+ import { getHassAPI, getSupervisorAPI } from "@typed-assistant/utils/getHassAPI"
9
9
  import { pullChanges } from "./pullChanges"
10
10
  import { withErrorHandling } from "@typed-assistant/utils/withErrorHandling"
11
11
 
@@ -87,7 +87,6 @@ const setupGitSync = async ({
87
87
  /** Duration in seconds */
88
88
  gitPullPollDuration?: number
89
89
  } = {}) => {
90
- log(`😅 Attempting to pull changes...`)
91
90
  const duration = gitPullPollDuration ?? 30
92
91
  const { error } = await pullChanges()
93
92
  if (error) return
@@ -106,13 +105,13 @@ const shouldIgnoreFileOrFolder = (filename: string) =>
106
105
 
107
106
  const restartAddon = async () => {
108
107
  log("♻️ Restarting addon...")
109
- await fetchWithAuth(`http://supervisor/addons/self/restart`, {
110
- method: "POST",
111
- })
108
+ await getHassAPI(`http://supervisor/addons/self/restart`, { method: "POST" })
112
109
  }
113
110
 
114
111
  const getAddonInfo = async () => {
115
112
  log("🔍 Getting addon info...")
116
113
 
117
- return withErrorHandling(fetchWithAuth)("http://supervisor/addons/self/info")
114
+ return withErrorHandling(getSupervisorAPI)<{
115
+ data: { ingress_entry: string }
116
+ }>("/addons/self/info")
118
117
  }