@opengeni/api-router 0.21.7 → 0.21.9

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.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createAppComposition,
3
3
  startSlackInteractionPump
4
- } from "./chunk-RIFVFI3J.js";
4
+ } from "./chunk-BESOWOUQ.js";
5
5
 
6
6
  // src/index.ts
7
7
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/api-router",
3
- "version": "0.21.7",
3
+ "version": "0.21.9",
4
4
  "description": "OpenGeni HTTP surface: the Hono adapter/router (createApp), routes, MCP HTTP transport, and HTTP access adapters over @opengeni/core. An engine-distribution surface — its runtime closure includes engine-internal packages.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -46,10 +46,10 @@
46
46
  "@opengeni/codex": "^0.2.10",
47
47
  "@opengeni/config": "^0.10.11",
48
48
  "@opengeni/contracts": "^0.38.1",
49
- "@opengeni/core": "^0.20.10",
50
- "@opengeni/db": "^0.27.7",
51
- "@opengeni/documents": "^0.5.3",
52
- "@opengeni/events": "^0.3.73",
49
+ "@opengeni/core": "^0.20.11",
50
+ "@opengeni/db": "^0.27.8",
51
+ "@opengeni/documents": "^0.5.4",
52
+ "@opengeni/events": "^0.3.74",
53
53
  "@opengeni/github": "^0.4.27",
54
54
  "@opengeni/network": "^0.2.0",
55
55
  "@opengeni/observability": "^0.4.14",
@@ -22,6 +22,7 @@ import { OAUTH_MAX_RESPONSE_BYTES, pinnedFetch, readResponseJsonBounded } from "
22
22
  import { Buffer } from "node:buffer";
23
23
  import { createHash, randomBytes } from "node:crypto";
24
24
  import { HTTPException } from "hono/http-exception";
25
+ import { ApiHttpError } from "../http/api-error";
25
26
  import {
26
27
  integrationBaseUrl,
27
28
  oauthStateTtlMs,
@@ -154,8 +155,12 @@ export function socialOAuthClientFor(
154
155
  ): { clientId: string; clientSecret?: string | undefined } {
155
156
  const configured = parseSocialOauthClientsJson(settings.socialOauthClientsJson)[provider];
156
157
  if (!configured) {
157
- throw new HTTPException(503, {
158
- message: `social provider ${provider} requires an operator OAuth app in OPENGENI_SOCIAL_OAUTH_CLIENTS_JSON`,
158
+ const providerLabel = provider === "x" ? "X" : "Reddit";
159
+ throw new ApiHttpError(503, {
160
+ code: "upstream_unavailable",
161
+ message: `${providerLabel} connection is not configured. An operator must add ${providerLabel} OAuth credentials to OPENGENI_SOCIAL_OAUTH_CLIENTS_JSON.`,
162
+ retryable: false,
163
+ details: { oauthReason: "operator_oauth_app_missing", provider },
159
164
  });
160
165
  }
161
166
  return configured;