Skip to content
Sarj Workspace Sync

access-guard/linear-provider

@sarj-ai/workspace-sync/access-guard/linear-provider ยท Source

import { z } from "zod";
import type { DownstreamAccount } from "./model.ts";
import type { AccessEnforcementProvider } from "./provider.ts";
export declare const LinearProfileAccountSchema: z.ZodObject<{
active: z.ZodBoolean;
admin: z.ZodOptional<z.ZodBoolean>;
app: z.ZodOptional<z.ZodBoolean>;
displayName: z.ZodOptional<z.ZodString>;
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
id: z.ZodString;
name: z.ZodOptional<z.ZodString>;
owner: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
export type LinearProfileAccount = z.output<typeof LinearProfileAccountSchema>;
export interface LinearProfileProviderContract extends AccessEnforcementProvider {
listProfileAccounts(runId: string): Promise<readonly LinearProfileAccount[]>;
updateFullName(accountId: string, fullName: string, correlationId: string, assertFinalWriteAuthority?: () => Promise<void>): Promise<LinearProfileAccount>;
}
export declare class LinearAccessProvider implements LinearProfileProviderContract {
#private;
readonly name = "linear";
constructor(apiKey: string, tenant: {
expectedOrganizationId: null | string;
expectedOrganizationUrlKey: string;
}, fetchImpl?: FetchImpl);
getAccount(accountId: string, correlationId: string): Promise<{
active: boolean;
admin?: boolean | undefined;
app?: boolean | undefined;
displayName?: string | undefined;
email: string;
id: string;
name?: string | undefined;
owner?: boolean | undefined;
}>;
listAccounts(runId: string): Promise<readonly DownstreamAccount[]>;
listProfileAccounts(runId: string): Promise<readonly LinearProfileAccount[]>;
updateFullName(accountId: string, fullName: string, correlationId: string, assertFinalWriteAuthority?: () => Promise<void>): Promise<LinearProfileAccount>;
suspendAccount(accountId: string, correlationId: string, assertFinalWriteAuthority?: () => Promise<void>): Promise<void>;
}
type FetchImpl = typeof fetch;
export {};