@timekast/factory 2.4.0 → 2.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.
@@ -183,6 +183,27 @@ export async function linkGitRepo(projectId, token, teamId, repo, deps = {}) {
183
183
  throw error;
184
184
  }
185
185
  }
186
+ /**
187
+ * The project's current git connection, or `null` when it has none.
188
+ *
189
+ * @throws {VercelApiError} on any non-2xx.
190
+ */
191
+ export async function getGitLink(projectId, token, teamId, deps = {}) {
192
+ const data = (await vercelApi('GET', `/v9/projects/${encodeURIComponent(projectId)}`, token, teamId, deps));
193
+ const link = data.link;
194
+ if (!link || link.type !== 'github' || typeof link.repoId !== 'number')
195
+ return null;
196
+ return { repo: `${link.org ?? ''}/${link.repo ?? ''}`, repoId: link.repoId };
197
+ }
198
+ /**
199
+ * Disconnect the project from its git repo (`DELETE /v9/projects/{id}/link`). The project,
200
+ * its env vars, domains and deployments stay; only the repo binding goes.
201
+ *
202
+ * @throws {VercelApiError} on any non-2xx.
203
+ */
204
+ export async function unlinkGitRepo(projectId, token, teamId, deps = {}) {
205
+ await vercelApi('DELETE', `/v9/projects/${encodeURIComponent(projectId)}/link`, token, teamId, deps);
206
+ }
186
207
  /**
187
208
  * Apply the project SETTINGS via `PATCH /v9/projects/{id}?teamId=` — the kit's
188
209
  * contract that `POST /v9/projects` refuses at create time:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timekast/factory",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Public, thin CLI to bootstrap and maintain TimeKast Factory derived projects.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",