@qlever-llc/trellis 0.10.9 → 0.10.10

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 (187) hide show
  1. package/esm/generated-sdk/auth/api.d.ts.map +1 -1
  2. package/esm/generated-sdk/auth/client.d.ts.map +1 -1
  3. package/esm/generated-sdk/auth/contract.d.ts.map +1 -1
  4. package/esm/generated-sdk/auth/contract.js +9590 -7
  5. package/esm/generated-sdk/auth/mod.d.ts +3 -3
  6. package/esm/generated-sdk/auth/mod.d.ts.map +1 -1
  7. package/esm/generated-sdk/auth/mod.js +1 -1
  8. package/esm/generated-sdk/auth/owned_api.d.ts.map +1 -1
  9. package/esm/generated-sdk/auth/owned_api.js +305 -62
  10. package/esm/generated-sdk/auth/schemas.d.ts.map +1 -1
  11. package/esm/generated-sdk/auth/schemas.js +6492 -139
  12. package/esm/generated-sdk/auth/types.d.ts +254 -254
  13. package/esm/generated-sdk/auth/types.d.ts.map +1 -1
  14. package/esm/generated-sdk/health/api.d.ts.map +1 -1
  15. package/esm/generated-sdk/health/client.d.ts.map +1 -1
  16. package/esm/generated-sdk/health/contract.d.ts.map +1 -1
  17. package/esm/generated-sdk/health/contract.js +117 -7
  18. package/esm/generated-sdk/health/mod.d.ts +2 -2
  19. package/esm/generated-sdk/health/mod.d.ts.map +1 -1
  20. package/esm/generated-sdk/health/mod.js +1 -1
  21. package/esm/generated-sdk/health/owned_api.d.ts.map +1 -1
  22. package/esm/generated-sdk/health/schemas.d.ts.map +1 -1
  23. package/esm/generated-sdk/health/schemas.js +79 -1
  24. package/esm/generated-sdk/health/types.d.ts +4 -4
  25. package/esm/generated-sdk/health/types.d.ts.map +1 -1
  26. package/esm/generated-sdk/jobs/api.d.ts.map +1 -1
  27. package/esm/generated-sdk/jobs/api.js +12 -4
  28. package/esm/generated-sdk/jobs/client.d.ts.map +1 -1
  29. package/esm/generated-sdk/jobs/contract.d.ts.map +1 -1
  30. package/esm/generated-sdk/jobs/contract.js +1080 -7
  31. package/esm/generated-sdk/jobs/mod.d.ts +2 -2
  32. package/esm/generated-sdk/jobs/mod.d.ts.map +1 -1
  33. package/esm/generated-sdk/jobs/mod.js +1 -1
  34. package/esm/generated-sdk/jobs/owned_api.d.ts.map +1 -1
  35. package/esm/generated-sdk/jobs/owned_api.js +26 -6
  36. package/esm/generated-sdk/jobs/schemas.d.ts.map +1 -1
  37. package/esm/generated-sdk/jobs/schemas.js +768 -18
  38. package/esm/generated-sdk/jobs/types.d.ts +14 -14
  39. package/esm/generated-sdk/jobs/types.d.ts.map +1 -1
  40. package/esm/generated-sdk/state/api.d.ts.map +1 -1
  41. package/esm/generated-sdk/state/api.js +3 -1
  42. package/esm/generated-sdk/state/client.d.ts.map +1 -1
  43. package/esm/generated-sdk/state/contract.d.ts.map +1 -1
  44. package/esm/generated-sdk/state/contract.js +638 -7
  45. package/esm/generated-sdk/state/mod.d.ts +2 -2
  46. package/esm/generated-sdk/state/mod.d.ts.map +1 -1
  47. package/esm/generated-sdk/state/mod.js +1 -1
  48. package/esm/generated-sdk/state/owned_api.d.ts.map +1 -1
  49. package/esm/generated-sdk/state/owned_api.js +36 -8
  50. package/esm/generated-sdk/state/schemas.d.ts.map +1 -1
  51. package/esm/generated-sdk/state/schemas.js +441 -14
  52. package/esm/generated-sdk/state/types.d.ts +15 -15
  53. package/esm/generated-sdk/state/types.d.ts.map +1 -1
  54. package/esm/generated-sdk/trellis-core/api.d.ts.map +1 -1
  55. package/esm/generated-sdk/trellis-core/client.d.ts.map +1 -1
  56. package/esm/generated-sdk/trellis-core/contract.d.ts.map +1 -1
  57. package/esm/generated-sdk/trellis-core/contract.js +744 -7
  58. package/esm/generated-sdk/trellis-core/mod.d.ts +2 -2
  59. package/esm/generated-sdk/trellis-core/mod.d.ts.map +1 -1
  60. package/esm/generated-sdk/trellis-core/mod.js +1 -1
  61. package/esm/generated-sdk/trellis-core/owned_api.d.ts.map +1 -1
  62. package/esm/generated-sdk/trellis-core/owned_api.js +1 -1
  63. package/esm/generated-sdk/trellis-core/schemas.d.ts.map +1 -1
  64. package/esm/generated-sdk/trellis-core/schemas.js +626 -8
  65. package/esm/generated-sdk/trellis-core/types.d.ts +14 -14
  66. package/esm/generated-sdk/trellis-core/types.d.ts.map +1 -1
  67. package/esm/server/service.d.ts +35 -13
  68. package/esm/server/service.d.ts.map +1 -1
  69. package/esm/service/deno.d.ts +1 -1
  70. package/esm/service/deno.d.ts.map +1 -1
  71. package/esm/service/mod.d.ts +1 -1
  72. package/esm/service/mod.d.ts.map +1 -1
  73. package/esm/service/node.d.ts +1 -1
  74. package/esm/service/node.d.ts.map +1 -1
  75. package/package.json +2 -2
  76. package/script/generated-sdk/auth/api.d.ts.map +1 -1
  77. package/script/generated-sdk/auth/client.d.ts.map +1 -1
  78. package/script/generated-sdk/auth/contract.d.ts.map +1 -1
  79. package/script/generated-sdk/auth/contract.js +9590 -7
  80. package/script/generated-sdk/auth/mod.d.ts +3 -3
  81. package/script/generated-sdk/auth/mod.d.ts.map +1 -1
  82. package/script/generated-sdk/auth/mod.js +2 -2
  83. package/script/generated-sdk/auth/owned_api.d.ts.map +1 -1
  84. package/script/generated-sdk/auth/owned_api.js +304 -61
  85. package/script/generated-sdk/auth/schemas.d.ts.map +1 -1
  86. package/script/generated-sdk/auth/schemas.js +6492 -139
  87. package/script/generated-sdk/auth/types.d.ts +254 -254
  88. package/script/generated-sdk/auth/types.d.ts.map +1 -1
  89. package/script/generated-sdk/health/api.d.ts.map +1 -1
  90. package/script/generated-sdk/health/client.d.ts.map +1 -1
  91. package/script/generated-sdk/health/contract.d.ts.map +1 -1
  92. package/script/generated-sdk/health/contract.js +117 -7
  93. package/script/generated-sdk/health/mod.d.ts +2 -2
  94. package/script/generated-sdk/health/mod.d.ts.map +1 -1
  95. package/script/generated-sdk/health/mod.js +2 -2
  96. package/script/generated-sdk/health/owned_api.d.ts.map +1 -1
  97. package/script/generated-sdk/health/schemas.d.ts.map +1 -1
  98. package/script/generated-sdk/health/schemas.js +79 -1
  99. package/script/generated-sdk/health/types.d.ts +4 -4
  100. package/script/generated-sdk/health/types.d.ts.map +1 -1
  101. package/script/generated-sdk/jobs/api.d.ts.map +1 -1
  102. package/script/generated-sdk/jobs/api.js +12 -4
  103. package/script/generated-sdk/jobs/client.d.ts.map +1 -1
  104. package/script/generated-sdk/jobs/contract.d.ts.map +1 -1
  105. package/script/generated-sdk/jobs/contract.js +1080 -7
  106. package/script/generated-sdk/jobs/mod.d.ts +2 -2
  107. package/script/generated-sdk/jobs/mod.d.ts.map +1 -1
  108. package/script/generated-sdk/jobs/mod.js +2 -2
  109. package/script/generated-sdk/jobs/owned_api.d.ts.map +1 -1
  110. package/script/generated-sdk/jobs/owned_api.js +25 -5
  111. package/script/generated-sdk/jobs/schemas.d.ts.map +1 -1
  112. package/script/generated-sdk/jobs/schemas.js +768 -18
  113. package/script/generated-sdk/jobs/types.d.ts +14 -14
  114. package/script/generated-sdk/jobs/types.d.ts.map +1 -1
  115. package/script/generated-sdk/state/api.d.ts.map +1 -1
  116. package/script/generated-sdk/state/api.js +3 -1
  117. package/script/generated-sdk/state/client.d.ts.map +1 -1
  118. package/script/generated-sdk/state/contract.d.ts.map +1 -1
  119. package/script/generated-sdk/state/contract.js +638 -7
  120. package/script/generated-sdk/state/mod.d.ts +2 -2
  121. package/script/generated-sdk/state/mod.d.ts.map +1 -1
  122. package/script/generated-sdk/state/mod.js +2 -2
  123. package/script/generated-sdk/state/owned_api.d.ts.map +1 -1
  124. package/script/generated-sdk/state/owned_api.js +35 -7
  125. package/script/generated-sdk/state/schemas.d.ts.map +1 -1
  126. package/script/generated-sdk/state/schemas.js +441 -14
  127. package/script/generated-sdk/state/types.d.ts +15 -15
  128. package/script/generated-sdk/state/types.d.ts.map +1 -1
  129. package/script/generated-sdk/trellis-core/api.d.ts.map +1 -1
  130. package/script/generated-sdk/trellis-core/client.d.ts.map +1 -1
  131. package/script/generated-sdk/trellis-core/contract.d.ts.map +1 -1
  132. package/script/generated-sdk/trellis-core/contract.js +744 -7
  133. package/script/generated-sdk/trellis-core/mod.d.ts +2 -2
  134. package/script/generated-sdk/trellis-core/mod.d.ts.map +1 -1
  135. package/script/generated-sdk/trellis-core/mod.js +2 -2
  136. package/script/generated-sdk/trellis-core/owned_api.d.ts.map +1 -1
  137. package/script/generated-sdk/trellis-core/schemas.d.ts.map +1 -1
  138. package/script/generated-sdk/trellis-core/schemas.js +626 -8
  139. package/script/generated-sdk/trellis-core/types.d.ts +14 -14
  140. package/script/generated-sdk/trellis-core/types.d.ts.map +1 -1
  141. package/script/server/service.d.ts +35 -13
  142. package/script/server/service.d.ts.map +1 -1
  143. package/script/service/deno.d.ts +1 -1
  144. package/script/service/deno.d.ts.map +1 -1
  145. package/script/service/mod.d.ts +1 -1
  146. package/script/service/mod.d.ts.map +1 -1
  147. package/script/service/node.d.ts +1 -1
  148. package/script/service/node.d.ts.map +1 -1
  149. package/src/sdk/_generated/auth/api.ts +10 -21
  150. package/src/sdk/_generated/auth/client.ts +1178 -160
  151. package/src/sdk/_generated/auth/contract.ts +9637 -13
  152. package/src/sdk/_generated/auth/mod.ts +22 -3
  153. package/src/sdk/_generated/auth/owned_api.ts +897 -264
  154. package/src/sdk/_generated/auth/schemas.ts +6630 -278
  155. package/src/sdk/_generated/auth/types.ts +2950 -359
  156. package/src/sdk/_generated/core/api.ts +10 -21
  157. package/src/sdk/_generated/core/client.ts +105 -12
  158. package/src/sdk/_generated/core/contract.ts +774 -13
  159. package/src/sdk/_generated/core/mod.ts +17 -2
  160. package/src/sdk/_generated/core/owned_api.ts +40 -24
  161. package/src/sdk/_generated/core/schemas.ts +626 -9
  162. package/src/sdk/_generated/core/types.ts +233 -18
  163. package/src/sdk/_generated/health/api.ts +10 -21
  164. package/src/sdk/_generated/health/client.ts +104 -8
  165. package/src/sdk/_generated/health/contract.ts +144 -13
  166. package/src/sdk/_generated/health/mod.ts +17 -2
  167. package/src/sdk/_generated/health/owned_api.ts +4 -9
  168. package/src/sdk/_generated/health/schemas.ts +79 -2
  169. package/src/sdk/_generated/health/types.ts +31 -4
  170. package/src/sdk/_generated/jobs/api.ts +20 -18
  171. package/src/sdk/_generated/jobs/client.ts +199 -28
  172. package/src/sdk/_generated/jobs/contract.ts +1119 -13
  173. package/src/sdk/_generated/jobs/mod.ts +17 -2
  174. package/src/sdk/_generated/jobs/owned_api.ts +64 -27
  175. package/src/sdk/_generated/jobs/schemas.ts +776 -20
  176. package/src/sdk/_generated/jobs/types.ts +407 -34
  177. package/src/sdk/_generated/state/api.ts +11 -18
  178. package/src/sdk/_generated/state/client.ts +169 -22
  179. package/src/sdk/_generated/state/contract.ts +670 -13
  180. package/src/sdk/_generated/state/mod.ts +17 -2
  181. package/src/sdk/_generated/state/owned_api.ts +65 -25
  182. package/src/sdk/_generated/state/schemas.ts +441 -15
  183. package/src/sdk/_generated/state/types.ts +229 -26
  184. package/src/server/service.ts +92 -15
  185. package/src/service/deno.ts +4 -0
  186. package/src/service/mod.ts +4 -0
  187. package/src/service/node.ts +4 -0
