Skip to content

Commit de852d9

Browse files
committed
feat: add status property for installations
1 parent b5c2813 commit de852d9

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.changeset/chubby-doodles-stand.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@badrap/libapp": patch
3+
---
4+
5+
Add `status` property for installations
6+
7+
The `status` property can have three different values: `"active"`, `"paused"` and `"uninstalled"`.
8+
9+
The old `removed` is now marked as deprecated and will be removed in a future release. For the time being the flag will still be kept around for now for backwards compatibility. Its value will be `true` when `status` is `"uninstalled"`, otherwise `false`.

src/api/index.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ export class UpdateFailed extends Error {
1515

1616
export type Installation<State extends Record<string, unknown>> = {
1717
id: string;
18-
removed: boolean;
1918
state: State;
2019
owner?: { type: "team"; name: string } | { type: "user"; email: string };
20+
status: "active" | "paused" | "uninstalled";
21+
/** @deprecated Use status instead. */
22+
removed: boolean;
2123
};
2224

2325
export type Asset = Readonly<{
@@ -127,6 +129,11 @@ export class API<
127129
responseType: v.object({
128130
id: v.string(),
129131
removed: v.boolean(),
132+
status: v.union(
133+
v.literal("active"),
134+
v.literal("paused"),
135+
v.literal("uninstalled"),
136+
),
130137
state: this.#stateType,
131138
owner: v
132139
.union(
@@ -158,6 +165,11 @@ export class API<
158165
responseType: v.object({
159166
id: v.string(),
160167
removed: v.boolean(),
168+
status: v.union(
169+
v.literal("active"),
170+
v.literal("paused"),
171+
v.literal("uninstalled"),
172+
),
161173
state: this.#stateType,
162174
owner: v
163175
.union(

0 commit comments

Comments
 (0)