@leed-ai/git-gateway-contract 0.0.0-stage → 0.1.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.
Files changed (286) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +50 -2
  3. package/dist/behaviour/assertions.d.ts +23 -0
  4. package/dist/behaviour/assertions.js +56 -0
  5. package/dist/behaviour/assertions.js.map +1 -0
  6. package/dist/behaviour/behaviour-case.d.ts +19 -0
  7. package/dist/behaviour/behaviour-case.js +12 -0
  8. package/dist/behaviour/behaviour-case.js.map +1 -0
  9. package/dist/behaviour/behaviour-suite.d.ts +30 -0
  10. package/dist/behaviour/behaviour-suite.js +50 -0
  11. package/dist/behaviour/behaviour-suite.js.map +1 -0
  12. package/dist/behaviour/commit-action-cases.d.ts +4 -0
  13. package/dist/behaviour/commit-action-cases.js +342 -0
  14. package/dist/behaviour/commit-action-cases.js.map +1 -0
  15. package/dist/behaviour/commit-write-cases.d.ts +4 -0
  16. package/dist/behaviour/commit-write-cases.js +234 -0
  17. package/dist/behaviour/commit-write-cases.js.map +1 -0
  18. package/dist/behaviour/fixtures.d.ts +29 -0
  19. package/dist/behaviour/fixtures.js +83 -0
  20. package/dist/behaviour/fixtures.js.map +1 -0
  21. package/dist/behaviour/lifecycle-cases.d.ts +4 -0
  22. package/dist/behaviour/lifecycle-cases.js +158 -0
  23. package/dist/behaviour/lifecycle-cases.js.map +1 -0
  24. package/dist/behaviour/promote-cases.d.ts +4 -0
  25. package/dist/behaviour/promote-cases.js +122 -0
  26. package/dist/behaviour/promote-cases.js.map +1 -0
  27. package/dist/behaviour/read-cases.d.ts +4 -0
  28. package/dist/behaviour/read-cases.js +248 -0
  29. package/dist/behaviour/read-cases.js.map +1 -0
  30. package/dist/behaviour/sync-cases.d.ts +4 -0
  31. package/dist/behaviour/sync-cases.js +205 -0
  32. package/dist/behaviour/sync-cases.js.map +1 -0
  33. package/dist/clock-B3MlpmVY.d.ts +10 -0
  34. package/dist/commit-BEZmeAOl.d.ts +23 -0
  35. package/dist/file-map-CxUveLWz.d.ts +18 -0
  36. package/dist/gateway-config-oVsdTEeK.d.ts +39 -0
  37. package/dist/gateway-error-body-BWzZFAQI.d.ts +214 -0
  38. package/dist/gateway-error.d.ts +30 -0
  39. package/dist/gateway-error.js +63 -0
  40. package/dist/gateway-error.js.map +1 -0
  41. package/dist/git-gateway-VA9Tc5tn.d.ts +358 -0
  42. package/dist/git-gateway.d.ts +2 -0
  43. package/dist/git-gateway.js +65 -0
  44. package/dist/git-gateway.js.map +1 -0
  45. package/dist/health.d.ts +9 -0
  46. package/dist/health.js +18 -0
  47. package/dist/health.js.map +1 -0
  48. package/dist/history-CqvHaUE-.d.ts +20 -0
  49. package/dist/package-name.d.ts +3 -0
  50. package/dist/package-name.js +6 -0
  51. package/dist/package-name.js.map +1 -0
  52. package/dist/proxy/audit-event.d.ts +61 -0
  53. package/dist/proxy/audit-event.js +97 -0
  54. package/dist/proxy/audit-event.js.map +1 -0
  55. package/dist/proxy/branch-rule.d.ts +72 -0
  56. package/dist/proxy/branch-rule.js +106 -0
  57. package/dist/proxy/branch-rule.js.map +1 -0
  58. package/dist/proxy/gateway-hooks.d.ts +58 -0
  59. package/dist/proxy/gateway-hooks.js +0 -0
  60. package/dist/proxy/git-operation.d.ts +17 -0
  61. package/dist/proxy/git-operation.js +32 -0
  62. package/dist/proxy/git-operation.js.map +1 -0
  63. package/dist/proxy/policy-result.d.ts +51 -0
  64. package/dist/proxy/policy-result.js +90 -0
  65. package/dist/proxy/policy-result.js.map +1 -0
  66. package/dist/proxy/principal.d.ts +18 -0
  67. package/dist/proxy/principal.js +32 -0
  68. package/dist/proxy/principal.js.map +1 -0
  69. package/dist/proxy/push-policy-result.d.ts +34 -0
  70. package/dist/proxy/push-policy-result.js +48 -0
  71. package/dist/proxy/push-policy-result.js.map +1 -0
  72. package/dist/proxy/push-policy.d.ts +146 -0
  73. package/dist/proxy/push-policy.js +112 -0
  74. package/dist/proxy/push-policy.js.map +1 -0
  75. package/dist/proxy/request-credential.d.ts +22 -0
  76. package/dist/proxy/request-credential.js +46 -0
  77. package/dist/proxy/request-credential.js.map +1 -0
  78. package/dist/proxy/smart-http-config.d.ts +22 -0
  79. package/dist/proxy/smart-http-config.js +40 -0
  80. package/dist/proxy/smart-http-config.js.map +1 -0
  81. package/dist/reference/apply-actions.d.ts +9 -0
  82. package/dist/reference/apply-actions.js +84 -0
  83. package/dist/reference/apply-actions.js.map +1 -0
  84. package/dist/reference/branch-methods.d.ts +7 -0
  85. package/dist/reference/branch-methods.js +105 -0
  86. package/dist/reference/branch-methods.js.map +1 -0
  87. package/dist/reference/bytes.d.ts +22 -0
  88. package/dist/reference/bytes.js +62 -0
  89. package/dist/reference/bytes.js.map +1 -0
  90. package/dist/reference/clock.d.ts +2 -0
  91. package/dist/reference/clock.js +18 -0
  92. package/dist/reference/clock.js.map +1 -0
  93. package/dist/reference/commit-method.d.ts +5 -0
  94. package/dist/reference/commit-method.js +83 -0
  95. package/dist/reference/commit-method.js.map +1 -0
  96. package/dist/reference/file-map.d.ts +2 -0
  97. package/dist/reference/file-map.js +24 -0
  98. package/dist/reference/file-map.js.map +1 -0
  99. package/dist/reference/hash.d.ts +10 -0
  100. package/dist/reference/hash.js +25 -0
  101. package/dist/reference/hash.js.map +1 -0
  102. package/dist/reference/history.d.ts +2 -0
  103. package/dist/reference/history.js +65 -0
  104. package/dist/reference/history.js.map +1 -0
  105. package/dist/reference/lifecycle-methods.d.ts +9 -0
  106. package/dist/reference/lifecycle-methods.js +48 -0
  107. package/dist/reference/lifecycle-methods.js.map +1 -0
  108. package/dist/reference/read-methods.d.ts +13 -0
  109. package/dist/reference/read-methods.js +68 -0
  110. package/dist/reference/read-methods.js.map +1 -0
  111. package/dist/reference/reference-gateway.d.ts +18 -0
  112. package/dist/reference/reference-gateway.js +35 -0
  113. package/dist/reference/reference-gateway.js.map +1 -0
  114. package/dist/reference/repo-state.d.ts +43 -0
  115. package/dist/reference/repo-state.js +45 -0
  116. package/dist/reference/repo-state.js.map +1 -0
  117. package/dist/reference/run-method.d.ts +13 -0
  118. package/dist/reference/run-method.js +15 -0
  119. package/dist/reference/run-method.js.map +1 -0
  120. package/dist/reference/three-way-merge.d.ts +16 -0
  121. package/dist/reference/three-way-merge.js +45 -0
  122. package/dist/reference/three-way-merge.js.map +1 -0
  123. package/dist/reference/trailer.d.ts +7 -0
  124. package/dist/reference/trailer.js +16 -0
  125. package/dist/reference/trailer.js.map +1 -0
  126. package/dist/reference/tree-index.d.ts +2 -0
  127. package/dist/reference/tree-index.js +66 -0
  128. package/dist/reference/tree-index.js.map +1 -0
  129. package/dist/reference/write-commit.d.ts +15 -0
  130. package/dist/reference/write-commit.js +44 -0
  131. package/dist/reference/write-commit.js.map +1 -0
  132. package/dist/rpc/commit-exists.d.ts +16 -0
  133. package/dist/rpc/commit-exists.js +30 -0
  134. package/dist/rpc/commit-exists.js.map +1 -0
  135. package/dist/rpc/commit.d.ts +172 -0
  136. package/dist/rpc/commit.js +115 -0
  137. package/dist/rpc/commit.js.map +1 -0
  138. package/dist/rpc/list-tree.d.ts +59 -0
  139. package/dist/rpc/list-tree.js +54 -0
  140. package/dist/rpc/list-tree.js.map +1 -0
  141. package/dist/rpc/log.d.ts +35 -0
  142. package/dist/rpc/log.js +41 -0
  143. package/dist/rpc/log.js.map +1 -0
  144. package/dist/rpc/mint-read-token.d.ts +17 -0
  145. package/dist/rpc/mint-read-token.js +36 -0
  146. package/dist/rpc/mint-read-token.js.map +1 -0
  147. package/dist/rpc/promote.d.ts +39 -0
  148. package/dist/rpc/promote.js +69 -0
  149. package/dist/rpc/promote.js.map +1 -0
  150. package/dist/rpc/read-file.d.ts +44 -0
  151. package/dist/rpc/read-file.js +56 -0
  152. package/dist/rpc/read-file.js.map +1 -0
  153. package/dist/rpc/repo-lifecycle.d.ts +39 -0
  154. package/dist/rpc/repo-lifecycle.js +64 -0
  155. package/dist/rpc/repo-lifecycle.js.map +1 -0
  156. package/dist/rpc/resolve-ref.d.ts +15 -0
  157. package/dist/rpc/resolve-ref.js +28 -0
  158. package/dist/rpc/resolve-ref.js.map +1 -0
  159. package/dist/rpc/sync-branch.d.ts +107 -0
  160. package/dist/rpc/sync-branch.js +114 -0
  161. package/dist/rpc/sync-branch.js.map +1 -0
  162. package/dist/schemas/commit-action.d.ts +100 -0
  163. package/dist/schemas/commit-action.js +138 -0
  164. package/dist/schemas/commit-action.js.map +1 -0
  165. package/dist/schemas/commit.d.ts +2 -0
  166. package/dist/schemas/commit.js +24 -0
  167. package/dist/schemas/commit.js.map +1 -0
  168. package/dist/schemas/content-encoding.d.ts +24 -0
  169. package/dist/schemas/content-encoding.js +41 -0
  170. package/dist/schemas/content-encoding.js.map +1 -0
  171. package/dist/schemas/examples.d.ts +38 -0
  172. package/dist/schemas/examples.js +32 -0
  173. package/dist/schemas/examples.js.map +1 -0
  174. package/dist/schemas/gateway-config.d.ts +2 -0
  175. package/dist/schemas/gateway-config.js +72 -0
  176. package/dist/schemas/gateway-config.js.map +1 -0
  177. package/dist/schemas/gateway-error-body.d.ts +2 -0
  178. package/dist/schemas/gateway-error-body.js +188 -0
  179. package/dist/schemas/gateway-error-body.js.map +1 -0
  180. package/dist/schemas/identity.d.ts +21 -0
  181. package/dist/schemas/identity.js +40 -0
  182. package/dist/schemas/identity.js.map +1 -0
  183. package/dist/schemas/names.d.ts +26 -0
  184. package/dist/schemas/names.js +58 -0
  185. package/dist/schemas/names.js.map +1 -0
  186. package/dist/schemas/ref-update.d.ts +10 -0
  187. package/dist/schemas/ref-update.js +25 -0
  188. package/dist/schemas/ref-update.js.map +1 -0
  189. package/dist/schemas/sha.d.ts +8 -0
  190. package/dist/schemas/sha.js +14 -0
  191. package/dist/schemas/sha.js.map +1 -0
  192. package/dist/schemas/tree-entry.d.ts +2 -0
  193. package/dist/schemas/tree-entry.js +62 -0
  194. package/dist/schemas/tree-entry.js.map +1 -0
  195. package/dist/storage/git-remote.d.ts +17 -0
  196. package/dist/storage/git-remote.js +31 -0
  197. package/dist/storage/git-remote.js.map +1 -0
  198. package/dist/storage/storage-backend.d.ts +61 -0
  199. package/dist/storage/storage-backend.js +0 -0
  200. package/dist/storage/storage-errors.d.ts +12 -0
  201. package/dist/storage/storage-errors.js +22 -0
  202. package/dist/storage/storage-errors.js.map +1 -0
  203. package/dist/storage/storage-input.d.ts +7 -0
  204. package/dist/storage/storage-input.js +14 -0
  205. package/dist/storage/storage-input.js.map +1 -0
  206. package/dist/storage/storage-read.d.ts +13 -0
  207. package/dist/storage/storage-read.js +30 -0
  208. package/dist/storage/storage-read.js.map +1 -0
  209. package/dist/storage/storage-repo-info.d.ts +16 -0
  210. package/dist/storage/storage-repo-info.js +30 -0
  211. package/dist/storage/storage-repo-info.js.map +1 -0
  212. package/dist/storage/storage-tree-entry.d.ts +21 -0
  213. package/dist/storage/storage-tree-entry.js +17 -0
  214. package/dist/storage/storage-tree-entry.js.map +1 -0
  215. package/dist/tree-entry-BM_1gou1.d.ts +41 -0
  216. package/dist/tree-index-Bk721Phv.d.ts +14 -0
  217. package/package.json +401 -4
  218. package/src/behaviour/assertions.ts +75 -0
  219. package/src/behaviour/behaviour-case.ts +28 -0
  220. package/src/behaviour/behaviour-suite.ts +76 -0
  221. package/src/behaviour/commit-action-cases.ts +253 -0
  222. package/src/behaviour/commit-write-cases.ts +205 -0
  223. package/src/behaviour/fixtures.ts +103 -0
  224. package/src/behaviour/lifecycle-cases.ts +104 -0
  225. package/src/behaviour/promote-cases.ts +78 -0
  226. package/src/behaviour/read-cases.ts +176 -0
  227. package/src/behaviour/sync-cases.ts +156 -0
  228. package/src/gateway-error.ts +72 -0
  229. package/src/git-gateway.ts +76 -0
  230. package/src/health.ts +26 -0
  231. package/src/package-name.ts +4 -0
  232. package/src/proxy/audit-event.ts +135 -0
  233. package/src/proxy/branch-rule.ts +190 -0
  234. package/src/proxy/gateway-hooks.ts +67 -0
  235. package/src/proxy/git-operation.ts +36 -0
  236. package/src/proxy/policy-result.ts +127 -0
  237. package/src/proxy/principal.ts +81 -0
  238. package/src/proxy/push-policy-result.ts +86 -0
  239. package/src/proxy/push-policy.ts +158 -0
  240. package/src/proxy/request-credential.ts +47 -0
  241. package/src/proxy/smart-http-config.ts +158 -0
  242. package/src/reference/apply-actions.ts +96 -0
  243. package/src/reference/branch-methods.ts +105 -0
  244. package/src/reference/bytes.ts +66 -0
  245. package/src/reference/clock.ts +19 -0
  246. package/src/reference/commit-method.ts +97 -0
  247. package/src/reference/file-map.ts +35 -0
  248. package/src/reference/hash.ts +25 -0
  249. package/src/reference/history.ts +78 -0
  250. package/src/reference/lifecycle-methods.ts +52 -0
  251. package/src/reference/read-methods.ts +87 -0
  252. package/src/reference/reference-gateway.ts +50 -0
  253. package/src/reference/repo-state.ts +83 -0
  254. package/src/reference/run-method.ts +25 -0
  255. package/src/reference/three-way-merge.ts +42 -0
  256. package/src/reference/trailer.ts +18 -0
  257. package/src/reference/tree-index.ts +65 -0
  258. package/src/reference/write-commit.ts +44 -0
  259. package/src/rpc/commit-exists.ts +46 -0
  260. package/src/rpc/commit.ts +156 -0
  261. package/src/rpc/list-tree.ts +78 -0
  262. package/src/rpc/log.ts +51 -0
  263. package/src/rpc/mint-read-token.ts +59 -0
  264. package/src/rpc/promote.ts +72 -0
  265. package/src/rpc/read-file.ts +75 -0
  266. package/src/rpc/repo-lifecycle.ts +103 -0
  267. package/src/rpc/resolve-ref.ts +41 -0
  268. package/src/rpc/sync-branch.ts +149 -0
  269. package/src/schemas/commit-action.ts +157 -0
  270. package/src/schemas/commit.ts +43 -0
  271. package/src/schemas/content-encoding.ts +58 -0
  272. package/src/schemas/examples.ts +24 -0
  273. package/src/schemas/gateway-config.ts +116 -0
  274. package/src/schemas/gateway-error-body.ts +230 -0
  275. package/src/schemas/identity.ts +57 -0
  276. package/src/schemas/names.ts +126 -0
  277. package/src/schemas/ref-update.ts +38 -0
  278. package/src/schemas/sha.ts +20 -0
  279. package/src/schemas/tree-entry.ts +72 -0
  280. package/src/storage/git-remote.ts +58 -0
  281. package/src/storage/storage-backend.ts +65 -0
  282. package/src/storage/storage-errors.ts +24 -0
  283. package/src/storage/storage-input.ts +14 -0
  284. package/src/storage/storage-read.ts +45 -0
  285. package/src/storage/storage-repo-info.ts +46 -0
  286. package/src/storage/storage-tree-entry.ts +20 -0
