@ancha-labs/cli 0.4.1 → 0.4.3

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.
@@ -117875,13 +117875,14 @@ function removeMember(c) {
117875
117875
  });
117876
117876
  }
117877
117877
  var collaboratorRoutes = [
117878
- { method: "GET", path: "/repos/:owner/:repo/collaborators", coverage: partial3("Direct collaborators, members of the owning organization and the owning user (affiliation all); other affiliations and the permission filter are gaps."), handler: (c) => {
117878
+ { method: "GET", path: "/repos/:owner/:repo/collaborators", coverage: partial3("Everyone with access: direct collaborators, members of the owning organization and the owning user (affiliation all, the default); people with a direct grant (direct); people with a direct grant who are not members of the owning organization (outside)."), handler: (c) => {
117879
117879
  query2(c, ["page", "per_page", "affiliation", "permission"]);
117880
- const affiliation = c.req.query("affiliation");
117881
- if (affiliation !== void 0 && affiliation !== "all") unsupported(`affiliation ${affiliation}`);
117880
+ const affiliation = c.req.query("affiliation") ?? "all";
117881
+ if (!["all", "direct", "outside"].includes(affiliation)) throw new GitHubError(422, "Validation Failed", [{ resource: "Collaborator", field: "affiliation", code: "invalid" }]);
117882
117882
  if (c.req.query("permission") !== void 0) unsupported("query parameter permission");
117883
- const ctx = c.env.ctx, repo4 = repository(c);
117884
- return paginate(c, withAccess(ctx, repo4).map((entry2) => collaboratorShape(ctx, entry2.user, entry2.permission)));
117883
+ const ctx = c.env.ctx, repo4 = repository(c), org5 = getOrganization(ctx, repo4.owner);
117884
+ const listed = withAccess(ctx, repo4).filter(({ user: user8 }) => affiliation === "all" || directPermission(ctx, repo4.id, user8.id) !== void 0 && (affiliation === "direct" || org5 === void 0 || orgMembership(ctx, org5.id, user8.id) === void 0));
117885
+ return paginate(c, listed.map((entry2) => collaboratorShape(ctx, entry2.user, entry2.permission)));
117885
117886
  } },
117886
117887
  { method: "GET", path: "/repos/:owner/:repo/collaborators/:username", coverage: partial3("204 when the user has any access, otherwise 404."), handler: (c) => {
117887
117888
  query2(c, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancha-labs/cli",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "type": "module",
5
5
  "description": "Simulation playgrounds for agents: run your agent against stateful replicas of Slack, GitHub, Datadog and more, locally or hosted at app.ancha.io.",
6
6
  "bugs": {