@cat-factory/contracts 0.33.0 → 0.35.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 (228) hide show
  1. package/dist/api-keys.d.ts +17 -0
  2. package/dist/api-keys.d.ts.map +1 -1
  3. package/dist/api-keys.js +2 -0
  4. package/dist/api-keys.js.map +1 -1
  5. package/dist/entities.d.ts +135 -0
  6. package/dist/entities.d.ts.map +1 -1
  7. package/dist/entities.js +46 -0
  8. package/dist/entities.js.map +1 -1
  9. package/dist/github.d.ts +14 -0
  10. package/dist/github.d.ts.map +1 -1
  11. package/dist/github.js +13 -0
  12. package/dist/github.js.map +1 -1
  13. package/dist/human-review.d.ts +8 -0
  14. package/dist/human-review.d.ts.map +1 -0
  15. package/dist/human-review.js +12 -0
  16. package/dist/human-review.js.map +1 -0
  17. package/dist/index.d.ts +2 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +2 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/merge.d.ts +9 -0
  22. package/dist/merge.d.ts.map +1 -1
  23. package/dist/merge.js +10 -0
  24. package/dist/merge.js.map +1 -1
  25. package/dist/notifications.d.ts +2 -2
  26. package/dist/notifications.d.ts.map +1 -1
  27. package/dist/notifications.js +6 -0
  28. package/dist/notifications.js.map +1 -1
  29. package/dist/observability.d.ts +63 -0
  30. package/dist/observability.d.ts.map +1 -1
  31. package/dist/observability.js +57 -0
  32. package/dist/observability.js.map +1 -1
  33. package/dist/requests.d.ts +7 -0
  34. package/dist/requests.d.ts.map +1 -1
  35. package/dist/requests.js +2 -0
  36. package/dist/requests.js.map +1 -1
  37. package/dist/routes/_shared.d.ts +49 -0
  38. package/dist/routes/_shared.d.ts.map +1 -0
  39. package/dist/routes/_shared.js +34 -0
  40. package/dist/routes/_shared.js.map +1 -0
  41. package/dist/routes/accounts.d.ts +775 -0
  42. package/dist/routes/accounts.d.ts.map +1 -0
  43. package/dist/routes/accounts.js +145 -0
  44. package/dist/routes/accounts.js.map +1 -0
  45. package/dist/routes/agent-runs.d.ts +659 -0
  46. package/dist/routes/agent-runs.d.ts.map +1 -0
  47. package/dist/routes/agent-runs.js +33 -0
  48. package/dist/routes/agent-runs.js.map +1 -0
  49. package/dist/routes/api-keys.d.ts +245 -0
  50. package/dist/routes/api-keys.d.ts.map +1 -0
  51. package/dist/routes/api-keys.js +49 -0
  52. package/dist/routes/api-keys.js.map +1 -0
  53. package/dist/routes/auth.d.ts +411 -0
  54. package/dist/routes/auth.d.ts.map +1 -0
  55. package/dist/routes/auth.js +129 -0
  56. package/dist/routes/auth.js.map +1 -0
  57. package/dist/routes/board.d.ts +1260 -0
  58. package/dist/routes/board.d.ts.map +1 -0
  59. package/dist/routes/board.js +85 -0
  60. package/dist/routes/board.js.map +1 -0
  61. package/dist/routes/bootstrap.d.ts +395 -0
  62. package/dist/routes/bootstrap.d.ts.map +1 -0
  63. package/dist/routes/bootstrap.js +56 -0
  64. package/dist/routes/bootstrap.js.map +1 -0
  65. package/dist/routes/brainstorm.d.ts +482 -0
  66. package/dist/routes/brainstorm.d.ts.map +1 -0
  67. package/dist/routes/brainstorm.js +69 -0
  68. package/dist/routes/brainstorm.js.map +1 -0
  69. package/dist/routes/clarity.d.ts +462 -0
  70. package/dist/routes/clarity.d.ts.map +1 -0
  71. package/dist/routes/clarity.js +67 -0
  72. package/dist/routes/clarity.js.map +1 -0
  73. package/dist/routes/consensus.d.ts +71 -0
  74. package/dist/routes/consensus.d.ts.map +1 -0
  75. package/dist/routes/consensus.js +23 -0
  76. package/dist/routes/consensus.js.map +1 -0
  77. package/dist/routes/documents.d.ts +449 -0
  78. package/dist/routes/documents.d.ts.map +1 -0
  79. package/dist/routes/documents.js +89 -0
  80. package/dist/routes/documents.js.map +1 -0
  81. package/dist/routes/environments.d.ts +715 -0
  82. package/dist/routes/environments.d.ts.map +1 -0
  83. package/dist/routes/environments.js +82 -0
  84. package/dist/routes/environments.js.map +1 -0
  85. package/dist/routes/execution.d.ts +2768 -0
  86. package/dist/routes/execution.d.ts.map +1 -0
  87. package/dist/routes/execution.js +119 -0
  88. package/dist/routes/execution.js.map +1 -0
  89. package/dist/routes/followUp.d.ts +277 -0
  90. package/dist/routes/followUp.d.ts.map +1 -0
  91. package/dist/routes/followUp.js +47 -0
  92. package/dist/routes/followUp.js.map +1 -0
  93. package/dist/routes/fragment-library.d.ts +594 -0
  94. package/dist/routes/fragment-library.d.ts.map +1 -0
  95. package/dist/routes/fragment-library.js +102 -0
  96. package/dist/routes/fragment-library.js.map +1 -0
  97. package/dist/routes/github.d.ts +807 -0
  98. package/dist/routes/github.d.ts.map +1 -0
  99. package/dist/routes/github.js +157 -0
  100. package/dist/routes/github.js.map +1 -0
  101. package/dist/routes/human-review.d.ts +290 -0
  102. package/dist/routes/human-review.d.ts.map +1 -0
  103. package/dist/routes/human-review.js +20 -0
  104. package/dist/routes/human-review.js.map +1 -0
  105. package/dist/routes/human-test.d.ts +1435 -0
  106. package/dist/routes/human-test.d.ts.map +1 -0
  107. package/dist/routes/human-test.js +48 -0
  108. package/dist/routes/human-test.js.map +1 -0
  109. package/dist/routes/incident-enrichment.d.ts +110 -0
  110. package/dist/routes/incident-enrichment.d.ts.map +1 -0
  111. package/dist/routes/incident-enrichment.js +26 -0
  112. package/dist/routes/incident-enrichment.js.map +1 -0
  113. package/dist/routes/index.d.ts +47 -0
  114. package/dist/routes/index.d.ts.map +1 -0
  115. package/dist/routes/index.js +50 -0
  116. package/dist/routes/index.js.map +1 -0
  117. package/dist/routes/kaizen.d.ts +113 -0
  118. package/dist/routes/kaizen.d.ts.map +1 -0
  119. package/dist/routes/kaizen.js +22 -0
  120. package/dist/routes/kaizen.js.map +1 -0
  121. package/dist/routes/localModels.d.ts +163 -0
  122. package/dist/routes/localModels.d.ts.map +1 -0
  123. package/dist/routes/localModels.js +41 -0
  124. package/dist/routes/localModels.js.map +1 -0
  125. package/dist/routes/localSettings.d.ts +93 -0
  126. package/dist/routes/localSettings.d.ts.map +1 -0
  127. package/dist/routes/localSettings.js +22 -0
  128. package/dist/routes/localSettings.js.map +1 -0
  129. package/dist/routes/merge.d.ts +197 -0
  130. package/dist/routes/merge.d.ts.map +1 -0
  131. package/dist/routes/merge.js +36 -0
  132. package/dist/routes/merge.js.map +1 -0
  133. package/dist/routes/model-presets.d.ts +162 -0
  134. package/dist/routes/model-presets.d.ts.map +1 -0
  135. package/dist/routes/model-presets.js +36 -0
  136. package/dist/routes/model-presets.js.map +1 -0
  137. package/dist/routes/models.d.ts +123 -0
  138. package/dist/routes/models.d.ts.map +1 -0
  139. package/dist/routes/models.js +25 -0
  140. package/dist/routes/models.js.map +1 -0
  141. package/dist/routes/notifications.d.ts +213 -0
  142. package/dist/routes/notifications.d.ts.map +1 -0
  143. package/dist/routes/notifications.js +31 -0
  144. package/dist/routes/notifications.js.map +1 -0
  145. package/dist/routes/openrouter.d.ts +145 -0
  146. package/dist/routes/openrouter.d.ts.map +1 -0
  147. package/dist/routes/openrouter.js +32 -0
  148. package/dist/routes/openrouter.js.map +1 -0
  149. package/dist/routes/personal-subscriptions.d.ts +124 -0
  150. package/dist/routes/personal-subscriptions.d.ts.map +1 -0
  151. package/dist/routes/personal-subscriptions.js +32 -0
  152. package/dist/routes/personal-subscriptions.js.map +1 -0
  153. package/dist/routes/pipelines.d.ts +457 -0
  154. package/dist/routes/pipelines.d.ts.map +1 -0
  155. package/dist/routes/pipelines.js +51 -0
  156. package/dist/routes/pipelines.js.map +1 -0
  157. package/dist/routes/prompt-fragments.d.ts +52 -0
  158. package/dist/routes/prompt-fragments.d.ts.map +1 -0
  159. package/dist/routes/prompt-fragments.js +14 -0
  160. package/dist/routes/prompt-fragments.js.map +1 -0
  161. package/dist/routes/provisioning-logs.d.ts +45 -0
  162. package/dist/routes/provisioning-logs.d.ts.map +1 -0
  163. package/dist/routes/provisioning-logs.js +14 -0
  164. package/dist/routes/provisioning-logs.js.map +1 -0
  165. package/dist/routes/recurring.d.ts +309 -0
  166. package/dist/routes/recurring.d.ts.map +1 -0
  167. package/dist/routes/recurring.js +50 -0
  168. package/dist/routes/recurring.js.map +1 -0
  169. package/dist/routes/release.d.ts +218 -0
  170. package/dist/routes/release.d.ts.map +1 -0
  171. package/dist/routes/release.js +47 -0
  172. package/dist/routes/release.js.map +1 -0
  173. package/dist/routes/requirements.d.ts +901 -0
  174. package/dist/routes/requirements.d.ts.map +1 -0
  175. package/dist/routes/requirements.js +96 -0
  176. package/dist/routes/requirements.js.map +1 -0
  177. package/dist/routes/runners.d.ts +442 -0
  178. package/dist/routes/runners.d.ts.map +1 -0
  179. package/dist/routes/runners.js +47 -0
  180. package/dist/routes/runners.js.map +1 -0
  181. package/dist/routes/sandbox.d.ts +898 -0
  182. package/dist/routes/sandbox.d.ts.map +1 -0
  183. package/dist/routes/sandbox.js +119 -0
  184. package/dist/routes/sandbox.js.map +1 -0
  185. package/dist/routes/service-fragment-defaults.d.ts +66 -0
  186. package/dist/routes/service-fragment-defaults.d.ts.map +1 -0
  187. package/dist/routes/service-fragment-defaults.js +20 -0
  188. package/dist/routes/service-fragment-defaults.js.map +1 -0
  189. package/dist/routes/services.d.ts +224 -0
  190. package/dist/routes/services.d.ts.map +1 -0
  191. package/dist/routes/services.js +44 -0
  192. package/dist/routes/services.js.map +1 -0
  193. package/dist/routes/slack.d.ts +332 -0
  194. package/dist/routes/slack.d.ts.map +1 -0
  195. package/dist/routes/slack.js +72 -0
  196. package/dist/routes/slack.js.map +1 -0
  197. package/dist/routes/spec.d.ts +76 -0
  198. package/dist/routes/spec.d.ts.map +1 -0
  199. package/dist/routes/spec.js +17 -0
  200. package/dist/routes/spec.js.map +1 -0
  201. package/dist/routes/tasks.d.ts +723 -0
  202. package/dist/routes/tasks.d.ts.map +1 -0
  203. package/dist/routes/tasks.js +108 -0
  204. package/dist/routes/tasks.js.map +1 -0
  205. package/dist/routes/tracker.d.ts +77 -0
  206. package/dist/routes/tracker.d.ts.map +1 -0
  207. package/dist/routes/tracker.js +20 -0
  208. package/dist/routes/tracker.js.map +1 -0
  209. package/dist/routes/user-secret.d.ts +231 -0
  210. package/dist/routes/user-secret.d.ts.map +1 -0
  211. package/dist/routes/user-secret.js +49 -0
  212. package/dist/routes/user-secret.js.map +1 -0
  213. package/dist/routes/vendor-credentials.d.ts +120 -0
  214. package/dist/routes/vendor-credentials.d.ts.map +1 -0
  215. package/dist/routes/vendor-credentials.js +33 -0
  216. package/dist/routes/vendor-credentials.js.map +1 -0
  217. package/dist/routes/workspace-settings.d.ts +93 -0
  218. package/dist/routes/workspace-settings.d.ts.map +1 -0
  219. package/dist/routes/workspace-settings.js +20 -0
  220. package/dist/routes/workspace-settings.js.map +1 -0
  221. package/dist/routes/workspaces.d.ts +1309 -0
  222. package/dist/routes/workspaces.d.ts.map +1 -0
  223. package/dist/routes/workspaces.js +45 -0
  224. package/dist/routes/workspaces.js.map +1 -0
  225. package/dist/slack.d.ts +2 -2
  226. package/dist/snapshot.d.ts +11 -1
  227. package/dist/snapshot.d.ts.map +1 -1
  228. package/package.json +3 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/routes/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqC,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAgD5B,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIlC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMvC,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAItC,CAAA;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMpC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKvC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMrC,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI5B,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM7B,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM9B,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAK3B,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKtC,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM5B,CAAA"}
