@greatwait/contracts 0.1.0-alpha.3 → 0.1.0-alpha.4

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 (299) hide show
  1. package/README.md +11 -9
  2. package/dist/authority.d.ts +33 -27
  3. package/dist/authority.js +12 -2
  4. package/dist/billing.d.ts +1001 -0
  5. package/dist/billing.js +684 -0
  6. package/dist/callback-safety.d.ts +2 -2
  7. package/dist/callback-safety.js +2 -2
  8. package/dist/compatibility.d.ts +3 -3
  9. package/dist/compatibility.js +1 -1
  10. package/dist/data-export.d.ts +67 -0
  11. package/dist/data-export.js +182 -0
  12. package/dist/endpoints.d.ts +181 -240
  13. package/dist/endpoints.js +77 -81
  14. package/dist/events.d.ts +17 -17
  15. package/dist/events.js +1 -1
  16. package/dist/first-value-journey.d.ts +49 -55
  17. package/dist/first-value-journey.js +6 -13
  18. package/dist/forecast.d.ts +71 -71
  19. package/dist/forecast.js +1 -1
  20. package/dist/identifiers.d.ts +20 -20
  21. package/dist/identifiers.js +1 -1
  22. package/dist/identity.d.ts +41 -37
  23. package/dist/identity.js +5 -4
  24. package/dist/index.d.ts +10 -5
  25. package/dist/index.js +10 -5
  26. package/dist/mcp.d.ts +21 -19
  27. package/dist/mcp.js +1 -1
  28. package/dist/naming.d.ts +45 -0
  29. package/dist/naming.js +159 -0
  30. package/dist/oauth.d.ts +186 -172
  31. package/dist/oauth.js +1 -1
  32. package/dist/operation-definitions.d.ts +9 -0
  33. package/dist/operation-definitions.js +7 -0
  34. package/dist/operations.d.ts +4162 -2171
  35. package/dist/operations.js +2679 -908
  36. package/dist/organization-lifecycle.d.ts +34 -0
  37. package/dist/organization-lifecycle.js +122 -0
  38. package/dist/partition.d.ts +26 -0
  39. package/dist/policy.d.ts +4 -4
  40. package/dist/policy.js +9 -5
  41. package/dist/problems.d.ts +32 -26
  42. package/dist/problems.js +6 -2
  43. package/dist/protocol.d.ts +204 -75
  44. package/dist/protocol.js +108 -36
  45. package/dist/scheduling-records.d.ts +343 -285
  46. package/dist/scheduling-records.js +1 -1
  47. package/dist/scheduling.d.ts +670 -360
  48. package/dist/scheduling.js +382 -56
  49. package/dist/secrets.d.ts +119 -105
  50. package/dist/secrets.js +1 -1
  51. package/dist/signatures.d.ts +74 -74
  52. package/dist/signatures.js +1 -1
  53. package/dist/tenancy.d.ts +142 -68
  54. package/dist/tenancy.js +70 -17
  55. package/dist/test-sink.d.ts +127 -127
  56. package/dist/test-sink.js +1 -1
  57. package/dist/time.d.ts +4 -4
  58. package/dist/time.js +1 -1
  59. package/dist/timing.d.ts +65 -0
  60. package/dist/timing.js +82 -0
  61. package/dist/usage.d.ts +103 -47
  62. package/dist/usage.js +197 -31
  63. package/dist/workspace.d.ts +34 -34
  64. package/dist/workspace.js +1 -1
  65. package/dist/zod-values.d.ts +3 -0
  66. package/dist/zod-values.js +2 -0
  67. package/dist/zod.d.ts +2 -0
  68. package/dist/zod.js +2 -0
  69. package/generated/v1/examples/attempts.list.response.json +4 -0
  70. package/generated/v1/examples/attempts.read.response.json +4 -0
  71. package/generated/v1/examples/billing.autotopup.request.json +5 -0
  72. package/generated/v1/examples/billing.autotopup.response.json +120 -0
  73. package/generated/v1/examples/billing.autotopuppreview.request.json +19 -0
  74. package/generated/v1/examples/billing.autotopuppreview.response.json +45 -0
  75. package/generated/v1/examples/billing.budgets.request.json +13 -0
  76. package/generated/v1/examples/billing.budgets.response.json +22 -0
  77. package/generated/v1/examples/billing.ceiling.request.json +8 -0
  78. package/generated/v1/examples/billing.ceiling.response.json +120 -0
  79. package/generated/v1/examples/billing.change.request.json +5 -0
  80. package/generated/v1/examples/billing.change.response.json +12 -0
  81. package/generated/v1/examples/billing.funding.response.json +120 -0
  82. package/generated/v1/examples/billing.fundingquote.request.json +7 -0
  83. package/generated/v1/examples/billing.fundingquote.response.json +13 -0
  84. package/generated/v1/examples/billing.ledger.response.json +23 -0
  85. package/generated/v1/examples/billing.notices.response.json +41 -0
  86. package/generated/v1/examples/billing.notificationsettings.response.json +17 -0
  87. package/generated/v1/examples/billing.notificationsettingsupdate.request.json +9 -0
  88. package/generated/v1/examples/billing.notificationsettingsupdate.response.json +17 -0
  89. package/generated/v1/examples/billing.portal.response.json +3 -0
  90. package/generated/v1/examples/billing.projects.response.json +12 -0
  91. package/generated/v1/examples/billing.purchase.request.json +5 -0
  92. package/generated/v1/examples/billing.purchase.response.json +120 -0
  93. package/generated/v1/examples/billing.quote.request.json +4 -0
  94. package/generated/v1/examples/billing.quote.response.json +19 -0
  95. package/generated/v1/examples/billing.reconcile.response.json +73 -0
  96. package/generated/v1/examples/billing.refundrequest.request.json +10 -0
  97. package/generated/v1/examples/billing.refundrequest.response.json +11 -0
  98. package/generated/v1/examples/billing.refundresolution.request.json +4 -0
  99. package/generated/v1/examples/billing.refundresolution.response.json +120 -0
  100. package/generated/v1/examples/billing.summary.response.json +73 -0
  101. package/generated/v1/examples/endpoints.acknowledgeSigningKeyRotation.response.json +18 -0
  102. package/generated/v1/examples/endpoints.create.response.json +1 -1
  103. package/generated/v1/examples/endpoints.disable.response.json +0 -1
  104. package/generated/v1/examples/{endpoints.verify.response.json → endpoints.enable.response.json} +4 -5
  105. package/generated/v1/examples/endpoints.list.response.json +1 -2
  106. package/generated/v1/examples/endpoints.read.response.json +2 -2
  107. package/generated/v1/examples/endpoints.revealSigningSecret.response.json +7 -0
  108. package/generated/v1/examples/endpoints.rotateSigningKey.response.json +1 -2
  109. package/generated/v1/examples/endpoints.update.response.json +1 -1
  110. package/generated/v1/examples/executions.list.response.json +20 -0
  111. package/generated/v1/examples/exports.cancel.response.json +11 -0
  112. package/generated/v1/examples/exports.create.request.json +1 -0
  113. package/generated/v1/examples/exports.create.response.json +8 -0
  114. package/generated/v1/examples/exports.part.response.json +5 -0
  115. package/generated/v1/examples/exports.read.response.json +8 -0
  116. package/generated/v1/examples/occurrences.read.response.json +4 -0
  117. package/generated/v1/examples/organizations.close.request.json +5 -0
  118. package/generated/v1/examples/organizations.close.response.json +10 -0
  119. package/generated/v1/examples/organizations.lifecycle.response.json +10 -0
  120. package/generated/v1/examples/organizations.restore.request.json +3 -0
  121. package/generated/v1/examples/organizations.restore.response.json +10 -0
  122. package/generated/v1/examples/projects.archive.request.json +3 -0
  123. package/generated/v1/examples/projects.archive.response.json +14 -0
  124. package/generated/v1/examples/projects.create.response.json +10 -1
  125. package/generated/v1/examples/projects.delete.response.json +9 -0
  126. package/generated/v1/examples/projects.list.response.json +12 -2
  127. package/generated/v1/examples/projects.rename.request.json +3 -0
  128. package/generated/v1/examples/projects.rename.response.json +14 -0
  129. package/generated/v1/examples/schedules.archive.response.json +3 -0
  130. package/generated/v1/examples/schedules.cancel.response.json +3 -0
  131. package/generated/v1/examples/schedules.create.request.json +4 -0
  132. package/generated/v1/examples/schedules.create.response.json +3 -0
  133. package/generated/v1/examples/schedules.list.response.json +3 -0
  134. package/generated/v1/examples/schedules.pause.response.json +3 -0
  135. package/generated/v1/examples/schedules.read.response.json +6 -0
  136. package/generated/v1/examples/schedules.replace.request.json +4 -0
  137. package/generated/v1/examples/schedules.replace.response.json +3 -0
  138. package/generated/v1/examples/schedules.resume.response.json +3 -0
  139. package/generated/v1/examples/timing.summary.response.json +35 -0
  140. package/generated/v1/examples/usage.read.response.json +1 -0
  141. package/generated/v1/first-value-journey.json +19 -10
  142. package/generated/v1/manifest.json +936 -23
  143. package/generated/v1/openapi.json +29983 -5784
  144. package/generated/v1/policy-matrix.json +278 -47
  145. package/generated/v1/schemas/attempts.list.response.json +24 -1
  146. package/generated/v1/schemas/attempts.read.response.json +24 -1
  147. package/generated/v1/schemas/billing.autotopup.request-headers.json +13 -0
  148. package/generated/v1/schemas/billing.autotopup.request.json +22 -0
  149. package/generated/v1/schemas/billing.autotopup.response-headers.json +10 -0
  150. package/generated/v1/schemas/billing.autotopup.response.json +552 -0
  151. package/generated/v1/schemas/billing.autotopuppreview.request.json +77 -0
  152. package/generated/v1/schemas/billing.autotopuppreview.response.json +277 -0
  153. package/generated/v1/schemas/billing.budgets.request-headers.json +13 -0
  154. package/generated/v1/schemas/billing.budgets.request.json +66 -0
  155. package/generated/v1/schemas/billing.budgets.response-headers.json +10 -0
  156. package/generated/v1/schemas/billing.budgets.response.json +92 -0
  157. package/generated/v1/schemas/billing.ceiling.request-headers.json +13 -0
  158. package/generated/v1/schemas/billing.ceiling.request.json +40 -0
  159. package/generated/v1/schemas/billing.ceiling.response-headers.json +10 -0
  160. package/generated/v1/schemas/billing.ceiling.response.json +552 -0
  161. package/generated/v1/schemas/billing.change.request-headers.json +13 -0
  162. package/generated/v1/schemas/billing.change.request.json +22 -0
  163. package/generated/v1/schemas/billing.change.response.json +119 -0
  164. package/generated/v1/schemas/billing.funding.response.json +552 -0
  165. package/generated/v1/schemas/billing.fundingquote.request.json +28 -0
  166. package/generated/v1/schemas/billing.fundingquote.response.json +61 -0
  167. package/generated/v1/schemas/billing.ledger.query.json +16 -0
  168. package/generated/v1/schemas/billing.ledger.response.json +125 -0
  169. package/generated/v1/schemas/billing.notices.query.json +16 -0
  170. package/generated/v1/schemas/billing.notices.response.json +278 -0
  171. package/generated/v1/schemas/billing.notificationsettings.response.json +70 -0
  172. package/generated/v1/schemas/billing.notificationsettingsupdate.request-headers.json +13 -0
  173. package/generated/v1/schemas/billing.notificationsettingsupdate.request.json +36 -0
  174. package/generated/v1/schemas/billing.notificationsettingsupdate.response-headers.json +10 -0
  175. package/generated/v1/schemas/billing.notificationsettingsupdate.response.json +70 -0
  176. package/generated/v1/schemas/billing.portal.response.json +11 -0
  177. package/generated/v1/schemas/billing.projects.response.json +119 -0
  178. package/generated/v1/schemas/billing.purchase.request-headers.json +13 -0
  179. package/generated/v1/schemas/billing.purchase.request.json +22 -0
  180. package/generated/v1/schemas/billing.purchase.response-headers.json +10 -0
  181. package/generated/v1/schemas/billing.purchase.response.json +552 -0
  182. package/generated/v1/schemas/billing.quote.request.json +20 -0
  183. package/generated/v1/schemas/billing.quote.response.json +86 -0
  184. package/generated/v1/schemas/billing.reconcile.response.json +468 -0
  185. package/generated/v1/schemas/billing.refundrequest.request-headers.json +13 -0
  186. package/generated/v1/schemas/billing.refundrequest.request.json +42 -0
  187. package/generated/v1/schemas/billing.refundrequest.response-headers.json +10 -0
  188. package/generated/v1/schemas/billing.refundrequest.response.json +45 -0
  189. package/generated/v1/schemas/billing.refundresolution.request-headers.json +13 -0
  190. package/generated/v1/schemas/billing.refundresolution.request.json +61 -0
  191. package/generated/v1/schemas/billing.refundresolution.response-headers.json +10 -0
  192. package/generated/v1/schemas/billing.refundresolution.response.json +552 -0
  193. package/generated/v1/schemas/billing.summary.response.json +468 -0
  194. package/generated/v1/schemas/context.read.response.json +2 -0
  195. package/generated/v1/schemas/credentials.connection.response.json +2 -0
  196. package/generated/v1/schemas/credentials.create.request.json +2 -0
  197. package/generated/v1/schemas/credentials.create.response.json +2 -0
  198. package/generated/v1/schemas/credentials.list.response.json +2 -0
  199. package/generated/v1/schemas/credentials.revoke.response.json +2 -0
  200. package/generated/v1/schemas/credentials.rotate.response.json +4 -0
  201. package/generated/v1/schemas/{endpoints.verify.request-headers.json → endpoints.acknowledgeSigningKeyRotation.request-headers.json} +2 -1
  202. package/generated/v1/schemas/{endpoints.verify.response.json → endpoints.acknowledgeSigningKeyRotation.response.json} +8 -21
  203. package/generated/v1/schemas/endpoints.create.request.json +5 -0
  204. package/generated/v1/schemas/endpoints.create.response.json +8 -21
  205. package/generated/v1/schemas/endpoints.disable.response.json +8 -21
  206. package/generated/v1/schemas/endpoints.enable.response-headers.json +11 -0
  207. package/generated/v1/schemas/endpoints.enable.response.json +87 -0
  208. package/generated/v1/schemas/endpoints.list.response.json +8 -21
  209. package/generated/v1/schemas/endpoints.read.response.json +8 -21
  210. package/generated/v1/schemas/endpoints.revealSigningSecret.response.json +43 -0
  211. package/generated/v1/schemas/endpoints.rotateSigningKey.response.json +8 -21
  212. package/generated/v1/schemas/endpoints.update.request.json +5 -0
  213. package/generated/v1/schemas/endpoints.update.response.json +8 -21
  214. package/generated/v1/schemas/executions.list.query.json +46 -0
  215. package/generated/v1/schemas/executions.list.response.json +116 -0
  216. package/generated/v1/schemas/exports.cancel.response.json +48 -0
  217. package/generated/v1/schemas/exports.create.request.json +6 -0
  218. package/generated/v1/schemas/exports.create.response.json +38 -0
  219. package/generated/v1/schemas/exports.part.query.json +11 -0
  220. package/generated/v1/schemas/exports.part.response.json +22 -0
  221. package/generated/v1/schemas/exports.read.response.json +38 -0
  222. package/generated/v1/schemas/grants.list.response.json +2 -0
  223. package/generated/v1/schemas/grants.revoke.response.json +2 -0
  224. package/generated/v1/schemas/occurrences.list.query.json +5 -0
  225. package/generated/v1/schemas/occurrences.list.response.json +23 -0
  226. package/generated/v1/schemas/occurrences.read.response.json +23 -0
  227. package/generated/v1/schemas/occurrences.redeliver.response.json +24 -1
  228. package/generated/v1/schemas/organizations.close.request.json +20 -0
  229. package/generated/v1/schemas/organizations.close.response.json +68 -0
  230. package/generated/v1/schemas/organizations.lifecycle.response.json +68 -0
  231. package/generated/v1/schemas/organizations.restore.request.json +13 -0
  232. package/generated/v1/schemas/organizations.restore.response.json +68 -0
  233. package/generated/v1/schemas/projects.archive.request-headers.json +11 -0
  234. package/generated/v1/schemas/projects.archive.request.json +10 -0
  235. package/generated/v1/schemas/projects.archive.response-headers.json +11 -0
  236. package/generated/v1/schemas/projects.archive.response.json +79 -0
  237. package/generated/v1/schemas/projects.create.response.json +55 -1
  238. package/generated/v1/schemas/projects.delete.request-headers.json +11 -0
  239. package/generated/v1/schemas/projects.delete.response.json +37 -0
  240. package/generated/v1/schemas/projects.list.response.json +61 -2
  241. package/generated/v1/schemas/projects.rename.request-headers.json +11 -0
  242. package/generated/v1/schemas/projects.rename.request.json +12 -0
  243. package/generated/v1/schemas/projects.rename.response-headers.json +11 -0
  244. package/generated/v1/schemas/projects.rename.response.json +79 -0
  245. package/generated/v1/schemas/schedules.archive.response.json +90 -2
  246. package/generated/v1/schemas/schedules.cancel.response.json +90 -2
  247. package/generated/v1/schemas/schedules.create.request.json +24 -3
  248. package/generated/v1/schemas/schedules.create.response.json +90 -2
  249. package/generated/v1/schemas/schedules.list.query.json +13 -0
  250. package/generated/v1/schemas/schedules.list.response.json +67 -2
  251. package/generated/v1/schemas/schedules.pause.response.json +90 -2
  252. package/generated/v1/schemas/schedules.read.response.json +90 -2
  253. package/generated/v1/schemas/schedules.replace.request.json +24 -3
  254. package/generated/v1/schemas/schedules.replace.response.json +90 -2
  255. package/generated/v1/schemas/schedules.resume.response.json +90 -2
  256. package/generated/v1/schemas/timing.summary.response.json +191 -0
  257. package/generated/v1/schemas/usage.read.query.json +7 -0
  258. package/generated/v1/schemas/usage.read.response.json +36 -1
  259. package/generated/v1/snippets/billing.autotopup.json +6 -0
  260. package/generated/v1/snippets/billing.autotopuppreview.json +6 -0
  261. package/generated/v1/snippets/billing.budgets.json +6 -0
  262. package/generated/v1/snippets/billing.ceiling.json +6 -0
  263. package/generated/v1/snippets/billing.change.json +6 -0
  264. package/generated/v1/snippets/billing.funding.json +6 -0
  265. package/generated/v1/snippets/billing.fundingquote.json +6 -0
  266. package/generated/v1/snippets/billing.ledger.json +6 -0
  267. package/generated/v1/snippets/billing.notices.json +6 -0
  268. package/generated/v1/snippets/billing.notificationsettings.json +6 -0
  269. package/generated/v1/snippets/billing.notificationsettingsupdate.json +6 -0
  270. package/generated/v1/snippets/billing.portal.json +6 -0
  271. package/generated/v1/snippets/billing.projects.json +6 -0
  272. package/generated/v1/snippets/billing.purchase.json +6 -0
  273. package/generated/v1/snippets/billing.quote.json +6 -0
  274. package/generated/v1/snippets/billing.reconcile.json +6 -0
  275. package/generated/v1/snippets/billing.refundrequest.json +6 -0
  276. package/generated/v1/snippets/billing.refundresolution.json +6 -0
  277. package/generated/v1/snippets/billing.summary.json +6 -0
  278. package/generated/v1/snippets/endpoints.acknowledgeSigningKeyRotation.json +6 -0
  279. package/generated/v1/snippets/{endpoints.verify.json → endpoints.enable.json} +3 -3
  280. package/generated/v1/snippets/endpoints.revealSigningSecret.json +6 -0
  281. package/generated/v1/snippets/executions.list.json +6 -0
  282. package/generated/v1/snippets/exports.cancel.json +6 -0
  283. package/generated/v1/snippets/exports.create.json +6 -0
  284. package/generated/v1/snippets/exports.part.json +6 -0
  285. package/generated/v1/snippets/exports.read.json +6 -0
  286. package/generated/v1/snippets/organizations.close.json +6 -0
  287. package/generated/v1/snippets/organizations.lifecycle.json +6 -0
  288. package/generated/v1/snippets/organizations.restore.json +6 -0
  289. package/generated/v1/snippets/projects.archive.json +6 -0
  290. package/generated/v1/snippets/projects.delete.json +6 -0
  291. package/generated/v1/snippets/projects.rename.json +6 -0
  292. package/generated/v1/snippets/schedules.create.json +3 -3
  293. package/generated/v1/snippets/schedules.replace.json +3 -3
  294. package/generated/v1/snippets/timing.summary.json +6 -0
  295. package/package.json +1 -6
  296. package/dist/callback-ownership.d.ts +0 -58
  297. package/dist/callback-ownership.js +0 -71
  298. package/generated/v1/callback-endpoint-verification.json +0 -59
  299. /package/generated/v1/schemas/{endpoints.verify.response-headers.json → endpoints.acknowledgeSigningKeyRotation.response-headers.json} +0 -0
