@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,54 @@
1
+ import { EXAMPLE_SHA_B } from "../schemas/examples.js";
2
+ import { FilePath, RepoName, Revision } from "../schemas/names.js";
3
+ import { Sha } from "../schemas/sha.js";
4
+ import { TreeEntry } from "../schemas/tree-entry.js";
5
+ import { z } from "zod";
6
+ // src/rpc/list-tree.ts
7
+ /** Input of `listTree`. */
8
+ const ListTreeInput = z.object({
9
+ repo: RepoName.describe("Repository to read from."),
10
+ ref: Revision.describe("Branch name or commit id to list at."),
11
+ path: FilePath.optional().describe("Directory to list. Absent: the repository root."),
12
+ recursive: z.boolean().default(false).describe("true lists every entry beneath the directory (directories included); false (default) one level.")
13
+ }).strict().meta({
14
+ id: "ListTreeInput",
15
+ title: "listTree input",
16
+ description: "Input of listTree(): a directory listing at a branch or commit. Fails with ref_not_found if the ref is missing.",
17
+ examples: [{
18
+ repo: "acme-raw-content",
19
+ ref: "main",
20
+ path: "content",
21
+ recursive: false
22
+ }]
23
+ });
24
+ /** A directory listing. */
25
+ const TreeListing = z.object({
26
+ commit: Sha.describe("Id of the commit listed (the ref resolved)."),
27
+ path: FilePath.nullable().describe("The directory listed; null for the repository root."),
28
+ entries: z.array(TreeEntry).describe("Entries sorted by full path in byte order; empty for a repository root with no files.")
29
+ }).strict().meta({
30
+ id: "TreeListing",
31
+ title: "Tree listing",
32
+ description: "A directory listing at a commit.",
33
+ examples: [{
34
+ commit: EXAMPLE_SHA_B,
35
+ path: "content",
36
+ entries: [{
37
+ path: "content/about.md",
38
+ name: "about.md",
39
+ type: "blob",
40
+ mode: "100644",
41
+ sha: "f2a5b0a7d1d3d1f1c1c3e7e5d2b9b7e1a3c5d7e9"
42
+ }]
43
+ }]
44
+ });
45
+ /** Output of `listTree`: the listing, or null when the path is not a directory. */
46
+ const ListTreeOutput = TreeListing.nullable().meta({
47
+ id: "ListTreeOutput",
48
+ title: "listTree output",
49
+ description: "Output of listTree(): the listing, or null when the path is not a directory at that ref (absent or a file).",
50
+ examples: [null]
51
+ });
52
+ export { ListTreeInput, ListTreeOutput, TreeListing };
53
+
54
+ //# sourceMappingURL=list-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-tree.js","names":[],"sources":["../../src/rpc/list-tree.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { z } from 'zod';\n\nimport { EXAMPLE_SHA_B } from '../schemas/examples.ts';\nimport { FilePath, RepoName, Revision } from '../schemas/names.ts';\nimport { Sha } from '../schemas/sha.ts';\nimport { TreeEntry } from '../schemas/tree-entry.ts';\n\n/** Input of `listTree`. */\nexport const ListTreeInput = z\n .object({\n repo: RepoName.describe('Repository to read from.'),\n ref: Revision.describe('Branch name or commit id to list at.'),\n path: FilePath.optional().describe('Directory to list. Absent: the repository root.'),\n recursive: z\n .boolean()\n .default(false)\n .describe(\n 'true lists every entry beneath the directory (directories included); false (default) one level.',\n ),\n })\n .strict()\n .meta({\n id: 'ListTreeInput',\n title: 'listTree input',\n description:\n 'Input of listTree(): a directory listing at a branch or commit. Fails with ref_not_found if the ref is missing.',\n examples: [{ repo: 'acme-raw-content', ref: 'main', path: 'content', recursive: false }],\n });\n\n/** Input of `listTree` as accepted (defaults optional). */\nexport type ListTreeInput = z.input<typeof ListTreeInput>;\n\n/** A directory listing. */\nexport const TreeListing = z\n .object({\n commit: Sha.describe('Id of the commit listed (the ref resolved).'),\n path: FilePath.nullable().describe('The directory listed; null for the repository root.'),\n entries: z\n .array(TreeEntry)\n .describe('Entries sorted by full path in byte order; empty for a repository root with no files.'),\n })\n .strict()\n .meta({\n id: 'TreeListing',\n title: 'Tree listing',\n description: 'A directory listing at a commit.',\n examples: [\n {\n commit: EXAMPLE_SHA_B,\n path: 'content',\n entries: [\n {\n path: 'content/about.md',\n name: 'about.md',\n type: 'blob',\n mode: '100644',\n sha: 'f2a5b0a7d1d3d1f1c1c3e7e5d2b9b7e1a3c5d7e9',\n },\n ],\n },\n ],\n });\n\n/** A directory listing, inferred from {@link TreeListing}. */\nexport type TreeListing = z.infer<typeof TreeListing>;\n\n/** Output of `listTree`: the listing, or null when the path is not a directory. */\nexport const ListTreeOutput = TreeListing.nullable().meta({\n id: 'ListTreeOutput',\n title: 'listTree output',\n description:\n 'Output of listTree(): the listing, or null when the path is not a directory at that ref (absent or a file).',\n examples: [null],\n});\n\n/** Output of `listTree`, inferred from {@link ListTreeOutput}. */\nexport type ListTreeOutput = z.infer<typeof ListTreeOutput>;\n"],"mappings":";;;;;;;AASA,MAAa,gBAAgB,EAC1B,OAAO;CACN,MAAM,SAAS,SAAS,0BAA0B;CAClD,KAAK,SAAS,SAAS,sCAAsC;CAC7D,MAAM,SAAS,SAAS,CAAC,CAAC,SAAS,iDAAiD;CACpF,WAAW,EACR,QAAQ,CAAC,CACT,QAAQ,KAAK,CAAC,CACd,SACC,iGACF;AACJ,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC;EAAE,MAAM;EAAoB,KAAK;EAAQ,MAAM;EAAW,WAAW;CAAM,CAAC;AACzF,CAAC;;AAMH,MAAa,cAAc,EACxB,OAAO;CACN,QAAQ,IAAI,SAAS,6CAA6C;CAClE,MAAM,SAAS,SAAS,CAAC,CAAC,SAAS,qDAAqD;CACxF,SAAS,EACN,MAAM,SAAS,CAAC,CAChB,SAAS,uFAAuF;AACrG,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CACR;EACE,QAAQ;EACR,MAAM;EACN,SAAS,CACP;GACE,MAAM;GACN,MAAM;GACN,MAAM;GACN,MAAM;GACN,KAAK;EACP,CACF;CACF,CACF;AACF,CAAC;;AAMH,MAAa,iBAAiB,YAAY,SAAS,CAAC,CAAC,KAAK;CACxD,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC,IAAI;AACjB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ /** Input of `log`. */
3
+ export declare const LogInput: z.ZodObject<{
4
+ repo: z.ZodString;
5
+ ref: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
6
+ limit: z.ZodDefault<z.ZodInt>;
7
+ offset: z.ZodDefault<z.ZodInt>;
8
+ since: z.ZodOptional<z.ZodISODateTime>;
9
+ }, z.core.$strict>;
10
+ /** Input of `log` as accepted (defaults optional). */
11
+ export type LogInput = z.input<typeof LogInput>;
12
+ /** Output of `log`. */
13
+ export declare const LogOutput: z.ZodObject<{
14
+ commits: z.ZodArray<z.ZodObject<{
15
+ sha: z.ZodString;
16
+ tree: z.ZodString;
17
+ parents: z.ZodArray<z.ZodString>;
18
+ author: z.ZodObject<{
19
+ name: z.ZodString;
20
+ email: z.ZodEmail;
21
+ date: z.ZodISODateTime;
22
+ }, z.core.$strict>;
23
+ committer: z.ZodObject<{
24
+ name: z.ZodString;
25
+ email: z.ZodEmail;
26
+ date: z.ZodISODateTime;
27
+ }, z.core.$strict>;
28
+ message: z.ZodString;
29
+ idempotencyKey: z.ZodNullable<z.ZodString>;
30
+ }, z.core.$strict>>;
31
+ hasMore: z.ZodBoolean;
32
+ }, z.core.$strict>;
33
+ /** Output of `log`, inferred from {@link LogOutput}. */
34
+ export type LogOutput = z.infer<typeof LogOutput>;
35
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1,41 @@
1
+ import { Commit } from "../schemas/commit.js";
2
+ import { EXAMPLE_COMMIT } from "../schemas/examples.js";
3
+ import { Timestamp } from "../schemas/identity.js";
4
+ import { RepoName, Revision } from "../schemas/names.js";
5
+ import { z } from "zod";
6
+ // src/rpc/log.ts
7
+ /** Input of `log`. */
8
+ const LogInput = z.object({
9
+ repo: RepoName.describe("Repository to read from."),
10
+ ref: Revision.describe("Branch name or commit id whose history is listed, starting at that commit."),
11
+ limit: z.int().min(1).max(500).default(50).describe("Most commits returned; 1–500, default 50."),
12
+ offset: z.int().min(0).default(0).describe("Commits skipped from the newest before listing; default 0."),
13
+ since: Timestamp.optional().describe("When given, only commits whose committer date is at or after this time are listed. Absent: no lower bound.")
14
+ }).strict().meta({
15
+ id: "LogInput",
16
+ title: "log input",
17
+ description: "Input of log(): the history reachable from a branch or commit, newest committer date first (children always before their parents). Fails with ref_not_found if the ref is missing.",
18
+ examples: [{
19
+ repo: "acme-raw-content",
20
+ ref: "main",
21
+ limit: 20,
22
+ offset: 0,
23
+ since: "2026-11-01T00:00:00.000Z"
24
+ }]
25
+ });
26
+ /** Output of `log`. */
27
+ const LogOutput = z.object({
28
+ commits: z.array(Commit).describe("The page of history, newest committer date first; empty when nothing matches."),
29
+ hasMore: z.boolean().describe("true when further matching commits exist beyond this page.")
30
+ }).strict().meta({
31
+ id: "LogOutput",
32
+ title: "log output",
33
+ description: "Output of log(): one page of history.",
34
+ examples: [{
35
+ commits: [EXAMPLE_COMMIT],
36
+ hasMore: false
37
+ }]
38
+ });
39
+ export { LogInput, LogOutput };
40
+
41
+ //# sourceMappingURL=log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.js","names":[],"sources":["../../src/rpc/log.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { z } from 'zod';\n\nimport { Commit } from '../schemas/commit.ts';\nimport { EXAMPLE_COMMIT } from '../schemas/examples.ts';\nimport { Timestamp } from '../schemas/identity.ts';\nimport { RepoName, Revision } from '../schemas/names.ts';\n\n/** Input of `log`. */\nexport const LogInput = z\n .object({\n repo: RepoName.describe('Repository to read from.'),\n ref: Revision.describe('Branch name or commit id whose history is listed, starting at that commit.'),\n limit: z.int().min(1).max(500).default(50).describe('Most commits returned; 1–500, default 50.'),\n offset: z.int().min(0).default(0).describe('Commits skipped from the newest before listing; default 0.'),\n since: Timestamp.optional().describe(\n 'When given, only commits whose committer date is at or after this time are listed. Absent: no lower bound.',\n ),\n })\n .strict()\n .meta({\n id: 'LogInput',\n title: 'log input',\n description:\n 'Input of log(): the history reachable from a branch or commit, newest committer date first (children always before their parents). Fails with ref_not_found if the ref is missing.',\n examples: [\n { repo: 'acme-raw-content', ref: 'main', limit: 20, offset: 0, since: '2026-11-01T00:00:00.000Z' },\n ],\n });\n\n/** Input of `log` as accepted (defaults optional). */\nexport type LogInput = z.input<typeof LogInput>;\n\n/** Output of `log`. */\nexport const LogOutput = z\n .object({\n commits: z\n .array(Commit)\n .describe('The page of history, newest committer date first; empty when nothing matches.'),\n hasMore: z.boolean().describe('true when further matching commits exist beyond this page.'),\n })\n .strict()\n .meta({\n id: 'LogOutput',\n title: 'log output',\n description: 'Output of log(): one page of history.',\n examples: [{ commits: [EXAMPLE_COMMIT], hasMore: false }],\n });\n\n/** Output of `log`, inferred from {@link LogOutput}. */\nexport type LogOutput = z.infer<typeof LogOutput>;\n"],"mappings":";;;;;;;AASA,MAAa,WAAW,EACrB,OAAO;CACN,MAAM,SAAS,SAAS,0BAA0B;CAClD,KAAK,SAAS,SAAS,4EAA4E;CACnG,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,SAAS,2CAA2C;CAC/F,QAAQ,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,4DAA4D;CACvG,OAAO,UAAU,SAAS,CAAC,CAAC,SAC1B,4GACF;AACF,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CACR;EAAE,MAAM;EAAoB,KAAK;EAAQ,OAAO;EAAI,QAAQ;EAAG,OAAO;CAA2B,CACnG;AACF,CAAC;;AAMH,MAAa,YAAY,EACtB,OAAO;CACN,SAAS,EACN,MAAM,MAAM,CAAC,CACb,SAAS,+EAA+E;CAC3F,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS,4DAA4D;AAC5F,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CAAC;EAAE,SAAS,CAAC,cAAc;EAAG,SAAS;CAAM,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ /** Input of `mintReadToken`. */
3
+ export declare const MintReadTokenInput: z.ZodObject<{
4
+ repo: z.ZodString;
5
+ ttlSeconds: z.ZodDefault<z.ZodInt>;
6
+ }, z.core.$strict>;
7
+ /** Input of `mintReadToken` as accepted (defaults optional). */
8
+ export type MintReadTokenInput = z.input<typeof MintReadTokenInput>;
9
+ /** Output of `mintReadToken`. */
10
+ export declare const MintReadTokenOutput: z.ZodObject<{
11
+ token: z.ZodString;
12
+ expiresAt: z.ZodISODateTime;
13
+ remoteUrl: z.ZodURL;
14
+ }, z.core.$strict>;
15
+ /** Output of `mintReadToken`, inferred from {@link MintReadTokenOutput}. */
16
+ export type MintReadTokenOutput = z.infer<typeof MintReadTokenOutput>;
17
+ //# sourceMappingURL=mint-read-token.d.ts.map
@@ -0,0 +1,36 @@
1
+ import { EXAMPLE_TIMESTAMP } from "../schemas/examples.js";
2
+ import { Timestamp } from "../schemas/identity.js";
3
+ import { RepoName } from "../schemas/names.js";
4
+ import { z } from "zod";
5
+ // src/rpc/mint-read-token.ts
6
+ /** Input of `mintReadToken`. */
7
+ const MintReadTokenInput = z.object({
8
+ repo: RepoName.describe("Repository the token may read."),
9
+ ttlSeconds: z.int().min(60).max(86400).default(3600).describe("Lifetime of the token in seconds; 60–86400, default 3600.")
10
+ }).strict().meta({
11
+ id: "MintReadTokenInput",
12
+ title: "mintReadToken input",
13
+ description: "Input of mintReadToken(): a short-lived credential that can clone and fetch one repository through the gateway and nothing else. Fails with repo_not_found.",
14
+ examples: [{
15
+ repo: "acme-raw-content",
16
+ ttlSeconds: 900
17
+ }]
18
+ });
19
+ /** Output of `mintReadToken`. */
20
+ const MintReadTokenOutput = z.object({
21
+ token: z.string().min(16).max(4096).describe("The credential: send it as the HTTP Basic password (any username) or as a Bearer token. Secret."),
22
+ expiresAt: Timestamp.describe("When the token stops working."),
23
+ remoteUrl: z.url().describe("Clone URL the token is good for: <publicBaseUrl>/<repo>.git.")
24
+ }).strict().meta({
25
+ id: "MintReadTokenOutput",
26
+ title: "mintReadToken output",
27
+ description: "Output of mintReadToken(): a read-only credential for one repository and where to use it.",
28
+ examples: [{
29
+ token: "ggr_0123456789abcdef0123456789abcdef",
30
+ expiresAt: EXAMPLE_TIMESTAMP,
31
+ remoteUrl: "https://git.example.com/acme-raw-content.git"
32
+ }]
33
+ });
34
+ export { MintReadTokenInput, MintReadTokenOutput };
35
+
36
+ //# sourceMappingURL=mint-read-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mint-read-token.js","names":[],"sources":["../../src/rpc/mint-read-token.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { z } from 'zod';\n\nimport { EXAMPLE_TIMESTAMP } from '../schemas/examples.ts';\nimport { Timestamp } from '../schemas/identity.ts';\nimport { RepoName } from '../schemas/names.ts';\n\n/** Input of `mintReadToken`. */\nexport const MintReadTokenInput = z\n .object({\n repo: RepoName.describe('Repository the token may read.'),\n ttlSeconds: z\n .int()\n .min(60)\n .max(86_400)\n .default(3600)\n .describe('Lifetime of the token in seconds; 60–86400, default 3600.'),\n })\n .strict()\n .meta({\n id: 'MintReadTokenInput',\n title: 'mintReadToken input',\n description:\n 'Input of mintReadToken(): a short-lived credential that can clone and fetch one repository through the gateway and nothing else. Fails with repo_not_found.',\n examples: [{ repo: 'acme-raw-content', ttlSeconds: 900 }],\n });\n\n/** Input of `mintReadToken` as accepted (defaults optional). */\nexport type MintReadTokenInput = z.input<typeof MintReadTokenInput>;\n\n/** Output of `mintReadToken`. */\nexport const MintReadTokenOutput = z\n .object({\n token: z\n .string()\n .min(16)\n .max(4096)\n .describe(\n 'The credential: send it as the HTTP Basic password (any username) or as a Bearer token. Secret.',\n ),\n expiresAt: Timestamp.describe('When the token stops working.'),\n remoteUrl: z.url().describe('Clone URL the token is good for: <publicBaseUrl>/<repo>.git.'),\n })\n .strict()\n .meta({\n id: 'MintReadTokenOutput',\n title: 'mintReadToken output',\n description: 'Output of mintReadToken(): a read-only credential for one repository and where to use it.',\n examples: [\n {\n token: 'ggr_0123456789abcdef0123456789abcdef',\n expiresAt: EXAMPLE_TIMESTAMP,\n remoteUrl: 'https://git.example.com/acme-raw-content.git',\n },\n ],\n });\n\n/** Output of `mintReadToken`, inferred from {@link MintReadTokenOutput}. */\nexport type MintReadTokenOutput = z.infer<typeof MintReadTokenOutput>;\n"],"mappings":";;;;;;AAQA,MAAa,qBAAqB,EAC/B,OAAO;CACN,MAAM,SAAS,SAAS,gCAAgC;CACxD,YAAY,EACT,IAAI,CAAC,CACL,IAAI,EAAE,CAAC,CACP,IAAI,KAAM,CAAC,CACX,QAAQ,IAAI,CAAC,CACb,SAAS,2DAA2D;AACzE,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC;EAAE,MAAM;EAAoB,YAAY;CAAI,CAAC;AAC1D,CAAC;;AAMH,MAAa,sBAAsB,EAChC,OAAO;CACN,OAAO,EACJ,OAAO,CAAC,CACR,IAAI,EAAE,CAAC,CACP,IAAI,IAAI,CAAC,CACT,SACC,iGACF;CACF,WAAW,UAAU,SAAS,+BAA+B;CAC7D,WAAW,EAAE,IAAI,CAAC,CAAC,SAAS,8DAA8D;AAC5F,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CACR;EACE,OAAO;EACP,WAAW;EACX,WAAW;CACb,CACF;AACF,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { z } from "zod";
2
+ /** Input of `promote`. */
3
+ export declare const PromoteInput: z.ZodObject<{
4
+ repo: z.ZodString;
5
+ from: z.ZodString;
6
+ into: z.ZodString;
7
+ sha: z.ZodString;
8
+ }, z.core.$strict>;
9
+ /** Input of `promote`, inferred from {@link PromoteInput}. */
10
+ export type PromoteInput = z.input<typeof PromoteInput>;
11
+ /** `into` was fast-forwarded (or created) at `sha`. */
12
+ export declare const PromotePromoted: z.ZodObject<{
13
+ status: z.ZodLiteral<"promoted">;
14
+ refUpdate: z.ZodObject<{
15
+ ref: z.ZodString;
16
+ oldSha: z.ZodString;
17
+ newSha: z.ZodString;
18
+ }, z.core.$strict>;
19
+ }, z.core.$strict>;
20
+ /** `into` already pointed at `sha`. */
21
+ export declare const PromoteUpToDate: z.ZodObject<{
22
+ status: z.ZodLiteral<"up_to_date">;
23
+ head: z.ZodString;
24
+ }, z.core.$strict>;
25
+ /** Output of `promote`, discriminated by `status`. */
26
+ export declare const PromoteOutput: z.ZodDiscriminatedUnion<[z.ZodObject<{
27
+ status: z.ZodLiteral<"promoted">;
28
+ refUpdate: z.ZodObject<{
29
+ ref: z.ZodString;
30
+ oldSha: z.ZodString;
31
+ newSha: z.ZodString;
32
+ }, z.core.$strict>;
33
+ }, z.core.$strict>, z.ZodObject<{
34
+ status: z.ZodLiteral<"up_to_date">;
35
+ head: z.ZodString;
36
+ }, z.core.$strict>], "status">;
37
+ /** Output of `promote`, inferred from {@link PromoteOutput}. */
38
+ export type PromoteOutput = z.infer<typeof PromoteOutput>;
39
+ //# sourceMappingURL=promote.d.ts.map
@@ -0,0 +1,69 @@
1
+ import { EXAMPLE_SHA_A, EXAMPLE_SHA_B } from "../schemas/examples.js";
2
+ import { BranchName, RepoName } from "../schemas/names.js";
3
+ import { RefUpdate } from "../schemas/ref-update.js";
4
+ import { Sha } from "../schemas/sha.js";
5
+ import { z } from "zod";
6
+ // src/rpc/promote.ts
7
+ /** Input of `promote`. */
8
+ const PromoteInput = z.object({
9
+ repo: RepoName.describe("Repository holding both branches."),
10
+ from: BranchName.describe("Branch whose head is promoted, e.g. staging."),
11
+ into: BranchName.describe("Branch fast-forwarded, e.g. main. Created at `sha` if it does not exist."),
12
+ sha: Sha.describe("The commit to promote; must be the current head of `from`.")
13
+ }).strict().refine((input) => input.from !== input.into, {
14
+ message: "from and into must differ",
15
+ path: ["into"]
16
+ }).meta({
17
+ id: "PromoteInput",
18
+ title: "promote input",
19
+ description: "Input of promote(): fast-forward `into` to `sha`, only if `sha` is the head of `from` and contains the head of `into`. Never merges, never forces. Refusals: ref_not_found (from missing), not_head_of_source, not_fast_forward.",
20
+ examples: [{
21
+ repo: "acme-raw-content",
22
+ from: "staging",
23
+ into: "main",
24
+ sha: EXAMPLE_SHA_B
25
+ }]
26
+ });
27
+ /** `into` was fast-forwarded (or created) at `sha`. */
28
+ const PromotePromoted = z.object({
29
+ status: z.literal("promoted").describe("`into` now points at `sha`."),
30
+ refUpdate: RefUpdate.describe("How `into` moved; oldSha is all zeros when promote created it.")
31
+ }).strict().meta({
32
+ id: "PromotePromoted",
33
+ title: "promote: promoted",
34
+ description: "promote() fast-forwarded `into` to `sha`, or created it there.",
35
+ examples: [{
36
+ status: "promoted",
37
+ refUpdate: {
38
+ ref: "refs/heads/main",
39
+ oldSha: EXAMPLE_SHA_A,
40
+ newSha: EXAMPLE_SHA_B
41
+ }
42
+ }]
43
+ });
44
+ /** `into` already pointed at `sha`. */
45
+ const PromoteUpToDate = z.object({
46
+ status: z.literal("up_to_date").describe("`into` already points at `sha`; nothing changed."),
47
+ head: Sha.describe("The head of `into`, equal to `sha`.")
48
+ }).strict().meta({
49
+ id: "PromoteUpToDate",
50
+ title: "promote: up to date",
51
+ description: "promote() found `into` already at `sha`.",
52
+ examples: [{
53
+ status: "up_to_date",
54
+ head: EXAMPLE_SHA_B
55
+ }]
56
+ });
57
+ /** Output of `promote`, discriminated by `status`. */
58
+ const PromoteOutput = z.discriminatedUnion("status", [PromotePromoted, PromoteUpToDate]).meta({
59
+ id: "PromoteOutput",
60
+ title: "promote output",
61
+ description: "Output of promote(), discriminated by `status`. Refusals are thrown as GatewayErrors.",
62
+ examples: [{
63
+ status: "up_to_date",
64
+ head: EXAMPLE_SHA_B
65
+ }]
66
+ });
67
+ export { PromoteInput, PromoteOutput, PromotePromoted, PromoteUpToDate };
68
+
69
+ //# sourceMappingURL=promote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promote.js","names":[],"sources":["../../src/rpc/promote.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { z } from 'zod';\n\nimport { EXAMPLE_SHA_A, EXAMPLE_SHA_B } from '../schemas/examples.ts';\nimport { BranchName, RepoName } from '../schemas/names.ts';\nimport { RefUpdate } from '../schemas/ref-update.ts';\nimport { Sha } from '../schemas/sha.ts';\n\n/** Input of `promote`. */\nexport const PromoteInput = z\n .object({\n repo: RepoName.describe('Repository holding both branches.'),\n from: BranchName.describe('Branch whose head is promoted, e.g. staging.'),\n into: BranchName.describe('Branch fast-forwarded, e.g. main. Created at `sha` if it does not exist.'),\n sha: Sha.describe('The commit to promote; must be the current head of `from`.'),\n })\n .strict()\n .refine((input) => input.from !== input.into, { message: 'from and into must differ', path: ['into'] })\n .meta({\n id: 'PromoteInput',\n title: 'promote input',\n description:\n 'Input of promote(): fast-forward `into` to `sha`, only if `sha` is the head of `from` and contains the head of `into`. Never merges, never forces. Refusals: ref_not_found (from missing), not_head_of_source, not_fast_forward.',\n examples: [{ repo: 'acme-raw-content', from: 'staging', into: 'main', sha: EXAMPLE_SHA_B }],\n });\n\n/** Input of `promote`, inferred from {@link PromoteInput}. */\nexport type PromoteInput = z.input<typeof PromoteInput>;\n\n/** `into` was fast-forwarded (or created) at `sha`. */\nexport const PromotePromoted = z\n .object({\n status: z.literal('promoted').describe('`into` now points at `sha`.'),\n refUpdate: RefUpdate.describe('How `into` moved; oldSha is all zeros when promote created it.'),\n })\n .strict()\n .meta({\n id: 'PromotePromoted',\n title: 'promote: promoted',\n description: 'promote() fast-forwarded `into` to `sha`, or created it there.',\n examples: [\n {\n status: 'promoted',\n refUpdate: { ref: 'refs/heads/main', oldSha: EXAMPLE_SHA_A, newSha: EXAMPLE_SHA_B },\n },\n ],\n });\n\n/** `into` already pointed at `sha`. */\nexport const PromoteUpToDate = z\n .object({\n status: z.literal('up_to_date').describe('`into` already points at `sha`; nothing changed.'),\n head: Sha.describe('The head of `into`, equal to `sha`.'),\n })\n .strict()\n .meta({\n id: 'PromoteUpToDate',\n title: 'promote: up to date',\n description: 'promote() found `into` already at `sha`.',\n examples: [{ status: 'up_to_date', head: EXAMPLE_SHA_B }],\n });\n\n/** Output of `promote`, discriminated by `status`. */\nexport const PromoteOutput = z.discriminatedUnion('status', [PromotePromoted, PromoteUpToDate]).meta({\n id: 'PromoteOutput',\n title: 'promote output',\n description: 'Output of promote(), discriminated by `status`. Refusals are thrown as GatewayErrors.',\n examples: [{ status: 'up_to_date', head: EXAMPLE_SHA_B }],\n});\n\n/** Output of `promote`, inferred from {@link PromoteOutput}. */\nexport type PromoteOutput = z.infer<typeof PromoteOutput>;\n"],"mappings":";;;;;;;AASA,MAAa,eAAe,EACzB,OAAO;CACN,MAAM,SAAS,SAAS,mCAAmC;CAC3D,MAAM,WAAW,SAAS,8CAA8C;CACxE,MAAM,WAAW,SAAS,0EAA0E;CACpG,KAAK,IAAI,SAAS,4DAA4D;AAChF,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;EAAW,MAAM;EAAQ,KAAK;CAAc,CAAC;AAC5F,CAAC;;AAMH,MAAa,kBAAkB,EAC5B,OAAO;CACN,QAAQ,EAAE,QAAQ,UAAU,CAAC,CAAC,SAAS,6BAA6B;CACpE,WAAW,UAAU,SAAS,gEAAgE;AAChG,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CACR;EACE,QAAQ;EACR,WAAW;GAAE,KAAK;GAAmB,QAAQ;GAAe,QAAQ;EAAc;CACpF,CACF;AACF,CAAC;;AAGH,MAAa,kBAAkB,EAC5B,OAAO;CACN,QAAQ,EAAE,QAAQ,YAAY,CAAC,CAAC,SAAS,kDAAkD;CAC3F,MAAM,IAAI,SAAS,qCAAqC;AAC1D,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,gBAAgB,EAAE,mBAAmB,UAAU,CAAC,iBAAiB,eAAe,CAAC,CAAC,CAAC,KAAK;CACnG,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CAAC;EAAE,QAAQ;EAAc,MAAM;CAAc,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { z } from "zod";
2
+ /** Input of `readFile`. */
3
+ export declare const ReadFileInput: z.ZodObject<{
4
+ repo: z.ZodString;
5
+ ref: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
6
+ path: z.ZodString;
7
+ encoding: z.ZodDefault<z.ZodEnum<{
8
+ base64: "base64";
9
+ text: "text";
10
+ }>>;
11
+ }, z.core.$strict>;
12
+ /** Input of `readFile` as accepted (defaults optional). */
13
+ export type ReadFileInput = z.input<typeof ReadFileInput>;
14
+ /** A file read from a repository. */
15
+ export declare const FileRead: z.ZodObject<{
16
+ path: z.ZodString;
17
+ commit: z.ZodString;
18
+ sha: z.ZodString;
19
+ size: z.ZodInt;
20
+ executable: z.ZodBoolean;
21
+ encoding: z.ZodEnum<{
22
+ base64: "base64";
23
+ text: "text";
24
+ }>;
25
+ content: z.ZodString;
26
+ }, z.core.$strict>;
27
+ /** A file read, inferred from {@link FileRead}. */
28
+ export type FileRead = z.infer<typeof FileRead>;
29
+ /** Output of `readFile`: the file, or null when no file is at the path. */
30
+ export declare const ReadFileOutput: z.ZodNullable<z.ZodObject<{
31
+ path: z.ZodString;
32
+ commit: z.ZodString;
33
+ sha: z.ZodString;
34
+ size: z.ZodInt;
35
+ executable: z.ZodBoolean;
36
+ encoding: z.ZodEnum<{
37
+ base64: "base64";
38
+ text: "text";
39
+ }>;
40
+ content: z.ZodString;
41
+ }, z.core.$strict>>;
42
+ /** Output of `readFile`, inferred from {@link ReadFileOutput}. */
43
+ export type ReadFileOutput = z.infer<typeof ReadFileOutput>;
44
+ //# sourceMappingURL=read-file.d.ts.map
@@ -0,0 +1,56 @@
1
+ import { ContentEncoding, ReadContent } from "../schemas/content-encoding.js";
2
+ import { EXAMPLE_SHA_B } from "../schemas/examples.js";
3
+ import { FilePath, RepoName, Revision } from "../schemas/names.js";
4
+ import { Sha } from "../schemas/sha.js";
5
+ import { z } from "zod";
6
+ // src/rpc/read-file.ts
7
+ /** Input of `readFile`. */
8
+ const ReadFileInput = z.object({
9
+ repo: RepoName.describe("Repository to read from."),
10
+ ref: Revision.describe("Branch name or commit id to read the file at."),
11
+ path: FilePath.describe("Path of the file to read."),
12
+ encoding: ContentEncoding.default("text").describe("Preferred encoding of the returned content. \"text\" (default) returns text when the bytes are valid UTF-8 and falls back to base64 otherwise; \"base64\" always returns base64.")
13
+ }).strict().meta({
14
+ id: "ReadFileInput",
15
+ title: "readFile input",
16
+ description: "Input of readFile(): one file at a branch or commit. Fails with ref_not_found if the ref is missing.",
17
+ examples: [{
18
+ repo: "acme-raw-content",
19
+ ref: "main",
20
+ path: "content/about.md",
21
+ encoding: "text"
22
+ }]
23
+ });
24
+ /** A file read from a repository. */
25
+ const FileRead = z.object({
26
+ path: FilePath.describe("Path of the file read."),
27
+ commit: Sha.describe("Id of the commit the file was read at (the ref resolved)."),
28
+ sha: Sha.describe("Id of the file's blob. Equal content always has an equal id."),
29
+ size: z.int().min(0).describe("Size of the file in bytes."),
30
+ executable: z.boolean().describe("true when the file mode is 100755."),
31
+ encoding: ContentEncoding.describe("How `content` is encoded; may be base64 even when text was requested."),
32
+ content: ReadContent.describe("The file's content, encoded as `encoding` says.")
33
+ }).strict().meta({
34
+ id: "FileRead",
35
+ title: "File read",
36
+ description: "A file read from a repository at a commit, with its blob id, size and mode.",
37
+ examples: [{
38
+ path: "content/about.md",
39
+ commit: EXAMPLE_SHA_B,
40
+ sha: "f2a5b0a7d1d3d1f1c1c3e7e5d2b9b7e1a3c5d7e9",
41
+ size: 11,
42
+ executable: false,
43
+ encoding: "text",
44
+ content: "# About us\n"
45
+ }]
46
+ });
47
+ /** Output of `readFile`: the file, or null when no file is at the path. */
48
+ const ReadFileOutput = FileRead.nullable().meta({
49
+ id: "ReadFileOutput",
50
+ title: "readFile output",
51
+ description: "Output of readFile(): the file, or null when the path is not a file at that ref (absent or a directory).",
52
+ examples: [null]
53
+ });
54
+ export { FileRead, ReadFileInput, ReadFileOutput };
55
+
56
+ //# sourceMappingURL=read-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-file.js","names":[],"sources":["../../src/rpc/read-file.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { z } from 'zod';\n\nimport { ContentEncoding, ReadContent } from '../schemas/content-encoding.ts';\nimport { EXAMPLE_SHA_B } from '../schemas/examples.ts';\nimport { FilePath, RepoName, Revision } from '../schemas/names.ts';\nimport { Sha } from '../schemas/sha.ts';\n\n/** Input of `readFile`. */\nexport const ReadFileInput = z\n .object({\n repo: RepoName.describe('Repository to read from.'),\n ref: Revision.describe('Branch name or commit id to read the file at.'),\n path: FilePath.describe('Path of the file to read.'),\n encoding: ContentEncoding.default('text').describe(\n 'Preferred encoding of the returned content. \"text\" (default) returns text when the bytes are valid UTF-8 and falls back to base64 otherwise; \"base64\" always returns base64.',\n ),\n })\n .strict()\n .meta({\n id: 'ReadFileInput',\n title: 'readFile input',\n description:\n 'Input of readFile(): one file at a branch or commit. Fails with ref_not_found if the ref is missing.',\n examples: [{ repo: 'acme-raw-content', ref: 'main', path: 'content/about.md', encoding: 'text' }],\n });\n\n/** Input of `readFile` as accepted (defaults optional). */\nexport type ReadFileInput = z.input<typeof ReadFileInput>;\n\n/** A file read from a repository. */\nexport const FileRead = z\n .object({\n path: FilePath.describe('Path of the file read.'),\n commit: Sha.describe('Id of the commit the file was read at (the ref resolved).'),\n sha: Sha.describe(\"Id of the file's blob. Equal content always has an equal id.\"),\n size: z.int().min(0).describe('Size of the file in bytes.'),\n executable: z.boolean().describe('true when the file mode is 100755.'),\n encoding: ContentEncoding.describe(\n 'How `content` is encoded; may be base64 even when text was requested.',\n ),\n content: ReadContent.describe(\"The file's content, encoded as `encoding` says.\"),\n })\n .strict()\n .meta({\n id: 'FileRead',\n title: 'File read',\n description: 'A file read from a repository at a commit, with its blob id, size and mode.',\n examples: [\n {\n path: 'content/about.md',\n commit: EXAMPLE_SHA_B,\n sha: 'f2a5b0a7d1d3d1f1c1c3e7e5d2b9b7e1a3c5d7e9',\n size: 11,\n executable: false,\n encoding: 'text',\n content: '# About us\\n',\n },\n ],\n });\n\n/** A file read, inferred from {@link FileRead}. */\nexport type FileRead = z.infer<typeof FileRead>;\n\n/** Output of `readFile`: the file, or null when no file is at the path. */\nexport const ReadFileOutput = FileRead.nullable().meta({\n id: 'ReadFileOutput',\n title: 'readFile output',\n description:\n 'Output of readFile(): the file, or null when the path is not a file at that ref (absent or a directory).',\n examples: [null],\n});\n\n/** Output of `readFile`, inferred from {@link ReadFileOutput}. */\nexport type ReadFileOutput = z.infer<typeof ReadFileOutput>;\n"],"mappings":";;;;;;;AASA,MAAa,gBAAgB,EAC1B,OAAO;CACN,MAAM,SAAS,SAAS,0BAA0B;CAClD,KAAK,SAAS,SAAS,+CAA+C;CACtE,MAAM,SAAS,SAAS,2BAA2B;CACnD,UAAU,gBAAgB,QAAQ,MAAM,CAAC,CAAC,SACxC,kLACF;AACF,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC;EAAE,MAAM;EAAoB,KAAK;EAAQ,MAAM;EAAoB,UAAU;CAAO,CAAC;AAClG,CAAC;;AAMH,MAAa,WAAW,EACrB,OAAO;CACN,MAAM,SAAS,SAAS,wBAAwB;CAChD,QAAQ,IAAI,SAAS,2DAA2D;CAChF,KAAK,IAAI,SAAS,8DAA8D;CAChF,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,4BAA4B;CAC1D,YAAY,EAAE,QAAQ,CAAC,CAAC,SAAS,oCAAoC;CACrE,UAAU,gBAAgB,SACxB,uEACF;CACA,SAAS,YAAY,SAAS,iDAAiD;AACjF,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CACR;EACE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,MAAM;EACN,YAAY;EACZ,UAAU;EACV,SAAS;CACX,CACF;AACF,CAAC;;AAMH,MAAa,iBAAiB,SAAS,SAAS,CAAC,CAAC,KAAK;CACrD,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC,IAAI;AACjB,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { z } from "zod";
2
+ /** Input of `createRepo`. */
3
+ export declare const CreateRepoInput: z.ZodObject<{
4
+ repo: z.ZodString;
5
+ defaultBranch: z.ZodDefault<z.ZodString>;
6
+ }, z.core.$strict>;
7
+ /** Input of `createRepo` as accepted (defaults optional). */
8
+ export type CreateRepoInput = z.input<typeof CreateRepoInput>;
9
+ /** A repository behind the gateway. */
10
+ export declare const RepoInfo: z.ZodObject<{
11
+ name: z.ZodString;
12
+ defaultBranch: z.ZodString;
13
+ createdAt: z.ZodISODateTime;
14
+ remoteUrl: z.ZodURL;
15
+ }, z.core.$strict>;
16
+ /** A repository, inferred from {@link RepoInfo}. */
17
+ export type RepoInfo = z.infer<typeof RepoInfo>;
18
+ /** Output of `createRepo`: the new repository. */
19
+ export declare const CreateRepoOutput: z.ZodObject<{
20
+ name: z.ZodString;
21
+ defaultBranch: z.ZodString;
22
+ createdAt: z.ZodISODateTime;
23
+ remoteUrl: z.ZodURL;
24
+ }, z.core.$strict>;
25
+ /** Output of `createRepo`, inferred from {@link CreateRepoOutput}. */
26
+ export type CreateRepoOutput = z.infer<typeof CreateRepoOutput>;
27
+ /** Input of `deleteRepo`. */
28
+ export declare const DeleteRepoInput: z.ZodObject<{
29
+ repo: z.ZodString;
30
+ }, z.core.$strict>;
31
+ /** Input of `deleteRepo`, inferred from {@link DeleteRepoInput}. */
32
+ export type DeleteRepoInput = z.input<typeof DeleteRepoInput>;
33
+ /** Output of `deleteRepo`. */
34
+ export declare const DeleteRepoOutput: z.ZodObject<{
35
+ deleted: z.ZodBoolean;
36
+ }, z.core.$strict>;
37
+ /** Output of `deleteRepo`, inferred from {@link DeleteRepoOutput}. */
38
+ export type DeleteRepoOutput = z.infer<typeof DeleteRepoOutput>;
39
+ //# sourceMappingURL=repo-lifecycle.d.ts.map
@@ -0,0 +1,64 @@
1
+ import { EXAMPLE_TIMESTAMP } from "../schemas/examples.js";
2
+ import { Timestamp } from "../schemas/identity.js";
3
+ import { BranchName, RepoName } from "../schemas/names.js";
4
+ import { z } from "zod";
5
+ // src/rpc/repo-lifecycle.ts
6
+ /** Input of `createRepo`. */
7
+ const CreateRepoInput = z.object({
8
+ repo: RepoName.describe("Name of the repository to create."),
9
+ defaultBranch: BranchName.default("main").describe("Branch HEAD names; it comes into being with the first commit to it. Default \"main\".")
10
+ }).strict().meta({
11
+ id: "CreateRepoInput",
12
+ title: "createRepo input",
13
+ description: "Input of createRepo(): create an empty repository. Fails with repo_exists if the name is taken.",
14
+ examples: [{
15
+ repo: "acme-raw-content",
16
+ defaultBranch: "main"
17
+ }]
18
+ });
19
+ /** A repository behind the gateway. */
20
+ const RepoInfo = z.object({
21
+ name: RepoName.describe("The repository name."),
22
+ defaultBranch: BranchName.describe("The branch HEAD names."),
23
+ createdAt: Timestamp.describe("When the repository was created."),
24
+ remoteUrl: z.url().describe("Clone URL of the repository on the gateway: <publicBaseUrl>/<name>.git.")
25
+ }).strict().meta({
26
+ id: "RepoInfo",
27
+ title: "Repository",
28
+ description: "A repository behind the gateway.",
29
+ examples: [{
30
+ name: "acme-raw-content",
31
+ defaultBranch: "main",
32
+ createdAt: EXAMPLE_TIMESTAMP,
33
+ remoteUrl: "https://git.example.com/acme-raw-content.git"
34
+ }]
35
+ });
36
+ /** Output of `createRepo`: the new repository. */
37
+ const CreateRepoOutput = RepoInfo.meta({
38
+ id: "CreateRepoOutput",
39
+ title: "createRepo output",
40
+ description: "Output of createRepo(): the repository created, empty (no branches until the first commit).",
41
+ examples: [{
42
+ name: "acme-raw-content",
43
+ defaultBranch: "main",
44
+ createdAt: EXAMPLE_TIMESTAMP,
45
+ remoteUrl: "https://git.example.com/acme-raw-content.git"
46
+ }]
47
+ });
48
+ /** Input of `deleteRepo`. */
49
+ const DeleteRepoInput = z.object({ repo: RepoName.describe("Name of the repository to delete, with all its branches and history.") }).strict().meta({
50
+ id: "DeleteRepoInput",
51
+ title: "deleteRepo input",
52
+ description: "Input of deleteRepo(): permanently delete a repository. Deleting a missing repository is not an error.",
53
+ examples: [{ repo: "acme-raw-content" }]
54
+ });
55
+ /** Output of `deleteRepo`. */
56
+ const DeleteRepoOutput = z.object({ deleted: z.boolean().describe("true when a repository was deleted; false when none had that name.") }).strict().meta({
57
+ id: "DeleteRepoOutput",
58
+ title: "deleteRepo output",
59
+ description: "Output of deleteRepo().",
60
+ examples: [{ deleted: true }]
61
+ });
62
+ export { CreateRepoInput, CreateRepoOutput, DeleteRepoInput, DeleteRepoOutput, RepoInfo };
63
+
64
+ //# sourceMappingURL=repo-lifecycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo-lifecycle.js","names":[],"sources":["../../src/rpc/repo-lifecycle.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { z } from 'zod';\n\nimport { EXAMPLE_TIMESTAMP } from '../schemas/examples.ts';\nimport { Timestamp } from '../schemas/identity.ts';\nimport { BranchName, RepoName } from '../schemas/names.ts';\n\n/** Input of `createRepo`. */\nexport const CreateRepoInput = z\n .object({\n repo: RepoName.describe('Name of the repository to create.'),\n defaultBranch: BranchName.default('main').describe(\n 'Branch HEAD names; it comes into being with the first commit to it. Default \"main\".',\n ),\n })\n .strict()\n .meta({\n id: 'CreateRepoInput',\n title: 'createRepo input',\n description:\n 'Input of createRepo(): create an empty repository. Fails with repo_exists if the name is taken.',\n examples: [{ repo: 'acme-raw-content', defaultBranch: 'main' }],\n });\n\n/** Input of `createRepo` as accepted (defaults optional). */\nexport type CreateRepoInput = z.input<typeof CreateRepoInput>;\n\n/** A repository behind the gateway. */\nexport const RepoInfo = z\n .object({\n name: RepoName.describe('The repository name.'),\n defaultBranch: BranchName.describe('The branch HEAD names.'),\n createdAt: Timestamp.describe('When the repository was created.'),\n remoteUrl: z.url().describe('Clone URL of the repository on the gateway: <publicBaseUrl>/<name>.git.'),\n })\n .strict()\n .meta({\n id: 'RepoInfo',\n title: 'Repository',\n description: 'A repository behind the gateway.',\n examples: [\n {\n name: 'acme-raw-content',\n defaultBranch: 'main',\n createdAt: EXAMPLE_TIMESTAMP,\n remoteUrl: 'https://git.example.com/acme-raw-content.git',\n },\n ],\n });\n\n/** A repository, inferred from {@link RepoInfo}. */\nexport type RepoInfo = z.infer<typeof RepoInfo>;\n\n/** Output of `createRepo`: the new repository. */\nexport const CreateRepoOutput = RepoInfo.meta({\n id: 'CreateRepoOutput',\n title: 'createRepo output',\n description: 'Output of createRepo(): the repository created, empty (no branches until the first commit).',\n examples: [\n {\n name: 'acme-raw-content',\n defaultBranch: 'main',\n createdAt: EXAMPLE_TIMESTAMP,\n remoteUrl: 'https://git.example.com/acme-raw-content.git',\n },\n ],\n});\n\n/** Output of `createRepo`, inferred from {@link CreateRepoOutput}. */\nexport type CreateRepoOutput = z.infer<typeof CreateRepoOutput>;\n\n/** Input of `deleteRepo`. */\nexport const DeleteRepoInput = z\n .object({\n repo: RepoName.describe('Name of the repository to delete, with all its branches and history.'),\n })\n .strict()\n .meta({\n id: 'DeleteRepoInput',\n title: 'deleteRepo input',\n description:\n 'Input of deleteRepo(): permanently delete a repository. Deleting a missing repository is not an error.',\n examples: [{ repo: 'acme-raw-content' }],\n });\n\n/** Input of `deleteRepo`, inferred from {@link DeleteRepoInput}. */\nexport type DeleteRepoInput = z.input<typeof DeleteRepoInput>;\n\n/** Output of `deleteRepo`. */\nexport const DeleteRepoOutput = z\n .object({\n deleted: z.boolean().describe('true when a repository was deleted; false when none had that name.'),\n })\n .strict()\n .meta({\n id: 'DeleteRepoOutput',\n title: 'deleteRepo output',\n description: 'Output of deleteRepo().',\n examples: [{ deleted: true }],\n });\n\n/** Output of `deleteRepo`, inferred from {@link DeleteRepoOutput}. */\nexport type DeleteRepoOutput = z.infer<typeof DeleteRepoOutput>;\n"],"mappings":";;;;;;AAQA,MAAa,kBAAkB,EAC5B,OAAO;CACN,MAAM,SAAS,SAAS,mCAAmC;CAC3D,eAAe,WAAW,QAAQ,MAAM,CAAC,CAAC,SACxC,uFACF;AACF,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC;EAAE,MAAM;EAAoB,eAAe;CAAO,CAAC;AAChE,CAAC;;AAMH,MAAa,WAAW,EACrB,OAAO;CACN,MAAM,SAAS,SAAS,sBAAsB;CAC9C,eAAe,WAAW,SAAS,wBAAwB;CAC3D,WAAW,UAAU,SAAS,kCAAkC;CAChE,WAAW,EAAE,IAAI,CAAC,CAAC,SAAS,yEAAyE;AACvG,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CACR;EACE,MAAM;EACN,eAAe;EACf,WAAW;EACX,WAAW;CACb,CACF;AACF,CAAC;;AAMH,MAAa,mBAAmB,SAAS,KAAK;CAC5C,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CACR;EACE,MAAM;EACN,eAAe;EACf,WAAW;EACX,WAAW;CACb,CACF;AACF,CAAC;;AAMD,MAAa,kBAAkB,EAC5B,OAAO,EACN,MAAM,SAAS,SAAS,sEAAsE,EAChG,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACzC,CAAC;;AAMH,MAAa,mBAAmB,EAC7B,OAAO,EACN,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS,oEAAoE,EACpG,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CAAC,EAAE,SAAS,KAAK,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ /** Input of `resolveRef`. */
3
+ export declare const ResolveRefInput: z.ZodObject<{
4
+ repo: z.ZodString;
5
+ ref: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
6
+ }, z.core.$strict>;
7
+ /** Input of `resolveRef`, inferred from {@link ResolveRefInput}. */
8
+ export type ResolveRefInput = z.input<typeof ResolveRefInput>;
9
+ /** Output of `resolveRef`. */
10
+ export declare const ResolveRefOutput: z.ZodNullable<z.ZodObject<{
11
+ sha: z.ZodString;
12
+ }, z.core.$strict>>;
13
+ /** Output of `resolveRef`, inferred from {@link ResolveRefOutput}. */
14
+ export type ResolveRefOutput = z.infer<typeof ResolveRefOutput>;
15
+ //# sourceMappingURL=resolve-ref.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { EXAMPLE_SHA_B } from "../schemas/examples.js";
2
+ import { RepoName, Revision } from "../schemas/names.js";
3
+ import { Sha } from "../schemas/sha.js";
4
+ import { z } from "zod";
5
+ // src/rpc/resolve-ref.ts
6
+ /** Input of `resolveRef`. */
7
+ const ResolveRefInput = z.object({
8
+ repo: RepoName.describe("Repository to look in."),
9
+ ref: Revision.describe("Branch name to resolve, or commit id to check.")
10
+ }).strict().meta({
11
+ id: "ResolveRefInput",
12
+ title: "resolveRef input",
13
+ description: "Input of resolveRef(): resolve a branch to its head, or confirm a commit id exists.",
14
+ examples: [{
15
+ repo: "acme-raw-content",
16
+ ref: "main"
17
+ }]
18
+ });
19
+ /** Output of `resolveRef`. */
20
+ const ResolveRefOutput = z.object({ sha: Sha.describe("Id of the commit the ref names.") }).strict().nullable().meta({
21
+ id: "ResolveRefOutput",
22
+ title: "resolveRef output",
23
+ description: "Output of resolveRef(): the commit id the ref names, or null when the branch or commit does not exist.",
24
+ examples: [{ sha: EXAMPLE_SHA_B }, null]
25
+ });
26
+ export { ResolveRefInput, ResolveRefOutput };
27
+
28
+ //# sourceMappingURL=resolve-ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-ref.js","names":[],"sources":["../../src/rpc/resolve-ref.ts"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\nimport { z } from 'zod';\n\nimport { EXAMPLE_SHA_B } from '../schemas/examples.ts';\nimport { RepoName, Revision } from '../schemas/names.ts';\nimport { Sha } from '../schemas/sha.ts';\n\n/** Input of `resolveRef`. */\nexport const ResolveRefInput = z\n .object({\n repo: RepoName.describe('Repository to look in.'),\n ref: Revision.describe('Branch name to resolve, or commit id to check.'),\n })\n .strict()\n .meta({\n id: 'ResolveRefInput',\n title: 'resolveRef input',\n description: 'Input of resolveRef(): resolve a branch to its head, or confirm a commit id exists.',\n examples: [{ repo: 'acme-raw-content', ref: 'main' }],\n });\n\n/** Input of `resolveRef`, inferred from {@link ResolveRefInput}. */\nexport type ResolveRefInput = z.input<typeof ResolveRefInput>;\n\n/** Output of `resolveRef`. */\nexport const ResolveRefOutput = z\n .object({\n sha: Sha.describe('Id of the commit the ref names.'),\n })\n .strict()\n .nullable()\n .meta({\n id: 'ResolveRefOutput',\n title: 'resolveRef output',\n description:\n 'Output of resolveRef(): the commit id the ref names, or null when the branch or commit does not exist.',\n examples: [{ sha: EXAMPLE_SHA_B }, null],\n });\n\n/** Output of `resolveRef`, inferred from {@link ResolveRefOutput}. */\nexport type ResolveRefOutput = z.infer<typeof ResolveRefOutput>;\n"],"mappings":";;;;;;AAQA,MAAa,kBAAkB,EAC5B,OAAO;CACN,MAAM,SAAS,SAAS,wBAAwB;CAChD,KAAK,SAAS,SAAS,gDAAgD;AACzE,CAAC,CAAC,CACD,OAAO,CAAC,CACR,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,UAAU,CAAC;EAAE,MAAM;EAAoB,KAAK;CAAO,CAAC;AACtD,CAAC;;AAMH,MAAa,mBAAmB,EAC7B,OAAO,EACN,KAAK,IAAI,SAAS,iCAAiC,EACrD,CAAC,CAAC,CACD,OAAO,CAAC,CACR,SAAS,CAAC,CACV,KAAK;CACJ,IAAI;CACJ,OAAO;CACP,aACE;CACF,UAAU,CAAC,EAAE,KAAK,cAAc,GAAG,IAAI;AACzC,CAAC"}