@@ -2,7 +2,1072 @@ import { API } from "./api.js";
2
2
  const CONTRACT_MODULE_METADATA = Symbol.for("@qlever-llc/trellis/contracts/contract-module");
3
3
  export const CONTRACT_ID = "trellis.jobs@v1";
4
4
  export const CONTRACT_DIGEST = "jSB8nKGOQqIxdFDdUqO-gOTt3Dijg--SOXJtJ1ChpoY";
5
- export const CONTRACT = { "capabilities": { "trellis.jobs::admin.mutate": { "consequence": "Can change background job execution state.", "description": "Cancel, retry, replay, or dismiss Jobs service work items.", "displayName": "Mutate jobs admin data" }, "trellis.jobs::admin.read": { "description": "View Jobs service health, services, jobs, and dead-letter queues.", "displayName": "Read jobs admin data" } }, "description": "Trellis-managed background job administration API.", "displayName": "Trellis Jobs", "docs": { "markdown": "Provides health, service, job, retry, cancel, and dead-letter queue RPCs for Trellis-managed background work.", "summary": "Background job administration APIs." }, "errors": { "NotFoundError": { "schema": { "schema": "NotFoundErrorData" }, "type": "NotFoundError" } }, "format": "trellis.contract.v1", "id": "trellis.jobs@v1", "kind": "service", "rpc": { "Jobs.Cancel": { "capabilities": { "call": ["trellis.jobs::admin.mutate"] }, "docs": { "markdown": "Requests cancellation for one background job.", "summary": "Cancel a job." }, "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }, { "type": "NotFoundError" }], "input": { "schema": "JobsCancelRequest" }, "output": { "schema": "JobsCancelResponse" }, "subject": "rpc.v1.Jobs.Cancel", "version": "v1" }, "Jobs.DismissDLQ": { "capabilities": { "call": ["trellis.jobs::admin.mutate"] }, "docs": { "markdown": "Marks one dead-letter job as dismissed.", "summary": "Dismiss a dead-letter job." }, "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }, { "type": "NotFoundError" }], "input": { "schema": "JobsDismissDLQRequest" }, "output": { "schema": "JobsDismissDLQResponse" }, "subject": "rpc.v1.Jobs.DismissDLQ", "version": "v1" }, "Jobs.Get": { "capabilities": { "call": ["trellis.jobs::admin.read"] }, "docs": { "markdown": "Returns one background job by id.", "summary": "Read a job." }, "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }, { "type": "NotFoundError" }], "input": { "schema": "JobsGetRequest" }, "output": { "schema": "JobsGetResponse" }, "subject": "rpc.v1.Jobs.Get", "version": "v1" }, "Jobs.Health": { "capabilities": { "call": ["trellis.jobs::admin.read"] }, "docs": { "markdown": "Returns Jobs service health and worker status details.", "summary": "Read jobs health." }, "errors": [{ "type": "UnexpectedError" }], "input": { "schema": "Empty" }, "output": { "schema": "JobsHealthResponse" }, "subject": "rpc.v1.Jobs.Health", "version": "v1" }, "Jobs.List": { "capabilities": { "call": ["trellis.jobs::admin.read"] }, "docs": { "markdown": "Lists jobs matching the requested filters.", "summary": "List jobs." }, "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }], "input": { "schema": "JobsListRequest" }, "output": { "schema": "JobsListResponse" }, "subject": "rpc.v1.Jobs.List", "version": "v1" }, "Jobs.ListDLQ": { "capabilities": { "call": ["trellis.jobs::admin.read"] }, "docs": { "markdown": "Lists jobs currently in dead-letter queues.", "summary": "List dead-letter jobs." }, "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }], "input": { "schema": "JobsListDLQRequest" }, "output": { "schema": "JobsListDLQResponse" }, "subject": "rpc.v1.Jobs.ListDLQ", "version": "v1" }, "Jobs.ListServices": { "capabilities": { "call": ["trellis.jobs::admin.read"] }, "docs": { "markdown": "Lists services that own or execute background job queues.", "summary": "List job services." }, "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }], "input": { "schema": "JobsListServicesRequest" }, "output": { "schema": "JobsListServicesResponse" }, "subject": "rpc.v1.Jobs.ListServices", "version": "v1" }, "Jobs.ReplayDLQ": { "capabilities": { "call": ["trellis.jobs::admin.mutate"] }, "docs": { "markdown": "Moves one dead-letter job back to processing.", "summary": "Replay a dead-letter job." }, "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }, { "type": "NotFoundError" }], "input": { "schema": "JobsReplayDLQRequest" }, "output": { "schema": "JobsReplayDLQResponse" }, "subject": "rpc.v1.Jobs.ReplayDLQ", "version": "v1" }, "Jobs.Retry": { "capabilities": { "call": ["trellis.jobs::admin.mutate"] }, "docs": { "markdown": "Moves a failed job back into retry processing.", "summary": "Retry a job." }, "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }, { "type": "NotFoundError" }], "input": { "schema": "JobsRetryRequest" }, "output": { "schema": "JobsRetryResponse" }, "subject": "rpc.v1.Jobs.Retry", "version": "v1" } }, "schemas": { "Empty": { "properties": {}, "type": "object" }, "Job": { "properties": { "completedAt": { "format": "date-time", "type": "string" }, "context": { "properties": { "requestId": { "minLength": 1, "type": "string" }, "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" }, "traceparent": { "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$", "type": "string" }, "tracestate": { "minLength": 1, "type": "string" } }, "required": ["requestId", "traceId", "traceparent"], "type": "object" }, "createdAt": { "format": "date-time", "type": "string" }, "deadline": { "format": "date-time", "type": "string" }, "id": { "minLength": 1, "type": "string" }, "lastError": { "type": "string" }, "logs": { "items": { "properties": { "level": { "anyOf": [{ "const": "info", "type": "string" }, { "const": "warn", "type": "string" }, { "const": "error", "type": "string" }] }, "message": { "type": "string" }, "timestamp": { "format": "date-time", "type": "string" } }, "required": ["timestamp", "level", "message"], "type": "object" }, "type": "array" }, "maxTries": { "minimum": 1, "type": "integer" }, "payload": {}, "progress": { "properties": { "current": { "minimum": 0, "type": "integer" }, "message": { "type": "string" }, "step": { "type": "string" }, "total": { "minimum": 0, "type": "integer" } }, "type": "object" }, "result": {}, "service": { "minLength": 1, "type": "string" }, "startedAt": { "format": "date-time", "type": "string" }, "state": { "anyOf": [{ "const": "pending", "type": "string" }, { "const": "active", "type": "string" }, { "const": "retry", "type": "string" }, { "const": "completed", "type": "string" }, { "const": "failed", "type": "string" }, { "const": "cancelled", "type": "string" }, { "const": "expired", "type": "string" }, { "const": "dead", "type": "string" }, { "const": "dismissed", "type": "string" }] }, "tries": { "minimum": 0, "type": "integer" }, "type": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" } }, "required": ["id", "context", "service", "type", "state", "payload", "createdAt", "updatedAt", "tries", "maxTries"], "type": "object" }, "JobContext": { "properties": { "requestId": { "minLength": 1, "type": "string" }, "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" }, "traceparent": { "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$", "type": "string" }, "tracestate": { "minLength": 1, "type": "string" } }, "required": ["requestId", "traceId", "traceparent"], "type": "object" }, "JobLogEntry": { "properties": { "level": { "anyOf": [{ "const": "info", "type": "string" }, { "const": "warn", "type": "string" }, { "const": "error", "type": "string" }] }, "message": { "type": "string" }, "timestamp": { "format": "date-time", "type": "string" } }, "required": ["timestamp", "level", "message"], "type": "object" }, "JobProgress": { "properties": { "current": { "minimum": 0, "type": "integer" }, "message": { "type": "string" }, "step": { "type": "string" }, "total": { "minimum": 0, "type": "integer" } }, "type": "object" }, "JobState": { "anyOf": [{ "const": "pending", "type": "string" }, { "const": "active", "type": "string" }, { "const": "retry", "type": "string" }, { "const": "completed", "type": "string" }, { "const": "failed", "type": "string" }, { "const": "cancelled", "type": "string" }, { "const": "expired", "type": "string" }, { "const": "dead", "type": "string" }, { "const": "dismissed", "type": "string" }] }, "JobsCancelRequest": { "description": "Jobs admin ids are globally addressable; callers identify jobs by id only.", "properties": { "id": { "minLength": 1, "type": "string" } }, "required": ["id"], "type": "object" }, "JobsCancelResponse": { "properties": { "job": { "properties": { "completedAt": { "format": "date-time", "type": "string" }, "context": { "properties": { "requestId": { "minLength": 1, "type": "string" }, "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" }, "traceparent": { "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$", "type": "string" }, "tracestate": { "minLength": 1, "type": "string" } }, "required": ["requestId", "traceId", "traceparent"], "type": "object" }, "createdAt": { "format": "date-time", "type": "string" }, "deadline": { "format": "date-time", "type": "string" }, "id": { "minLength": 1, "type": "string" }, "lastError": { "type": "string" }, "logs": { "items": { "properties": { "level": { "anyOf": [{ "const": "info", "type": "string" }, { "const": "warn", "type": "string" }, { "const": "error", "type": "string" }] }, "message": { "type": "string" }, "timestamp": { "format": "date-time", "type": "string" } }, "required": ["timestamp", "level", "message"], "type": "object" }, "type": "array" }, "maxTries": { "minimum": 1, "type": "integer" }, "payload": {}, "progress": { "properties": { "current": { "minimum": 0, "type": "integer" }, "message": { "type": "string" }, "step": { "type": "string" }, "total": { "minimum": 0, "type": "integer" } }, "type": "object" }, "result": {}, "service": { "minLength": 1, "type": "string" }, "startedAt": { "format": "date-time", "type": "string" }, "state": { "anyOf": [{ "const": "pending", "type": "string" }, { "const": "active", "type": "string" }, { "const": "retry", "type": "string" }, { "const": "completed", "type": "string" }, { "const": "failed", "type": "string" }, { "const": "cancelled", "type": "string" }, { "const": "expired", "type": "string" }, { "const": "dead", "type": "string" }, { "const": "dismissed", "type": "string" }] }, "tries": { "minimum": 0, "type": "integer" }, "type": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" } }, "required": ["id", "context", "service", "type", "state", "payload", "createdAt", "updatedAt", "tries", "maxTries"], "type": "object" } }, "required": ["job"], "type": "object" }, "JobsDismissDLQRequest": { "description": "Jobs admin ids are globally addressable; callers identify jobs by id only.", "properties": { "id": { "minLength": 1, "type": "string" } }, "required": ["id"], "type": "object" }, "JobsDismissDLQResponse": { "properties": { "job": { "properties": { "completedAt": { "format": "date-time", "type": "string" }, "context": { "properties": { "requestId": { "minLength": 1, "type": "string" }, "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" }, "traceparent": { "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$", "type": "string" }, "tracestate": { "minLength": 1, "type": "string" } }, "required": ["requestId", "traceId", "traceparent"], "type": "object" }, "createdAt": { "format": "date-time", "type": "string" }, "deadline": { "format": "date-time", "type": "string" }, "id": { "minLength": 1, "type": "string" }, "lastError": { "type": "string" }, "logs": { "items": { "properties": { "level": { "anyOf": [{ "const": "info", "type": "string" }, { "const": "warn", "type": "string" }, { "const": "error", "type": "string" }] }, "message": { "type": "string" }, "timestamp": { "format": "date-time", "type": "string" } }, "required": ["timestamp", "level", "message"], "type": "object" }, "type": "array" }, "maxTries": { "minimum": 1, "type": "integer" }, "payload": {}, "progress": { "properties": { "current": { "minimum": 0, "type": "integer" }, "message": { "type": "string" }, "step": { "type": "string" }, "total": { "minimum": 0, "type": "integer" } }, "type": "object" }, "result": {}, "service": { "minLength": 1, "type": "string" }, "startedAt": { "format": "date-time", "type": "string" }, "state": { "anyOf": [{ "const": "pending", "type": "string" }, { "const": "active", "type": "string" }, { "const": "retry", "type": "string" }, { "const": "completed", "type": "string" }, { "const": "failed", "type": "string" }, { "const": "cancelled", "type": "string" }, { "const": "expired", "type": "string" }, { "const": "dead", "type": "string" }, { "const": "dismissed", "type": "string" }] }, "tries": { "minimum": 0, "type": "integer" }, "type": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" } }, "required": ["id", "context", "service", "type", "state", "payload", "createdAt", "updatedAt", "tries", "maxTries"], "type": "object" } }, "required": ["job"], "type": "object" }, "JobsGetRequest": { "description": "Jobs admin ids are globally addressable; callers identify jobs by id only.", "properties": { "id": { "minLength": 1, "type": "string" } }, "required": ["id"], "type": "object" }, "JobsGetResponse": { "properties": { "job": { "properties": { "completedAt": { "format": "date-time", "type": "string" }, "context": { "properties": { "requestId": { "minLength": 1, "type": "string" }, "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" }, "traceparent": { "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$", "type": "string" }, "tracestate": { "minLength": 1, "type": "string" } }, "required": ["requestId", "traceId", "traceparent"], "type": "object" }, "createdAt": { "format": "date-time", "type": "string" }, "deadline": { "format": "date-time", "type": "string" }, "id": { "minLength": 1, "type": "string" }, "lastError": { "type": "string" }, "logs": { "items": { "properties": { "level": { "anyOf": [{ "const": "info", "type": "string" }, { "const": "warn", "type": "string" }, { "const": "error", "type": "string" }] }, "message": { "type": "string" }, "timestamp": { "format": "date-time", "type": "string" } }, "required": ["timestamp", "level", "message"], "type": "object" }, "type": "array" }, "maxTries": { "minimum": 1, "type": "integer" }, "payload": {}, "progress": { "properties": { "current": { "minimum": 0, "type": "integer" }, "message": { "type": "string" }, "step": { "type": "string" }, "total": { "minimum": 0, "type": "integer" } }, "type": "object" }, "result": {}, "service": { "minLength": 1, "type": "string" }, "startedAt": { "format": "date-time", "type": "string" }, "state": { "anyOf": [{ "const": "pending", "type": "string" }, { "const": "active", "type": "string" }, { "const": "retry", "type": "string" }, { "const": "completed", "type": "string" }, { "const": "failed", "type": "string" }, { "const": "cancelled", "type": "string" }, { "const": "expired", "type": "string" }, { "const": "dead", "type": "string" }, { "const": "dismissed", "type": "string" }] }, "tries": { "minimum": 0, "type": "integer" }, "type": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" } }, "required": ["id", "context", "service", "type", "state", "payload", "createdAt", "updatedAt", "tries", "maxTries"], "type": "object" } }, "required": ["job"], "type": "object" }, "JobsHealthResponse": { "properties": { "checks": { "items": { "patternProperties": { "^.*$": {} }, "type": "object" }, "type": "array" }, "service": { "minLength": 1, "type": "string" }, "status": {}, "timestamp": { "format": "date-time", "type": "string" } }, "required": ["service", "status", "timestamp", "checks"], "type": "object" }, "JobsListDLQRequest": { "properties": { "limit": { "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "service": { "minLength": 1, "type": "string" }, "since": { "format": "date-time", "type": "string" }, "type": { "minLength": 1, "type": "string" } }, "required": ["limit"], "type": "object" }, "JobsListDLQResponse": { "properties": { "count": { "minimum": 0, "type": "integer" }, "entries": { "items": { "properties": { "completedAt": { "format": "date-time", "type": "string" }, "context": { "properties": { "requestId": { "minLength": 1, "type": "string" }, "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" }, "traceparent": { "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$", "type": "string" }, "tracestate": { "minLength": 1, "type": "string" } }, "required": ["requestId", "traceId", "traceparent"], "type": "object" }, "createdAt": { "format": "date-time", "type": "string" }, "deadline": { "format": "date-time", "type": "string" }, "id": { "minLength": 1, "type": "string" }, "lastError": { "type": "string" }, "logs": { "items": { "properties": { "level": { "anyOf": [{ "const": "info", "type": "string" }, { "const": "warn", "type": "string" }, { "const": "error", "type": "string" }] }, "message": { "type": "string" }, "timestamp": { "format": "date-time", "type": "string" } }, "required": ["timestamp", "level", "message"], "type": "object" }, "type": "array" }, "maxTries": { "minimum": 1, "type": "integer" }, "payload": {}, "progress": { "properties": { "current": { "minimum": 0, "type": "integer" }, "message": { "type": "string" }, "step": { "type": "string" }, "total": { "minimum": 0, "type": "integer" } }, "type": "object" }, "result": {}, "service": { "minLength": 1, "type": "string" }, "startedAt": { "format": "date-time", "type": "string" }, "state": { "anyOf": [{ "const": "pending", "type": "string" }, { "const": "active", "type": "string" }, { "const": "retry", "type": "string" }, { "const": "completed", "type": "string" }, { "const": "failed", "type": "string" }, { "const": "cancelled", "type": "string" }, { "const": "expired", "type": "string" }, { "const": "dead", "type": "string" }, { "const": "dismissed", "type": "string" }] }, "tries": { "minimum": 0, "type": "integer" }, "type": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" } }, "required": ["id", "context", "service", "type", "state", "payload", "createdAt", "updatedAt", "tries", "maxTries"], "type": "object" }, "type": "array" }, "limit": { "minimum": 1, "type": "integer" }, "nextOffset": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" } }, "required": ["entries", "count", "offset", "limit"], "type": "object" }, "JobsListRequest": { "properties": { "limit": { "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "service": { "minLength": 1, "type": "string" }, "since": { "format": "date-time", "type": "string" }, "state": { "items": { "anyOf": [{ "const": "pending", "type": "string" }, { "const": "active", "type": "string" }, { "const": "retry", "type": "string" }, { "const": "completed", "type": "string" }, { "const": "failed", "type": "string" }, { "const": "cancelled", "type": "string" }, { "const": "expired", "type": "string" }, { "const": "dead", "type": "string" }, { "const": "dismissed", "type": "string" }] }, "type": "array" }, "type": { "minLength": 1, "type": "string" } }, "required": ["limit"], "type": "object" }, "JobsListResponse": { "properties": { "count": { "minimum": 0, "type": "integer" }, "entries": { "items": { "properties": { "completedAt": { "format": "date-time", "type": "string" }, "context": { "properties": { "requestId": { "minLength": 1, "type": "string" }, "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" }, "traceparent": { "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$", "type": "string" }, "tracestate": { "minLength": 1, "type": "string" } }, "required": ["requestId", "traceId", "traceparent"], "type": "object" }, "createdAt": { "format": "date-time", "type": "string" }, "deadline": { "format": "date-time", "type": "string" }, "id": { "minLength": 1, "type": "string" }, "lastError": { "type": "string" }, "logs": { "items": { "properties": { "level": { "anyOf": [{ "const": "info", "type": "string" }, { "const": "warn", "type": "string" }, { "const": "error", "type": "string" }] }, "message": { "type": "string" }, "timestamp": { "format": "date-time", "type": "string" } }, "required": ["timestamp", "level", "message"], "type": "object" }, "type": "array" }, "maxTries": { "minimum": 1, "type": "integer" }, "payload": {}, "progress": { "properties": { "current": { "minimum": 0, "type": "integer" }, "message": { "type": "string" }, "step": { "type": "string" }, "total": { "minimum": 0, "type": "integer" } }, "type": "object" }, "result": {}, "service": { "minLength": 1, "type": "string" }, "startedAt": { "format": "date-time", "type": "string" }, "state": { "anyOf": [{ "const": "pending", "type": "string" }, { "const": "active", "type": "string" }, { "const": "retry", "type": "string" }, { "const": "completed", "type": "string" }, { "const": "failed", "type": "string" }, { "const": "cancelled", "type": "string" }, { "const": "expired", "type": "string" }, { "const": "dead", "type": "string" }, { "const": "dismissed", "type": "string" }] }, "tries": { "minimum": 0, "type": "integer" }, "type": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" } }, "required": ["id", "context", "service", "type", "state", "payload", "createdAt", "updatedAt", "tries", "maxTries"], "type": "object" }, "type": "array" }, "limit": { "minimum": 1, "type": "integer" }, "nextOffset": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" } }, "required": ["entries", "count", "offset", "limit"], "type": "object" }, "JobsListServicesRequest": { "properties": { "limit": { "minimum": 1, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" } }, "required": ["limit"], "type": "object" }, "JobsListServicesResponse": { "properties": { "count": { "minimum": 0, "type": "integer" }, "entries": { "items": { "properties": { "healthy": { "type": "boolean" }, "name": { "minLength": 1, "type": "string" }, "workers": { "items": { "properties": { "concurrency": { "minimum": 1, "type": "integer" }, "instanceId": { "minLength": 1, "type": "string" }, "jobType": { "minLength": 1, "type": "string" }, "service": { "minLength": 1, "type": "string" }, "timestamp": { "format": "date-time", "type": "string" }, "version": { "minLength": 1, "type": "string" } }, "required": ["service", "jobType", "instanceId", "timestamp"], "type": "object" }, "type": "array" } }, "required": ["name", "healthy", "workers"], "type": "object" }, "type": "array" }, "limit": { "minimum": 1, "type": "integer" }, "nextOffset": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" } }, "required": ["entries", "count", "offset", "limit"], "type": "object" }, "JobsReplayDLQRequest": { "description": "Jobs admin ids are globally addressable; callers identify jobs by id only.", "properties": { "id": { "minLength": 1, "type": "string" } }, "required": ["id"], "type": "object" }, "JobsReplayDLQResponse": { "properties": { "job": { "properties": { "completedAt": { "format": "date-time", "type": "string" }, "context": { "properties": { "requestId": { "minLength": 1, "type": "string" }, "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" }, "traceparent": { "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$", "type": "string" }, "tracestate": { "minLength": 1, "type": "string" } }, "required": ["requestId", "traceId", "traceparent"], "type": "object" }, "createdAt": { "format": "date-time", "type": "string" }, "deadline": { "format": "date-time", "type": "string" }, "id": { "minLength": 1, "type": "string" }, "lastError": { "type": "string" }, "logs": { "items": { "properties": { "level": { "anyOf": [{ "const": "info", "type": "string" }, { "const": "warn", "type": "string" }, { "const": "error", "type": "string" }] }, "message": { "type": "string" }, "timestamp": { "format": "date-time", "type": "string" } }, "required": ["timestamp", "level", "message"], "type": "object" }, "type": "array" }, "maxTries": { "minimum": 1, "type": "integer" }, "payload": {}, "progress": { "properties": { "current": { "minimum": 0, "type": "integer" }, "message": { "type": "string" }, "step": { "type": "string" }, "total": { "minimum": 0, "type": "integer" } }, "type": "object" }, "result": {}, "service": { "minLength": 1, "type": "string" }, "startedAt": { "format": "date-time", "type": "string" }, "state": { "anyOf": [{ "const": "pending", "type": "string" }, { "const": "active", "type": "string" }, { "const": "retry", "type": "string" }, { "const": "completed", "type": "string" }, { "const": "failed", "type": "string" }, { "const": "cancelled", "type": "string" }, { "const": "expired", "type": "string" }, { "const": "dead", "type": "string" }, { "const": "dismissed", "type": "string" }] }, "tries": { "minimum": 0, "type": "integer" }, "type": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" } }, "required": ["id", "context", "service", "type", "state", "payload", "createdAt", "updatedAt", "tries", "maxTries"], "type": "object" } }, "required": ["job"], "type": "object" }, "JobsRetryRequest": { "description": "Jobs admin ids are globally addressable; callers identify jobs by id only.", "properties": { "id": { "minLength": 1, "type": "string" } }, "required": ["id"], "type": "object" }, "JobsRetryResponse": { "properties": { "job": { "properties": { "completedAt": { "format": "date-time", "type": "string" }, "context": { "properties": { "requestId": { "minLength": 1, "type": "string" }, "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" }, "traceparent": { "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$", "type": "string" }, "tracestate": { "minLength": 1, "type": "string" } }, "required": ["requestId", "traceId", "traceparent"], "type": "object" }, "createdAt": { "format": "date-time", "type": "string" }, "deadline": { "format": "date-time", "type": "string" }, "id": { "minLength": 1, "type": "string" }, "lastError": { "type": "string" }, "logs": { "items": { "properties": { "level": { "anyOf": [{ "const": "info", "type": "string" }, { "const": "warn", "type": "string" }, { "const": "error", "type": "string" }] }, "message": { "type": "string" }, "timestamp": { "format": "date-time", "type": "string" } }, "required": ["timestamp", "level", "message"], "type": "object" }, "type": "array" }, "maxTries": { "minimum": 1, "type": "integer" }, "payload": {}, "progress": { "properties": { "current": { "minimum": 0, "type": "integer" }, "message": { "type": "string" }, "step": { "type": "string" }, "total": { "minimum": 0, "type": "integer" } }, "type": "object" }, "result": {}, "service": { "minLength": 1, "type": "string" }, "startedAt": { "format": "date-time", "type": "string" }, "state": { "anyOf": [{ "const": "pending", "type": "string" }, { "const": "active", "type": "string" }, { "const": "retry", "type": "string" }, { "const": "completed", "type": "string" }, { "const": "failed", "type": "string" }, { "const": "cancelled", "type": "string" }, { "const": "expired", "type": "string" }, { "const": "dead", "type": "string" }, { "const": "dismissed", "type": "string" }] }, "tries": { "minimum": 0, "type": "integer" }, "type": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" } }, "required": ["id", "context", "service", "type", "state", "payload", "createdAt", "updatedAt", "tries", "maxTries"], "type": "object" } }, "required": ["job"], "type": "object" }, "NotFoundErrorData": { "properties": { "context": { "patternProperties": { "^.*$": {} }, "type": "object" }, "id": { "minLength": 1, "type": "string" }, "jobId": { "minLength": 1, "type": "string" }, "message": { "type": "string" }, "resource": { "minLength": 1, "type": "string" }, "traceId": { "type": "string" }, "type": { "const": "NotFoundError", "type": "string" } }, "required": ["id", "type", "message", "resource"], "type": "object" } }, "uses": { "required": { "auth": { "contract": "trellis.auth@v1", "rpc": { "call": ["Auth.Requests.Validate"] } }, "core": { "contract": "trellis.core@v1", "rpc": { "call": ["Trellis.Bindings.Get", "Trellis.Catalog"] } }, "health": { "contract": "trellis.health@v1", "events": { "publish": ["Health.Heartbeat"] } } } } };
5
+ export const CONTRACT = {
6
+ "capabilities": {
7
+ "trellis.jobs::admin.mutate": {
8
+ "consequence": "Can change background job execution state.",
9
+ "description": "Cancel, retry, replay, or dismiss Jobs service work items.",
10
+ "displayName": "Mutate jobs admin data",
11
+ },
12
+ "trellis.jobs::admin.read": {
13
+ "description": "View Jobs service health, services, jobs, and dead-letter queues.",
14
+ "displayName": "Read jobs admin data",
15
+ },
16
+ },
17
+ "description": "Trellis-managed background job administration API.",
18
+ "displayName": "Trellis Jobs",
19
+ "docs": {
20
+ "markdown": "Provides health, service, job, retry, cancel, and dead-letter queue RPCs for Trellis-managed background work.",
21
+ "summary": "Background job administration APIs.",
22
+ },
23
+ "errors": {
24
+ "NotFoundError": {
25
+ "schema": { "schema": "NotFoundErrorData" },
26
+ "type": "NotFoundError",
27
+ },
28
+ },
29
+ "format": "trellis.contract.v1",
30
+ "id": "trellis.jobs@v1",
31
+ "kind": "service",
32
+ "rpc": {
33
+ "Jobs.Cancel": {
34
+ "capabilities": { "call": ["trellis.jobs::admin.mutate"] },
35
+ "docs": {
36
+ "markdown": "Requests cancellation for one background job.",
37
+ "summary": "Cancel a job.",
38
+ },
39
+ "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }, {
40
+ "type": "NotFoundError",
41
+ }],
42
+ "input": { "schema": "JobsCancelRequest" },
43
+ "output": { "schema": "JobsCancelResponse" },
44
+ "subject": "rpc.v1.Jobs.Cancel",
45
+ "version": "v1",
46
+ },
47
+ "Jobs.DismissDLQ": {
48
+ "capabilities": { "call": ["trellis.jobs::admin.mutate"] },
49
+ "docs": {
50
+ "markdown": "Marks one dead-letter job as dismissed.",
51
+ "summary": "Dismiss a dead-letter job.",
52
+ },
53
+ "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }, {
54
+ "type": "NotFoundError",
55
+ }],
56
+ "input": { "schema": "JobsDismissDLQRequest" },
57
+ "output": { "schema": "JobsDismissDLQResponse" },
58
+ "subject": "rpc.v1.Jobs.DismissDLQ",
59
+ "version": "v1",
60
+ },
61
+ "Jobs.Get": {
62
+ "capabilities": { "call": ["trellis.jobs::admin.read"] },
63
+ "docs": {
64
+ "markdown": "Returns one background job by id.",
65
+ "summary": "Read a job.",
66
+ },
67
+ "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }, {
68
+ "type": "NotFoundError",
69
+ }],
70
+ "input": { "schema": "JobsGetRequest" },
71
+ "output": { "schema": "JobsGetResponse" },
72
+ "subject": "rpc.v1.Jobs.Get",
73
+ "version": "v1",
74
+ },
75
+ "Jobs.Health": {
76
+ "capabilities": { "call": ["trellis.jobs::admin.read"] },
77
+ "docs": {
78
+ "markdown": "Returns Jobs service health and worker status details.",
79
+ "summary": "Read jobs health.",
80
+ },
81
+ "errors": [{ "type": "UnexpectedError" }],
82
+ "input": { "schema": "Empty" },
83
+ "output": { "schema": "JobsHealthResponse" },
84
+ "subject": "rpc.v1.Jobs.Health",
85
+ "version": "v1",
86
+ },
87
+ "Jobs.List": {
88
+ "capabilities": { "call": ["trellis.jobs::admin.read"] },
89
+ "docs": {
90
+ "markdown": "Lists jobs matching the requested filters.",
91
+ "summary": "List jobs.",
92
+ },
93
+ "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }],
94
+ "input": { "schema": "JobsListRequest" },
95
+ "output": { "schema": "JobsListResponse" },
96
+ "subject": "rpc.v1.Jobs.List",
97
+ "version": "v1",
98
+ },
99
+ "Jobs.ListDLQ": {
100
+ "capabilities": { "call": ["trellis.jobs::admin.read"] },
101
+ "docs": {
102
+ "markdown": "Lists jobs currently in dead-letter queues.",
103
+ "summary": "List dead-letter jobs.",
104
+ },
105
+ "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }],
106
+ "input": { "schema": "JobsListDLQRequest" },
107
+ "output": { "schema": "JobsListDLQResponse" },
108
+ "subject": "rpc.v1.Jobs.ListDLQ",
109
+ "version": "v1",
110
+ },
111
+ "Jobs.ListServices": {
112
+ "capabilities": { "call": ["trellis.jobs::admin.read"] },
113
+ "docs": {
114
+ "markdown": "Lists services that own or execute background job queues.",
115
+ "summary": "List job services.",
116
+ },
117
+ "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }],
118
+ "input": { "schema": "JobsListServicesRequest" },
119
+ "output": { "schema": "JobsListServicesResponse" },
120
+ "subject": "rpc.v1.Jobs.ListServices",
121
+ "version": "v1",
122
+ },
123
+ "Jobs.ReplayDLQ": {
124
+ "capabilities": { "call": ["trellis.jobs::admin.mutate"] },
125
+ "docs": {
126
+ "markdown": "Moves one dead-letter job back to processing.",
127
+ "summary": "Replay a dead-letter job.",
128
+ },
129
+ "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }, {
130
+ "type": "NotFoundError",
131
+ }],
132
+ "input": { "schema": "JobsReplayDLQRequest" },
133
+ "output": { "schema": "JobsReplayDLQResponse" },
134
+ "subject": "rpc.v1.Jobs.ReplayDLQ",
135
+ "version": "v1",
136
+ },
137
+ "Jobs.Retry": {
138
+ "capabilities": { "call": ["trellis.jobs::admin.mutate"] },
139
+ "docs": {
140
+ "markdown": "Moves a failed job back into retry processing.",
141
+ "summary": "Retry a job.",
142
+ },
143
+ "errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }, {
144
+ "type": "NotFoundError",
145
+ }],
146
+ "input": { "schema": "JobsRetryRequest" },
147
+ "output": { "schema": "JobsRetryResponse" },
148
+ "subject": "rpc.v1.Jobs.Retry",
149
+ "version": "v1",
150
+ },
151
+ },
152
+ "schemas": {
153
+ "Empty": { "properties": {}, "type": "object" },
154
+ "Job": {
155
+ "properties": {
156
+ "completedAt": { "format": "date-time", "type": "string" },
157
+ "context": {
158
+ "properties": {
159
+ "requestId": { "minLength": 1, "type": "string" },
160
+ "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" },
161
+ "traceparent": {
162
+ "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$",
163
+ "type": "string",
164
+ },
165
+ "tracestate": { "minLength": 1, "type": "string" },
166
+ },
167
+ "required": ["requestId", "traceId", "traceparent"],
168
+ "type": "object",
169
+ },
170
+ "createdAt": { "format": "date-time", "type": "string" },
171
+ "deadline": { "format": "date-time", "type": "string" },
172
+ "id": { "minLength": 1, "type": "string" },
173
+ "lastError": { "type": "string" },
174
+ "logs": {
175
+ "items": {
176
+ "properties": {
177
+ "level": {
178
+ "anyOf": [{ "const": "info", "type": "string" }, {
179
+ "const": "warn",
180
+ "type": "string",
181
+ }, { "const": "error", "type": "string" }],
182
+ },
183
+ "message": { "type": "string" },
184
+ "timestamp": { "format": "date-time", "type": "string" },
185
+ },
186
+ "required": ["timestamp", "level", "message"],
187
+ "type": "object",
188
+ },
189
+ "type": "array",
190
+ },
191
+ "maxTries": { "minimum": 1, "type": "integer" },
192
+ "payload": {},
193
+ "progress": {
194
+ "properties": {
195
+ "current": { "minimum": 0, "type": "integer" },
196
+ "message": { "type": "string" },
197
+ "step": { "type": "string" },
198
+ "total": { "minimum": 0, "type": "integer" },
199
+ },
200
+ "type": "object",
201
+ },
202
+ "result": {},
203
+ "service": { "minLength": 1, "type": "string" },
204
+ "startedAt": { "format": "date-time", "type": "string" },
205
+ "state": {
206
+ "anyOf": [
207
+ { "const": "pending", "type": "string" },
208
+ { "const": "active", "type": "string" },
209
+ { "const": "retry", "type": "string" },
210
+ { "const": "completed", "type": "string" },
211
+ { "const": "failed", "type": "string" },
212
+ { "const": "cancelled", "type": "string" },
213
+ { "const": "expired", "type": "string" },
214
+ { "const": "dead", "type": "string" },
215
+ { "const": "dismissed", "type": "string" },
216
+ ],
217
+ },
218
+ "tries": { "minimum": 0, "type": "integer" },
219
+ "type": { "minLength": 1, "type": "string" },
220
+ "updatedAt": { "format": "date-time", "type": "string" },
221
+ },
222
+ "required": [
223
+ "id",
224
+ "context",
225
+ "service",
226
+ "type",
227
+ "state",
228
+ "payload",
229
+ "createdAt",
230
+ "updatedAt",
231
+ "tries",
232
+ "maxTries",
233
+ ],
234
+ "type": "object",
235
+ },
236
+ "JobContext": {
237
+ "properties": {
238
+ "requestId": { "minLength": 1, "type": "string" },
239
+ "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" },
240
+ "traceparent": {
241
+ "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$",
242
+ "type": "string",
243
+ },
244
+ "tracestate": { "minLength": 1, "type": "string" },
245
+ },
246
+ "required": ["requestId", "traceId", "traceparent"],
247
+ "type": "object",
248
+ },
249
+ "JobLogEntry": {
250
+ "properties": {
251
+ "level": {
252
+ "anyOf": [{ "const": "info", "type": "string" }, {
253
+ "const": "warn",
254
+ "type": "string",
255
+ }, { "const": "error", "type": "string" }],
256
+ },
257
+ "message": { "type": "string" },
258
+ "timestamp": { "format": "date-time", "type": "string" },
259
+ },
260
+ "required": ["timestamp", "level", "message"],
261
+ "type": "object",
262
+ },
263
+ "JobProgress": {
264
+ "properties": {
265
+ "current": { "minimum": 0, "type": "integer" },
266
+ "message": { "type": "string" },
267
+ "step": { "type": "string" },
268
+ "total": { "minimum": 0, "type": "integer" },
269
+ },
270
+ "type": "object",
271
+ },
272
+ "JobState": {
273
+ "anyOf": [
274
+ { "const": "pending", "type": "string" },
275
+ { "const": "active", "type": "string" },
276
+ { "const": "retry", "type": "string" },
277
+ { "const": "completed", "type": "string" },
278
+ { "const": "failed", "type": "string" },
279
+ { "const": "cancelled", "type": "string" },
280
+ { "const": "expired", "type": "string" },
281
+ { "const": "dead", "type": "string" },
282
+ { "const": "dismissed", "type": "string" },
283
+ ],
284
+ },
285
+ "JobsCancelRequest": {
286
+ "description": "Jobs admin ids are globally addressable; callers identify jobs by id only.",
287
+ "properties": { "id": { "minLength": 1, "type": "string" } },
288
+ "required": ["id"],
289
+ "type": "object",
290
+ },
291
+ "JobsCancelResponse": {
292
+ "properties": {
293
+ "job": {
294
+ "properties": {
295
+ "completedAt": { "format": "date-time", "type": "string" },
296
+ "context": {
297
+ "properties": {
298
+ "requestId": { "minLength": 1, "type": "string" },
299
+ "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" },
300
+ "traceparent": {
301
+ "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$",
302
+ "type": "string",
303
+ },
304
+ "tracestate": { "minLength": 1, "type": "string" },
305
+ },
306
+ "required": ["requestId", "traceId", "traceparent"],
307
+ "type": "object",
308
+ },
309
+ "createdAt": { "format": "date-time", "type": "string" },
310
+ "deadline": { "format": "date-time", "type": "string" },
311
+ "id": { "minLength": 1, "type": "string" },
312
+ "lastError": { "type": "string" },
313
+ "logs": {
314
+ "items": {
315
+ "properties": {
316
+ "level": {
317
+ "anyOf": [{ "const": "info", "type": "string" }, {
318
+ "const": "warn",
319
+ "type": "string",
320
+ }, { "const": "error", "type": "string" }],
321
+ },
322
+ "message": { "type": "string" },
323
+ "timestamp": { "format": "date-time", "type": "string" },
324
+ },
325
+ "required": ["timestamp", "level", "message"],
326
+ "type": "object",
327
+ },
328
+ "type": "array",
329
+ },
330
+ "maxTries": { "minimum": 1, "type": "integer" },
331
+ "payload": {},
332
+ "progress": {
333
+ "properties": {
334
+ "current": { "minimum": 0, "type": "integer" },
335
+ "message": { "type": "string" },
336
+ "step": { "type": "string" },
337
+ "total": { "minimum": 0, "type": "integer" },
338
+ },
339
+ "type": "object",
340
+ },
341
+ "result": {},
342
+ "service": { "minLength": 1, "type": "string" },
343
+ "startedAt": { "format": "date-time", "type": "string" },
344
+ "state": {
345
+ "anyOf": [
346
+ { "const": "pending", "type": "string" },
347
+ { "const": "active", "type": "string" },
348
+ { "const": "retry", "type": "string" },
349
+ { "const": "completed", "type": "string" },
350
+ { "const": "failed", "type": "string" },
351
+ { "const": "cancelled", "type": "string" },
352
+ { "const": "expired", "type": "string" },
353
+ { "const": "dead", "type": "string" },
354
+ { "const": "dismissed", "type": "string" },
355
+ ],
356
+ },
357
+ "tries": { "minimum": 0, "type": "integer" },
358
+ "type": { "minLength": 1, "type": "string" },
359
+ "updatedAt": { "format": "date-time", "type": "string" },
360
+ },
361
+ "required": [
362
+ "id",
363
+ "context",
364
+ "service",
365
+ "type",
366
+ "state",
367
+ "payload",
368
+ "createdAt",
369
+ "updatedAt",
370
+ "tries",
371
+ "maxTries",
372
+ ],
373
+ "type": "object",
374
+ },
375
+ },
376
+ "required": ["job"],
377
+ "type": "object",
378
+ },
379
+ "JobsDismissDLQRequest": {
380
+ "description": "Jobs admin ids are globally addressable; callers identify jobs by id only.",
381
+ "properties": { "id": { "minLength": 1, "type": "string" } },
382
+ "required": ["id"],
383
+ "type": "object",
384
+ },
385
+ "JobsDismissDLQResponse": {
386
+ "properties": {
387
+ "job": {
388
+ "properties": {
389
+ "completedAt": { "format": "date-time", "type": "string" },
390
+ "context": {
391
+ "properties": {
392
+ "requestId": { "minLength": 1, "type": "string" },
393
+ "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" },
394
+ "traceparent": {
395
+ "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$",
396
+ "type": "string",
397
+ },
398
+ "tracestate": { "minLength": 1, "type": "string" },
399
+ },
400
+ "required": ["requestId", "traceId", "traceparent"],
401
+ "type": "object",
402
+ },
403
+ "createdAt": { "format": "date-time", "type": "string" },
404
+ "deadline": { "format": "date-time", "type": "string" },
405
+ "id": { "minLength": 1, "type": "string" },
406
+ "lastError": { "type": "string" },
407
+ "logs": {
408
+ "items": {
409
+ "properties": {
410
+ "level": {
411
+ "anyOf": [{ "const": "info", "type": "string" }, {
412
+ "const": "warn",
413
+ "type": "string",
414
+ }, { "const": "error", "type": "string" }],
415
+ },
416
+ "message": { "type": "string" },
417
+ "timestamp": { "format": "date-time", "type": "string" },
418
+ },
419
+ "required": ["timestamp", "level", "message"],
420
+ "type": "object",
421
+ },
422
+ "type": "array",
423
+ },
424
+ "maxTries": { "minimum": 1, "type": "integer" },
425
+ "payload": {},
426
+ "progress": {
427
+ "properties": {
428
+ "current": { "minimum": 0, "type": "integer" },
429
+ "message": { "type": "string" },
430
+ "step": { "type": "string" },
431
+ "total": { "minimum": 0, "type": "integer" },
432
+ },
433
+ "type": "object",
434
+ },
435
+ "result": {},
436
+ "service": { "minLength": 1, "type": "string" },
437
+ "startedAt": { "format": "date-time", "type": "string" },
438
+ "state": {
439
+ "anyOf": [
440
+ { "const": "pending", "type": "string" },
441
+ { "const": "active", "type": "string" },
442
+ { "const": "retry", "type": "string" },
443
+ { "const": "completed", "type": "string" },
444
+ { "const": "failed", "type": "string" },
445
+ { "const": "cancelled", "type": "string" },
446
+ { "const": "expired", "type": "string" },
447
+ { "const": "dead", "type": "string" },
448
+ { "const": "dismissed", "type": "string" },
449
+ ],
450
+ },
451
+ "tries": { "minimum": 0, "type": "integer" },
452
+ "type": { "minLength": 1, "type": "string" },
453
+ "updatedAt": { "format": "date-time", "type": "string" },
454
+ },
455
+ "required": [
456
+ "id",
457
+ "context",
458
+ "service",
459
+ "type",
460
+ "state",
461
+ "payload",
462
+ "createdAt",
463
+ "updatedAt",
464
+ "tries",
465
+ "maxTries",
466
+ ],
467
+ "type": "object",
468
+ },
469
+ },
470
+ "required": ["job"],
471
+ "type": "object",
472
+ },
473
+ "JobsGetRequest": {
474
+ "description": "Jobs admin ids are globally addressable; callers identify jobs by id only.",
475
+ "properties": { "id": { "minLength": 1, "type": "string" } },
476
+ "required": ["id"],
477
+ "type": "object",
478
+ },
479
+ "JobsGetResponse": {
480
+ "properties": {
481
+ "job": {
482
+ "properties": {
483
+ "completedAt": { "format": "date-time", "type": "string" },
484
+ "context": {
485
+ "properties": {
486
+ "requestId": { "minLength": 1, "type": "string" },
487
+ "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" },
488
+ "traceparent": {
489
+ "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$",
490
+ "type": "string",
491
+ },
492
+ "tracestate": { "minLength": 1, "type": "string" },
493
+ },
494
+ "required": ["requestId", "traceId", "traceparent"],
495
+ "type": "object",
496
+ },
497
+ "createdAt": { "format": "date-time", "type": "string" },
498
+ "deadline": { "format": "date-time", "type": "string" },
499
+ "id": { "minLength": 1, "type": "string" },
500
+ "lastError": { "type": "string" },
501
+ "logs": {
502
+ "items": {
503
+ "properties": {
504
+ "level": {
505
+ "anyOf": [{ "const": "info", "type": "string" }, {
506
+ "const": "warn",
507
+ "type": "string",
508
+ }, { "const": "error", "type": "string" }],
509
+ },
510
+ "message": { "type": "string" },
511
+ "timestamp": { "format": "date-time", "type": "string" },
512
+ },
513
+ "required": ["timestamp", "level", "message"],
514
+ "type": "object",
515
+ },
516
+ "type": "array",
517
+ },
518
+ "maxTries": { "minimum": 1, "type": "integer" },
519
+ "payload": {},
520
+ "progress": {
521
+ "properties": {
522
+ "current": { "minimum": 0, "type": "integer" },
523
+ "message": { "type": "string" },
524
+ "step": { "type": "string" },
525
+ "total": { "minimum": 0, "type": "integer" },
526
+ },
527
+ "type": "object",
528
+ },
529
+ "result": {},
530
+ "service": { "minLength": 1, "type": "string" },
531
+ "startedAt": { "format": "date-time", "type": "string" },
532
+ "state": {
533
+ "anyOf": [
534
+ { "const": "pending", "type": "string" },
535
+ { "const": "active", "type": "string" },
536
+ { "const": "retry", "type": "string" },
537
+ { "const": "completed", "type": "string" },
538
+ { "const": "failed", "type": "string" },
539
+ { "const": "cancelled", "type": "string" },
540
+ { "const": "expired", "type": "string" },
541
+ { "const": "dead", "type": "string" },
542
+ { "const": "dismissed", "type": "string" },
543
+ ],
544
+ },
545
+ "tries": { "minimum": 0, "type": "integer" },
546
+ "type": { "minLength": 1, "type": "string" },
547
+ "updatedAt": { "format": "date-time", "type": "string" },
548
+ },
549
+ "required": [
550
+ "id",
551
+ "context",
552
+ "service",
553
+ "type",
554
+ "state",
555
+ "payload",
556
+ "createdAt",
557
+ "updatedAt",
558
+ "tries",
559
+ "maxTries",
560
+ ],
561
+ "type": "object",
562
+ },
563
+ },
564
+ "required": ["job"],
565
+ "type": "object",
566
+ },
567
+ "JobsHealthResponse": {
568
+ "properties": {
569
+ "checks": {
570
+ "items": { "patternProperties": { "^.*$": {} }, "type": "object" },
571
+ "type": "array",
572
+ },
573
+ "service": { "minLength": 1, "type": "string" },
574
+ "status": {},
575
+ "timestamp": { "format": "date-time", "type": "string" },
576
+ },
577
+ "required": ["service", "status", "timestamp", "checks"],
578
+ "type": "object",
579
+ },
580
+ "JobsListDLQRequest": {
581
+ "properties": {
582
+ "limit": { "minimum": 1, "type": "integer" },
583
+ "offset": { "minimum": 0, "type": "integer" },
584
+ "service": { "minLength": 1, "type": "string" },
585
+ "since": { "format": "date-time", "type": "string" },
586
+ "type": { "minLength": 1, "type": "string" },
587
+ },
588
+ "required": ["limit"],
589
+ "type": "object",
590
+ },
591
+ "JobsListDLQResponse": {
592
+ "properties": {
593
+ "count": { "minimum": 0, "type": "integer" },
594
+ "entries": {
595
+ "items": {
596
+ "properties": {
597
+ "completedAt": { "format": "date-time", "type": "string" },
598
+ "context": {
599
+ "properties": {
600
+ "requestId": { "minLength": 1, "type": "string" },
601
+ "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" },
602
+ "traceparent": {
603
+ "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$",
604
+ "type": "string",
605
+ },
606
+ "tracestate": { "minLength": 1, "type": "string" },
607
+ },
608
+ "required": ["requestId", "traceId", "traceparent"],
609
+ "type": "object",
610
+ },
611
+ "createdAt": { "format": "date-time", "type": "string" },
612
+ "deadline": { "format": "date-time", "type": "string" },
613
+ "id": { "minLength": 1, "type": "string" },
614
+ "lastError": { "type": "string" },
615
+ "logs": {
616
+ "items": {
617
+ "properties": {
618
+ "level": {
619
+ "anyOf": [{ "const": "info", "type": "string" }, {
620
+ "const": "warn",
621
+ "type": "string",
622
+ }, { "const": "error", "type": "string" }],
623
+ },
624
+ "message": { "type": "string" },
625
+ "timestamp": { "format": "date-time", "type": "string" },
626
+ },
627
+ "required": ["timestamp", "level", "message"],
628
+ "type": "object",
629
+ },
630
+ "type": "array",
631
+ },
632
+ "maxTries": { "minimum": 1, "type": "integer" },
633
+ "payload": {},
634
+ "progress": {
635
+ "properties": {
636
+ "current": { "minimum": 0, "type": "integer" },
637
+ "message": { "type": "string" },
638
+ "step": { "type": "string" },
639
+ "total": { "minimum": 0, "type": "integer" },
640
+ },
641
+ "type": "object",
642
+ },
643
+ "result": {},
644
+ "service": { "minLength": 1, "type": "string" },
645
+ "startedAt": { "format": "date-time", "type": "string" },
646
+ "state": {
647
+ "anyOf": [
648
+ { "const": "pending", "type": "string" },
649
+ { "const": "active", "type": "string" },
650
+ { "const": "retry", "type": "string" },
651
+ { "const": "completed", "type": "string" },
652
+ { "const": "failed", "type": "string" },
653
+ { "const": "cancelled", "type": "string" },
654
+ { "const": "expired", "type": "string" },
655
+ { "const": "dead", "type": "string" },
656
+ { "const": "dismissed", "type": "string" },
657
+ ],
658
+ },
659
+ "tries": { "minimum": 0, "type": "integer" },
660
+ "type": { "minLength": 1, "type": "string" },
661
+ "updatedAt": { "format": "date-time", "type": "string" },
662
+ },
663
+ "required": [
664
+ "id",
665
+ "context",
666
+ "service",
667
+ "type",
668
+ "state",
669
+ "payload",
670
+ "createdAt",
671
+ "updatedAt",
672
+ "tries",
673
+ "maxTries",
674
+ ],
675
+ "type": "object",
676
+ },
677
+ "type": "array",
678
+ },
679
+ "limit": { "minimum": 1, "type": "integer" },
680
+ "nextOffset": { "minimum": 0, "type": "integer" },
681
+ "offset": { "minimum": 0, "type": "integer" },
682
+ },
683
+ "required": ["entries", "count", "offset", "limit"],
684
+ "type": "object",
685
+ },
686
+ "JobsListRequest": {
687
+ "properties": {
688
+ "limit": { "minimum": 1, "type": "integer" },
689
+ "offset": { "minimum": 0, "type": "integer" },
690
+ "service": { "minLength": 1, "type": "string" },
691
+ "since": { "format": "date-time", "type": "string" },
692
+ "state": {
693
+ "items": {
694
+ "anyOf": [
695
+ { "const": "pending", "type": "string" },
696
+ { "const": "active", "type": "string" },
697
+ { "const": "retry", "type": "string" },
698
+ { "const": "completed", "type": "string" },
699
+ { "const": "failed", "type": "string" },
700
+ { "const": "cancelled", "type": "string" },
701
+ { "const": "expired", "type": "string" },
702
+ { "const": "dead", "type": "string" },
703
+ { "const": "dismissed", "type": "string" },
704
+ ],
705
+ },
706
+ "type": "array",
707
+ },
708
+ "type": { "minLength": 1, "type": "string" },
709
+ },
710
+ "required": ["limit"],
711
+ "type": "object",
712
+ },
713
+ "JobsListResponse": {
714
+ "properties": {
715
+ "count": { "minimum": 0, "type": "integer" },
716
+ "entries": {
717
+ "items": {
718
+ "properties": {
719
+ "completedAt": { "format": "date-time", "type": "string" },
720
+ "context": {
721
+ "properties": {
722
+ "requestId": { "minLength": 1, "type": "string" },
723
+ "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" },
724
+ "traceparent": {
725
+ "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$",
726
+ "type": "string",
727
+ },
728
+ "tracestate": { "minLength": 1, "type": "string" },
729
+ },
730
+ "required": ["requestId", "traceId", "traceparent"],
731
+ "type": "object",
732
+ },
733
+ "createdAt": { "format": "date-time", "type": "string" },
734
+ "deadline": { "format": "date-time", "type": "string" },
735
+ "id": { "minLength": 1, "type": "string" },
736
+ "lastError": { "type": "string" },
737
+ "logs": {
738
+ "items": {
739
+ "properties": {
740
+ "level": {
741
+ "anyOf": [{ "const": "info", "type": "string" }, {
742
+ "const": "warn",
743
+ "type": "string",
744
+ }, { "const": "error", "type": "string" }],
745
+ },
746
+ "message": { "type": "string" },
747
+ "timestamp": { "format": "date-time", "type": "string" },
748
+ },
749
+ "required": ["timestamp", "level", "message"],
750
+ "type": "object",
751
+ },
752
+ "type": "array",
753
+ },
754
+ "maxTries": { "minimum": 1, "type": "integer" },
755
+ "payload": {},
756
+ "progress": {
757
+ "properties": {
758
+ "current": { "minimum": 0, "type": "integer" },
759
+ "message": { "type": "string" },
760
+ "step": { "type": "string" },
761
+ "total": { "minimum": 0, "type": "integer" },
762
+ },
763
+ "type": "object",
764
+ },
765
+ "result": {},
766
+ "service": { "minLength": 1, "type": "string" },
767
+ "startedAt": { "format": "date-time", "type": "string" },
768
+ "state": {
769
+ "anyOf": [
770
+ { "const": "pending", "type": "string" },
771
+ { "const": "active", "type": "string" },
772
+ { "const": "retry", "type": "string" },
773
+ { "const": "completed", "type": "string" },
774
+ { "const": "failed", "type": "string" },
775
+ { "const": "cancelled", "type": "string" },
776
+ { "const": "expired", "type": "string" },
777
+ { "const": "dead", "type": "string" },
778
+ { "const": "dismissed", "type": "string" },
779
+ ],
780
+ },
781
+ "tries": { "minimum": 0, "type": "integer" },
782
+ "type": { "minLength": 1, "type": "string" },
783
+ "updatedAt": { "format": "date-time", "type": "string" },
784
+ },
785
+ "required": [
786
+ "id",
787
+ "context",
788
+ "service",
789
+ "type",
790
+ "state",
791
+ "payload",
792
+ "createdAt",
793
+ "updatedAt",
794
+ "tries",
795
+ "maxTries",
796
+ ],
797
+ "type": "object",
798
+ },
799
+ "type": "array",
800
+ },
801
+ "limit": { "minimum": 1, "type": "integer" },
802
+ "nextOffset": { "minimum": 0, "type": "integer" },
803
+ "offset": { "minimum": 0, "type": "integer" },
804
+ },
805
+ "required": ["entries", "count", "offset", "limit"],
806
+ "type": "object",
807
+ },
808
+ "JobsListServicesRequest": {
809
+ "properties": {
810
+ "limit": { "minimum": 1, "type": "integer" },
811
+ "offset": { "minimum": 0, "type": "integer" },
812
+ },
813
+ "required": ["limit"],
814
+ "type": "object",
815
+ },
816
+ "JobsListServicesResponse": {
817
+ "properties": {
818
+ "count": { "minimum": 0, "type": "integer" },
819
+ "entries": {
820
+ "items": {
821
+ "properties": {
822
+ "healthy": { "type": "boolean" },
823
+ "name": { "minLength": 1, "type": "string" },
824
+ "workers": {
825
+ "items": {
826
+ "properties": {
827
+ "concurrency": { "minimum": 1, "type": "integer" },
828
+ "instanceId": { "minLength": 1, "type": "string" },
829
+ "jobType": { "minLength": 1, "type": "string" },
830
+ "service": { "minLength": 1, "type": "string" },
831
+ "timestamp": { "format": "date-time", "type": "string" },
832
+ "version": { "minLength": 1, "type": "string" },
833
+ },
834
+ "required": ["service", "jobType", "instanceId", "timestamp"],
835
+ "type": "object",
836
+ },
837
+ "type": "array",
838
+ },
839
+ },
840
+ "required": ["name", "healthy", "workers"],
841
+ "type": "object",
842
+ },
843
+ "type": "array",
844
+ },
845
+ "limit": { "minimum": 1, "type": "integer" },
846
+ "nextOffset": { "minimum": 0, "type": "integer" },
847
+ "offset": { "minimum": 0, "type": "integer" },
848
+ },
849
+ "required": ["entries", "count", "offset", "limit"],
850
+ "type": "object",
851
+ },
852
+ "JobsReplayDLQRequest": {
853
+ "description": "Jobs admin ids are globally addressable; callers identify jobs by id only.",
854
+ "properties": { "id": { "minLength": 1, "type": "string" } },
855
+ "required": ["id"],
856
+ "type": "object",
857
+ },
858
+ "JobsReplayDLQResponse": {
859
+ "properties": {
860
+ "job": {
861
+ "properties": {
862
+ "completedAt": { "format": "date-time", "type": "string" },
863
+ "context": {
864
+ "properties": {
865
+ "requestId": { "minLength": 1, "type": "string" },
866
+ "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" },
867
+ "traceparent": {
868
+ "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$",
869
+ "type": "string",
870
+ },
871
+ "tracestate": { "minLength": 1, "type": "string" },
872
+ },
873
+ "required": ["requestId", "traceId", "traceparent"],
874
+ "type": "object",
875
+ },
876
+ "createdAt": { "format": "date-time", "type": "string" },
877
+ "deadline": { "format": "date-time", "type": "string" },
878
+ "id": { "minLength": 1, "type": "string" },
879
+ "lastError": { "type": "string" },
880
+ "logs": {
881
+ "items": {
882
+ "properties": {
883
+ "level": {
884
+ "anyOf": [{ "const": "info", "type": "string" }, {
885
+ "const": "warn",
886
+ "type": "string",
887
+ }, { "const": "error", "type": "string" }],
888
+ },
889
+ "message": { "type": "string" },
890
+ "timestamp": { "format": "date-time", "type": "string" },
891
+ },
892
+ "required": ["timestamp", "level", "message"],
893
+ "type": "object",
894
+ },
895
+ "type": "array",
896
+ },
897
+ "maxTries": { "minimum": 1, "type": "integer" },
898
+ "payload": {},
899
+ "progress": {
900
+ "properties": {
901
+ "current": { "minimum": 0, "type": "integer" },
902
+ "message": { "type": "string" },
903
+ "step": { "type": "string" },
904
+ "total": { "minimum": 0, "type": "integer" },
905
+ },
906
+ "type": "object",
907
+ },
908
+ "result": {},
909
+ "service": { "minLength": 1, "type": "string" },
910
+ "startedAt": { "format": "date-time", "type": "string" },
911
+ "state": {
912
+ "anyOf": [
913
+ { "const": "pending", "type": "string" },
914
+ { "const": "active", "type": "string" },
915
+ { "const": "retry", "type": "string" },
916
+ { "const": "completed", "type": "string" },
917
+ { "const": "failed", "type": "string" },
918
+ { "const": "cancelled", "type": "string" },
919
+ { "const": "expired", "type": "string" },
920
+ { "const": "dead", "type": "string" },
921
+ { "const": "dismissed", "type": "string" },
922
+ ],
923
+ },
924
+ "tries": { "minimum": 0, "type": "integer" },
925
+ "type": { "minLength": 1, "type": "string" },
926
+ "updatedAt": { "format": "date-time", "type": "string" },
927
+ },
928
+ "required": [
929
+ "id",
930
+ "context",
931
+ "service",
932
+ "type",
933
+ "state",
934
+ "payload",
935
+ "createdAt",
936
+ "updatedAt",
937
+ "tries",
938
+ "maxTries",
939
+ ],
940
+ "type": "object",
941
+ },
942
+ },
943
+ "required": ["job"],
944
+ "type": "object",
945
+ },
946
+ "JobsRetryRequest": {
947
+ "description": "Jobs admin ids are globally addressable; callers identify jobs by id only.",
948
+ "properties": { "id": { "minLength": 1, "type": "string" } },
949
+ "required": ["id"],
950
+ "type": "object",
951
+ },
952
+ "JobsRetryResponse": {
953
+ "properties": {
954
+ "job": {
955
+ "properties": {
956
+ "completedAt": { "format": "date-time", "type": "string" },
957
+ "context": {
958
+ "properties": {
959
+ "requestId": { "minLength": 1, "type": "string" },
960
+ "traceId": { "pattern": "^[0-9a-f]{32}$", "type": "string" },
961
+ "traceparent": {
962
+ "pattern": "^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$",
963
+ "type": "string",
964
+ },
965
+ "tracestate": { "minLength": 1, "type": "string" },
966
+ },
967
+ "required": ["requestId", "traceId", "traceparent"],
968
+ "type": "object",
969
+ },
970
+ "createdAt": { "format": "date-time", "type": "string" },
971
+ "deadline": { "format": "date-time", "type": "string" },
972
+ "id": { "minLength": 1, "type": "string" },
973
+ "lastError": { "type": "string" },
974
+ "logs": {
975
+ "items": {
976
+ "properties": {
977
+ "level": {
978
+ "anyOf": [{ "const": "info", "type": "string" }, {
979
+ "const": "warn",
980
+ "type": "string",
981
+ }, { "const": "error", "type": "string" }],
982
+ },
983
+ "message": { "type": "string" },
984
+ "timestamp": { "format": "date-time", "type": "string" },
985
+ },
986
+ "required": ["timestamp", "level", "message"],
987
+ "type": "object",
988
+ },
989
+ "type": "array",
990
+ },
991
+ "maxTries": { "minimum": 1, "type": "integer" },
992
+ "payload": {},
993
+ "progress": {
994
+ "properties": {
995
+ "current": { "minimum": 0, "type": "integer" },
996
+ "message": { "type": "string" },
997
+ "step": { "type": "string" },
998
+ "total": { "minimum": 0, "type": "integer" },
999
+ },
1000
+ "type": "object",
1001
+ },
1002
+ "result": {},
1003
+ "service": { "minLength": 1, "type": "string" },
1004
+ "startedAt": { "format": "date-time", "type": "string" },
1005
+ "state": {
1006
+ "anyOf": [
1007
+ { "const": "pending", "type": "string" },
1008
+ { "const": "active", "type": "string" },
1009
+ { "const": "retry", "type": "string" },
1010
+ { "const": "completed", "type": "string" },
1011
+ { "const": "failed", "type": "string" },
1012
+ { "const": "cancelled", "type": "string" },
1013
+ { "const": "expired", "type": "string" },
1014
+ { "const": "dead", "type": "string" },
1015
+ { "const": "dismissed", "type": "string" },
1016
+ ],
1017
+ },
1018
+ "tries": { "minimum": 0, "type": "integer" },
1019
+ "type": { "minLength": 1, "type": "string" },
1020
+ "updatedAt": { "format": "date-time", "type": "string" },
1021
+ },
1022
+ "required": [
1023
+ "id",
1024
+ "context",
1025
+ "service",
1026
+ "type",
1027
+ "state",
1028
+ "payload",
1029
+ "createdAt",
1030
+ "updatedAt",
1031
+ "tries",
1032
+ "maxTries",
1033
+ ],
1034
+ "type": "object",
1035
+ },
1036
+ },
1037
+ "required": ["job"],
1038
+ "type": "object",
1039
+ },
1040
+ "NotFoundErrorData": {
1041
+ "properties": {
1042
+ "context": { "patternProperties": { "^.*$": {} }, "type": "object" },
1043
+ "id": { "minLength": 1, "type": "string" },
1044
+ "jobId": { "minLength": 1, "type": "string" },
1045
+ "message": { "type": "string" },
1046
+ "resource": { "minLength": 1, "type": "string" },
1047
+ "traceId": { "type": "string" },
1048
+ "type": { "const": "NotFoundError", "type": "string" },
1049
+ },
1050
+ "required": ["id", "type", "message", "resource"],
1051
+ "type": "object",
1052
+ },
1053
+ },
1054
+ "uses": {
1055
+ "required": {
1056
+ "auth": {
1057
+ "contract": "trellis.auth@v1",
1058
+ "rpc": { "call": ["Auth.Requests.Validate"] },
1059
+ },
1060
+ "core": {
1061
+ "contract": "trellis.core@v1",
1062
+ "rpc": { "call": ["Trellis.Bindings.Get", "Trellis.Catalog"] },
1063
+ },
1064
+ "health": {
1065
+ "contract": "trellis.health@v1",
1066
+ "events": { "publish": ["Health.Heartbeat"] },
1067
+ },
1068
+ },
1069
+ },
1070
+ };
6
1071
  function assertSelectedKeysExist(kind, keys, api) {
7
1072
  if (!keys) {
8
1073
  return;
@@ -25,27 +1090,35 @@ export const sdk = {
25
1090
  CONTRACT_DIGEST,
26
1091
  CONTRACT,
27
1092
  API,
28
- use: ((spec) => {
1093
+ use: (spec) => {
29
1094
  assertValidUseSpec(spec);
30
1095
  const dependencyUse = {
31
1096
  contract: CONTRACT_ID,
32
1097
  ...(spec.rpc?.call ? { rpc: { call: [...spec.rpc.call] } } : {}),
33
- ...(spec.operations?.call ? { operations: { call: [...spec.operations.call] } } : {}),
1098
+ ...(spec.operations?.call
1099
+ ? { operations: { call: [...spec.operations.call] } }
1100
+ : {}),
34
1101
  ...((spec.events?.publish || spec.events?.subscribe)
35
1102
  ? {
36
1103
  events: {
37
- ...(spec.events.publish ? { publish: [...spec.events.publish] } : {}),
38
- ...(spec.events.subscribe ? { subscribe: [...spec.events.subscribe] } : {}),
1104
+ ...(spec.events.publish
1105
+ ? { publish: [...spec.events.publish] }
1106
+ : {}),
1107
+ ...(spec.events.subscribe
1108
+ ? { subscribe: [...spec.events.subscribe] }
1109
+ : {}),
39
1110
  },
40
1111
  }
41
1112
  : {}),
42
- ...(spec.feeds?.subscribe ? { feeds: { subscribe: [...spec.feeds.subscribe] } } : {}),
1113
+ ...(spec.feeds?.subscribe
1114
+ ? { feeds: { subscribe: [...spec.feeds.subscribe] } }
1115
+ : {}),
43
1116
  };
44
1117
  Object.defineProperty(dependencyUse, CONTRACT_MODULE_METADATA, {
45
1118
  value: sdk,
46
1119
  enumerable: false,
47
1120
  });
48
1121
  return dependencyUse;
49
- }),
1122
+ },
50
1123
  };
51
1124
  export const use = sdk.use;