@opengeni/api-router 2.2.0-canary.0 → 2.3.2-canary.1
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/app.js +1 -1
- package/dist/auth/managed-auth.d.ts +5 -2
- package/dist/auth/managed-email.d.ts +29 -0
- package/dist/auth/organization-user-setup.d.ts +57 -0
- package/dist/{chunk-3TP54PPX.js → chunk-IBV7Z6F4.js} +3545 -2009
- package/dist/chunk-IBV7Z6F4.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/integrations/slack-app-home.d.ts +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/session-view.d.ts +1 -0
- package/dist/routes/automations.d.ts +13 -0
- package/dist/routes/insights.d.ts +2 -1
- package/dist/routes/managed-onboarding.d.ts +29 -0
- package/dist/routes/pr-review-github.d.ts +3 -0
- package/package.json +18 -18
- package/src/app.ts +56 -5
- package/src/auth/managed-auth.ts +29 -34
- package/src/auth/managed-email.ts +174 -0
- package/src/auth/organization-user-setup.ts +217 -0
- package/src/http/auth.ts +15 -0
- package/src/http/sse.ts +62 -13
- package/src/integrations/slack-app-home.ts +2 -2
- package/src/mcp/company-brain-governed-writes.ts +4 -4
- package/src/mcp/company-profile-agent-admin.ts +11 -18
- package/src/mcp/remember.ts +4 -4
- package/src/mcp/server.ts +50 -4
- package/src/mcp/session-view.ts +8 -2
- package/src/routes/automations.ts +3 -3
- package/src/routes/documents.ts +2 -0
- package/src/routes/insights.ts +61 -19
- package/src/routes/managed-onboarding.ts +317 -0
- package/src/routes/organization-memberships.ts +212 -155
- package/src/routes/pr-review-github.ts +844 -0
- package/src/routes/pr-review.ts +20 -0
- package/src/routes/rigs.ts +37 -4
- package/src/routes/sessions.ts +101 -0
- package/src/sandbox/channel-a.ts +34 -7
- package/src/sandbox/viewer.ts +47 -11
- package/dist/chunk-3TP54PPX.js.map +0 -1
package/dist/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Settings } from "@opengeni/config";
|
|
2
|
-
import { type ManagedAuth } from "@opengeni/core";
|
|
2
|
+
import { type ManagedAuth, type ManagedEmailMessage, type ManagedEmailTransport } from "@opengeni/core";
|
|
3
3
|
import type { Database } from "@opengeni/db";
|
|
4
4
|
export type { ManagedAuth };
|
|
5
5
|
export declare function managedAuthRequiresEmailVerification(settings: Pick<Settings, "environment">): boolean;
|
|
@@ -8,4 +8,7 @@ export declare function managedAuthUserCreateOverride(settings: Pick<Settings, "
|
|
|
8
8
|
} & Record<string, unknown>): {
|
|
9
9
|
data: typeof user;
|
|
10
10
|
} | undefined;
|
|
11
|
-
|
|
11
|
+
/** Keep Better Auth password policy and storage format behind this boundary. */
|
|
12
|
+
export declare function hashManagedAuthPassword(password: string): Promise<string>;
|
|
13
|
+
export declare function createManagedAuth(settings: Settings, db: Database, managedEmailTransport: ManagedEmailTransport): ManagedAuth | null;
|
|
14
|
+
export declare function sendManagedAuthEmail(transport: ManagedEmailTransport, input: Omit<ManagedEmailMessage, "from">): Promise<void>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Settings } from "@opengeni/config";
|
|
2
|
+
import type { ManagedEmailDeliveryResult, ManagedEmailMessage, ManagedEmailTransport } from "@opengeni/core";
|
|
3
|
+
export type CapturedManagedEmail = ManagedEmailMessage & {
|
|
4
|
+
capturedAt: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Process-local test/development transport. Captures are count/TTL bounded and
|
|
8
|
+
* one-time readable; there is deliberately no route, disk, database, or log
|
|
9
|
+
* projection for message bodies or setup bearers.
|
|
10
|
+
*/
|
|
11
|
+
export declare class InMemoryManagedEmailTransport implements ManagedEmailTransport {
|
|
12
|
+
private readonly options;
|
|
13
|
+
private readonly messages;
|
|
14
|
+
readonly sender: string;
|
|
15
|
+
readonly idempotency: ManagedEmailTransport["idempotency"];
|
|
16
|
+
constructor(options?: {
|
|
17
|
+
maxMessages?: number;
|
|
18
|
+
ttlMs?: number;
|
|
19
|
+
now?: () => number;
|
|
20
|
+
sender?: string;
|
|
21
|
+
idempotency?: ManagedEmailTransport["idempotency"];
|
|
22
|
+
});
|
|
23
|
+
send(message: ManagedEmailMessage): Promise<ManagedEmailDeliveryResult>;
|
|
24
|
+
take(predicate: (message: CapturedManagedEmail) => boolean): CapturedManagedEmail | null;
|
|
25
|
+
size(): number;
|
|
26
|
+
private prune;
|
|
27
|
+
private now;
|
|
28
|
+
}
|
|
29
|
+
export declare function createManagedEmailTransport(settings: Settings): ManagedEmailTransport;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Settings } from "@opengeni/config";
|
|
2
|
+
import type { ManagedEmailTransport } from "@opengeni/core";
|
|
3
|
+
/**
|
|
4
|
+
* Prove that the stable invited-user setup bearer can be constructed before an
|
|
5
|
+
* invitation commits. Provider availability is intentionally outside this
|
|
6
|
+
* precondition: the durable delivery journal records a failed or ambiguous
|
|
7
|
+
* transport outcome after the invitation exists.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assertOrganizationUserSetupDeliveryConfigured(settings: Settings, transport: ManagedEmailTransport): void;
|
|
10
|
+
/** Reject an invalid embedded-provider contract before any durable boundary. */
|
|
11
|
+
export declare function assertManagedEmailTransportMetadata(transport: ManagedEmailTransport): void;
|
|
12
|
+
export declare function deriveOrganizationUserSetupToken(settings: Settings, input: {
|
|
13
|
+
invitationId: string;
|
|
14
|
+
deliveryId: string;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
token: string;
|
|
17
|
+
digest: string;
|
|
18
|
+
url: string;
|
|
19
|
+
}>;
|
|
20
|
+
export type OrganizationUserSetupEmailSnapshot = {
|
|
21
|
+
senderEmail: string;
|
|
22
|
+
recipientEmail: string;
|
|
23
|
+
recipientName: string | null;
|
|
24
|
+
organizationName: string;
|
|
25
|
+
organizationRole: "owner" | "admin" | "member";
|
|
26
|
+
sharedWorkspaceAccess: Array<{
|
|
27
|
+
workspaceId: string;
|
|
28
|
+
workspaceName: string;
|
|
29
|
+
role: "viewer" | "member" | "admin";
|
|
30
|
+
}>;
|
|
31
|
+
setupUrl: string;
|
|
32
|
+
};
|
|
33
|
+
export declare function renderOrganizationUserSetupEmail(input: OrganizationUserSetupEmailSnapshot): {
|
|
34
|
+
from: string;
|
|
35
|
+
to: string;
|
|
36
|
+
subject: string;
|
|
37
|
+
text: string;
|
|
38
|
+
html: string;
|
|
39
|
+
};
|
|
40
|
+
export declare function organizationUserSetupPayloadDigest(input: {
|
|
41
|
+
from: string;
|
|
42
|
+
to: string;
|
|
43
|
+
subject: string;
|
|
44
|
+
text: string;
|
|
45
|
+
html: string;
|
|
46
|
+
providerIdempotencyScope: string;
|
|
47
|
+
}): Promise<string>;
|
|
48
|
+
export declare function organizationUserSetupRequestFingerprint(settings: Settings, input: {
|
|
49
|
+
tokenDigest: string;
|
|
50
|
+
name: string;
|
|
51
|
+
password: string;
|
|
52
|
+
}): Promise<string>;
|
|
53
|
+
export declare function selfServiceOrganizationSetupRequestFingerprint(input: {
|
|
54
|
+
authUserId: string;
|
|
55
|
+
organizationName: string;
|
|
56
|
+
}): Promise<string>;
|
|
57
|
+
export declare function organizationUserSetupTokenDigest(token: string): Promise<string>;
|