@opencode/protocol 0.0.0-dev-256 → 0.0.0-dev-261

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.
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
3
- import { ConflictError } from "../errors.js";
3
+ import { ConflictError, InvalidRequestError } from "../errors.js";
4
4
  export declare const CredentialGroup: HttpApiGroup.HttpApiGroup<"server.credential", HttpApiEndpoint.HttpApiEndpoint<"credential.activate", "POST", "/api/credential/:credentialID/activate", Schema.toCodecStringTree<Schema.Struct<{
5
5
  credentialID: Schema.brand<Schema.String, "Credential.ID"> & {
6
6
  create: () => string & import("effect/Brand").Brand<"Credential.ID">;
@@ -55,7 +55,7 @@ export declare const CredentialGroup: HttpApiGroup.HttpApiGroup<"server.credenti
55
55
  readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
56
56
  }>]>;
57
57
  }>;
58
- }>>, Schema.toCodecJson<typeof ConflictError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.list", "GET", "/api/credential", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
58
+ }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof ConflictError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"credential.list", "GET", "/api/credential", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
59
59
  readonly data: Schema.$Array<Schema.Struct<{
60
60
  readonly id: Schema.brand<Schema.String, "Credential.ID"> & {
61
61
  create: () => string & import("effect/Brand").Brand<"Credential.ID">;
@@ -1,7 +1,7 @@
1
1
  import { Credential } from "@opencode/schema/credential";
2
2
  import { Schema } from "effect";
3
3
  import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
4
- import { ConflictError } from "../errors.js";
4
+ import { ConflictError, InvalidRequestError } from "../errors.js";
5
5
  export const CredentialGroup = HttpApiGroup.make("server.credential")
6
6
  .add(HttpApiEndpoint.get("credential.list", "/api/credential", {
7
7
  success: Schema.Struct({ data: Schema.Array(Credential.Entry) }),
@@ -13,11 +13,11 @@ export const CredentialGroup = HttpApiGroup.make("server.credential")
13
13
  .add(HttpApiEndpoint.post("credential.create", "/api/credential", {
14
14
  payload: Credential.CreateInput,
15
15
  success: Schema.Struct({ data: Credential.Entry }),
16
- error: ConflictError,
16
+ error: [ConflictError, InvalidRequestError],
17
17
  }).annotateMerge(OpenApi.annotations({
18
18
  identifier: "credential.create",
19
19
  summary: "Create credential",
20
- description: "Store an integration credential. It becomes the integration's active credential unless activate is false and the integration already has one. Fails with a conflict when the requested ID already exists.",
20
+ description: "Store an integration credential. It becomes the integration's active credential unless activate is false and the integration already has one. Fails with a conflict when the requested ID already exists, and with an invalid request when an `integration.connect` policy denies the integration.",
21
21
  })))
22
22
  .add(HttpApiEndpoint.patch("credential.update", "/api/credential/:credentialID", {
23
23
  params: { credentialID: Credential.ID },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/protocol",
4
- "version": "0.0.0-dev-256",
4
+ "version": "0.0.0-dev-261",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "typecheck:tsc": "tsc --noEmit"
36
36
  },
37
37
  "dependencies": {
38
- "@opencode/schema": "0.0.0-dev-256",
38
+ "@opencode/schema": "0.0.0-dev-261",
39
39
  "effect": "4.0.6"
40
40
  },
41
41
  "devDependencies": {