package/dist/mcp.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from "./zod.js";
2
2
  /**
3
3
  * Where the remote MCP surface lives, and what it tells an agent about itself.
4
4
  *
@@ -90,13 +90,14 @@ export type McpConnectionOutcome = (typeof MCP_CONNECTION_OUTCOMES)[number];
90
90
  * transient value never travels to this route, and the route has nothing it
91
91
  * could echo.
92
92
  */
93
- export declare const mcpConnectionSchema: z.ZodObject<{
94
- discovery: z.ZodString;
95
- displayPrefix: z.ZodString;
96
- endpoint: z.ZodString;
97
- id: z.ZodString;
98
- scopes: z.ZodArray<z.ZodEnum<{
93
+ export declare const mcpConnectionSchema: import("zod").ZodObject<{
94
+ discovery: import("zod").ZodString;
95
+ displayPrefix: import("zod").ZodString;
96
+ endpoint: import("zod").ZodString;
97
+ id: import("zod").ZodString;
98
+ scopes: import("zod").ZodArray<import("zod").ZodEnum<{
99
99
  "credentials:administer": "credentials:administer";
100
+ "billing:write": "billing:write";
100
101
  "credentials:read": "credentials:read";
101
102
  "credentials:write": "credentials:write";
102
103
  "endpoints:read": "endpoints:read";
@@ -106,19 +107,20 @@ export declare const mcpConnectionSchema: z.ZodObject<{
106
107
  "grants:write": "grants:write";
107
108
  "occurrences:read": "occurrences:read";
108
109
  "occurrences:redeliver": "occurrences:redeliver";
110
+ "projects:administer": "projects:administer";
109
111
  "projects:read": "projects:read";
110
112
  "projects:write": "projects:write";
111
113
  "schedules:read": "schedules:read";
112
114
  "schedules:write": "schedules:write";
113
115
  "usage:read": "usage:read";
114
116
  }>>;
115
- state: z.ZodEnum<{
117
+ state: import("zod").ZodEnum<{
116
118
  revoked: "revoked";
117
119
  usable: "usable";
118
120
  expired: "expired";
119
121
  }>;
120
- tools: z.ZodArray<z.ZodString>;
121
- }, z.core.$strip>;
122
+ tools: import("zod").ZodArray<import("zod").ZodString>;
123
+ }, import("zod/v4/core").$strip>;
122
124
  export type McpConnection = z.infer<typeof mcpConnectionSchema>;
123
125
  /**
124
126
  * Why a connection test stopped, from a closed list.
@@ -167,33 +169,33 @@ export declare function activationDuration(elapsedMs: number): McpActivationDura
167
169
  * schema refuses what it does not recognise, so the mistake surfaces where it
168
170
  * was made.
169
171
  */
170
- export declare const mcpActivationEventSchema: z.ZodObject<{
171
- authKind: z.ZodEnum<{
172
+ export declare const mcpActivationEventSchema: import("zod").ZodObject<{
173
+ authKind: import("zod").ZodEnum<{
172
174
  oauth: "oauth";
173
175
  "api-key": "api-key";
174
176
  }>;
175
- checks: z.ZodRecord<z.ZodEnum<{
177
+ checks: import("zod").ZodRecord<import("zod").ZodEnum<{
176
178
  authority: "authority";
177
179
  initialize: "initialize";
178
180
  tools: "tools";
179
- }>, z.ZodEnum<{
181
+ }>, import("zod").ZodEnum<{
180
182
  failed: "failed";
181
183
  passed: "passed";
182
184
  skipped: "skipped";
183
185
  }>>;
184
- client: z.ZodString;
185
- duration: z.ZodEnum<{
186
+ client: import("zod").ZodString;
187
+ duration: import("zod").ZodEnum<{
186
188
  under_1s: "under_1s";
187
189
  under_5s: "under_5s";
188
190
  under_30s: "under_30s";
189
191
  over_30s: "over_30s";
190
192
  }>;
191
- failure: z.ZodOptional<z.ZodEnum<{
193
+ failure: import("zod").ZodOptional<import("zod").ZodEnum<{
192
194
  unauthorized: "unauthorized";
193
195
  unreachable: "unreachable";
194
196
  protocol: "protocol";
195
197
  mismatch: "mismatch";
196
198
  }>>;
197
- type: z.ZodLiteral<"mcp.connection_test">;
198
- }, z.core.$strict>;
199
+ type: import("zod").ZodLiteral<"mcp.connection_test">;
200
+ }, import("zod/v4/core").$strict>;
199
201
  export type McpActivationEvent = z.infer<typeof mcpActivationEventSchema>;
package/dist/mcp.js CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from "./zod.js";
2
2
  import { scopeSchema } from "./authority.js";
3
3
  import { apiCredentialIdSchema } from "./identifiers.js";
4
4
  import { CREDENTIAL_PREFIX_PATTERN } from "./secrets.js";
@@ -0,0 +1,45 @@
1
+ import { type Recurrence } from "./scheduling.js";
2
+ /** "60s", "5m", "2h", "1d" when the interval is a whole one; seconds otherwise. */
3
+ export declare function compactInterval(seconds: number): string;
4
+ /**
5
+ * A cron expression in a few words — "2pm MTW", "9am daily", "2:30pm
6
+ * weekdays" — or the expression itself when it is not a plain time on some
7
+ * days of the week. A name should never claim a reading it cannot make.
8
+ */
9
+ export declare function cronWords(expression: string): string;
10
+ /** The host of a URL, without a leading "www." — or the text if it is not one. */
11
+ export declare function targetDomain(url: string): string;
12
+ /**
13
+ * The name a schedule gets when nobody types one: its type, period and
14
+ * target domain in a sentence.
15
+ *
16
+ * | Recurrence | Endpoint | Name |
17
+ * | ------------------------- | ----------------------- | --------------------------- |
18
+ * | every 60 seconds | https://flowxo.com/x | Every 60s → flowxo.com |
19
+ * | cron `0 14 * * 1-3` | https://example.com/y | 2pm MTW → example.com |
20
+ * | once, at an instant | https://example.com/y | Once 2026-09-05 14:33 UTC → example.com |
21
+ * | every 5 minutes, no endpoint | — | Every 5m (timer) |
22
+ */
23
+ export declare function generatedScheduleName(recurrence: Recurrence | {
24
+ readonly at: string;
25
+ readonly kind: "at";
26
+ }, endpointUrl: string | undefined): string;
27
+ /**
28
+ * The period half of a generated name on its own — "Every 1h", "2pm MTW",
29
+ * "Once 2026-09-05 14:33 UTC". What a row is called when whoever writes it
30
+ * knows the recurrence and nothing about where it delivers: the migration
31
+ * that backfilled the column, and a repository handed no name.
32
+ */
33
+ export declare function periodWords(recurrence: Recurrence | {
34
+ readonly at: string;
35
+ readonly kind: "at";
36
+ }): string;
37
+ /**
38
+ * The name an endpoint gets when nobody types one: its whole URL.
39
+ *
40
+ * "For endpoints, let's use the whole URL as the name, and require the names
41
+ * to be unique. Two endpoints can only have the same URL if they are
42
+ * explicitely named." The whole address, not the domain — an endpoint appears
43
+ * in a dropdown, and two receivers on one host are two entries.
44
+ */
45
+ export declare function generatedEndpointName(url: string): string;
package/dist/naming.js ADDED
@@ -0,0 +1,159 @@
1
+ import { SCHEDULE_NAME_MAX_LENGTH } from "./scheduling.js";
2
+ /**
3
+ * The names a schedule and an endpoint get when nobody types one (W4-14,
4
+ * FXO-2255).
5
+ *
6
+ * "The optional names should be defaulted on save for schedule and endpoint -
7
+ * for schedule, the type, period, and target domain in a sentance, something
8
+ * like 'Every 60s -> flowxo.com' or '2pm MTW -> example.com' (for CRON for
9
+ * instance)". And: "For endpoints, let's use the whole URL as the name".
10
+ *
11
+ * **A stored value, not a rendering trick.** The service writes the generated
12
+ * name into the row on save, and the person edits it like any other name
13
+ * afterwards; nothing recomputes it when the recurrence changes. So this
14
+ * module is used at the moment of creation and nowhere else on the read
15
+ * path — the dashboard shows it only as a preview of what the save will
16
+ * write.
17
+ */
18
+ const DAY_INITIALS = ["Su", "M", "T", "W", "Th", "F", "Sa"];
19
+ /** "60s", "5m", "2h", "1d" when the interval is a whole one; seconds otherwise. */
20
+ export function compactInterval(seconds) {
21
+ if (seconds % 86_400 === 0)
22
+ return `${String(seconds / 86_400)}d`;
23
+ if (seconds % 3_600 === 0)
24
+ return `${String(seconds / 3_600)}h`;
25
+ if (seconds % 60 === 0)
26
+ return `${String(seconds / 60)}m`;
27
+ return `${String(seconds)}s`;
28
+ }
29
+ /** "2pm", "2:30pm", "9am", "12am"; undefined when the field is not one plain time. */
30
+ function clockWords(minute, hour) {
31
+ if (!/^\d{1,2}$/u.test(minute) || !/^\d{1,2}$/u.test(hour))
32
+ return undefined;
33
+ const h = Number(hour);
34
+ const m = Number(minute);
35
+ if (h > 23 || m > 59)
36
+ return undefined;
37
+ const twelve = h % 12 === 0 ? 12 : h % 12;
38
+ const suffix = h < 12 ? "am" : "pm";
39
+ return m === 0
40
+ ? `${String(twelve)}${suffix}`
41
+ : `${String(twelve)}:${String(m).padStart(2, "0")}${suffix}`;
42
+ }
43
+ /** "daily", "weekdays", "weekends", or initials like "MTW"; undefined if unreadable. */
44
+ function daysWords(field) {
45
+ if (field === "*" || field === "?")
46
+ return "daily";
47
+ const days = new Set();
48
+ for (const part of field.split(",")) {
49
+ const range = /^(\d)(?:-(\d))?$/u.exec(part);
50
+ if (range === null)
51
+ return undefined;
52
+ const from = Number(range[1]);
53
+ const to = range[2] === undefined ? from : Number(range[2]);
54
+ if (from > 7 || to > 7 || from > to)
55
+ return undefined;
56
+ for (let day = from; day <= to; day += 1)
57
+ days.add(day % 7);
58
+ }
59
+ if (days.size === 0)
60
+ return undefined;
61
+ const ordered = [1, 2, 3, 4, 5, 6, 0].filter((day) => days.has(day));
62
+ if (ordered.length === 7)
63
+ return "daily";
64
+ if (ordered.length === 5 && ordered.every((day) => day >= 1 && day <= 5)) {
65
+ return "weekdays";
66
+ }
67
+ if (ordered.length === 2 && days.has(0) && days.has(6))
68
+ return "weekends";
69
+ return ordered.map((day) => DAY_INITIALS[day]).join("");
70
+ }
71
+ /**
72
+ * A cron expression in a few words — "2pm MTW", "9am daily", "2:30pm
73
+ * weekdays" — or the expression itself when it is not a plain time on some
74
+ * days of the week. A name should never claim a reading it cannot make.
75
+ */
76
+ export function cronWords(expression) {
77
+ const fields = expression.trim().split(/\s+/u);
78
+ if (fields.length !== 5)
79
+ return `cron ${expression.trim()}`;
80
+ const [minute, hour, dayOfMonth, month, dayOfWeek] = fields;
81
+ const clock = clockWords(minute, hour);
82
+ const days = daysWords(dayOfWeek);
83
+ if (clock === undefined ||
84
+ days === undefined ||
85
+ dayOfMonth !== "*" ||
86
+ month !== "*") {
87
+ return `cron ${expression.trim()}`;
88
+ }
89
+ return `${clock} ${days}`;
90
+ }
91
+ /** The host of a URL, without a leading "www." — or the text if it is not one. */
92
+ export function targetDomain(url) {
93
+ try {
94
+ return new URL(url).hostname.replace(/^www\./u, "");
95
+ }
96
+ catch {
97
+ return url;
98
+ }
99
+ }
100
+ /**
101
+ * The name a schedule gets when nobody types one: its type, period and
102
+ * target domain in a sentence.
103
+ *
104
+ * | Recurrence | Endpoint | Name |
105
+ * | ------------------------- | ----------------------- | --------------------------- |
106
+ * | every 60 seconds | https://flowxo.com/x | Every 60s → flowxo.com |
107
+ * | cron `0 14 * * 1-3` | https://example.com/y | 2pm MTW → example.com |
108
+ * | once, at an instant | https://example.com/y | Once 2026-09-05 14:33 UTC → example.com |
109
+ * | every 5 minutes, no endpoint | — | Every 5m (timer) |
110
+ */
111
+ export function generatedScheduleName(recurrence, endpointUrl) {
112
+ const period = periodWords(recurrence);
113
+ return boundedName(endpointUrl === undefined
114
+ ? `${period} (timer)`
115
+ : `${period} → ${targetDomain(endpointUrl)}`);
116
+ }
117
+ /**
118
+ * The period half of a generated name on its own — "Every 1h", "2pm MTW",
119
+ * "Once 2026-09-05 14:33 UTC". What a row is called when whoever writes it
120
+ * knows the recurrence and nothing about where it delivers: the migration
121
+ * that backfilled the column, and a repository handed no name.
122
+ */
123
+ export function periodWords(recurrence) {
124
+ return boundedName(recurrence.kind === "every"
125
+ ? `Every ${compactInterval(recurrence.everySeconds)}`
126
+ : recurrence.kind === "cron"
127
+ ? cronWords(recurrence.cron)
128
+ : `Once ${"at" in recurrence ? instantWords(recurrence.at) : ""}`.trim());
129
+ }
130
+ /**
131
+ * Cut to what the contract admits. A hostname may run to 253 characters and
132
+ * a cron expression to whatever somebody typed; a generated name longer than
133
+ * the schema's bound would be refused by the row's own check, or written and
134
+ * then rejected on every read.
135
+ */
136
+ function boundedName(name) {
137
+ return name.length <= SCHEDULE_NAME_MAX_LENGTH
138
+ ? name
139
+ : `${name.slice(0, SCHEDULE_NAME_MAX_LENGTH - 1)}…`;
140
+ }
141
+ /** "2026-09-05 14:33 UTC" — the service has no reader's clock at save time. */
142
+ function instantWords(iso) {
143
+ const ms = Date.parse(iso);
144
+ if (Number.isNaN(ms))
145
+ return iso;
146
+ const date = new Date(ms).toISOString();
147
+ return `${date.slice(0, 10)} ${date.slice(11, 16)} UTC`;
148
+ }
149
+ /**
150
+ * The name an endpoint gets when nobody types one: its whole URL.
151
+ *
152
+ * "For endpoints, let's use the whole URL as the name, and require the names
153
+ * to be unique. Two endpoints can only have the same URL if they are
154
+ * explicitely named." The whole address, not the domain — an endpoint appears
155
+ * in a dropdown, and two receivers on one host are two entries.
156
+ */
157
+ export function generatedEndpointName(url) {
158
+ return url;
159
+ }