Disambiguates the Phoenix/auth client lib from lib-arcadia-agents-client. Dir lib-arcadia-client → lib-arcadia-core-client; alias updated in tsconfig paths, vite config, app.css @source, imports, CI and docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
41 lines
1.7 KiB
TypeScript
41 lines
1.7 KiB
TypeScript
// Integration-registry client (operator surface) — thin shim over the shared
|
|
// `@crema/integration-registry-client` lib, bound to `operator` mode. The lib
|
|
// owns the types, the HTTP contract, and the display helpers (shared with
|
|
// arcadia-console's tenant surface); this file just exposes operator-idiomatic
|
|
// names so the page reads naturally.
|
|
|
|
import type { ArcadiaClient } from "@crema/arcadia-core-client"
|
|
import {
|
|
createIntegrationsApi,
|
|
type CredentialInput,
|
|
type IntegrationInput,
|
|
type ScopeFilter,
|
|
} from "@crema/integration-registry-client"
|
|
|
|
// Re-export the shared types + helpers so callers import from one place.
|
|
export * from "@crema/integration-registry-client"
|
|
|
|
const op = (c: ArcadiaClient) => createIntegrationsApi(c, "operator")
|
|
|
|
export const listIntegrations = (c: ArcadiaClient, filter: ScopeFilter = {}) =>
|
|
op(c).list(filter)
|
|
export const createIntegration = (c: ArcadiaClient, input: IntegrationInput) =>
|
|
op(c).create(input)
|
|
export const updateIntegration = (
|
|
c: ArcadiaClient,
|
|
id: string,
|
|
input: Partial<IntegrationInput>,
|
|
) => op(c).update(id, input)
|
|
export const deleteIntegration = (c: ArcadiaClient, id: string) => op(c).remove(id)
|
|
export const addCredential = (c: ArcadiaClient, integrationId: string, input: CredentialInput) =>
|
|
op(c).addCredential(integrationId, input)
|
|
export const updateCredential = (
|
|
c: ArcadiaClient,
|
|
credentialId: string,
|
|
input: Partial<CredentialInput>,
|
|
) => op(c).updateCredential(credentialId, input)
|
|
export const deleteCredential = (c: ArcadiaClient, credentialId: string) =>
|
|
op(c).deleteCredential(credentialId)
|
|
export const testIntegration = (c: ArcadiaClient, id: string) => op(c).test(id)
|
|
export const usageSummary = (c: ArcadiaClient, filter: ScopeFilter = {}) => op(c).usage(filter)
|