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