Skip to main content

apps/gateway/src/services/settings-repository.ts

Metadata

Indexed Symbols

  • getPlatformSettingsRecord (line 23, function) - Implements get platform settings record for service-layer operations.
  • upsertPlatformSettingsRecord (line 55, function) - Implements upsert platform settings record for service-layer operations.
  • getWorkspaceSettingsRecord (line 82, function) - Implements get workspace settings record for service-layer operations.
  • upsertWorkspaceSettingsRecord (line 117, function) - Implements upsert workspace settings record for service-layer operations.
  • upsertRuntimeSecret (line 150, function) - Implements upsert runtime secret for service-layer operations.
  • listRuntimeSecretKeys (line 175, function) - Implements list runtime secret keys for service-layer operations.
  • getRuntimeSecretValue (line 200, function) - Implements get runtime secret value for service-layer operations.

Markdown Headings (if applicable)

No markdown headings detected.

Source Preview

import type { PlatformSettings, WorkspaceSettings } from "@anchor/contracts";
import { query } from "./postgres.js";
import { decryptJsonPayload, encryptJsonPayload } from "./crypto.js";

const PLATFORM_SETTING_KEY = "global";
const PLATFORM_SCOPE_ID = "00000000-0000-0000-0000-000000000000";

type PlatformSettingsRow = {
value: PlatformSettings;
version: number;
updated_by: string;
updated_at: string;
};

type WorkspaceSettingsRow = {
workspace_id: string;
value: WorkspaceSettings;
version: number;
updated_by: string;
updated_at: string;
};

export async function getPlatformSettingsRecord(): Promise<{
value: PlatformSettings | null;
version: number;