@opengeni/api-router 6.8.0 → 6.9.1-canary.41937124785001

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.
Files changed (47) hide show
  1. package/dist/app.js +1 -1
  2. package/dist/auth/signup-challenge.d.ts +12 -0
  3. package/dist/billing-auto-top-up.d.ts +33 -0
  4. package/dist/{chunk-A2VKA7K3.js → chunk-XHNCHFTH.js} +2067 -1252
  5. package/dist/{chunk-A2VKA7K3.js.map → chunk-XHNCHFTH.js.map} +1 -1
  6. package/dist/codex-realtime.d.ts +28 -2
  7. package/dist/index.js +1 -1
  8. package/dist/mcp/scheduled-task-input.d.ts +6 -0
  9. package/dist/mcp/server.d.ts +1 -0
  10. package/dist/mcp/session-view.d.ts +1 -0
  11. package/dist/mcp/transport.d.ts +9 -0
  12. package/dist/meeting-calendar-title.d.ts +63 -6
  13. package/dist/meeting-join-links.d.ts +11 -0
  14. package/dist/routes/billing-auto-top-up.d.ts +8 -0
  15. package/dist/routes/billing.d.ts +4 -0
  16. package/package.json +29 -28
  17. package/src/app.ts +38 -7
  18. package/src/auth/managed-auth.ts +3 -1
  19. package/src/auth/signup-challenge.test.ts +57 -0
  20. package/src/auth/signup-challenge.ts +33 -0
  21. package/src/billing-auto-top-up.ts +551 -0
  22. package/src/claude-subscription-oauth.ts +5 -1
  23. package/src/claude-subscription-profile.ts +10 -8
  24. package/src/codex-realtime.ts +44 -1
  25. package/src/http/api-error.ts +22 -1
  26. package/src/integrations/slack-agent-proposals.ts +7 -7
  27. package/src/integrations/slack-agents.ts +28 -21
  28. package/src/integrations/slack-interactions.ts +1 -1
  29. package/src/integrations/slack-request-text.ts +1 -4
  30. package/src/mcp/action-schema-imports.gen.ts +4 -0
  31. package/src/mcp/secret-tools.ts +1 -1
  32. package/src/mcp/server.ts +32 -85
  33. package/src/mcp/transport.ts +21 -0
  34. package/src/meeting-calendar-title.ts +227 -35
  35. package/src/meeting-join-links.ts +95 -0
  36. package/src/model-calls/service.ts +18 -3
  37. package/src/routes/billing-auto-top-up.ts +161 -0
  38. package/src/routes/billing.ts +26 -6
  39. package/src/routes/documents.ts +3 -3
  40. package/src/routes/files.ts +3 -3
  41. package/src/routes/managed-auth-session-sets.ts +16 -5
  42. package/src/routes/recordings.ts +68 -15
  43. package/src/routes/sessions.ts +10 -2
  44. package/src/routes/site-runtime.ts +2 -0
  45. package/src/routes/transcriptions.ts +13 -8
  46. package/src/routes/workspaces.ts +20 -0
  47. package/src/site-publishing/agent-session.ts +1 -0
package/dist/app.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  withDefaultEnabledCapabilityMcpTools,
30
30
  workflowIdForSession,
31
31
  workspaceActorContextExempt
32
- } from "./chunk-A2VKA7K3.js";
32
+ } from "./chunk-XHNCHFTH.js";
33
33
  import "./chunk-OGQDXVXY.js";
34
34
  export {
35
35
  API_MAX_REQUEST_BODY_BYTES,
@@ -5,3 +5,15 @@ export declare function requireSignupChallenge(settings: Settings): void;
5
5
  export declare function oauthSignupChallengeVerified(value: string, provider: string, now?: number): boolean;
6
6
  /** Cloudflare consumes tokens globally, so concurrent replicas cannot reuse a pass. */
7
7
  export declare function verifySignupChallenge(settings: Settings, token: unknown, fetcher?: typeof fetch): Promise<void>;
8
+ /**
9
+ * A Google or GitHub start may turn out to be a sign-in, which needs no
10
+ * challenge, so a token that can't be verified must not refuse it. The start
11
+ * then carries no proof, and the user-create hook still refuses a new account.
12
+ * `onUnverified` receives the refusal's code (`SIGNUP_CHALLENGE_FAILED`,
13
+ * `SIGNUP_CHALLENGE_UNAVAILABLE` or `SIGNUP_CHALLENGE_REQUIRED`) so a broken
14
+ * configuration or provider outage stays visible to operators.
15
+ */
16
+ export declare function verifySocialSignupChallenge(settings: Settings, token: unknown, options?: {
17
+ fetcher?: typeof fetch;
18
+ onUnverified?: (code: string) => void;
19
+ }): Promise<boolean>;
@@ -0,0 +1,33 @@
1
+ import Stripe from "stripe";
2
+ import type { BillingAutoTopUpSettings } from "@opengeni/contracts";
3
+ import { type AutoTopUpIntent, type AutoTopUpOperation, type AutoTopUpSettingsRow, type AutoTopUpStore } from "@opengeni/db";
4
+ export type AutoTopUpDecision = "off" | "payment_method_required" | "payment_failed" | "processing" | "cap_reached" | "ready";
5
+ export declare function decideAutoTopUp(input: {
6
+ settings: AutoTopUpSettingsRow | null;
7
+ pending: boolean;
8
+ spent: number;
9
+ chargeMicros?: number;
10
+ }): AutoTopUpDecision;
11
+ export declare function autoTopUpPaymentMetadata(operation: AutoTopUpOperation): Stripe.MetadataParam;
12
+ /** No network result grants money until its exact customer, mode, amount, currency,
13
+ * tax quote and immutable operation all match. Never trust webhook ordering. */
14
+ export declare function assertAutoTopUpPayment(operation: AutoTopUpOperation, payment: Stripe.PaymentIntent): void;
15
+ export declare class StripeAutoTopUps {
16
+ private readonly stripe;
17
+ private readonly store;
18
+ private readonly options;
19
+ constructor(stripe: Stripe, store: AutoTopUpStore, options: {
20
+ enabled: boolean;
21
+ provider: AutoTopUpIntent["provider"];
22
+ creditsProductId?: string;
23
+ });
24
+ settings(accountId: string): Promise<BillingAutoTopUpSettings>;
25
+ /** Bounded one-operation pass. The caller's maintenance scheduler supplies account
26
+ * IDs; an advisory discovery result never grants consent or payment authority. */
27
+ process(accountId: string): Promise<void>;
28
+ private validCustomer;
29
+ private settle;
30
+ private cancel;
31
+ handlePaymentIntent(eventPayment: Stripe.PaymentIntent): Promise<boolean>;
32
+ handleSetup(session: Stripe.Checkout.Session): Promise<boolean>;
33
+ }