@opengeni/core 3.2.2 → 3.4.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.
@@ -56,6 +56,19 @@ export type VerifiedDelegatedHumanContext = Readonly<{
56
56
  * transplanted. This proof never becomes managed-cookie/person-present proof.
57
57
  */
58
58
  export declare function stampDelegatedHumanAuthorization(request: Request, input: DelegatedHumanAuthorization): void;
59
+ /**
60
+ * Verified published-Site dispatch only: the caller has verified the signed
61
+ * gateway, served host and opaque viewer cookie. This is exact-workspace
62
+ * ownership for session routes, not a console login or a generic Site bearer.
63
+ * Native people use the existing delegated-human resolver; external owning
64
+ * users reload their existing membership without provisioning a new identity.
65
+ */
66
+ export declare function stampSiteViewerSessionAuthorization(request: Request, input: {
67
+ organizationId: string;
68
+ workspaceId: string;
69
+ subjectId: string;
70
+ permissions: Permission[];
71
+ }): void;
59
72
  /** Token prefix of personal API keys, which act as the person who made them. */
60
73
  export declare const PERSONAL_API_KEY_TOKEN_PREFIX = "ogp_";
61
74
  /**
@@ -0,0 +1,14 @@
1
+ import { cancelSiteRuntimeConversation, type Database } from "@opengeni/db";
2
+ import { type EventBus } from "@opengeni/events";
3
+ import type { SessionWorkflowClient } from "../dependencies.js";
4
+ /** Internal host lifecycle, not a session-read/control API or a viewer grant. */
5
+ export declare function cancelPublishedSiteSession(deps: {
6
+ db: Database;
7
+ bus: EventBus;
8
+ workflowClient: Pick<SessionWorkflowClient, "requestSessionWorkflowWakeDispatch">;
9
+ }, input: Parameters<typeof cancelSiteRuntimeConversation>[1]): Promise<{
10
+ receiptId: string;
11
+ replay: boolean;
12
+ cancelledSessionCount: number;
13
+ cancelledTurnCount: number;
14
+ } | null>;
@@ -1,5 +1,28 @@
1
- import type { InsightsCallsQuery, InsightsCallsResponse, InsightsUsageQuery, InsightsUsageRange, InsightsUsageResponse } from "@opengeni/contracts/insights-usage";
1
+ import type { InsightsCallsQuery, InsightsCallsResponse, InsightsUsageQuery, InsightsUsageRange, InsightsUsageResponse, InsightsSiteUsageQuery } from "@opengeni/contracts/insights-usage";
2
2
  import { type Database } from "@opengeni/db";
3
+ export declare function getInsightsSiteUsage(db: Database, input: {
4
+ accountId: string;
5
+ workspaceId: string;
6
+ query: InsightsSiteUsageQuery;
7
+ viewerSubjectId: string | null;
8
+ now?: Date;
9
+ }): Promise<{
10
+ workspaceId: string;
11
+ range: "30d" | "90d" | "month" | "today" | "week" | "ytd";
12
+ windowStart: string;
13
+ windowEnd: string;
14
+ rows: {
15
+ siteId: string | null;
16
+ title: string;
17
+ kind: "other" | "restricted" | "site";
18
+ calls: number;
19
+ pricedCalls: number;
20
+ chargedMicros: number;
21
+ apiEquivalentMicros: number;
22
+ subscriptionApiEquivalentMicros: number;
23
+ ownKeyApiEquivalentMicros: number;
24
+ }[];
25
+ }>;
3
26
  export type InsightsQueryScope = {
4
27
  accountId: string;
5
28
  /** null means organization scope; it does not grant workspace/session access. */
@@ -36,6 +36,7 @@ export declare function resolveGoalModelAdmission(db: Database, settings: Settin
36
36
  serverVersion?: string | undefined;
37
37
  databaseUrl: string;
38
38
  apiDatabasePoolMax: number;
39
+ databasePreparedStatements?: boolean | undefined;
39
40
  dbSchema: string;
40
41
  rlsStrategy: "force" | "scoped";
41
42
  runtimeDatabaseRole: string;
@@ -568,6 +569,7 @@ export declare function resolveGoalModelAdmission(db: Database, settings: Settin
568
569
  stripePublishableKey?: string | undefined;
569
570
  stripeWebhookSecret?: string | undefined;
570
571
  stripeCreditsProductId?: string | undefined;
572
+ subscriptionPlansEnabled: boolean;
571
573
  mcpServers: {
572
574
  id: string;
573
575
  name?: string | undefined;
package/dist/index.d.ts CHANGED
@@ -85,6 +85,7 @@ export * from "./domain/organization-membership-lifecycle.js";
85
85
  export * from "./application/new-session-drafts.js";
86
86
  export * from "./application/composer-submit.js";
87
87
  export * from "./application/session-commands.js";
88
+ export * from "./application/site-session-cancellation.js";
88
89
  export * from "./application/archived-session-imports.js";
89
90
  export * from "./application/session-tenancy.js";
90
91
  export * from "./application/organization-privacy.js";