1 | import { GraphQLClient } from "./graphql";
|
2 | import { CommandIncoming, EventIncoming } from "./payload";
|
3 | export declare type CredentialResolver<T> = (graphClient: GraphQLClient, payload: CommandIncoming | EventIncoming) => Promise<T>;
|
4 | export interface GitHubCredential {
|
5 | token: string;
|
6 | scopes: string[];
|
7 | }
|
8 | export interface GitHubAppCredential {
|
9 | token: string;
|
10 | permissions: Record<string, "write" | "read">;
|
11 | }
|
12 | export declare function isGitHubCredential(spec: any): spec is GitHubCredential;
|
13 | export declare function isGitHubAppCredential(spec: any): spec is GitHubAppCredential;
|
14 | export declare function gitHubUserToken(): CredentialResolver<GitHubCredential>;
|
15 | export declare function gitHubAppToken(id: {
|
16 | owner: string;
|
17 | repo: string;
|
18 | apiUrl?: string;
|
19 | } | string): CredentialResolver<GitHubAppCredential | GitHubCredential>;
|
20 | export interface CredentialProvider {
|
21 | resolve<T>(spec: CredentialResolver<T>): Promise<T | undefined>;
|
22 | }
|
23 | export declare class DefaultCredentialProvider implements CredentialProvider {
|
24 | private readonly graphClient;
|
25 | private readonly payload;
|
26 | constructor(graphClient: GraphQLClient, payload: CommandIncoming | EventIncoming);
|
27 | resolve<T>(spec: CredentialResolver<T>): Promise<T>;
|
28 | }
|
29 | //# sourceMappingURL=secrets.d.ts.map |
\ | No newline at end of file |