gitd-client 0.0.0-stage → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,336 @@
1
+ // @generated by protoc-gen-es v2.16.0 with parameter "target=ts,import_extension=js"
2
+ // @generated from file gitd/v1/gitd.proto (package gitd.v1, syntax proto3)
3
+ /* eslint-disable */
4
+ import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
5
+ import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
6
+ /**
7
+ * Describes the file gitd/v1/gitd.proto.
8
+ */
9
+ export const file_gitd_v1_gitd = /*@__PURE__*/ fileDesc("ChJnaXRkL3YxL2dpdGQucHJvdG8SB2dpdGQudjEibQoKQ3JlZGVudGlhbBISCgp1cmxfcHJlZml4GAEgASgJEhUKC2h0dHBzX3Rva2VuGAIgASgJSAASFgoMc3NoX2tleV9wYXRoGAMgASgJSAASEgoKaHR0cHNfdXNlchgEIAEoCUIICgZzZWNyZXQiOAoIUmV2aXNpb24SEAoGYnJhbmNoGAEgASgJSAASEAoGY29tbWl0GAIgASgJSABCCAoGdGFyZ2V0Ij4KCFByb2dyZXNzEg0KBXBoYXNlGAEgASgJEg8KB3BlcmNlbnQYAiABKAUSEgoKcmVwb3NpdG9yeRgDIAEoCSJQCg5TdWJtb2R1bGVTdGF0ZRIMCgRwYXRoGAEgASgJEgsKA3VybBgCIAEoCRIOCgZjb21taXQYAyABKAkSEwoLY2hlY2tlZF9vdXQYBCABKAgiUwoQUGVuZGluZ1N1Ym1vZHVsZRILCgN1cmwYASABKAkSDAoEcGF0aBgCIAEoCRIkCgdmYWlsdXJlGAMgASgLMhMuZ2l0ZC52MS5HaXRGYWlsdXJlIpkDCgpHaXRGYWlsdXJlEioKBnJlYXNvbhgBIAEoDjIaLmdpdGQudjEuR2l0RmFpbHVyZS5SZWFzb24SEAoIZ2l0X3NhaWQYAiABKAkSEgoKcmVwb3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nNlMAESPwoIRGVzY3JpYmUSGC5naXRkLnYxLkRlc2NyaWJlUmVxdWVzdBoZLmdpdGQudjEuRGVzY3JpYmVSZXNwb25zZRI5CgZSZW1vdmUSFi5naXRkLnYxLlJlbW92ZVJlcXVlc3QaFy5naXRkLnYxLlJlbW92ZVJlc3BvbnNlEjgKBUFkb3B0EhUuZ2l0ZC52MS5BZG9wdFJlcXVlc3QaFi5naXRkLnYxLkFkb3B0UmVzcG9uc2UwARI8CgdQdWJsaXNoEhcuZ2l0ZC52MS5QdWJsaXNoUmVxdWVzdBoYLmdpdGQudjEuUHVibGlzaFJlc3BvbnNlMksKEVJlcG9zaXRvcnlTZXJ2aWNlEjYKBVByb2JlEhUuZ2l0ZC52MS5Qcm9iZVJlcXVlc3QaFi5naXRkLnYxLlByb2JlUmVzcG9uc2UytwEKDVNlcnZlclNlcnZpY2USMwoESW5mbxIULmdpdGQudjEuSW5mb1JlcXVlc3QaFS5naXRkLnYxLkluZm9SZXNwb25zZRI5CgZSZXRpcmUSFi5naXRkLnYxLlJldGlyZVJlcXVlc3QaFy5naXRkLnYxLlJldGlyZVJlc3BvbnNlEjYKBUF1ZGl0EhUuZ2l0ZC52MS5BdWRpdFJlcXVlc3QaFi5naXRkLnYxLkF1ZGl0UmVzcG9uc2VCMlowZ2l0aHViLmNvbS9kb29zZXJ2aWNlL2dpdGQvZ2VuL2dvL2dpdGQvdjE7Z2l0ZHYxYgZwcm90bzM", [file_google_protobuf_timestamp]);
10
+ /**
11
+ * Describes the message gitd.v1.Credential.
12
+ * Use `create(CredentialSchema)` to create a new message.
13
+ */
14
+ export const CredentialSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 0);
15
+ /**
16
+ * Describes the message gitd.v1.Revision.
17
+ * Use `create(RevisionSchema)` to create a new message.
18
+ */
19
+ export const RevisionSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 1);
20
+ /**
21
+ * Describes the message gitd.v1.Progress.
22
+ * Use `create(ProgressSchema)` to create a new message.
23
+ */
24
+ export const ProgressSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 2);
25
+ /**
26
+ * Describes the message gitd.v1.SubmoduleState.
27
+ * Use `create(SubmoduleStateSchema)` to create a new message.
28
+ */
29
+ export const SubmoduleStateSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 3);
30
+ /**
31
+ * Describes the message gitd.v1.PendingSubmodule.
32
+ * Use `create(PendingSubmoduleSchema)` to create a new message.
33
+ */
34
+ export const PendingSubmoduleSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 4);
35
+ /**
36
+ * Describes the message gitd.v1.GitFailure.
37
+ * Use `create(GitFailureSchema)` to create a new message.
38
+ */
39
+ export const GitFailureSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 5);
40
+ /**
41
+ * @generated from enum gitd.v1.GitFailure.Reason
42
+ */
43
+ export var GitFailure_Reason;
44
+ (function (GitFailure_Reason) {
45
+ /**
46
+ * @generated from enum value: REASON_UNSPECIFIED = 0;
47
+ */
48
+ GitFailure_Reason[GitFailure_Reason["UNSPECIFIED"] = 0] = "UNSPECIFIED";
49
+ /**
50
+ * @generated from enum value: REASON_AUTH_REQUIRED = 1;
51
+ */
52
+ GitFailure_Reason[GitFailure_Reason["AUTH_REQUIRED"] = 1] = "AUTH_REQUIRED";
53
+ /**
54
+ * @generated from enum value: REASON_AUTH_REFUSED = 2;
55
+ */
56
+ GitFailure_Reason[GitFailure_Reason["AUTH_REFUSED"] = 2] = "AUTH_REFUSED";
57
+ /**
58
+ * @generated from enum value: REASON_NOT_FOUND = 3;
59
+ */
60
+ GitFailure_Reason[GitFailure_Reason["NOT_FOUND"] = 3] = "NOT_FOUND";
61
+ /**
62
+ * @generated from enum value: REASON_BAD_ADDRESS = 4;
63
+ */
64
+ GitFailure_Reason[GitFailure_Reason["BAD_ADDRESS"] = 4] = "BAD_ADDRESS";
65
+ /**
66
+ * @generated from enum value: REASON_PATH_REFUSED = 5;
67
+ */
68
+ GitFailure_Reason[GitFailure_Reason["PATH_REFUSED"] = 5] = "PATH_REFUSED";
69
+ /**
70
+ * @generated from enum value: REASON_BUSY = 6;
71
+ */
72
+ GitFailure_Reason[GitFailure_Reason["BUSY"] = 6] = "BUSY";
73
+ /**
74
+ * @generated from enum value: REASON_TIMEOUT = 7;
75
+ */
76
+ GitFailure_Reason[GitFailure_Reason["TIMEOUT"] = 7] = "TIMEOUT";
77
+ /**
78
+ * @generated from enum value: REASON_CORRUPT = 8;
79
+ */
80
+ GitFailure_Reason[GitFailure_Reason["CORRUPT"] = 8] = "CORRUPT";
81
+ /**
82
+ * @generated from enum value: REASON_GIT_FAILED = 9;
83
+ */
84
+ GitFailure_Reason[GitFailure_Reason["GIT_FAILED"] = 9] = "GIT_FAILED";
85
+ /**
86
+ * @generated from enum value: REASON_NOTHING_NEW = 10;
87
+ */
88
+ GitFailure_Reason[GitFailure_Reason["NOTHING_NEW"] = 10] = "NOTHING_NEW";
89
+ /**
90
+ * The branch is outside the prefix publishing is limited to.
91
+ *
92
+ * @generated from enum value: REASON_BRANCH_REFUSED = 11;
93
+ */
94
+ GitFailure_Reason[GitFailure_Reason["BRANCH_REFUSED"] = 11] = "BRANCH_REFUSED";
95
+ /**
96
+ * The workspace's git configuration sets something gitd does not run git under, such
97
+ * as a filter or a hook path: whoever writes in the workspace could otherwise have gitd
98
+ * run a command of theirs.
99
+ *
100
+ * @generated from enum value: REASON_CONFIG_REFUSED = 12;
101
+ */
102
+ GitFailure_Reason[GitFailure_Reason["CONFIG_REFUSED"] = 12] = "CONFIG_REFUSED";
103
+ })(GitFailure_Reason || (GitFailure_Reason = {}));
104
+ /**
105
+ * Describes the enum gitd.v1.GitFailure.Reason.
106
+ */
107
+ export const GitFailure_ReasonSchema = /*@__PURE__*/ enumDesc(file_gitd_v1_gitd, 5, 0);
108
+ /**
109
+ * Describes the message gitd.v1.PrepareRequest.
110
+ * Use `create(PrepareRequestSchema)` to create a new message.
111
+ */
112
+ export const PrepareRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 6);
113
+ /**
114
+ * Describes the message gitd.v1.Layers.
115
+ * Use `create(LayersSchema)` to create a new message.
116
+ */
117
+ export const LayersSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 7);
118
+ /**
119
+ * Describes the message gitd.v1.PrepareResponse.
120
+ * Use `create(PrepareResponseSchema)` to create a new message.
121
+ */
122
+ export const PrepareResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 8);
123
+ /**
124
+ * Describes the message gitd.v1.WorkspaceResult.
125
+ * Use `create(WorkspaceResultSchema)` to create a new message.
126
+ */
127
+ export const WorkspaceResultSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 9);
128
+ /**
129
+ * Describes the message gitd.v1.UpdateRequest.
130
+ * Use `create(UpdateRequestSchema)` to create a new message.
131
+ */
132
+ export const UpdateRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 10);
133
+ /**
134
+ * Describes the message gitd.v1.UpdateResponse.
135
+ * Use `create(UpdateResponseSchema)` to create a new message.
136
+ */
137
+ export const UpdateResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 11);
138
+ /**
139
+ * Describes the message gitd.v1.CheckoutRequest.
140
+ * Use `create(CheckoutRequestSchema)` to create a new message.
141
+ */
142
+ export const CheckoutRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 12);
143
+ /**
144
+ * Describes the message gitd.v1.CheckoutResponse.
145
+ * Use `create(CheckoutResponseSchema)` to create a new message.
146
+ */
147
+ export const CheckoutResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 13);
148
+ /**
149
+ * Describes the message gitd.v1.SyncSubmodulesRequest.
150
+ * Use `create(SyncSubmodulesRequestSchema)` to create a new message.
151
+ */
152
+ export const SyncSubmodulesRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 14);
153
+ /**
154
+ * Describes the message gitd.v1.SyncSubmodulesResponse.
155
+ * Use `create(SyncSubmodulesResponseSchema)` to create a new message.
156
+ */
157
+ export const SyncSubmodulesResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 15);
158
+ /**
159
+ * Describes the message gitd.v1.SyncSubmodulesResult.
160
+ * Use `create(SyncSubmodulesResultSchema)` to create a new message.
161
+ */
162
+ export const SyncSubmodulesResultSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 16);
163
+ /**
164
+ * Describes the message gitd.v1.DescribeRequest.
165
+ * Use `create(DescribeRequestSchema)` to create a new message.
166
+ */
167
+ export const DescribeRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 17);
168
+ /**
169
+ * Describes the message gitd.v1.DescribeResponse.
170
+ * Use `create(DescribeResponseSchema)` to create a new message.
171
+ */
172
+ export const DescribeResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 18);
173
+ /**
174
+ * Describes the message gitd.v1.RemoveRequest.
175
+ * Use `create(RemoveRequestSchema)` to create a new message.
176
+ */
177
+ export const RemoveRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 19);
178
+ /**
179
+ * Describes the message gitd.v1.RemoveResponse.
180
+ * Use `create(RemoveResponseSchema)` to create a new message.
181
+ */
182
+ export const RemoveResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 20);
183
+ /**
184
+ * Describes the message gitd.v1.AdoptRequest.
185
+ * Use `create(AdoptRequestSchema)` to create a new message.
186
+ */
187
+ export const AdoptRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 21);
188
+ /**
189
+ * Describes the message gitd.v1.AdoptResponse.
190
+ * Use `create(AdoptResponseSchema)` to create a new message.
191
+ */
192
+ export const AdoptResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 22);
193
+ /**
194
+ * Describes the message gitd.v1.AdoptResult.
195
+ * Use `create(AdoptResultSchema)` to create a new message.
196
+ */
197
+ export const AdoptResultSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 23);
198
+ /**
199
+ * Describes the message gitd.v1.PublishRequest.
200
+ * Use `create(PublishRequestSchema)` to create a new message.
201
+ */
202
+ export const PublishRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 24);
203
+ /**
204
+ * Describes the message gitd.v1.PublishedRepository.
205
+ * Use `create(PublishedRepositorySchema)` to create a new message.
206
+ */
207
+ export const PublishedRepositorySchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 25);
208
+ /**
209
+ * Describes the message gitd.v1.PublishResponse.
210
+ * Use `create(PublishResponseSchema)` to create a new message.
211
+ */
212
+ export const PublishResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 26);
213
+ /**
214
+ * Describes the message gitd.v1.ProbeRequest.
215
+ * Use `create(ProbeRequestSchema)` to create a new message.
216
+ */
217
+ export const ProbeRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 27);
218
+ /**
219
+ * Describes the message gitd.v1.ProbeResponse.
220
+ * Use `create(ProbeResponseSchema)` to create a new message.
221
+ */
222
+ export const ProbeResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 28);
223
+ /**
224
+ * @generated from enum gitd.v1.ProbeResponse.Access
225
+ */
226
+ export var ProbeResponse_Access;
227
+ (function (ProbeResponse_Access) {
228
+ /**
229
+ * @generated from enum value: ACCESS_UNSPECIFIED = 0;
230
+ */
231
+ ProbeResponse_Access[ProbeResponse_Access["UNSPECIFIED"] = 0] = "UNSPECIFIED";
232
+ /**
233
+ * Read with nothing.
234
+ *
235
+ * @generated from enum value: ACCESS_PUBLIC = 1;
236
+ */
237
+ ProbeResponse_Access[ProbeResponse_Access["PUBLIC"] = 1] = "PUBLIC";
238
+ /**
239
+ * Read with the credentials given.
240
+ *
241
+ * @generated from enum value: ACCESS_REACHABLE = 2;
242
+ */
243
+ ProbeResponse_Access[ProbeResponse_Access["REACHABLE"] = 2] = "REACHABLE";
244
+ /**
245
+ * Not readable with what was given.
246
+ *
247
+ * @generated from enum value: ACCESS_DENIED = 3;
248
+ */
249
+ ProbeResponse_Access[ProbeResponse_Access["DENIED"] = 3] = "DENIED";
250
+ })(ProbeResponse_Access || (ProbeResponse_Access = {}));
251
+ /**
252
+ * Describes the enum gitd.v1.ProbeResponse.Access.
253
+ */
254
+ export const ProbeResponse_AccessSchema = /*@__PURE__*/ enumDesc(file_gitd_v1_gitd, 28, 0);
255
+ /**
256
+ * Describes the message gitd.v1.RetireRequest.
257
+ * Use `create(RetireRequestSchema)` to create a new message.
258
+ */
259
+ export const RetireRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 29);
260
+ /**
261
+ * Describes the message gitd.v1.RetireResponse.
262
+ * Use `create(RetireResponseSchema)` to create a new message.
263
+ */
264
+ export const RetireResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 30);
265
+ /**
266
+ * Describes the message gitd.v1.InfoRequest.
267
+ * Use `create(InfoRequestSchema)` to create a new message.
268
+ */
269
+ export const InfoRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 31);
270
+ /**
271
+ * Describes the message gitd.v1.InfoResponse.
272
+ * Use `create(InfoResponseSchema)` to create a new message.
273
+ */
274
+ export const InfoResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 32);
275
+ /**
276
+ * Describes the message gitd.v1.AuditRequest.
277
+ * Use `create(AuditRequestSchema)` to create a new message.
278
+ */
279
+ export const AuditRequestSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 33);
280
+ /**
281
+ * Describes the message gitd.v1.AuditResponse.
282
+ * Use `create(AuditResponseSchema)` to create a new message.
283
+ */
284
+ export const AuditResponseSchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 34);
285
+ /**
286
+ * Describes the message gitd.v1.AuditEntry.
287
+ * Use `create(AuditEntrySchema)` to create a new message.
288
+ */
289
+ export const AuditEntrySchema = /*@__PURE__*/ messageDesc(file_gitd_v1_gitd, 35);
290
+ /**
291
+ * How a workspace was made.
292
+ *
293
+ * @generated from enum gitd.v1.Strategy
294
+ */
295
+ export var Strategy;
296
+ (function (Strategy) {
297
+ /**
298
+ * @generated from enum value: STRATEGY_UNSPECIFIED = 0;
299
+ */
300
+ Strategy[Strategy["UNSPECIFIED"] = 0] = "UNSPECIFIED";
301
+ /**
302
+ * Every file written.
303
+ *
304
+ * @generated from enum value: STRATEGY_COPY = 1;
305
+ */
306
+ Strategy[Strategy["COPY"] = 1] = "COPY";
307
+ /**
308
+ * A layer of its own mounted on a shared template, read only: milliseconds, and only
309
+ * what changes takes disk.
310
+ *
311
+ * @generated from enum value: STRATEGY_OVERLAY = 2;
312
+ */
313
+ Strategy[Strategy["OVERLAY"] = 2] = "OVERLAY";
314
+ /**
315
+ * The template cloned block by block: almost no disk.
316
+ *
317
+ * @generated from enum value: STRATEGY_REFLINK = 3;
318
+ */
319
+ Strategy[Strategy["REFLINK"] = 3] = "REFLINK";
320
+ })(Strategy || (Strategy = {}));
321
+ /**
322
+ * Describes the enum gitd.v1.Strategy.
323
+ */
324
+ export const StrategySchema = /*@__PURE__*/ enumDesc(file_gitd_v1_gitd, 0);
325
+ /**
326
+ * @generated from service gitd.v1.WorkspaceService
327
+ */
328
+ export const WorkspaceService = /*@__PURE__*/ serviceDesc(file_gitd_v1_gitd, 0);
329
+ /**
330
+ * @generated from service gitd.v1.RepositoryService
331
+ */
332
+ export const RepositoryService = /*@__PURE__*/ serviceDesc(file_gitd_v1_gitd, 1);
333
+ /**
334
+ * @generated from service gitd.v1.ServerService
335
+ */
336
+ export const ServerService = /*@__PURE__*/ serviceDesc(file_gitd_v1_gitd, 2);
package/dist/gitd.d.ts ADDED
@@ -0,0 +1,36 @@
1
+ import { type Transport } from "@connectrpc/connect";
2
+ import type { AuditEntry, AuditOptions, CheckoutOptions, Description, Info, PrepareOptions, Probe, Published, UpdateOptions, Workspace } from "./types.js";
3
+ export interface GitdOptions {
4
+ /** gitd's Unix socket; default $GITD_SOCKET, then /run/gitd/gitd.sock. */
5
+ socket?: string;
6
+ /** A transport of your own instead, e.g. for tests. */
7
+ transport?: Transport;
8
+ }
9
+ /**
10
+ * A gitd on its Unix socket. No call takes a credential: gitd reads and publishes with the
11
+ * ones it keeps.
12
+ */
13
+ export declare class Gitd {
14
+ private readonly workspaces;
15
+ private readonly repositories;
16
+ private readonly server;
17
+ constructor(options?: GitdOptions);
18
+ /** Which gitd answers, and how it makes workspaces here and why. */
19
+ info(): Promise<Info>;
20
+ /** Whether a repository can be read with the credentials gitd keeps, and its branches. */
21
+ probe(url: string): Promise<Probe>;
22
+ /** Makes a workspace of a repository at a path under gitd's roots. */
23
+ prepare(options: PrepareOptions): Promise<Workspace>;
24
+ /** Brings a workspace to the tip of its branch, or of the branch given. */
25
+ update(path: string, options?: UpdateOptions): Promise<Workspace>;
26
+ /** Moves a workspace to a commit, as a rollback does. */
27
+ checkout(path: string, commit: string, options?: CheckoutOptions): Promise<Workspace>;
28
+ /** What a workspace is on disk, without the network. */
29
+ describe(path: string): Promise<Description>;
30
+ /** Pushes what was committed in a workspace to a new branch, with the token gitd keeps. */
31
+ publish(path: string, branch: string): Promise<Published>;
32
+ /** The audit log: every publish, done or refused, newest first. */
33
+ audit(options?: AuditOptions): Promise<AuditEntry[]>;
34
+ /** Deletes a workspace; its pool stays. */
35
+ remove(path: string): Promise<void>;
36
+ }
package/dist/gitd.js ADDED
@@ -0,0 +1,115 @@
1
+ import { timestampFromDate } from "@bufbuild/protobuf/wkt";
2
+ import { createClient } from "@connectrpc/connect";
3
+ import { createConnectTransport } from "@connectrpc/connect-node";
4
+ import { RepositoryService, ServerService, WorkspaceService } from "./gen/gitd/v1/gitd_pb.js";
5
+ import { call, drain } from "./calls.js";
6
+ import { accessName, pushedOf, revisionOf, strategyName, strategyProto, toAuditEntry, toWorkspace, } from "./convert.js";
7
+ const defaultSocket = "/run/gitd/gitd.sock";
8
+ /**
9
+ * A gitd on its Unix socket. No call takes a credential: gitd reads and publishes with the
10
+ * ones it keeps.
11
+ */
12
+ export class Gitd {
13
+ workspaces;
14
+ repositories;
15
+ server;
16
+ constructor(options = {}) {
17
+ const transport = options.transport ?? socketTransport(options.socket);
18
+ this.workspaces = createClient(WorkspaceService, transport);
19
+ this.repositories = createClient(RepositoryService, transport);
20
+ this.server = createClient(ServerService, transport);
21
+ }
22
+ /** Which gitd answers, and how it makes workspaces here and why. */
23
+ async info() {
24
+ const answer = await call(() => this.server.info({}));
25
+ return {
26
+ version: answer.version,
27
+ gitVersion: answer.gitVersion,
28
+ pools: answer.pools,
29
+ poolsBytes: Number(answer.poolsBytes),
30
+ templates: answer.templates,
31
+ templatesBytes: Number(answer.templatesBytes),
32
+ strategy: strategyName(answer.strategy),
33
+ strategyReason: answer.strategyReason,
34
+ };
35
+ }
36
+ /** Whether a repository can be read with the credentials gitd keeps, and its branches. */
37
+ async probe(url) {
38
+ const answer = await call(() => this.repositories.probe({ url }));
39
+ return {
40
+ access: accessName(answer.access),
41
+ defaultBranch: answer.defaultBranch,
42
+ branches: { ...answer.commits },
43
+ denied: answer.failure?.gitSaid,
44
+ };
45
+ }
46
+ /** Makes a workspace of a repository at a path under gitd's roots. */
47
+ async prepare(options) {
48
+ const request = {
49
+ url: options.url,
50
+ path: options.path,
51
+ revision: revisionOf(options.branch, options.commit),
52
+ withSubmodules: options.submodules ?? false,
53
+ fullHistory: options.fullHistory ?? false,
54
+ strategy: strategyProto(options.strategy),
55
+ };
56
+ const stream = this.workspaces.prepare(request, { signal: options.signal });
57
+ return toWorkspace(options.path, await drain(stream, options.onProgress));
58
+ }
59
+ /** Brings a workspace to the tip of its branch, or of the branch given. */
60
+ async update(path, options = {}) {
61
+ const request = { path, branch: options.branch ?? "", withSubmodules: options.submodules ?? false };
62
+ const stream = this.workspaces.update(request, { signal: options.signal });
63
+ return toWorkspace(path, await drain(stream, options.onProgress));
64
+ }
65
+ /** Moves a workspace to a commit, as a rollback does. */
66
+ async checkout(path, commit, options = {}) {
67
+ const request = { path, commit, withSubmodules: options.submodules ?? false };
68
+ const stream = this.workspaces.checkout(request, { signal: options.signal });
69
+ return toWorkspace(path, await drain(stream, options.onProgress));
70
+ }
71
+ /** What a workspace is on disk, without the network. */
72
+ async describe(path) {
73
+ const answer = await call(() => this.workspaces.describe({ path }));
74
+ return {
75
+ url: answer.url,
76
+ commit: answer.commit,
77
+ branch: answer.branch,
78
+ modified: answer.modified,
79
+ strategy: strategyName(answer.strategy),
80
+ submodules: answer.submodules.map((submodule) => ({
81
+ path: submodule.path,
82
+ url: submodule.url,
83
+ commit: submodule.commit,
84
+ checkedOut: submodule.checkedOut,
85
+ })),
86
+ lfsPatterns: answer.lfsPatterns,
87
+ };
88
+ }
89
+ /** Pushes what was committed in a workspace to a new branch, with the token gitd keeps. */
90
+ async publish(path, branch) {
91
+ const answer = await call(() => this.workspaces.publish({ path, branch }));
92
+ return { branch: answer.branch, repositories: pushedOf(answer.repository, answer.submodules) };
93
+ }
94
+ /** The audit log: every publish, done or refused, newest first. */
95
+ async audit(options = {}) {
96
+ const request = {
97
+ since: options.since && timestampFromDate(options.since),
98
+ url: options.url ?? "",
99
+ limit: options.limit ?? 0,
100
+ };
101
+ const answer = await call(() => this.server.audit(request));
102
+ return answer.entries.map(toAuditEntry);
103
+ }
104
+ /** Deletes a workspace; its pool stays. */
105
+ async remove(path) {
106
+ await call(() => this.workspaces.remove({ path }));
107
+ }
108
+ }
109
+ function socketTransport(socket) {
110
+ return createConnectTransport({
111
+ baseUrl: "http://gitd",
112
+ httpVersion: "1.1",
113
+ nodeOptions: { socketPath: socket ?? process.env.GITD_SOCKET ?? defaultSocket },
114
+ });
115
+ }
@@ -0,0 +1,4 @@
1
+ export { Gitd, type GitdOptions } from "./gitd.js";
2
+ export { GitdError } from "./errors.js";
3
+ export type * from "./types.js";
4
+ export * as proto from "./gen/gitd/v1/gitd_pb.js";
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { Gitd } from "./gitd.js";
2
+ export { GitdError } from "./errors.js";
3
+ export * as proto from "./gen/gitd/v1/gitd_pb.js";
@@ -0,0 +1,126 @@
1
+ import type { Progress } from "./gen/gitd/v1/gitd_pb.js";
2
+ /** How a workspace was made: a layer on a shared template, a block clone, or every file written. */
3
+ export type StrategyName = "overlay" | "reflink" | "copy";
4
+ /** Where a workspace ended up. */
5
+ export interface Workspace {
6
+ path: string;
7
+ commit: string;
8
+ /** The branch it follows; empty when detached at a commit. */
9
+ branch: string;
10
+ strategy: StrategyName;
11
+ /** An overlay workspace's template (lower) and its own layer (upper, work). */
12
+ layers?: Layers;
13
+ /** Submodules that could not be checked out, and why. */
14
+ pendingSubmodules: PendingSubmodule[];
15
+ /** Files the repository keeps in git LFS: pointers here, as gitd does not download them. */
16
+ lfsPatterns: string[];
17
+ }
18
+ export interface Layers {
19
+ lower: string;
20
+ upper: string;
21
+ work: string;
22
+ }
23
+ export interface PendingSubmodule {
24
+ path: string;
25
+ url: string;
26
+ reason: string;
27
+ }
28
+ /** What a workspace is on disk. */
29
+ export interface Description {
30
+ url: string;
31
+ commit: string;
32
+ branch: string;
33
+ /** Whether there are uncommitted changes. */
34
+ modified: boolean;
35
+ strategy: StrategyName;
36
+ submodules: Submodule[];
37
+ /** Files kept in git LFS, which are pointers here. */
38
+ lfsPatterns: string[];
39
+ }
40
+ export interface Submodule {
41
+ path: string;
42
+ url: string;
43
+ commit: string;
44
+ checkedOut: boolean;
45
+ }
46
+ /** What a publish pushed: the workspace's repository first, then each submodule. */
47
+ export interface Published {
48
+ branch: string;
49
+ repositories: PublishedRepository[];
50
+ }
51
+ export interface PublishedRepository {
52
+ url: string;
53
+ /** The submodule's path; empty for the workspace's own repository. */
54
+ path: string;
55
+ commit: string;
56
+ /** The subjects of the new commits, newest first. */
57
+ subjects: string[];
58
+ }
59
+ /** Which gitd answers, and how it makes workspaces on its machine. */
60
+ export interface Info {
61
+ version: string;
62
+ gitVersion: string;
63
+ pools: number;
64
+ poolsBytes: number;
65
+ templates: number;
66
+ templatesBytes: number;
67
+ strategy: StrategyName;
68
+ strategyReason: string;
69
+ }
70
+ /** Whether a repository can be read, and its branches. */
71
+ export interface Probe {
72
+ access: "public" | "reachable" | "denied";
73
+ defaultBranch: string;
74
+ /** Each branch and the commit it points at. */
75
+ branches: Record<string, string>;
76
+ /** Why it cannot be read, when denied. */
77
+ denied?: string;
78
+ }
79
+ /** One publish, done or refused, as the audit log keeps it. */
80
+ export interface AuditEntry {
81
+ time: Date;
82
+ /** The workspace's path, as the caller gave it. */
83
+ workspace: string;
84
+ /** The workspace's repository; empty when the workspace could not be opened. */
85
+ url: string;
86
+ branch: string;
87
+ /** What was pushed, the workspace's repository first; empty when refused. */
88
+ repositories: PublishedRepository[];
89
+ /** Why it was refused, when it was. */
90
+ refused?: {
91
+ reason: string;
92
+ said: string;
93
+ };
94
+ }
95
+ export interface AuditOptions {
96
+ /** Only the publishes from this time on. */
97
+ since?: Date;
98
+ /** Only the publishes of this repository, by its URL. */
99
+ url?: string;
100
+ /** At most this many: 100 by default, never more than 1000. */
101
+ limit?: number;
102
+ }
103
+ /** Options of a call that streams progress. */
104
+ export interface Progressing {
105
+ /** Told what git is doing while the call runs. */
106
+ onProgress?: (progress: Progress) => void;
107
+ signal?: AbortSignal;
108
+ }
109
+ export interface PrepareOptions extends Progressing {
110
+ url: string;
111
+ path: string;
112
+ branch?: string;
113
+ commit?: string;
114
+ submodules?: boolean;
115
+ fullHistory?: boolean;
116
+ /** A preference; gitd falls back to copy when it cannot run here. */
117
+ strategy?: StrategyName;
118
+ }
119
+ export interface UpdateOptions extends Progressing {
120
+ /** The branch to follow; default: the one it follows. */
121
+ branch?: string;
122
+ submodules?: boolean;
123
+ }
124
+ export interface CheckoutOptions extends Progressing {
125
+ submodules?: boolean;
126
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};