@@ -0,0 +1,108 @@
1
+ import { ContractNoBody, defineApiContract, withObjectKeys } from '@toad-contracts/valibot';
2
+ import * as v from 'valibot';
3
+ import { blockSchema } from '../entities.js';
4
+ import { connectTaskSourceSchema, createTaskFromIssueSchema, importTaskSchema, linkTaskSchema, searchTasksSchema, setTaskSourceEnabledSchema, sourceTaskSchema, spawnEpicSchema, taskConnectionSchema, taskSearchResultSchema, taskSourceDiagnosticSchema, taskSourceStateSchema, } from '../tasks.js';
5
+ import { errorResponses } from './_shared.js';
6
+ // ---------------------------------------------------------------------------
7
+ // Task-source route contracts: source discovery + per-workspace toggle,
8
+ // connection management, live diagnostics, issue import/listing, linking an
9
+ // issue to a block as agent context, materialising an issue as a board task,
10
+ // and spawning an epic. Mounted under `/workspaces/:workspaceId`, so the paths
11
+ // here are relative to that prefix. See TaskSourceController.
12
+ // ---------------------------------------------------------------------------
13
+ const sourceParams = withObjectKeys(v.object({ source: v.string() }));
14
+ // Response wrappers that exist only inline in the controller today.
15
+ const taskSourcesViewSchema = v.object({
16
+ sources: v.array(taskSourceStateSchema),
17
+ });
18
+ const taskConnectionsViewSchema = v.object({
19
+ connections: v.array(taskConnectionSchema),
20
+ });
21
+ const taskListSchema = v.array(sourceTaskSchema);
22
+ const taskSearchResultsViewSchema = v.object({
23
+ results: v.array(taskSearchResultSchema),
24
+ });
25
+ const createTaskFromIssueResultSchema = v.object({
26
+ block: blockSchema,
27
+ task: sourceTaskSchema,
28
+ });
29
+ const spawnEpicResultSchema = v.object({
30
+ epic: blockSchema,
31
+ tasks: v.array(blockSchema),
32
+ });
33
+ export const listTaskSourcesContract = defineApiContract({
34
+ method: 'get',
35
+ pathResolver: () => '/task-sources',
36
+ responsesByStatusCode: { 200: taskSourcesViewSchema, ...errorResponses },
37
+ });
38
+ export const setTaskSourceEnabledContract = defineApiContract({
39
+ method: 'put',
40
+ requestPathParamsSchema: sourceParams,
41
+ pathResolver: ({ source }) => `/task-sources/${source}/enabled`,
42
+ requestBodySchema: setTaskSourceEnabledSchema,
43
+ responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
44
+ });
45
+ export const listTaskConnectionsContract = defineApiContract({
46
+ method: 'get',
47
+ pathResolver: () => '/task-sources/connections',
48
+ responsesByStatusCode: { 200: taskConnectionsViewSchema, ...errorResponses },
49
+ });
50
+ export const connectTaskSourceContract = defineApiContract({
51
+ method: 'post',
52
+ requestPathParamsSchema: sourceParams,
53
+ pathResolver: ({ source }) => `/task-sources/${source}/connect`,
54
+ requestBodySchema: connectTaskSourceSchema,
55
+ responsesByStatusCode: { 201: taskConnectionSchema, ...errorResponses },
56
+ });
57
+ export const disconnectTaskSourceContract = defineApiContract({
58
+ method: 'delete',
59
+ requestPathParamsSchema: sourceParams,
60
+ pathResolver: ({ source }) => `/task-sources/${source}/connection`,
61
+ responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
62
+ });
63
+ export const diagnoseTaskSourceContract = defineApiContract({
64
+ method: 'post',
65
+ requestPathParamsSchema: sourceParams,
66
+ pathResolver: ({ source }) => `/task-sources/${source}/diagnostics`,
67
+ requestBodySchema: ContractNoBody,
68
+ responsesByStatusCode: { 200: taskSourceDiagnosticSchema, ...errorResponses },
69
+ });
70
+ export const listTasksContract = defineApiContract({
71
+ method: 'get',
72
+ pathResolver: () => '/tasks',
73
+ responsesByStatusCode: { 200: taskListSchema, ...errorResponses },
74
+ });
75
+ export const importTaskContract = defineApiContract({
76
+ method: 'post',
77
+ requestPathParamsSchema: sourceParams,
78
+ pathResolver: ({ source }) => `/task-sources/${source}/import`,
79
+ requestBodySchema: importTaskSchema,
80
+ responsesByStatusCode: { 201: sourceTaskSchema, ...errorResponses },
81
+ });
82
+ export const searchTasksContract = defineApiContract({
83
+ method: 'post',
84
+ requestPathParamsSchema: sourceParams,
85
+ pathResolver: ({ source }) => `/task-sources/${source}/search`,
86
+ requestBodySchema: searchTasksSchema,
87
+ responsesByStatusCode: { 200: taskSearchResultsViewSchema, ...errorResponses },
88
+ });
89
+ export const linkTaskContract = defineApiContract({
90
+ method: 'post',
91
+ pathResolver: () => '/tasks/link',
92
+ requestBodySchema: linkTaskSchema,
93
+ responsesByStatusCode: { 201: sourceTaskSchema, ...errorResponses },
94
+ });
95
+ export const createTaskFromIssueContract = defineApiContract({
96
+ method: 'post',
97
+ pathResolver: () => '/tasks/create-block',
98
+ requestBodySchema: createTaskFromIssueSchema,
99
+ responsesByStatusCode: { 201: createTaskFromIssueResultSchema, ...errorResponses },
100
+ });
101
+ export const spawnEpicContract = defineApiContract({
102
+ method: 'post',
103
+ requestPathParamsSchema: sourceParams,
104
+ pathResolver: ({ source }) => `/task-sources/${source}/epics/spawn`,
105
+ requestBodySchema: spawnEpicSchema,
106
+ responsesByStatusCode: { 201: spawnEpicResultSchema, ...errorResponses },
107
+ });
108
+ //# sourceMappingURL=tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/routes/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,8EAA8E;AAC9E,wEAAwE;AACxE,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,8DAA8D;AAC9D,8EAA8E;AAE9E,MAAM,YAAY,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAA;AAErE,oEAAoE;AACpE,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC;CACxC,CAAC,CAAA;AACF,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC;CAC3C,CAAC,CAAA;AACF,MAAM,cAAc,GAA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athResolver: () => string;
4
+ readonly responsesByStatusCode: {
5
+ readonly '4xx': import("valibot").ObjectSchema<{
6
+ readonly error: import("valibot").ObjectSchema<{
7
+ readonly code: import("valibot").StringSchema<undefined>;
8
+ readonly message: import("valibot").StringSchema<undefined>;
9
+ readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
10
+ readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
11
+ readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
12
+ readonly message: import("valibot").StringSchema<undefined>;
13
+ }, undefined>, undefined>, undefined>;
14
+ }, undefined>;
15
+ }, undefined>;
16
+ readonly '5xx': import("valibot").ObjectSchema<{
17
+ readonly error: import("valibot").ObjectSchema<{
18
+ readonly code: import("valibot").StringSchema<undefined>;
19
+ readonly message: import("valibot").StringSchema<undefined>;
20
+ readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
21
+ readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
22
+ readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
23
+ readonly message: import("valibot").StringSchema<undefined>;
24
+ }, undefined>, undefined>, undefined>;
25
+ }, undefined>;
26
+ }, undefined>;
27
+ readonly 200: import("valibot").ObjectSchema<{
28
+ readonly tracker: import("valibot").NullableSchema<import("valibot").PicklistSchema<["github", "jira"], undefined>, undefined>;
29
+ readonly jiraProjectKey: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
30
+ readonly writebackCommentOnPrOpen: import("valibot").BooleanSchema<undefined>;
31
+ readonly writebackResolveOnMerge: import("valibot").BooleanSchema<undefined>;
32
+ readonly updatedAt: import("valibot").NumberSchema<undefined>;
33
+ }, undefined>;
34
+ };
35
+ };
36
+ export declare const putTrackerSettingsContract: {
37
+ readonly method: "put";
38
+ readonly pathResolver: () => string;
39
+ readonly requestBodySchema: import("valibot").ObjectSchema<{
40
+ readonly tracker: import("valibot").NullableSchema<import("valibot").PicklistSchema<["github", "jira"], undefined>, undefined>;
41
+ readonly jiraProjectKey: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TrimAction]>, undefined>, undefined>;
42
+ readonly writebackCommentOnPrOpen: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
43
+ readonly writebackResolveOnMerge: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
44
+ }, undefined>;
45
+ readonly responsesByStatusCode: {
46
+ readonly '4xx': import("valibot").ObjectSchema<{
47
+ readonly error: import("valibot").ObjectSchema<{
48
+ readonly code: import("valibot").StringSchema<undefined>;
49
+ readonly message: import("valibot").StringSchema<undefined>;
50
+ readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
51
+ readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
52
+ readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
53
+ readonly message: import("valibot").StringSchema<undefined>;
54
+ }, undefined>, undefined>, undefined>;
55
+ }, undefined>;
56
+ }, undefined>;
57
+ readonly '5xx': import("valibot").ObjectSchema<{
58
+ readonly error: import("valibot").ObjectSchema<{
59
+ readonly code: import("valibot").StringSchema<undefined>;
60
+ readonly message: import("valibot").StringSchema<undefined>;
61
+ readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
62
+ readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
63
+ readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
64
+ readonly message: import("valibot").StringSchema<undefined>;
65
+ }, undefined>, undefined>, undefined>;
66
+ }, undefined>;
67
+ }, undefined>;
68
+ readonly 200: import("valibot").ObjectSchema<{
69
+ readonly tracker: import("valibot").NullableSchema<import("valibot").PicklistSchema<["github", "jira"], undefined>, undefined>;
70
+ readonly jiraProjectKey: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
71
+ readonly writebackCommentOnPrOpen: import("valibot").BooleanSchema<undefined>;
72
+ readonly writebackResolveOnMerge: import("valibot").BooleanSchema<undefined>;
73
+ readonly updatedAt: import("valibot").NumberSchema<undefined>;
74
+ }, undefined>;
75
+ };
76
+ };
77
+ //# sourceMappingURL=tracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracker.d.ts","sourceRoot":"","sources":["../../src/routes/tracker.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIrC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKrC,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { defineApiContract } from '@toad-contracts/valibot';
2
+ import { putTrackerSettingsSchema, trackerSettingsSchema } from '../tracker.js';
3
+ import { errorResponses } from './_shared.js';
4
+ // ---------------------------------------------------------------------------
5
+ // Issue-tracker settings route contracts. Mounted under `/workspaces/:workspaceId`,
6
+ // so the paths here are relative to that prefix. See TrackerSettingsController in
7
+ // @cat-factory/server.
8
+ // ---------------------------------------------------------------------------
9
+ export const getTrackerSettingsContract = defineApiContract({
10
+ method: 'get',
11
+ pathResolver: () => '/tracker-settings',
12
+ responsesByStatusCode: { 200: trackerSettingsSchema, ...errorResponses },
13
+ });
14
+ export const putTrackerSettingsContract = defineApiContract({
15
+ method: 'put',
16
+ pathResolver: () => '/tracker-settings',
17
+ requestBodySchema: putTrackerSettingsSchema,
18
+ responsesByStatusCode: { 200: trackerSettingsSchema, ...errorResponses },
19
+ });
20
+ //# sourceMappingURL=tracker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracker.js","sourceRoot":"","sources":["../../src/routes/tracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,8EAA8E;AAC9E,oFAAoF;AACpF,kFAAkF;AAClF,uBAAuB;AACvB,8EAA8E;AAE9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC;IAC1D,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,mBAAmB;IACvC,qBAAqB,EAAE,EAAE,GAAG,EAAE,qBAAqB,EAAE,GAAG,cAAc,EAAE;CACzE,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC;IAC1D,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,mBAAmB;IACvC,iBAAiB,EAAE,wBAAwB;IAC3C,qBAAqB,EAAE,EAAE,GAAG,EAAE,qBAAqB,EAAE,GAAG,cAAc,EAAE;CACzE,CAAC,CAAA"}
@@ -0,0 +1,231 @@
1
+ import { ContractNoBody } from '@toad-contracts/valibot';
2
+ import * as v from 'valibot';
3
+ export declare const listUserSecretsContract: {
4
+ readonly method: "get";
5
+ readonly pathResolver: () => string;
6
+ readonly responsesByStatusCode: {
7
+ readonly '4xx': v.ObjectSchema<{
8
+ readonly error: v.ObjectSchema<{
9
+ readonly code: v.StringSchema<undefined>;
10
+ readonly message: v.StringSchema<undefined>;
11
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
12
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
13
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
14
+ readonly message: v.StringSchema<undefined>;
15
+ }, undefined>, undefined>, undefined>;
16
+ }, undefined>;
17
+ }, undefined>;
18
+ readonly '5xx': v.ObjectSchema<{
19
+ readonly error: v.ObjectSchema<{
20
+ readonly code: v.StringSchema<undefined>;
21
+ readonly message: v.StringSchema<undefined>;
22
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
23
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
24
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
25
+ readonly message: v.StringSchema<undefined>;
26
+ }, undefined>, undefined>, undefined>;
27
+ }, undefined>;
28
+ }, undefined>;
29
+ readonly 200: v.ObjectSchema<{
30
+ readonly secrets: v.ArraySchema<v.ObjectSchema<{
31
+ readonly kind: v.PicklistSchema<readonly ["github_pat"], undefined>;
32
+ readonly label: v.StringSchema<undefined>;
33
+ readonly hasSecret: v.BooleanSchema<undefined>;
34
+ readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
35
+ readonly connectedAt: v.NumberSchema<undefined>;
36
+ }, undefined>, undefined>;
37
+ readonly descriptors: v.ArraySchema<v.ObjectSchema<{
38
+ readonly kind: v.PicklistSchema<readonly ["github_pat"], undefined>;
39
+ readonly label: v.StringSchema<undefined>;
40
+ readonly configFields: v.ArraySchema<v.ObjectSchema<{
41
+ readonly key: v.StringSchema<undefined>;
42
+ readonly label: v.StringSchema<undefined>;
43
+ readonly help: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
44
+ readonly placeholder: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
45
+ readonly secret: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
46
+ readonly required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
47
+ readonly type: v.OptionalSchema<v.PicklistSchema<["text", "password", "select"], undefined>, undefined>;
48
+ readonly options: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
49
+ readonly value: v.StringSchema<undefined>;
50
+ readonly label: v.StringSchema<undefined>;
51
+ }, undefined>, undefined>, undefined>;
52
+ readonly default: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
53
+ }, undefined>, undefined>;
54
+ readonly supportsTest: v.BooleanSchema<undefined>;
55
+ }, undefined>, undefined>;
56
+ }, undefined>;
57
+ };
58
+ };
59
+ export declare const getUserSecretDescriptorContract: {
60
+ readonly method: "get";
61
+ readonly requestPathParamsSchema: v.ObjectSchema<{
62
+ readonly kind: v.StringSchema<undefined>;
63
+ }, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
64
+ readonly pathResolver: ({ kind }: {
65
+ kind: string;
66
+ }) => string;
67
+ readonly responsesByStatusCode: {
68
+ readonly '4xx': v.ObjectSchema<{
69
+ readonly error: v.ObjectSchema<{
70
+ readonly code: v.StringSchema<undefined>;
71
+ readonly message: v.StringSchema<undefined>;
72
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
73
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
74
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
75
+ readonly message: v.StringSchema<undefined>;
76
+ }, undefined>, undefined>, undefined>;
77
+ }, undefined>;
78
+ }, undefined>;
79
+ readonly '5xx': v.ObjectSchema<{
80
+ readonly error: v.ObjectSchema<{
81
+ readonly code: v.StringSchema<undefined>;
82
+ readonly message: v.StringSchema<undefined>;
83
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
84
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
85
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
86
+ readonly message: v.StringSchema<undefined>;
87
+ }, undefined>, undefined>, undefined>;
88
+ }, undefined>;
89
+ }, undefined>;
90
+ readonly 200: v.ObjectSchema<{
91
+ readonly kind: v.PicklistSchema<readonly ["github_pat"], undefined>;
92
+ readonly label: v.StringSchema<undefined>;
93
+ readonly configFields: v.ArraySchema<v.ObjectSchema<{
94
+ readonly key: v.StringSchema<undefined>;
95
+ readonly label: v.StringSchema<undefined>;
96
+ readonly help: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
97
+ readonly placeholder: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
98
+ readonly secret: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
99
+ readonly required: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
100
+ readonly type: v.OptionalSchema<v.PicklistSchema<["text", "password", "select"], undefined>, undefined>;
101
+ readonly options: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
102
+ readonly value: v.StringSchema<undefined>;
103
+ readonly label: v.StringSchema<undefined>;
104
+ }, undefined>, undefined>, undefined>;
105
+ readonly default: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
106
+ }, undefined>, undefined>;
107
+ readonly supportsTest: v.BooleanSchema<undefined>;
108
+ }, undefined>;
109
+ };
110
+ };
111
+ export declare const storeUserSecretContract: {
112
+ readonly method: "post";
113
+ readonly requestPathParamsSchema: v.ObjectSchema<{
114
+ readonly kind: v.StringSchema<undefined>;
115
+ }, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
116
+ readonly pathResolver: ({ kind }: {
117
+ kind: string;
118
+ }) => string;
119
+ readonly requestBodySchema: v.ObjectSchema<{
120
+ readonly label: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 120, undefined>]>, undefined>;
121
+ readonly secret: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 4000, undefined>]>;
122
+ readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 2000, undefined>]>, undefined>, undefined>;
123
+ }, undefined>;
124
+ readonly responsesByStatusCode: {
125
+ readonly '4xx': v.ObjectSchema<{
126
+ readonly error: v.ObjectSchema<{
127
+ readonly code: v.StringSchema<undefined>;
128
+ readonly message: v.StringSchema<undefined>;
129
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
130
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
131
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
132
+ readonly message: v.StringSchema<undefined>;
133
+ }, undefined>, undefined>, undefined>;
134
+ }, undefined>;
135
+ }, undefined>;
136
+ readonly '5xx': v.ObjectSchema<{
137
+ readonly error: v.ObjectSchema<{
138
+ readonly code: v.StringSchema<undefined>;
139
+ readonly message: v.StringSchema<undefined>;
140
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
141
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
142
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
143
+ readonly message: v.StringSchema<undefined>;
144
+ }, undefined>, undefined>, undefined>;
145
+ }, undefined>;
146
+ }, undefined>;
147
+ readonly 201: v.ObjectSchema<{
148
+ readonly kind: v.PicklistSchema<readonly ["github_pat"], undefined>;
149
+ readonly label: v.StringSchema<undefined>;
150
+ readonly hasSecret: v.BooleanSchema<undefined>;
151
+ readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
152
+ readonly connectedAt: v.NumberSchema<undefined>;
153
+ }, undefined>;
154
+ };
155
+ };
156
+ export declare const removeUserSecretContract: {
157
+ readonly method: "delete";
158
+ readonly requestPathParamsSchema: v.ObjectSchema<{
159
+ readonly kind: v.StringSchema<undefined>;
160
+ }, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
161
+ readonly pathResolver: ({ kind }: {
162
+ kind: string;
163
+ }) => string;
164
+ readonly responsesByStatusCode: {
165
+ readonly '4xx': v.ObjectSchema<{
166
+ readonly error: v.ObjectSchema<{
167
+ readonly code: v.StringSchema<undefined>;
168
+ readonly message: v.StringSchema<undefined>;
169
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
170
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
171
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
172
+ readonly message: v.StringSchema<undefined>;
173
+ }, undefined>, undefined>, undefined>;
174
+ }, undefined>;
175
+ }, undefined>;
176
+ readonly '5xx': v.ObjectSchema<{
177
+ readonly error: v.ObjectSchema<{
178
+ readonly code: v.StringSchema<undefined>;
179
+ readonly message: v.StringSchema<undefined>;
180
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
181
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
182
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
183
+ readonly message: v.StringSchema<undefined>;
184
+ }, undefined>, undefined>, undefined>;
185
+ }, undefined>;
186
+ }, undefined>;
187
+ readonly 204: typeof ContractNoBody;
188
+ };
189
+ };
190
+ export declare const testUserSecretContract: {
191
+ readonly method: "post";
192
+ readonly requestPathParamsSchema: v.ObjectSchema<{
193
+ readonly kind: v.StringSchema<undefined>;
194
+ }, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
195
+ readonly pathResolver: ({ kind }: {
196
+ kind: string;
197
+ }) => string;
198
+ readonly requestBodySchema: v.ObjectSchema<{
199
+ readonly secret: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 4000, undefined>]>;
200
+ readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 2000, undefined>]>, undefined>, undefined>;
201
+ }, undefined>;
202
+ readonly responsesByStatusCode: {
203
+ readonly '4xx': v.ObjectSchema<{
204
+ readonly error: v.ObjectSchema<{
205
+ readonly code: v.StringSchema<undefined>;
206
+ readonly message: v.StringSchema<undefined>;
207
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
208
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
209
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
210
+ readonly message: v.StringSchema<undefined>;
211
+ }, undefined>, undefined>, undefined>;
212
+ }, undefined>;
213
+ }, undefined>;
214
+ readonly '5xx': v.ObjectSchema<{
215
+ readonly error: v.ObjectSchema<{
216
+ readonly code: v.StringSchema<undefined>;
217
+ readonly message: v.StringSchema<undefined>;
218
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
219
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
220
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
221
+ readonly message: v.StringSchema<undefined>;
222
+ }, undefined>, undefined>, undefined>;
223
+ }, undefined>;
224
+ }, undefined>;
225
+ readonly 200: v.ObjectSchema<{
226
+ readonly ok: v.BooleanSchema<undefined>;
227
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
228
+ }, undefined>;
229
+ };
230
+ };
231
+ //# sourceMappingURL=user-secret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-secret.d.ts","sourceRoot":"","sources":["../../src/routes/user-secret.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqC,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAyB5B,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIlC,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAK1C,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMlC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKnC,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMjC,CAAA"}
@@ -0,0 +1,49 @@
1
+ import { ContractNoBody, defineApiContract, withObjectKeys } from '@toad-contracts/valibot';
2
+ import * as v from 'valibot';
3
+ import { connectionTestResultSchema } from '../provider-config.js';
4
+ import { storeUserSecretSchema, testUserSecretSchema, userSecretDescriptorSchema, userSecretStatusSchema, } from '../user-secret.js';
5
+ import { errorResponses } from './_shared.js';
6
+ // ---------------------------------------------------------------------------
7
+ // Per-USER generic secret route contracts (a GitHub PAT today). Scoped to the
8
+ // signed-in user (not a workspace) and mounted at the root, so the paths here
9
+ // are absolute. The secret is write-only — only status metadata is returned.
10
+ // See UserSecretController in @cat-factory/server.
11
+ // ---------------------------------------------------------------------------
12
+ // Response wrapper that exists only inline in the controller today.
13
+ const userSecretsViewSchema = v.object({
14
+ secrets: v.array(userSecretStatusSchema),
15
+ descriptors: v.array(userSecretDescriptorSchema),
16
+ });
17
+ const kindParams = withObjectKeys(v.object({ kind: v.string() }));
18
+ export const listUserSecretsContract = defineApiContract({
19
+ method: 'get',
20
+ pathResolver: () => '/user-secrets',
21
+ responsesByStatusCode: { 200: userSecretsViewSchema, ...errorResponses },
22
+ });
23
+ export const getUserSecretDescriptorContract = defineApiContract({
24
+ method: 'get',
25
+ requestPathParamsSchema: kindParams,
26
+ pathResolver: ({ kind }) => `/user-secrets/${kind}/descriptor`,
27
+ responsesByStatusCode: { 200: userSecretDescriptorSchema, ...errorResponses },
28
+ });
29
+ export const storeUserSecretContract = defineApiContract({
30
+ method: 'post',
31
+ requestPathParamsSchema: kindParams,
32
+ pathResolver: ({ kind }) => `/user-secrets/${kind}`,
33
+ requestBodySchema: storeUserSecretSchema,
34
+ responsesByStatusCode: { 201: userSecretStatusSchema, ...errorResponses },
35
+ });
36
+ export const removeUserSecretContract = defineApiContract({
37
+ method: 'delete',
38
+ requestPathParamsSchema: kindParams,
39
+ pathResolver: ({ kind }) => `/user-secrets/${kind}`,
40
+ responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
41
+ });
42
+ export const testUserSecretContract = defineApiContract({
43
+ method: 'post',
44
+ requestPathParamsSchema: kindParams,
45
+ pathResolver: ({ kind }) => `/user-secrets/${kind}/test`,
46
+ requestBodySchema: testUserSecretSchema,
47
+ responsesByStatusCode: { 200: connectionTestResultSchema, ...errorResponses },
48
+ });
49
+ //# sourceMappingURL=user-secret.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-secret.js","sourceRoot":"","sources":["../../src/routes/user-secret.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,mDAAmD;AACnD,8EAA8E;AAE9E,oEAAoE;AACpE,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC;CACjD,CAAC,CAAA;AAEF,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAA;AAEjE,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;IACvD,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,eAAe;IACnC,qBAAqB,EAAE,EAAE,GAAG,EAAE,qBAAqB,EAAE,GAAG,cAAc,EAAE;CACzE,CAAC,CAAA;AAEF,MAAM,C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ialsContract: {
4
+ readonly method: "get";
5
+ readonly pathResolver: () => string;
6
+ readonly responsesByStatusCode: {
7
+ readonly '4xx': v.ObjectSchema<{
8
+ readonly error: v.ObjectSchema<{
9
+ readonly code: v.StringSchema<undefined>;
10
+ readonly message: v.StringSchema<undefined>;
11
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
12
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
13
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
14
+ readonly message: v.StringSchema<undefined>;
15
+ }, undefined>, undefined>, undefined>;
16
+ }, undefined>;
17
+ }, undefined>;
18
+ readonly '5xx': v.ObjectSchema<{
19
+ readonly error: v.ObjectSchema<{
20
+ readonly code: v.StringSchema<undefined>;
21
+ readonly message: v.StringSchema<undefined>;
22
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
23
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
24
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
25
+ readonly message: v.StringSchema<undefined>;
26
+ }, undefined>, undefined>, undefined>;
27
+ }, undefined>;
28
+ }, undefined>;
29
+ readonly 200: v.ObjectSchema<{
30
+ readonly credentials: v.ArraySchema<v.ObjectSchema<{
31
+ readonly id: v.StringSchema<undefined>;
32
+ readonly vendor: v.PicklistSchema<["claude", "codex", "glm", "kimi", "deepseek"], undefined>;
33
+ readonly label: v.StringSchema<undefined>;
34
+ readonly createdAt: v.NumberSchema<undefined>;
35
+ readonly lastUsedAt: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
36
+ readonly inputTokens: v.NumberSchema<undefined>;
37
+ readonly outputTokens: v.NumberSchema<undefined>;
38
+ readonly requestCount: v.NumberSchema<undefined>;
39
+ }, undefined>, undefined>;
40
+ }, undefined>;
41
+ };
42
+ };
43
+ export declare const addVendorCredentialContract: {
44
+ readonly method: "post";
45
+ readonly pathResolver: () => string;
46
+ readonly requestBodySchema: v.ObjectSchema<{
47
+ readonly vendor: v.PicklistSchema<["claude", "codex", "glm", "kimi", "deepseek"], undefined>;
48
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>;
49
+ readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
50
+ }, undefined>;
51
+ readonly responsesByStatusCode: {
52
+ readonly '4xx': v.ObjectSchema<{
53
+ readonly error: v.ObjectSchema<{
54
+ readonly code: v.StringSchema<undefined>;
55
+ readonly message: v.StringSchema<undefined>;
56
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
57
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
58
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
59
+ readonly message: v.StringSchema<undefined>;
60
+ }, undefined>, undefined>, undefined>;
61
+ }, undefined>;
62
+ }, undefined>;
63
+ readonly '5xx': v.ObjectSchema<{
64
+ readonly error: v.ObjectSchema<{
65
+ readonly code: v.StringSchema<undefined>;
66
+ readonly message: v.StringSchema<undefined>;
67
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
68
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
69
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
70
+ readonly message: v.StringSchema<undefined>;
71
+ }, undefined>, undefined>, undefined>;
72
+ }, undefined>;
73
+ }, undefined>;
74
+ readonly 201: v.ObjectSchema<{
75
+ readonly id: v.StringSchema<undefined>;
76
+ readonly vendor: v.PicklistSchema<["claude", "codex", "glm", "kimi", "deepseek"], undefined>;
77
+ readonly label: v.StringSchema<undefined>;
78
+ readonly createdAt: v.NumberSchema<undefined>;
79
+ readonly lastUsedAt: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
80
+ readonly inputTokens: v.NumberSchema<undefined>;
81
+ readonly outputTokens: v.NumberSchema<undefined>;
82
+ readonly requestCount: v.NumberSchema<undefined>;
83
+ }, undefined>;
84
+ };
85
+ };
86
+ export declare const removeVendorCredentialContract: {
87
+ readonly method: "delete";
88
+ readonly requestPathParamsSchema: v.ObjectSchema<{
89
+ readonly id: v.StringSchema<undefined>;
90
+ }, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
91
+ readonly pathResolver: ({ id }: {
92
+ id: string;
93
+ }) => string;
94
+ readonly responsesByStatusCode: {
95
+ readonly '4xx': v.ObjectSchema<{
96
+ readonly error: v.ObjectSchema<{
97
+ readonly code: v.StringSchema<undefined>;
98
+ readonly message: v.StringSchema<undefined>;
99
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
100
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
101
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
102
+ readonly message: v.StringSchema<undefined>;
103
+ }, undefined>, undefined>, undefined>;
104
+ }, undefined>;
105
+ }, undefined>;
106
+ readonly '5xx': v.ObjectSchema<{
107
+ readonly error: v.ObjectSchema<{
108
+ readonly code: v.StringSchema<undefined>;
109
+ readonly message: v.StringSchema<undefined>;
110
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
111
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
112
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
113
+ readonly message: v.StringSchema<undefined>;
114
+ }, undefined>, undefined>, undefined>;
115
+ }, undefined>;
116
+ }, undefined>;
117
+ readonly 204: typeof ContractNoBody;
118
+ };
119
+ };
120
+ //# sourceMappingURL=vendor-credentials.d.ts.map