Skip to content

Commit c6e53a8

Browse files
committed
fix: add status property to listInstallations items
1 parent f0b62ca commit c6e53a8

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

.changeset/frank-ties-dig.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@badrap/libapp": patch
3+
---
4+
5+
Fix listInstallations types

src/api/index.ts

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,29 @@ export class API<
7979

8080
async *listInstallations(): AsyncIterable<{
8181
id: string;
82-
removed: boolean;
8382
owner?: { type: "team"; name: string } | { type: "user"; email: string };
83+
status: "active" | "paused" | "uninstalled";
84+
/** @deprecated Use status instead. */
85+
removed: boolean;
8486
}> {
8587
yield* await this.#client.request({
8688
method: "GET",
8789
path: ["installations"],
8890
responseType: v.array(
8991
v.object({
9092
id: v.string(),
91-
removed: v.boolean(),
9293
owner: v
9394
.union(
9495
v.object({ type: v.literal("team"), name: v.string() }),
9596
v.object({ type: v.literal("user"), email: v.string() }),
9697
)
9798
.optional(),
99+
status: v.union(
100+
v.literal("active"),
101+
v.literal("paused"),
102+
v.literal("uninstalled"),
103+
),
104+
removed: v.boolean(),
98105
}),
99106
),
100107
});
@@ -128,19 +135,19 @@ export class API<
128135
path: ["installations", installationId],
129136
responseType: v.object({
130137
id: v.string(),
131-
removed: v.boolean(),
132-
status: v.union(
133-
v.literal("active"),
134-
v.literal("paused"),
135-
v.literal("uninstalled"),
136-
),
137138
state: this.#stateType,
138139
owner: v
139140
.union(
140141
v.object({ type: v.literal("team"), name: v.string() }),
141142
v.object({ type: v.literal("user"), email: v.string() }),
142143
)
143144
.optional(),
145+
status: v.union(
146+
v.literal("active"),
147+
v.literal("paused"),
148+
v.literal("uninstalled"),
149+
),
150+
removed: v.boolean(),
144151
}),
145152
});
146153
}
@@ -164,19 +171,19 @@ export class API<
164171
path: ["installations", installationId],
165172
responseType: v.object({
166173
id: v.string(),
167-
removed: v.boolean(),
168-
status: v.union(
169-
v.literal("active"),
170-
v.literal("paused"),
171-
v.literal("uninstalled"),
172-
),
173174
state: this.#stateType,
174175
owner: v
175176
.union(
176177
v.object({ type: v.literal("team"), name: v.string() }),
177178
v.object({ type: v.literal("user"), email: v.string() }),
178179
)
179180
.optional(),
181+
status: v.union(
182+
v.literal("active"),
183+
v.literal("paused"),
184+
v.literal("uninstalled"),
185+
),
186+
removed: v.boolean(),
180187
}),
181188
});
182189

0 commit comments

Comments
 (0)