@@ -0,0 +1,107 @@
1
+ import { z } from "zod";
2
+ /** Input of `syncBranch`. */
3
+ export declare const SyncBranchInput: z.ZodObject<{
4
+ repo: z.ZodString;
5
+ from: z.ZodString;
6
+ into: z.ZodString;
7
+ author: z.ZodOptional<z.ZodObject<{
8
+ name: z.ZodString;
9
+ email: z.ZodEmail;
10
+ }, z.core.$strict>>;
11
+ message: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strict>;
13
+ /** Input of `syncBranch`, inferred from {@link SyncBranchInput}. */
14
+ export type SyncBranchInput = z.input<typeof SyncBranchInput>;
15
+ /** `into` already contains `from`. */
16
+ export declare const SyncUpToDate: z.ZodObject<{
17
+ status: z.ZodLiteral<"up_to_date">;
18
+ head: z.ZodString;
19
+ }, z.core.$strict>;
20
+ /** `into` had no commits of its own and was fast-forwarded. */
21
+ export declare const SyncFastForward: z.ZodObject<{
22
+ status: z.ZodLiteral<"fast_forward">;
23
+ refUpdate: z.ZodObject<{
24
+ ref: z.ZodString;
25
+ oldSha: z.ZodString;
26
+ newSha: z.ZodString;
27
+ }, z.core.$strict>;
28
+ }, z.core.$strict>;
29
+ /** Both sides had commits; a merge commit was written. */
30
+ export declare const SyncMerged: z.ZodObject<{
31
+ status: z.ZodLiteral<"merged">;
32
+ commit: z.ZodObject<{
33
+ sha: z.ZodString;
34
+ tree: z.ZodString;
35
+ parents: z.ZodArray<z.ZodString>;
36
+ author: z.ZodObject<{
37
+ name: z.ZodString;
38
+ email: z.ZodEmail;
39
+ date: z.ZodISODateTime;
40
+ }, z.core.$strict>;
41
+ committer: z.ZodObject<{
42
+ name: z.ZodString;
43
+ email: z.ZodEmail;
44
+ date: z.ZodISODateTime;
45
+ }, z.core.$strict>;
46
+ message: z.ZodString;
47
+ idempotencyKey: z.ZodNullable<z.ZodString>;
48
+ }, z.core.$strict>;
49
+ refUpdate: z.ZodObject<{
50
+ ref: z.ZodString;
51
+ oldSha: z.ZodString;
52
+ newSha: z.ZodString;
53
+ }, z.core.$strict>;
54
+ }, z.core.$strict>;
55
+ /** Both sides changed the same paths differently; nothing was written. */
56
+ export declare const SyncConflict: z.ZodObject<{
57
+ status: z.ZodLiteral<"conflict">;
58
+ paths: z.ZodArray<z.ZodString>;
59
+ base: z.ZodString;
60
+ fromHead: z.ZodString;
61
+ intoHead: z.ZodString;
62
+ }, z.core.$strict>;
63
+ /** Output of `syncBranch`, discriminated by `status`. */
64
+ export declare const SyncBranchOutput: z.ZodDiscriminatedUnion<[z.ZodObject<{
65
+ status: z.ZodLiteral<"up_to_date">;
66
+ head: z.ZodString;
67
+ }, z.core.$strict>, z.ZodObject<{
68
+ status: z.ZodLiteral<"fast_forward">;
69
+ refUpdate: z.ZodObject<{
70
+ ref: z.ZodString;
71
+ oldSha: z.ZodString;
72
+ newSha: z.ZodString;
73
+ }, z.core.$strict>;
74
+ }, z.core.$strict>, z.ZodObject<{
75
+ status: z.ZodLiteral<"merged">;
76
+ commit: z.ZodObject<{
77
+ sha: z.ZodString;
78
+ tree: z.ZodString;
79
+ parents: z.ZodArray<z.ZodString>;
80
+ author: z.ZodObject<{
81
+ name: z.ZodString;
82
+ email: z.ZodEmail;
83
+ date: z.ZodISODateTime;
84
+ }, z.core.$strict>;
85
+ committer: z.ZodObject<{
86
+ name: z.ZodString;
87
+ email: z.ZodEmail;
88
+ date: z.ZodISODateTime;
89
+ }, z.core.$strict>;
90
+ message: z.ZodString;
91
+ idempotencyKey: z.ZodNullable<z.ZodString>;
92
+ }, z.core.$strict>;
93
+ refUpdate: z.ZodObject<{
94
+ ref: z.ZodString;
95
+ oldSha: z.ZodString;
96
+ newSha: z.ZodString;
97
+ }, z.core.$strict>;
98
+ }, z.core.$strict>, z.ZodObject<{
99
+ status: z.ZodLiteral<"conflict">;
100
+ paths: z.ZodArray<z.ZodString>;
101
+ base: z.ZodString;
102
+ fromHead: z.ZodString;
103
+ intoHead: z.ZodString;
104
+ }, z.core.$strict>], "status">;
105
+ /** Output of `syncBranch`, inferred from {@link SyncBranchOutput}. */
106
+ export type SyncBranchOutput = z.infer<typeof SyncBranchOutput>;
107
+ //# sourceMappingURL=sync-branch.d.ts.map
@@ -0,0 +1,114 @@
1
+ import { Commit } from "../schemas/commit.js";
2
+ import { EXAMPLE_COMMIT, EXAMPLE_SHA_A, EXAMPLE_SHA_B } from "../schemas/examples.js";
3
+ import { Identity } from "../schemas/identity.js";
4
+ import { BranchName, FilePath, RepoName } from "../schemas/names.js";
5
+ import { RefUpdate } from "../schemas/ref-update.js";
6
+ import { Sha } from "../schemas/sha.js";
7
+ import { z } from "zod";
8
+ // src/rpc/sync-branch.ts
9
+ /** Input of `syncBranch`. */
10
+ const SyncBranchInput = z.object({
11
+ repo: RepoName.describe("Repository holding both branches."),
12
+ from: BranchName.describe("Branch whose commits are brought into `into`."),
13
+ into: BranchName.describe("Branch brought up to date; never rewritten, only fast-forwarded or merged into."),
14
+ author: Identity.optional().describe("Author and committer of a merge commit, if one is needed. Absent: the configured service identity."),
15
+ message: z.string().min(1).max(65536).optional().describe("Message of a merge commit, if one is needed. Absent: \"Merge branch '<from>' into <into>\".")
16
+ }).strict().refine((input) => input.from !== input.into, {
17
+ message: "from and into must differ",
18
+ path: ["into"]
19
+ }).meta({
20
+ id: "SyncBranchInput",
21
+ title: "syncBranch input",
22
+ description: "Input of syncBranch(): bring `into` up to date with `from` without rewriting `into`. Fails with ref_not_found if either branch is missing and unrelated_histories if they share no ancestor.",
23
+ examples: [{
24
+ repo: "acme-raw-content",
25
+ from: "main",
26
+ into: "staging"
27
+ }]
28
+ });
29
+ /** `into` already contains `from`. */
30
+ const SyncUpToDate = z.object({
31
+ status: z.literal("up_to_date").describe("`into` already contains the head of `from`; nothing changed."),
32
+ head: Sha.describe("The head of `into`, unchanged.")
33
+ }).strict().meta({
34
+ id: "SyncUpToDate",
35
+ title: "syncBranch: up to date",
36
+ description: "syncBranch() found that `into` already contains the head of `from`.",
37
+ examples: [{
38
+ status: "up_to_date",
39
+ head: EXAMPLE_SHA_A
40
+ }]
41
+ });
42
+ /** `into` had no commits of its own and was fast-forwarded. */
43
+ const SyncFastForward = z.object({
44
+ status: z.literal("fast_forward").describe("`into` had no commits of its own and now points at the head of `from`."),
45
+ refUpdate: RefUpdate.describe("How `into` moved.")
46
+ }).strict().meta({
47
+ id: "SyncFastForward",
48
+ title: "syncBranch: fast-forward",
49
+ description: "syncBranch() fast-forwarded `into` to the head of `from` with a ref update naming the old head.",
50
+ examples: [{
51
+ status: "fast_forward",
52
+ refUpdate: {
53
+ ref: "refs/heads/staging",
54
+ oldSha: EXAMPLE_SHA_A,
55
+ newSha: EXAMPLE_SHA_B
56
+ }
57
+ }]
58
+ });
59
+ /** Both sides had commits; a merge commit was written. */
60
+ const SyncMerged = z.object({
61
+ status: z.literal("merged").describe("Both branches had commits; a file-level merge commit was written to `into`."),
62
+ commit: Commit.describe("The merge commit; its parents are the old head of `into`, then the head of `from`."),
63
+ refUpdate: RefUpdate.describe("How `into` moved.")
64
+ }).strict().meta({
65
+ id: "SyncMerged",
66
+ title: "syncBranch: merged",
67
+ description: "syncBranch() merged file by file against the merge base: a path changed on one side takes that side.",
68
+ examples: [{
69
+ status: "merged",
70
+ commit: EXAMPLE_COMMIT,
71
+ refUpdate: {
72
+ ref: "refs/heads/staging",
73
+ oldSha: EXAMPLE_SHA_A,
74
+ newSha: EXAMPLE_SHA_B
75
+ }
76
+ }]
77
+ });
78
+ /** Both sides changed the same paths differently; nothing was written. */
79
+ const SyncConflict = z.object({
80
+ status: z.literal("conflict").describe("Some paths changed differently on both sides; nothing was written."),
81
+ paths: z.array(FilePath.describe("A conflicting path.")).min(1).describe("Every conflicting path, sorted in byte order: changed differently on both sides, or a file on one side where the other has a directory."),
82
+ base: Sha.describe("The merge base used."),
83
+ fromHead: Sha.describe("The head of `from` merged."),
84
+ intoHead: Sha.describe("The head of `into`, unchanged.")
85
+ }).strict().meta({
86
+ id: "SyncConflict",
87
+ title: "syncBranch: conflict",
88
+ description: "syncBranch() could not merge: the listed paths conflict. `into` is unchanged.",
89
+ examples: [{
90
+ status: "conflict",
91
+ paths: ["content/about.md"],
92
+ base: "4b825dc642cb6eb9a060e54bf8d69288fbee4904",
93
+ fromHead: EXAMPLE_SHA_B,
94
+ intoHead: EXAMPLE_SHA_A
95
+ }]
96
+ });
97
+ /** Output of `syncBranch`, discriminated by `status`. */
98
+ const SyncBranchOutput = z.discriminatedUnion("status", [
99
+ SyncUpToDate,
100
+ SyncFastForward,
101
+ SyncMerged,
102
+ SyncConflict
103
+ ]).meta({
104
+ id: "SyncBranchOutput",
105
+ title: "syncBranch output",
106
+ description: "Output of syncBranch(), discriminated by `status`.",
107
+ examples: [{
108
+ status: "up_to_date",
109
+ head: EXAMPLE_SHA_A
110
+ }]
111
+ });
112
+ export { SyncBranchInput, SyncBranchOutput, SyncConflict, SyncFastForward, SyncMerged, SyncUpToDate };
113
+
114
+ //# sourceMappingURL=sync-branch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-branch.js","names":[],"sources":["../../src/rpc/sync-branch.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { z } from 'zod';\n\nimport { Commit } from '../schemas/commit.ts';\nimport { EXAMPLE_COMMIT, EXAMPLE_SHA_A, EXAMPLE_SHA_B } from '../schemas/examples.ts';\nimport { Identity } from '../schemas/identity.ts';\nimport { BranchName, FilePath, RepoName } from '../schemas/names.ts';\nimport { RefUpdate } from '../schemas/ref-update.ts';\nimport { Sha } from '../schemas/sha.ts';\n\n/** Input of `syncBranch`. */\nexport const SyncBranchInput = z\n .object({\n repo: RepoName.describe('Repository holding both branches.'),\n from: BranchName.describe('Branch whose commits are brought into `into`.'),\n into: BranchName.describe(\n 'Branch brought up to date; never rewritten, only fast-forwarded or merged into.',\n ),\n author: Identity.optional().describe(\n 'Author and committer of a merge commit, if one is needed. Absent: the configured service identity.',\n ),\n message: z\n .string()\n .min(1)\n .max(65_536)\n .optional()\n .describe(\n 'Message of a merge commit, if one is needed. Absent: \"Merge branch \\'<from>\\' into <into>\".',\n ),\n })\n .strict()\n .refine((input) => input.from !== input.into, { message: 'from and into must differ', path: ['into'] })\n .meta({\n id: 'SyncBranchInput',\n title: 'syncBranch input',\n description:\n 'Input of syncBranch(): bring `into` up to date with `from` without rewriting `into`. Fails with ref_not_found if either branch is missing and unrelated_histories if they share no ancestor.',\n examples: [{ repo: 'acme-raw-content', from: 'main', into: 'staging' }],\n });\n\n/** Input of `syncBranch`, inferred from {@link SyncBranchInput}. */\nexport type SyncBranchInput = z.input<typeof SyncBranchInput>;\n\n/** `into` already contains `from`. */\nexport const SyncUpToDate = z\n .object({\n status: z.literal('up_to_date').describe('`into` already contains the head of `from`; nothing changed.'),\n head: Sha.describe('The head of `into`, unchanged.'),\n })\n .strict()\n .meta({\n id: 'SyncUpToDate',\n title: 'syncBranch: up to date',\n description: 'syncBranch() found that `into` already contains the head of `from`.',\n examples: [{ status: 'up_to_date', head: EXAMPLE_SHA_A }],\n });\n\n/** `into` had no commits of its own and was fast-forwarded. */\nexport const SyncFastForward = z\n .object({\n status: z\n .literal('fast_forward')\n .describe('`into` had no commits of its own and now points at the head of `from`.'),\n refUpdate: RefUpdate.describe('How `into` moved.'),\n })\n .strict()\n .meta({\n id: 'SyncFastForward',\n title: 'syncBranch: fast-forward',\n description:\n 'syncBranch() fast-forwarded `into` to the head of `from` with a ref update naming the old head.',\n examples: [\n {\n status: 'fast_forward',\n refUpdate: { ref: 'refs/heads/staging', oldSha: EXAMPLE_SHA_A, newSha: EXAMPLE_SHA_B },\n },\n ],\n });\n\n/** Both sides had commits; a merge commit was written. */\nexport const SyncMerged = z\n .object({\n status: z\n .literal('merged')\n .describe('Both branches had commits; a file-level merge commit was written to `into`.'),\n commit: Commit.describe(\n 'The merge commit; its parents are the old head of `into`, then the head of `from`.',\n ),\n refUpdate: RefUpdate.describe('How `into` moved.'),\n })\n .strict()\n .meta({\n id: 'SyncMerged',\n title: 'syncBranch: merged',\n description:\n 'syncBranch() merged file by file against the merge base: a path changed on one side takes that side.',\n examples: [\n {\n status: 'merged',\n commit: EXAMPLE_COMMIT,\n refUpdate: { ref: 'refs/heads/staging', oldSha: EXAMPLE_SHA_A, newSha: EXAMPLE_SHA_B },\n },\n ],\n });\n\n/** Both sides changed the same paths differently; nothing was written. */\nexport const SyncConflict = z\n .object({\n status: z\n .literal('conflict')\n .describe('Some paths changed differently on both sides; nothing was written.'),\n paths: z\n .array(FilePath.describe('A conflicting path.'))\n .min(1)\n .describe(\n 'Every conflicting path, sorted in byte order: changed differently on both sides, or a file on one side where the other has a directory.',\n ),\n base: Sha.describe('The merge base used.'),\n fromHead: Sha.describe('The head of `from` merged.'),\n intoHead: Sha.describe('The head of `into`, unchanged.'),\n })\n .strict()\n .meta({\n id: 'SyncConflict',\n title: 'syncBranch: conflict',\n description: 'syncBranch() could not merge: the listed paths conflict. `into` is unchanged.',\n examples: [\n {\n status: 'conflict',\n paths: ['content/about.md'],\n base: '4b825dc642cb6eb9a060e54bf8d69288fbee4904',\n fromHead: EXAMPLE_SHA_B,\n intoHead: EXAMPLE_SHA_A,\n },\n ],\n });\n\n/** Output of `syncBranch`, discriminated by `status`. */\nexport const SyncBranchOutput = z\n .discriminatedUnion('status', [SyncUpToDate, SyncFastForward, SyncMerged, SyncConflict])\n .meta({\n id: 'SyncBranchOutput',\n title: 'syncBranch output',\n description: 'Output of syncBranch(), discriminated by `status`.',\n examples: [{ status: 'up_to_date', head: EXAMPLE_SHA_A }],\n });\n\n/** Output of `syncBranch`, inferred from {@link SyncBranchOutput}. */\nexport type SyncBranchOutput = z.infer<typeof SyncBranchOutput>;\n"],"mappings":";;;;;;;;;AAWA,MAAa,kBAAkB,EAC5B,OAAO;CACN,MAAM,SAAS,SAAS,mCAAmC;CAC3D,MAAM,WAAW,SAAS,+CAA+C;CACzE,MAAM,WAAW,SACf,iFACF;CACA,QAAQ,SAAS,SAAS,CAAC,CAAC,SAC1B,oGACF;CACA,SAAS,EACN,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,KAAM,CAAC,CACX,SAAS,CAAC,CACV,SACC,6FACF;AACJ,CAAC,CAAC,CACD,OAAO,CAAC,CACR,QAAQ,UAAU,MAAM,SAAS,MAAM,MAAM;CAAE,SAAS;CAA6B,MAAM,CAAC,MAAM;AAAE,CAAC,CAAC,CACtG,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC;EAAE,MAAM;EAAoB,MAAM;EAAQ,MAAM;CAAU,CAAC;AACxE,CAAC;;AAMH,MAAa,eAAe,EACzB,OAAO;CACN,QAAQ,EAAE,QAAQ,YAAY,CAAC,CAAC,SAAS,8DAA8D;CACvG,MAAM,IAAI,SAAS,gCAAgC;AACrD,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CAAC;EAAE,QAAQ;EAAc,MAAM;CAAc,CAAC;AAC1D,CAAC;;AAGH,MAAa,kBAAkB,EAC5B,OAAO;CACN,QAAQ,EACL,QAAQ,cAAc,CAAC,CACvB,SAAS,wEAAwE;CACpF,WAAW,UAAU,SAAS,mBAAmB;AACnD,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CACR;EACE,QAAQ;EACR,WAAW;GAAE,KAAK;GAAsB,QAAQ;GAAe,QAAQ;EAAc;CACvF,CACF;AACF,CAAC;;AAGH,MAAa,aAAa,EACvB,OAAO;CACN,QAAQ,EACL,QAAQ,QAAQ,CAAC,CACjB,SAAS,6EAA6E;CACzF,QAAQ,OAAO,SACb,oFACF;CACA,WAAW,UAAU,SAAS,mBAAmB;AACnD,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CACR;EACE,QAAQ;EACR,QAAQ;EACR,WAAW;GAAE,KAAK;GAAsB,QAAQ;GAAe,QAAQ;EAAc;CACvF,CACF;AACF,CAAC;;AAGH,MAAa,eAAe,EACzB,OAAO;CACN,QAAQ,EACL,QAAQ,UAAU,CAAC,CACnB,SAAS,oEAAoE;CAChF,OAAO,EACJ,MAAM,SAAS,SAAS,qBAAqB,CAAC,CAAC,CAC/C,IAAI,CAAC,CAAC,CACN,SACC,yIACF;CACF,MAAM,IAAI,SAAS,sBAAsB;CACzC,UAAU,IAAI,SAAS,4BAA4B;CACnD,UAAU,IAAI,SAAS,gCAAgC;AACzD,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CACR;EACE,QAAQ;EACR,OAAO,CAAC,kBAAkB;EAC1B,MAAM;EACN,UAAU;EACV,UAAU;CACZ,CACF;AACF,CAAC;;AAGH,MAAa,mBAAmB,EAC7B,mBAAmB,UAAU;CAAC;CAAc;CAAiB;CAAY;AAAY,CAAC,CAAC,CACvF,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CAAC;EAAE,QAAQ;EAAc,MAAM;CAAc,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { z } from "zod";
2
+ /** Create a file that must not exist yet. */
3
+ export declare const CreateAction: z.ZodObject<{
4
+ action: z.ZodLiteral<"create">;
5
+ path: z.ZodString;
6
+ content: z.ZodString;
7
+ encoding: z.ZodDefault<z.ZodEnum<{
8
+ base64: "base64";
9
+ text: "text";
10
+ }>>;
11
+ }, z.core.$strict>;
12
+ /** Replace the content of an existing file. */
13
+ export declare const UpdateAction: z.ZodObject<{
14
+ action: z.ZodLiteral<"update">;
15
+ path: z.ZodString;
16
+ content: z.ZodString;
17
+ encoding: z.ZodDefault<z.ZodEnum<{
18
+ base64: "base64";
19
+ text: "text";
20
+ }>>;
21
+ }, z.core.$strict>;
22
+ /** Create or replace a file. */
23
+ export declare const UpsertAction: z.ZodObject<{
24
+ action: z.ZodLiteral<"upsert">;
25
+ path: z.ZodString;
26
+ content: z.ZodString;
27
+ encoding: z.ZodDefault<z.ZodEnum<{
28
+ base64: "base64";
29
+ text: "text";
30
+ }>>;
31
+ }, z.core.$strict>;
32
+ /** Delete an existing file. */
33
+ export declare const DeleteAction: z.ZodObject<{
34
+ action: z.ZodLiteral<"delete">;
35
+ path: z.ZodString;
36
+ }, z.core.$strict>;
37
+ /** Move (rename) a file, optionally replacing its content. */
38
+ export declare const MoveAction: z.ZodObject<{
39
+ action: z.ZodLiteral<"move">;
40
+ path: z.ZodString;
41
+ previousPath: z.ZodString;
42
+ content: z.ZodOptional<z.ZodString>;
43
+ encoding: z.ZodDefault<z.ZodEnum<{
44
+ base64: "base64";
45
+ text: "text";
46
+ }>>;
47
+ }, z.core.$strict>;
48
+ /** Set or clear the executable bit of an existing file. */
49
+ export declare const ChmodAction: z.ZodObject<{
50
+ action: z.ZodLiteral<"chmod">;
51
+ path: z.ZodString;
52
+ executeFilemode: z.ZodBoolean;
53
+ }, z.core.$strict>;
54
+ /** One change in a commit, discriminated by `action`. */
55
+ export declare const CommitAction: z.ZodDiscriminatedUnion<[z.ZodObject<{
56
+ action: z.ZodLiteral<"create">;
57
+ path: z.ZodString;
58
+ content: z.ZodString;
59
+ encoding: z.ZodDefault<z.ZodEnum<{
60
+ base64: "base64";
61
+ text: "text";
62
+ }>>;
63
+ }, z.core.$strict>, z.ZodObject<{
64
+ action: z.ZodLiteral<"update">;
65
+ path: z.ZodString;
66
+ content: z.ZodString;
67
+ encoding: z.ZodDefault<z.ZodEnum<{
68
+ base64: "base64";
69
+ text: "text";
70
+ }>>;
71
+ }, z.core.$strict>, z.ZodObject<{
72
+ action: z.ZodLiteral<"upsert">;
73
+ path: z.ZodString;
74
+ content: z.ZodString;
75
+ encoding: z.ZodDefault<z.ZodEnum<{
76
+ base64: "base64";
77
+ text: "text";
78
+ }>>;
79
+ }, z.core.$strict>, z.ZodObject<{
80
+ action: z.ZodLiteral<"delete">;
81
+ path: z.ZodString;
82
+ }, z.core.$strict>, z.ZodObject<{
83
+ action: z.ZodLiteral<"move">;
84
+ path: z.ZodString;
85
+ previousPath: z.ZodString;
86
+ content: z.ZodOptional<z.ZodString>;
87
+ encoding: z.ZodDefault<z.ZodEnum<{
88
+ base64: "base64";
89
+ text: "text";
90
+ }>>;
91
+ }, z.core.$strict>, z.ZodObject<{
92
+ action: z.ZodLiteral<"chmod">;
93
+ path: z.ZodString;
94
+ executeFilemode: z.ZodBoolean;
95
+ }, z.core.$strict>], "action">;
96
+ /** One change in a commit, as accepted (before defaults). */
97
+ export type CommitActionInput = z.input<typeof CommitAction>;
98
+ /** One change in a commit, after parsing. */
99
+ export type CommitAction = z.output<typeof CommitAction>;
100
+ //# sourceMappingURL=commit-action.d.ts.map
@@ -0,0 +1,138 @@
1
+ import { ContentEncoding, FileContent, isBase64 } from "./content-encoding.js";
2
+ import { FilePath } from "./names.js";
3
+ import { z } from "zod";
4
+ // src/schemas/commit-action.ts
5
+ const encodingField = ContentEncoding.default("text").describe("How `content` is encoded; defaults to \"text\".");
6
+ /** Rejects base64 content that is not valid padded base64. */
7
+ function base64Valid(value) {
8
+ return value.encoding !== "base64" || value.content === void 0 || isBase64(value.content);
9
+ }
10
+ const base64Message = {
11
+ message: "content is not valid base64",
12
+ path: ["content"]
13
+ };
14
+ /** Create a file that must not exist yet. */
15
+ const CreateAction = z.object({
16
+ action: z.literal("create").describe("Create a new file. Fails with path_exists if the path exists."),
17
+ path: FilePath.describe("Path of the file to create; it and every parent must not already be a file."),
18
+ content: FileContent.describe("Content of the new file, encoded as `encoding` says."),
19
+ encoding: encodingField
20
+ }).strict().refine(base64Valid, base64Message).meta({
21
+ id: "CreateAction",
22
+ title: "Create action",
23
+ description: "Creates a file that does not exist yet. Fails with path_exists if the path is a file or a directory, and with path_conflict if a parent is a file. The new file is not executable.",
24
+ examples: [{
25
+ action: "create",
26
+ path: "content/about.md",
27
+ content: "# About\n",
28
+ encoding: "text"
29
+ }]
30
+ });
31
+ /** Replace the content of an existing file. */
32
+ const UpdateAction = z.object({
33
+ action: z.literal("update").describe("Replace an existing file. Fails with path_not_found if it is absent."),
34
+ path: FilePath.describe("Path of the existing file to replace."),
35
+ content: FileContent.describe("New content of the file, encoded as `encoding` says."),
36
+ encoding: encodingField
37
+ }).strict().refine(base64Valid, base64Message).meta({
38
+ id: "UpdateAction",
39
+ title: "Update action",
40
+ description: "Replaces the content of an existing file, keeping its executable bit. Fails with path_not_found if the path is not a file.",
41
+ examples: [{
42
+ action: "update",
43
+ path: "content/about.md",
44
+ content: "# About us\n",
45
+ encoding: "text"
46
+ }]
47
+ });
48
+ /** Create or replace a file. */
49
+ const UpsertAction = z.object({
50
+ action: z.literal("upsert").describe("Create the file, or replace it if it exists."),
51
+ path: FilePath.describe("Path of the file to create or replace."),
52
+ content: FileContent.describe("Content of the file, encoded as `encoding` says."),
53
+ encoding: encodingField
54
+ }).strict().refine(base64Valid, base64Message).meta({
55
+ id: "UpsertAction",
56
+ title: "Upsert action",
57
+ description: "Creates the file, or replaces it (keeping its executable bit) if it exists. Fails with path_exists if the path is a directory and path_conflict if a parent is a file. Not part of the GitLab Commits API.",
58
+ examples: [{
59
+ action: "upsert",
60
+ path: "assets/logo.png",
61
+ content: "iVBORw0KGgo=",
62
+ encoding: "base64"
63
+ }]
64
+ });
65
+ /** Delete an existing file. */
66
+ const DeleteAction = z.object({
67
+ action: z.literal("delete").describe("Delete an existing file. Fails with path_not_found if it is absent."),
68
+ path: FilePath.describe("Path of the file to delete. Directories left empty disappear with it.")
69
+ }).strict().meta({
70
+ id: "DeleteAction",
71
+ title: "Delete action",
72
+ description: "Deletes an existing file. Fails with path_not_found if the path is not a file (a directory cannot be deleted in one action).",
73
+ examples: [{
74
+ action: "delete",
75
+ path: "content/old.md"
76
+ }]
77
+ });
78
+ /** Move (rename) a file, optionally replacing its content. */
79
+ const MoveAction = z.object({
80
+ action: z.literal("move").describe("Move a file from `previousPath` to `path`."),
81
+ path: FilePath.describe("Destination path; it must not exist and no parent of it may be a file."),
82
+ previousPath: FilePath.describe("Path of the existing file to move."),
83
+ content: FileContent.optional().describe("New content for the moved file, encoded as `encoding` says. Absent: the content is kept."),
84
+ encoding: encodingField
85
+ }).strict().refine((value) => value.path !== value.previousPath, {
86
+ message: "path and previousPath must differ",
87
+ path: ["path"]
88
+ }).refine(base64Valid, base64Message).meta({
89
+ id: "MoveAction",
90
+ title: "Move action",
91
+ description: "Moves a file, keeping its executable bit and, unless `content` is given, its content. Fails with path_not_found if `previousPath` is not a file, path_exists if `path` exists, and path_conflict if a parent of `path` is a file.",
92
+ examples: [{
93
+ action: "move",
94
+ path: "content/new.md",
95
+ previousPath: "content/old.md",
96
+ encoding: "text"
97
+ }]
98
+ });
99
+ /** Set or clear the executable bit of an existing file. */
100
+ const ChmodAction = z.object({
101
+ action: z.literal("chmod").describe("Set or clear the executable bit of an existing file."),
102
+ path: FilePath.describe("Path of the existing file."),
103
+ executeFilemode: z.boolean().describe("true: mode 100755 (executable); false: mode 100644 (not executable).")
104
+ }).strict().meta({
105
+ id: "ChmodAction",
106
+ title: "Chmod action",
107
+ description: "Sets (true) or clears (false) the executable bit of an existing file. Fails with path_not_found if the path is not a file. Setting the bit it already has changes nothing.",
108
+ examples: [{
109
+ action: "chmod",
110
+ path: "scripts/build.sh",
111
+ executeFilemode: true
112
+ }]
113
+ });
114
+ /** One change in a commit, discriminated by `action`. */
115
+ const CommitAction = z.discriminatedUnion("action", [
116
+ CreateAction,
117
+ UpdateAction,
118
+ UpsertAction,
119
+ DeleteAction,
120
+ MoveAction,
121
+ ChmodAction
122
+ ]).meta({
123
+ id: "CommitAction",
124
+ title: "Commit action",
125
+ description: "One change in a commit, discriminated by `action`. Actions apply in order, each to the result of the one before, with the GitLab Commits API semantics (plus upsert).",
126
+ examples: [{
127
+ action: "create",
128
+ path: "content/about.md",
129
+ content: "# About\n",
130
+ encoding: "text"
131
+ }, {
132
+ action: "delete",
133
+ path: "content/old.md"
134
+ }]
135
+ });
136
+ export { ChmodAction, CommitAction, CreateAction, DeleteAction, MoveAction, UpdateAction, UpsertAction };
137
+
138
+ //# sourceMappingURL=commit-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit-action.js","names":[],"sources":["../../src/schemas/commit-action.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { z } from 'zod';\n\nimport { ContentEncoding, FileContent, isBase64 } from './content-encoding.ts';\nimport { FilePath } from './names.ts';\n\nconst encodingField = ContentEncoding.default('text').describe(\n 'How `content` is encoded; defaults to \"text\".',\n);\n\n/** Rejects base64 content that is not valid padded base64. */\nfunction base64Valid(value: { content?: string | undefined; encoding: 'text' | 'base64' }): boolean {\n return value.encoding !== 'base64' || value.content === undefined || isBase64(value.content);\n}\nconst base64Message = { message: 'content is not valid base64', path: ['content'] };\n\n/** Create a file that must not exist yet. */\nexport const CreateAction = z\n .object({\n action: z.literal('create').describe('Create a new file. Fails with path_exists if the path exists.'),\n path: FilePath.describe('Path of the file to create; it and every parent must not already be a file.'),\n content: FileContent.describe('Content of the new file, encoded as `encoding` says.'),\n encoding: encodingField,\n })\n .strict()\n .refine(base64Valid, base64Message)\n .meta({\n id: 'CreateAction',\n title: 'Create action',\n description:\n 'Creates a file that does not exist yet. Fails with path_exists if the path is a file or a directory, and with path_conflict if a parent is a file. The new file is not executable.',\n examples: [{ action: 'create', path: 'content/about.md', content: '# About\\n', encoding: 'text' }],\n });\n\n/** Replace the content of an existing file. */\nexport const UpdateAction = z\n .object({\n action: z\n .literal('update')\n .describe('Replace an existing file. Fails with path_not_found if it is absent.'),\n path: FilePath.describe('Path of the existing file to replace.'),\n content: FileContent.describe('New content of the file, encoded as `encoding` says.'),\n encoding: encodingField,\n })\n .strict()\n .refine(base64Valid, base64Message)\n .meta({\n id: 'UpdateAction',\n title: 'Update action',\n description:\n 'Replaces the content of an existing file, keeping its executable bit. Fails with path_not_found if the path is not a file.',\n examples: [{ action: 'update', path: 'content/about.md', content: '# About us\\n', encoding: 'text' }],\n });\n\n/** Create or replace a file. */\nexport const UpsertAction = z\n .object({\n action: z.literal('upsert').describe('Create the file, or replace it if it exists.'),\n path: FilePath.describe('Path of the file to create or replace.'),\n content: FileContent.describe('Content of the file, encoded as `encoding` says.'),\n encoding: encodingField,\n })\n .strict()\n .refine(base64Valid, base64Message)\n .meta({\n id: 'UpsertAction',\n title: 'Upsert action',\n description:\n 'Creates the file, or replaces it (keeping its executable bit) if it exists. Fails with path_exists if the path is a directory and path_conflict if a parent is a file. Not part of the GitLab Commits API.',\n examples: [{ action: 'upsert', path: 'assets/logo.png', content: 'iVBORw0KGgo=', encoding: 'base64' }],\n });\n\n/** Delete an existing file. */\nexport const DeleteAction = z\n .object({\n action: z\n .literal('delete')\n .describe('Delete an existing file. Fails with path_not_found if it is absent.'),\n path: FilePath.describe('Path of the file to delete. Directories left empty disappear with it.'),\n })\n .strict()\n .meta({\n id: 'DeleteAction',\n title: 'Delete action',\n description:\n 'Deletes an existing file. Fails with path_not_found if the path is not a file (a directory cannot be deleted in one action).',\n examples: [{ action: 'delete', path: 'content/old.md' }],\n });\n\n/** Move (rename) a file, optionally replacing its content. */\nexport const MoveAction = z\n .object({\n action: z.literal('move').describe('Move a file from `previousPath` to `path`.'),\n path: FilePath.describe('Destination path; it must not exist and no parent of it may be a file.'),\n previousPath: FilePath.describe('Path of the existing file to move.'),\n content: FileContent.optional().describe(\n 'New content for the moved file, encoded as `encoding` says. Absent: the content is kept.',\n ),\n encoding: encodingField,\n })\n .strict()\n .refine((value) => value.path !== value.previousPath, {\n message: 'path and previousPath must differ',\n path: ['path'],\n })\n .refine(base64Valid, base64Message)\n .meta({\n id: 'MoveAction',\n title: 'Move action',\n description:\n 'Moves a file, keeping its executable bit and, unless `content` is given, its content. Fails with path_not_found if `previousPath` is not a file, path_exists if `path` exists, and path_conflict if a parent of `path` is a file.',\n examples: [{ action: 'move', path: 'content/new.md', previousPath: 'content/old.md', encoding: 'text' }],\n });\n\n/** Set or clear the executable bit of an existing file. */\nexport const ChmodAction = z\n .object({\n action: z.literal('chmod').describe('Set or clear the executable bit of an existing file.'),\n path: FilePath.describe('Path of the existing file.'),\n executeFilemode: z\n .boolean()\n .describe('true: mode 100755 (executable); false: mode 100644 (not executable).'),\n })\n .strict()\n .meta({\n id: 'ChmodAction',\n title: 'Chmod action',\n description:\n 'Sets (true) or clears (false) the executable bit of an existing file. Fails with path_not_found if the path is not a file. Setting the bit it already has changes nothing.',\n examples: [{ action: 'chmod', path: 'scripts/build.sh', executeFilemode: true }],\n });\n\n/** One change in a commit, discriminated by `action`. */\nexport const CommitAction = z\n .discriminatedUnion('action', [\n CreateAction,\n UpdateAction,\n UpsertAction,\n DeleteAction,\n MoveAction,\n ChmodAction,\n ])\n .meta({\n id: 'CommitAction',\n title: 'Commit action',\n description:\n 'One change in a commit, discriminated by `action`. Actions apply in order, each to the result of the one before, with the GitLab Commits API semantics (plus upsert).',\n examples: [\n { action: 'create', path: 'content/about.md', content: '# About\\n', encoding: 'text' },\n { action: 'delete', path: 'content/old.md' },\n ],\n });\n\n/** One change in a commit, as accepted (before defaults). */\nexport type CommitActionInput = z.input<typeof CommitAction>;\n/** One change in a commit, after parsing. */\nexport type CommitAction = z.output<typeof CommitAction>;\n"],"mappings":";;;;AAMA,MAAM,gBAAgB,gBAAgB,QAAQ,MAAM,CAAC,CAAC,SACpD,iDACF;;AAGA,SAAS,YAAY,OAA+E;CAClG,OAAO,MAAM,aAAa,YAAY,MAAM,YAAY,KAAA,KAAa,SAAS,MAAM,OAAO;AAC7F;AACA,MAAM,gBAAgB;CAAE,SAAS;CAA+B,MAAM,CAAC,SAAS;AAAE;;AAGlF,MAAa,eAAe,EACzB,OAAO;CACN,QAAQ,EAAE,QAAQ,QAAQ,CAAC,CAAC,SAAS,+DAA+D;CACpG,MAAM,SAAS,SAAS,6EAA6E;CACrG,SAAS,YAAY,SAAS,sDAAsD;CACpF,UAAU;AACZ,CAAC,CAAC,CACD,OAAO,CAAC,CACR,OAAO,aAAa,aAAa,CAAC,CAClC,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC;EAAE,QAAQ;EAAU,MAAM;EAAoB,SAAS;EAAa,UAAU;CAAO,CAAC;AACnG,CAAC;;AAGH,MAAa,eAAe,EACzB,OAAO;CACN,QAAQ,EACL,QAAQ,QAAQ,CAAC,CACjB,SAAS,sEAAsE;CAClF,MAAM,SAAS,SAAS,uCAAuC;CAC/D,SAAS,YAAY,SAAS,sDAAsD;CACpF,UAAU;AACZ,CAAC,CAAC,CACD,OAAO,CAAC,CACR,OAAO,aAAa,aAAa,CAAC,CAClC,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC;EAAE,QAAQ;EAAU,MAAM;EAAoB,SAAS;EAAgB,UAAU;CAAO,CAAC;AACtG,CAAC;;AAGH,MAAa,eAAe,EACzB,OAAO;CACN,QAAQ,EAAE,QAAQ,QAAQ,CAAC,CAAC,SAAS,8CAA8C;CACnF,MAAM,SAAS,SAAS,wCAAwC;CAChE,SAAS,YAAY,SAAS,kDAAkD;CAChF,UAAU;AACZ,CAAC,CAAC,CACD,OAAO,CAAC,CACR,OAAO,aAAa,aAAa,CAAC,CAClC,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC;EAAE,QAAQ;EAAU,MAAM;EAAmB,SAAS;EAAgB,UAAU;CAAS,CAAC;AACvG,CAAC;;AAGH,MAAa,eAAe,EACzB,OAAO;CACN,QAAQ,EACL,QAAQ,QAAQ,CAAC,CACjB,SAAS,qEAAqE;CACjF,MAAM,SAAS,SAAS,uEAAuE;AACjG,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC;EAAE,QAAQ;EAAU,MAAM;CAAiB,CAAC;AACzD,CAAC;;AAGH,MAAa,aAAa,EACvB,OAAO;CACN,QAAQ,EAAE,QAAQ,MAAM,CAAC,CAAC,SAAS,4CAA4C;CAC/E,MAAM,SAAS,SAAS,wEAAwE;CAChG,cAAc,SAAS,SAAS,oCAAoC;CACpE,SAAS,YAAY,SAAS,CAAC,CAAC,SAC9B,0FACF;CACA,UAAU;AACZ,CAAC,CAAC,CACD,OAAO,CAAC,CACR,QAAQ,UAAU,MAAM,SAAS,MAAM,cAAc;CACpD,SAAS;CACT,MAAM,CAAC,MAAM;AACf,CAAC,CAAC,CACD,OAAO,aAAa,aAAa,CAAC,CAClC,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC;EAAE,QAAQ;EAAQ,MAAM;EAAkB,cAAc;EAAkB,UAAU;CAAO,CAAC;AACzG,CAAC;;AAGH,MAAa,cAAc,EACxB,OAAO;CACN,QAAQ,EAAE,QAAQ,OAAO,CAAC,CAAC,SAAS,sDAAsD;CAC1F,MAAM,SAAS,SAAS,4BAA4B;CACpD,iBAAiB,EACd,QAAQ,CAAC,CACT,SAAS,sEAAsE;AACpF,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC;EAAE,QAAQ;EAAS,MAAM;EAAoB,iBAAiB;CAAK,CAAC;AACjF,CAAC;;AAGH,MAAa,eAAe,EACzB,mBAAmB,UAAU;CAC5B;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,CACD,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CACR;EAAE,QAAQ;EAAU,MAAM;EAAoB,SAAS;EAAa,UAAU;CAAO,GACrF;EAAE,QAAQ;EAAU,MAAM;CAAiB,CAC7C;AACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { t as Commit } from "../commit-BEZmeAOl.js";
2
+ export { Commit };
@@ -0,0 +1,24 @@
1
+ import { EXAMPLE_COMMIT } from "./examples.js";
2
+ import { IdempotencyKey } from "./names.js";
3
+ import { Sha } from "./sha.js";
4
+ import { Signature } from "./identity.js";
5
+ import { z } from "zod";
6
+ // src/schemas/commit.ts
7
+ /** A commit as stored in a repository. */
8
+ const Commit = z.object({
9
+ sha: Sha.describe("Id of this commit."),
10
+ tree: Sha.describe("Id of the root tree this commit records."),
11
+ parents: z.array(Sha.describe("Id of a parent commit.")).max(2).describe("Parent commit ids in order: empty for a root commit, one for an ordinary commit, two for a merge (the branch merged into first)."),
12
+ author: Signature.describe("Who wrote the change, and when."),
13
+ committer: Signature.describe("Who recorded the commit, and when; equals the author unless one was given."),
14
+ message: z.string().min(1).describe("Full commit message as stored, including any \"Gateway-Idempotency-Key:\" trailer the gateway appended."),
15
+ idempotencyKey: IdempotencyKey.nullable().describe("The key from the message's \"Gateway-Idempotency-Key:\" trailer, or null when the commit has none.")
16
+ }).strict().meta({
17
+ id: "Commit",
18
+ title: "Commit",
19
+ description: "A commit as stored in a repository, with its message trailer parsed out.",
20
+ examples: [EXAMPLE_COMMIT]
21
+ });
22
+ export { Commit };
23
+
24
+ //# sourceMappingURL=commit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit.js","names":[],"sources":["../../src/schemas/commit.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { z } from 'zod';\n\nimport { EXAMPLE_COMMIT } from './examples.ts';\nimport { IdempotencyKey } from './names.ts';\nimport { Sha } from './sha.ts';\nimport { Signature } from './identity.ts';\n\n/** A commit as stored in a repository. */\nexport const Commit = z\n .object({\n sha: Sha.describe('Id of this commit.'),\n tree: Sha.describe('Id of the root tree this commit records.'),\n parents: z\n .array(Sha.describe('Id of a parent commit.'))\n .max(2)\n .describe(\n 'Parent commit ids in order: empty for a root commit, one for an ordinary commit, two for a merge (the branch merged into first).',\n ),\n author: Signature.describe('Who wrote the change, and when.'),\n committer: Signature.describe(\n 'Who recorded the commit, and when; equals the author unless one was given.',\n ),\n message: z\n .string()\n .min(1)\n .describe(\n 'Full commit message as stored, including any \"Gateway-Idempotency-Key:\" trailer the gateway appended.',\n ),\n idempotencyKey: IdempotencyKey.nullable().describe(\n 'The key from the message\\'s \"Gateway-Idempotency-Key:\" trailer, or null when the commit has none.',\n ),\n })\n .strict()\n .meta({\n id: 'Commit',\n title: 'Commit',\n description: 'A commit as stored in a repository, with its message trailer parsed out.',\n examples: [EXAMPLE_COMMIT],\n });\n\n/** A stored commit, inferred from {@link Commit}. */\nexport type Commit = z.infer<typeof Commit>;\n"],"mappings":";;;;;;;AASA,MAAa,SAAS,EACnB,OAAO;CACN,KAAK,IAAI,SAAS,oBAAoB;CACtC,MAAM,IAAI,SAAS,0CAA0C;CAC7D,SAAS,EACN,MAAM,IAAI,SAAS,wBAAwB,CAAC,CAAC,CAC7C,IAAI,CAAC,CAAC,CACN,SACC,kIACF;CACF,QAAQ,UAAU,SAAS,iCAAiC;CAC5D,WAAW,UAAU,SACnB,4EACF;CACA,SAAS,EACN,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,SACC,yGACF;CACF,gBAAgB,eAAe,SAAS,CAAC,CAAC,SACxC,oGACF;AACF,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CAAC,cAAc;AAC3B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ /** How file content is carried in a string. */
3
+ export declare const ContentEncoding: z.ZodEnum<{
4
+ base64: "base64";
5
+ text: "text";
6
+ }>;
7
+ /** How file content is carried, inferred from {@link ContentEncoding}. */
8
+ export type ContentEncoding = z.infer<typeof ContentEncoding>;
9
+ /**
10
+ * Whether a string is standard padded base64 (RFC 4648 §4): a multiple of four characters from the
11
+ * base64 alphabet, with "=" padding only at the end. Checked with a length test and one
12
+ * character-class scan rather than a grouped pattern, so it runs in linear time without recursion
13
+ * and stays safe at the full {@link FileContent} size on every JavaScript engine.
14
+ */
15
+ export declare function isBase64(value: string): boolean;
16
+ /** File content as text or base64, at most 48 MiB of characters. */
17
+ export declare const FileContent: z.ZodString;
18
+ /** File content, inferred from {@link FileContent}. */
19
+ export type FileContent = z.infer<typeof FileContent>;
20
+ /** File content returned by a read, with no length cap. */
21
+ export declare const ReadContent: z.ZodString;
22
+ /** File content returned by a read, inferred from {@link ReadContent}. */
23
+ export type ReadContent = z.infer<typeof ReadContent>;
24
+ //# sourceMappingURL=content-encoding.d.ts.map
@@ -0,0 +1,41 @@
1
+ import { z } from "zod";
2
+ // src/schemas/content-encoding.ts
3
+ /** How file content is carried in a string. */
4
+ const ContentEncoding = z.enum(["text", "base64"]).meta({
5
+ id: "ContentEncoding",
6
+ title: "Content encoding",
7
+ description: "How file content is carried in a JSON string.",
8
+ enumDescriptions: {
9
+ text: "The string is the file content itself, stored as UTF-8 bytes.",
10
+ base64: "The string is standard base64 (RFC 4648, with padding) of the raw file bytes; use for binary files."
11
+ },
12
+ examples: ["text", "base64"]
13
+ });
14
+ /** The base64 alphabet followed by at most two "=" padding characters. */
15
+ const BASE64_CHARACTERS = /^[A-Za-z0-9+/]*={0,2}$/;
16
+ /**
17
+ * Whether a string is standard padded base64 (RFC 4648 §4): a multiple of four characters from the
18
+ * base64 alphabet, with "=" padding only at the end. Checked with a length test and one
19
+ * character-class scan rather than a grouped pattern, so it runs in linear time without recursion
20
+ * and stays safe at the full {@link FileContent} size on every JavaScript engine.
21
+ */
22
+ function isBase64(value) {
23
+ return value.length % 4 === 0 && BASE64_CHARACTERS.test(value);
24
+ }
25
+ /** File content as text or base64, at most 48 MiB of characters. */
26
+ const FileContent = z.string().max(50331648).meta({
27
+ id: "FileContent",
28
+ title: "File content",
29
+ description: "File content as a string, interpreted according to the accompanying encoding: UTF-8 text, or base64 of the raw bytes. At most 48 MiB of characters (32 MiB of bytes as base64). An empty string is an empty file.",
30
+ examples: ["# Hello\n", "iVBORw0KGgo="]
31
+ });
32
+ /** File content returned by a read, with no length cap. */
33
+ const ReadContent = z.string().meta({
34
+ id: "ReadContent",
35
+ title: "Read content",
36
+ description: "File content returned by a read, interpreted according to the accompanying encoding: UTF-8 text, or base64 of the raw bytes. Not length-capped: base64 output is 4/3 the size of the bytes and files can arrive over git push at any size, so a read returns whatever the repository holds. An empty string is an empty file.",
37
+ examples: ["# Hello\n", "iVBORw0KGgo="]
38
+ });
39
+ export { ContentEncoding, FileContent, ReadContent, isBase64 };
40
+
41
+ //# sourceMappingURL=content-encoding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-encoding.js","names":[],"sources":["../../src/schemas/content-encoding.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { z } from 'zod';\n\n/** How file content is carried in a string. */\nexport const ContentEncoding = z.enum(['text', 'base64']).meta({\n id: 'ContentEncoding',\n title: 'Content encoding',\n description: 'How file content is carried in a JSON string.',\n enumDescriptions: {\n text: 'The string is the file content itself, stored as UTF-8 bytes.',\n base64:\n 'The string is standard base64 (RFC 4648, with padding) of the raw file bytes; use for binary files.',\n },\n examples: ['text', 'base64'],\n});\n\n/** How file content is carried, inferred from {@link ContentEncoding}. */\nexport type ContentEncoding = z.infer<typeof ContentEncoding>;\n\n/** The base64 alphabet followed by at most two \"=\" padding characters. */\nconst BASE64_CHARACTERS = /^[A-Za-z0-9+/]*={0,2}$/;\n\n/**\n * Whether a string is standard padded base64 (RFC 4648 §4): a multiple of four characters from the\n * base64 alphabet, with \"=\" padding only at the end. Checked with a length test and one\n * character-class scan rather than a grouped pattern, so it runs in linear time without recursion\n * and stays safe at the full {@link FileContent} size on every JavaScript engine.\n */\nexport function isBase64(value: string): boolean {\n return value.length % 4 === 0 && BASE64_CHARACTERS.test(value);\n}\n\n/** File content as text or base64, at most 48 MiB of characters. */\nexport const FileContent = z\n .string()\n .max(48 * 1024 * 1024)\n .meta({\n id: 'FileContent',\n title: 'File content',\n description:\n 'File content as a string, interpreted according to the accompanying encoding: UTF-8 text, or base64 of the raw bytes. At most 48 MiB of characters (32 MiB of bytes as base64). An empty string is an empty file.',\n examples: ['# Hello\\n', 'iVBORw0KGgo='],\n });\n\n/** File content, inferred from {@link FileContent}. */\nexport type FileContent = z.infer<typeof FileContent>;\n\n/** File content returned by a read, with no length cap. */\nexport const ReadContent = z.string().meta({\n id: 'ReadContent',\n title: 'Read content',\n description:\n 'File content returned by a read, interpreted according to the accompanying encoding: UTF-8 text, or base64 of the raw bytes. Not length-capped: base64 output is 4/3 the size of the bytes and files can arrive over git push at any size, so a read returns whatever the repository holds. An empty string is an empty file.',\n examples: ['# Hello\\n', 'iVBORw0KGgo='],\n});\n\n/** File content returned by a read, inferred from {@link ReadContent}. */\nexport type ReadContent = z.infer<typeof ReadContent>;\n"],"mappings":";;;AAIA,MAAa,kBAAkB,EAAE,KAAK,CAAC,QAAQ,QAAQ,CAAC,CAAC,CAAC,KAAK;CAC7D,IAAI;CACJ,OAAO;CACP,aAAa;CACb,kBAAkB;EAChB,MAAM;EACN,QACE;CACJ;CACA,UAAU,CAAC,QAAQ,QAAQ;AAC7B,CAAC;;AAMD,MAAM,oBAAoB;;;;;;;AAQ1B,SAAgB,SAAS,OAAwB;CAC/C,OAAO,MAAM,SAAS,MAAM,KAAK,kBAAkB,KAAK,KAAK;AAC/D;;AAGA,MAAa,cAAc,EACxB,OAAO,CAAC,CACR,IAAI,QAAgB,CAAC,CACrB,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC,aAAa,cAAc;AACxC,CAAC;;AAMH,MAAa,cAAc,EAAE,OAAO,CAAC,CAAC,KAAK;CACzC,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC,aAAa,cAAc;AACxC,CAAC"}
@@ -0,0 +1,38 @@
1
+ /** Example values shared by the schemas' `examples` metadata, so examples agree with each other. */
2
+ export declare const EXAMPLE_SHA_A = "1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d";
3
+ /** A second example commit id. */
4
+ export declare const EXAMPLE_SHA_B = "8f3c2a9e1b7d4c6f0a5e2d9b8c7a6f5e4d3c2b1a";
5
+ /** An example tree id (git's empty tree). */
6
+ export declare const EXAMPLE_TREE = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
7
+ /** An example identity. */
8
+ export declare const EXAMPLE_IDENTITY: {
9
+ name: string;
10
+ email: string;
11
+ };
12
+ /** An example timestamp. */
13
+ export declare const EXAMPLE_TIMESTAMP = "2026-11-20T09:30:00.000Z";
14
+ /** An example signature. */
15
+ export declare const EXAMPLE_SIGNATURE: {
16
+ name: string;
17
+ email: string;
18
+ date: string;
19
+ };
20
+ /** An example stored commit. */
21
+ export declare const EXAMPLE_COMMIT: {
22
+ sha: string;
23
+ tree: string;
24
+ parents: string[];
25
+ author: {
26
+ name: string;
27
+ email: string;
28
+ date: string;
29
+ };
30
+ committer: {
31
+ name: string;
32
+ email: string;
33
+ date: string;
34
+ };
35
+ message: string;
36
+ idempotencyKey: string;
37
+ };
38
+ //# sourceMappingURL=examples.d.ts.map