import type { RlsStrategy } from "./database.js"; export type ProvisionResult = { appRole: string | null; artifactOutboxDispatcherRole: string | null; artifactMaterializerRole: string | null; hostExportRole: string | null; temporalRole: string | null; temporalDatabases: string[]; schema: string; rlsStrategy: RlsStrategy; }; export type ProvisionRolesOptions = { /** * The schema Opengeni's tables live in. The app-role GRANTs target this * schema + `opengeni_private`. Defaults to `public` (standalone). */ targetSchema?: string; /** * RLS posture (Step I). `"force"` (default) provisions the non-owner * `opengeni_app` login role and GRANTs it table DML in the target schema — * the role Opengeni connects as under FORCE-RLS. `"scoped"` SKIPS the app-role * provisioning entirely: the embedded host runs Opengeni's queries over a role * IT owns/manages (typically the schema owner), so Opengeni neither creates * nor grants the `opengeni_app` role. Temporal-role provisioning is unaffected * by strategy. */ rlsStrategy?: RlsStrategy; appRole?: string; appPassword?: string; /** Global, EXECUTE-only artifact live-hint dispatcher capability. */ artifactOutboxDispatcherRole?: string; artifactOutboxDispatcherPassword?: string; /** Global, EXECUTE-only artifact materialization worker capability. */ artifactMaterializerRole?: string; artifactMaterializerPassword?: string; /** * Optional cross-workspace projection role. It receives schema USAGE and * EXECUTE only on the host-export API; it receives no table privileges. * Provision it after the first migration run so the schema exists. The * provisioner also registers same-owner default privileges for future * host-export functions; shipped migrations preserve existing exporter ACLs * when a migration-only upgrade adds a function. */ hostExportRole?: string; hostExportPassword?: string; temporalRole?: string; temporalPassword?: string; temporalDatabases?: string[]; }; /** * SDK entry point (Step I): provision the Opengeni database roles + grants over * a host-supplied admin connection. This is the named, parameterized form of the * historical env-driven `provision-roles` script (which still works as a CLI via * the `import.meta.main` block at the bottom — it just reads env into these * options). * * STANDALONE (default): `provisionRoles(adminConnection)` with no options → * `targetSchema: "public"`, `rlsStrategy: "force"`, reads `opengeni_app` creds * from env. Byte-for-byte the historical script behavior. * * EMBEDDED: `provisionRoles(adminConnection, { targetSchema, rlsStrategy })` lets * a host provision the app role over a dedicated schema (force) OR skip the * app role entirely and own the connection role itself (scoped). */ export declare function provisionRoles(adminConnection: string, options?: ProvisionRolesOptions): Promise; /** Command-line entry. Bundled release images call this explicitly; see * scripts/assemble-server-runtime.ts. */ export declare function runProvisionRolesCli(): Promise;