-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
153 lines (131 loc) · 3.47 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import {ChannelCredentials, Metadata} from '@grpc/grpc-js';
import {
BranchObject,
CommitObject,
CommitSetObject,
RepoObject,
TriggerObject,
} from '../builders/pfs';
import {
CommitState,
CreateBranchRequest,
CreateRepoRequest,
DeleteBranchRequest,
DeleteRepoRequest,
FinishCommitRequest,
InspectCommitSetRequest,
ListBranchRequest,
ListCommitRequest,
OriginKind,
StartCommitRequest,
SubscribeCommitRequest,
} from '../proto/pfs/pfs_pb';
import {DatumState} from '../proto/pps/pps_pb';
export interface GRPCPlugin {
onCall?: (args: {requestName: string}) => void;
onCompleted?: (args: {requestName: string}) => void;
onError?: (args: {error: unknown; requestName: string}) => void;
}
export type ServiceHandlerFunction = (...args: never[]) => Promise<unknown>;
export type ServiceDefinition = Record<string, ServiceHandlerFunction>;
export interface ServiceArgs {
pachdAddress: string;
channelCredentials: ChannelCredentials;
credentialMetadata: Metadata;
plugins?: GRPCPlugin[];
}
export type JobSetQueryArgs = {
id: string;
projectId: string;
details?: boolean;
};
export type JobQueryArgs = {
id: string;
projectId: string;
pipelineName: string;
wait?: boolean;
};
export type GetLogsRequestArgs = {
pipelineName?: string;
jobId?: string;
since?: number;
follow?: boolean;
};
export type ListCommitArgs = {
repo: RepoObject;
number?: ListCommitRequest.AsObject['number'];
reverse?: ListCommitRequest.AsObject['reverse'];
all?: ListCommitRequest.AsObject['all'];
originKind?: OriginKind;
from?: CommitObject;
to?: CommitObject;
};
export type InspectCommitSetArgs = {
commitSet: CommitSetObject;
wait?: InspectCommitSetRequest.AsObject['wait'];
};
export type StartCommitRequestArgs = {
branch: BranchObject;
description?: StartCommitRequest.AsObject['description'];
parent?: CommitObject;
};
export type FinishCommitRequestArgs = {
commit: CommitObject;
error?: FinishCommitRequest.AsObject['error'];
force?: FinishCommitRequest.AsObject['force'];
description?: FinishCommitRequest.AsObject['description'];
};
export type CreateRepoRequestArgs = {
repo: RepoObject;
description?: CreateRepoRequest.AsObject['description'];
update?: CreateRepoRequest.AsObject['update'];
};
export type DeleteRepoRequestArgs = {
repo: RepoObject;
force?: DeleteRepoRequest.AsObject['force'];
};
export type InspectCommitRequestArgs = {
wait: CommitState;
commit: CommitObject;
};
export type SubscribeCommitRequestArgs = {
repo: RepoObject;
branch?: SubscribeCommitRequest.AsObject['branch'];
state?: CommitState;
all?: SubscribeCommitRequest.AsObject['all'];
originKind?: OriginKind;
from?: CommitObject;
};
export type ListBranchRequestArgs = {
repo: RepoObject;
reverse?: ListBranchRequest.AsObject['reverse'];
};
export type CreateBranchArgs = {
head?: CommitObject;
branch?: BranchObject;
provenance: BranchObject[];
trigger?: TriggerObject;
newCommitSet: CreateBranchRequest.AsObject['newCommitSet'];
};
export type DeleteBranchRequestArgs = {
branch: BranchObject;
force?: DeleteBranchRequest.AsObject['force'];
};
export type InspectDatumRequestArgs = {
id: string;
jobId: string;
pipelineName: string;
};
export type ListDatumsRequestArgs = {
jobId: string;
pipelineName: string;
filter?: DatumState[];
};
export type RenewFileSetRequestArgs = {
fileSetId: string;
duration?: number;
};
export type AddFileSetRequestArgs = {
fileSetId: string;
commit: CommitObject;
};