@agentuity/server 1.0.17 → 1.0.19
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.
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/api.js.map +1 -1
- package/dist/api/apikey/create.d.ts +1 -1
- package/dist/api/apikey/create.d.ts.map +1 -1
- package/dist/api/apikey/create.js +2 -2
- package/dist/api/apikey/create.js.map +1 -1
- package/dist/api/apikey/delete.d.ts +1 -1
- package/dist/api/apikey/delete.d.ts.map +1 -1
- package/dist/api/apikey/delete.js +2 -2
- package/dist/api/apikey/delete.js.map +1 -1
- package/dist/api/apikey/get.d.ts +1 -1
- package/dist/api/apikey/get.d.ts.map +1 -1
- package/dist/api/apikey/get.js +2 -2
- package/dist/api/apikey/get.js.map +1 -1
- package/dist/api/apikey/index.d.ts +5 -5
- package/dist/api/apikey/index.d.ts.map +1 -1
- package/dist/api/apikey/index.js +5 -5
- package/dist/api/apikey/index.js.map +1 -1
- package/dist/api/apikey/list.d.ts +1 -1
- package/dist/api/apikey/list.d.ts.map +1 -1
- package/dist/api/apikey/list.js +2 -2
- package/dist/api/apikey/list.js.map +1 -1
- package/dist/api/db/index.d.ts +4 -4
- package/dist/api/db/index.d.ts.map +1 -1
- package/dist/api/db/index.js +4 -4
- package/dist/api/db/index.js.map +1 -1
- package/dist/api/db/logs.d.ts +1 -1
- package/dist/api/db/logs.d.ts.map +1 -1
- package/dist/api/db/logs.js +2 -2
- package/dist/api/db/logs.js.map +1 -1
- package/dist/api/db/query.d.ts +1 -1
- package/dist/api/db/query.d.ts.map +1 -1
- package/dist/api/db/query.js +2 -2
- package/dist/api/db/query.js.map +1 -1
- package/dist/api/db/tables.d.ts +1 -1
- package/dist/api/db/tables.d.ts.map +1 -1
- package/dist/api/db/tables.js +2 -2
- package/dist/api/db/tables.js.map +1 -1
- package/dist/api/eval/get.d.ts +1 -1
- package/dist/api/eval/get.d.ts.map +1 -1
- package/dist/api/eval/get.js +1 -1
- package/dist/api/eval/get.js.map +1 -1
- package/dist/api/eval/index.d.ts +4 -4
- package/dist/api/eval/index.d.ts.map +1 -1
- package/dist/api/eval/index.js +4 -4
- package/dist/api/eval/index.js.map +1 -1
- package/dist/api/eval/list.d.ts +1 -1
- package/dist/api/eval/list.d.ts.map +1 -1
- package/dist/api/eval/list.js +1 -1
- package/dist/api/eval/list.js.map +1 -1
- package/dist/api/eval/run-get.d.ts +1 -1
- package/dist/api/eval/run-get.d.ts.map +1 -1
- package/dist/api/eval/run-get.js +1 -1
- package/dist/api/eval/run-get.js.map +1 -1
- package/dist/api/eval/run-list.d.ts +1 -1
- package/dist/api/eval/run-list.d.ts.map +1 -1
- package/dist/api/eval/run-list.js +1 -1
- package/dist/api/eval/run-list.js.map +1 -1
- package/dist/api/index.d.ts +14 -14
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +14 -14
- package/dist/api/index.js.map +1 -1
- package/dist/api/machine/index.d.ts +2 -2
- package/dist/api/machine/index.d.ts.map +1 -1
- package/dist/api/machine/index.js +2 -2
- package/dist/api/machine/index.js.map +1 -1
- package/dist/api/machine/machine.d.ts +1 -1
- package/dist/api/machine/machine.d.ts.map +1 -1
- package/dist/api/machine/machine.js +2 -2
- package/dist/api/machine/machine.js.map +1 -1
- package/dist/api/org/env-delete.d.ts +1 -1
- package/dist/api/org/env-delete.d.ts.map +1 -1
- package/dist/api/org/env-delete.js +2 -2
- package/dist/api/org/env-delete.js.map +1 -1
- package/dist/api/org/env-get.d.ts +1 -1
- package/dist/api/org/env-get.d.ts.map +1 -1
- package/dist/api/org/env-get.js +2 -2
- package/dist/api/org/env-get.js.map +1 -1
- package/dist/api/org/env-update.d.ts +1 -1
- package/dist/api/org/env-update.d.ts.map +1 -1
- package/dist/api/org/env-update.js +2 -2
- package/dist/api/org/env-update.js.map +1 -1
- package/dist/api/org/index.d.ts +6 -6
- package/dist/api/org/index.d.ts.map +1 -1
- package/dist/api/org/index.js +6 -6
- package/dist/api/org/index.js.map +1 -1
- package/dist/api/org/list.d.ts +1 -1
- package/dist/api/org/list.d.ts.map +1 -1
- package/dist/api/org/list.js +2 -2
- package/dist/api/org/list.js.map +1 -1
- package/dist/api/org/resources.d.ts +1 -1
- package/dist/api/org/resources.d.ts.map +1 -1
- package/dist/api/org/resources.js +2 -2
- package/dist/api/org/resources.js.map +1 -1
- package/dist/api/project/agent.d.ts +1 -1
- package/dist/api/project/agent.d.ts.map +1 -1
- package/dist/api/project/agent.js +2 -2
- package/dist/api/project/agent.js.map +1 -1
- package/dist/api/project/create.d.ts +1 -1
- package/dist/api/project/create.d.ts.map +1 -1
- package/dist/api/project/create.js +2 -2
- package/dist/api/project/create.js.map +1 -1
- package/dist/api/project/delete.d.ts +1 -1
- package/dist/api/project/delete.d.ts.map +1 -1
- package/dist/api/project/delete.js +2 -2
- package/dist/api/project/delete.js.map +1 -1
- package/dist/api/project/deploy.d.ts +1 -1
- package/dist/api/project/deploy.d.ts.map +1 -1
- package/dist/api/project/deploy.js +2 -2
- package/dist/api/project/deploy.js.map +1 -1
- package/dist/api/project/deployment.d.ts +1 -1
- package/dist/api/project/deployment.d.ts.map +1 -1
- package/dist/api/project/deployment.js +2 -2
- package/dist/api/project/deployment.js.map +1 -1
- package/dist/api/project/env-delete.d.ts +1 -1
- package/dist/api/project/env-delete.d.ts.map +1 -1
- package/dist/api/project/env-delete.js +2 -2
- package/dist/api/project/env-delete.js.map +1 -1
- package/dist/api/project/env-update.d.ts +2 -2
- package/dist/api/project/env-update.d.ts.map +1 -1
- package/dist/api/project/env-update.js +3 -3
- package/dist/api/project/env-update.js.map +1 -1
- package/dist/api/project/exists.d.ts +1 -1
- package/dist/api/project/exists.d.ts.map +1 -1
- package/dist/api/project/exists.js +2 -2
- package/dist/api/project/exists.js.map +1 -1
- package/dist/api/project/get.d.ts +1 -1
- package/dist/api/project/get.d.ts.map +1 -1
- package/dist/api/project/get.js +2 -2
- package/dist/api/project/get.js.map +1 -1
- package/dist/api/project/hostname.d.ts +1 -1
- package/dist/api/project/hostname.d.ts.map +1 -1
- package/dist/api/project/hostname.js +2 -2
- package/dist/api/project/hostname.js.map +1 -1
- package/dist/api/project/index.d.ts +13 -13
- package/dist/api/project/index.d.ts.map +1 -1
- package/dist/api/project/index.js +13 -13
- package/dist/api/project/index.js.map +1 -1
- package/dist/api/project/list.d.ts +1 -1
- package/dist/api/project/list.d.ts.map +1 -1
- package/dist/api/project/list.js +2 -2
- package/dist/api/project/list.js.map +1 -1
- package/dist/api/project/malware.d.ts +1 -1
- package/dist/api/project/malware.d.ts.map +1 -1
- package/dist/api/project/malware.js +6 -2
- package/dist/api/project/malware.js.map +1 -1
- package/dist/api/project/update-region.d.ts +1 -1
- package/dist/api/project/update-region.d.ts.map +1 -1
- package/dist/api/project/update-region.js +2 -2
- package/dist/api/project/update-region.js.map +1 -1
- package/dist/api/project/util.d.ts +13 -0
- package/dist/api/project/util.d.ts.map +1 -1
- package/dist/api/project/util.js +1 -0
- package/dist/api/project/util.js.map +1 -1
- package/dist/api/queue/analytics.d.ts +2 -2
- package/dist/api/queue/analytics.d.ts.map +1 -1
- package/dist/api/queue/analytics.js +6 -18
- package/dist/api/queue/analytics.js.map +1 -1
- package/dist/api/queue/destinations.d.ts +2 -2
- package/dist/api/queue/destinations.d.ts.map +1 -1
- package/dist/api/queue/destinations.js +14 -84
- package/dist/api/queue/destinations.js.map +1 -1
- package/dist/api/queue/dlq.d.ts +2 -2
- package/dist/api/queue/dlq.d.ts.map +1 -1
- package/dist/api/queue/dlq.js +8 -46
- package/dist/api/queue/dlq.js.map +1 -1
- package/dist/api/queue/index.d.ts +10 -10
- package/dist/api/queue/index.d.ts.map +1 -1
- package/dist/api/queue/index.js +10 -10
- package/dist/api/queue/index.js.map +1 -1
- package/dist/api/queue/messages.d.ts +2 -2
- package/dist/api/queue/messages.d.ts.map +1 -1
- package/dist/api/queue/messages.js +17 -107
- package/dist/api/queue/messages.js.map +1 -1
- package/dist/api/queue/queues.d.ts +2 -2
- package/dist/api/queue/queues.d.ts.map +1 -1
- package/dist/api/queue/queues.js +9 -39
- package/dist/api/queue/queues.js.map +1 -1
- package/dist/api/queue/sources.d.ts +2 -2
- package/dist/api/queue/sources.d.ts.map +1 -1
- package/dist/api/queue/sources.js +15 -98
- package/dist/api/queue/sources.js.map +1 -1
- package/dist/api/queue/util.d.ts +16 -0
- package/dist/api/queue/util.d.ts.map +1 -1
- package/dist/api/queue/util.js +64 -0
- package/dist/api/queue/util.js.map +1 -1
- package/dist/api/queue/websocket.d.ts +1 -1
- package/dist/api/queue/websocket.d.ts.map +1 -1
- package/dist/api/queue/websocket.js +3 -3
- package/dist/api/queue/websocket.js.map +1 -1
- package/dist/api/region/create.d.ts +1 -1
- package/dist/api/region/create.d.ts.map +1 -1
- package/dist/api/region/create.js +8 -2
- package/dist/api/region/create.js.map +1 -1
- package/dist/api/region/delete.d.ts +1 -1
- package/dist/api/region/delete.d.ts.map +1 -1
- package/dist/api/region/delete.js +2 -2
- package/dist/api/region/delete.js.map +1 -1
- package/dist/api/region/index.d.ts +4 -4
- package/dist/api/region/index.d.ts.map +1 -1
- package/dist/api/region/index.js +4 -4
- package/dist/api/region/index.js.map +1 -1
- package/dist/api/region/list.d.ts +1 -1
- package/dist/api/region/list.d.ts.map +1 -1
- package/dist/api/region/list.js +2 -2
- package/dist/api/region/list.js.map +1 -1
- package/dist/api/region/resources.d.ts +1 -1
- package/dist/api/region/resources.d.ts.map +1 -1
- package/dist/api/region/resources.js +2 -2
- package/dist/api/region/resources.js.map +1 -1
- package/dist/api/sandbox/cli-list.d.ts +1 -1
- package/dist/api/sandbox/cli-list.d.ts.map +1 -1
- package/dist/api/sandbox/cli-list.js +2 -2
- package/dist/api/sandbox/cli-list.js.map +1 -1
- package/dist/api/sandbox/client.d.ts +5 -1
- package/dist/api/sandbox/client.d.ts.map +1 -1
- package/dist/api/sandbox/client.js +12 -11
- package/dist/api/sandbox/client.js.map +1 -1
- package/dist/api/sandbox/create.d.ts +7 -1
- package/dist/api/sandbox/create.d.ts.map +1 -1
- package/dist/api/sandbox/create.js +15 -4
- package/dist/api/sandbox/create.js.map +1 -1
- package/dist/api/sandbox/destroy.d.ts +1 -1
- package/dist/api/sandbox/destroy.d.ts.map +1 -1
- package/dist/api/sandbox/destroy.js +2 -2
- package/dist/api/sandbox/destroy.js.map +1 -1
- package/dist/api/sandbox/execute.d.ts +1 -1
- package/dist/api/sandbox/execute.d.ts.map +1 -1
- package/dist/api/sandbox/execute.js +2 -2
- package/dist/api/sandbox/execute.js.map +1 -1
- package/dist/api/sandbox/execution.d.ts +1 -1
- package/dist/api/sandbox/execution.d.ts.map +1 -1
- package/dist/api/sandbox/execution.js +2 -2
- package/dist/api/sandbox/execution.js.map +1 -1
- package/dist/api/sandbox/files.d.ts +1 -1
- package/dist/api/sandbox/files.d.ts.map +1 -1
- package/dist/api/sandbox/files.js +1 -1
- package/dist/api/sandbox/files.js.map +1 -1
- package/dist/api/sandbox/get.d.ts +5 -1
- package/dist/api/sandbox/get.d.ts.map +1 -1
- package/dist/api/sandbox/get.js +17 -3
- package/dist/api/sandbox/get.js.map +1 -1
- package/dist/api/sandbox/index.d.ts +34 -30
- package/dist/api/sandbox/index.d.ts.map +1 -1
- package/dist/api/sandbox/index.js +17 -15
- package/dist/api/sandbox/index.js.map +1 -1
- package/dist/api/sandbox/list.d.ts +7 -1
- package/dist/api/sandbox/list.d.ts.map +1 -1
- package/dist/api/sandbox/list.js +17 -3
- package/dist/api/sandbox/list.js.map +1 -1
- package/dist/api/sandbox/pause.d.ts +22 -0
- package/dist/api/sandbox/pause.d.ts.map +1 -0
- package/dist/api/sandbox/pause.js +25 -0
- package/dist/api/sandbox/pause.js.map +1 -0
- package/dist/api/sandbox/resolve.d.ts +1 -1
- package/dist/api/sandbox/resolve.d.ts.map +1 -1
- package/dist/api/sandbox/resolve.js +1 -1
- package/dist/api/sandbox/resolve.js.map +1 -1
- package/dist/api/sandbox/resume.d.ts +22 -0
- package/dist/api/sandbox/resume.d.ts.map +1 -0
- package/dist/api/sandbox/resume.js +25 -0
- package/dist/api/sandbox/resume.js.map +1 -0
- package/dist/api/sandbox/run.d.ts +1 -1
- package/dist/api/sandbox/run.d.ts.map +1 -1
- package/dist/api/sandbox/run.js +6 -6
- package/dist/api/sandbox/run.js.map +1 -1
- package/dist/api/sandbox/runtime.d.ts +1 -1
- package/dist/api/sandbox/runtime.d.ts.map +1 -1
- package/dist/api/sandbox/runtime.js +2 -2
- package/dist/api/sandbox/runtime.js.map +1 -1
- package/dist/api/sandbox/snapshot.d.ts +1 -1
- package/dist/api/sandbox/snapshot.d.ts.map +1 -1
- package/dist/api/sandbox/snapshot.js +3 -3
- package/dist/api/sandbox/snapshot.js.map +1 -1
- package/dist/api/sandbox/util.d.ts +6 -0
- package/dist/api/sandbox/util.d.ts.map +1 -1
- package/dist/api/sandbox/util.js +6 -0
- package/dist/api/sandbox/util.js.map +1 -1
- package/dist/api/session/get.d.ts +2 -2
- package/dist/api/session/get.d.ts.map +1 -1
- package/dist/api/session/get.js +3 -3
- package/dist/api/session/get.js.map +1 -1
- package/dist/api/session/index.d.ts +3 -3
- package/dist/api/session/index.d.ts.map +1 -1
- package/dist/api/session/index.js +3 -3
- package/dist/api/session/index.js.map +1 -1
- package/dist/api/session/list.d.ts +1 -1
- package/dist/api/session/list.d.ts.map +1 -1
- package/dist/api/session/list.js +2 -2
- package/dist/api/session/list.js.map +1 -1
- package/dist/api/session/logs.d.ts +1 -1
- package/dist/api/session/logs.d.ts.map +1 -1
- package/dist/api/session/logs.js +2 -2
- package/dist/api/session/logs.js.map +1 -1
- package/dist/api/stream/get.d.ts +1 -1
- package/dist/api/stream/get.d.ts.map +1 -1
- package/dist/api/stream/get.js +2 -2
- package/dist/api/stream/get.js.map +1 -1
- package/dist/api/stream/index.d.ts +3 -3
- package/dist/api/stream/index.d.ts.map +1 -1
- package/dist/api/stream/index.js +3 -3
- package/dist/api/stream/index.js.map +1 -1
- package/dist/api/stream/list.d.ts +1 -1
- package/dist/api/stream/list.d.ts.map +1 -1
- package/dist/api/stream/list.js +2 -2
- package/dist/api/stream/list.js.map +1 -1
- package/dist/api/thread/delete.d.ts +1 -1
- package/dist/api/thread/delete.d.ts.map +1 -1
- package/dist/api/thread/delete.js +2 -2
- package/dist/api/thread/delete.js.map +1 -1
- package/dist/api/thread/get.d.ts +2 -2
- package/dist/api/thread/get.d.ts.map +1 -1
- package/dist/api/thread/get.js +3 -3
- package/dist/api/thread/get.js.map +1 -1
- package/dist/api/thread/index.d.ts +4 -4
- package/dist/api/thread/index.d.ts.map +1 -1
- package/dist/api/thread/index.js +4 -4
- package/dist/api/thread/index.js.map +1 -1
- package/dist/api/thread/list.d.ts +1 -1
- package/dist/api/thread/list.d.ts.map +1 -1
- package/dist/api/thread/list.js +2 -2
- package/dist/api/thread/list.js.map +1 -1
- package/dist/api/user/index.d.ts +1 -1
- package/dist/api/user/index.d.ts.map +1 -1
- package/dist/api/user/index.js +1 -1
- package/dist/api/user/index.js.map +1 -1
- package/dist/api/user/whoami.d.ts +1 -1
- package/dist/api/user/whoami.d.ts.map +1 -1
- package/dist/api/user/whoami.js +2 -2
- package/dist/api/user/whoami.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/runtime-bootstrap.js +1 -1
- package/dist/runtime-bootstrap.js.map +1 -1
- package/package.json +4 -4
- package/src/api/api.ts +3 -8
- package/src/api/apikey/create.ts +2 -2
- package/src/api/apikey/delete.ts +2 -2
- package/src/api/apikey/get.ts +2 -2
- package/src/api/apikey/index.ts +5 -5
- package/src/api/apikey/list.ts +2 -2
- package/src/api/db/index.ts +4 -4
- package/src/api/db/logs.ts +2 -2
- package/src/api/db/query.ts +2 -2
- package/src/api/db/tables.ts +2 -2
- package/src/api/eval/get.ts +1 -1
- package/src/api/eval/index.ts +4 -4
- package/src/api/eval/list.ts +1 -1
- package/src/api/eval/run-get.ts +1 -1
- package/src/api/eval/run-list.ts +1 -1
- package/src/api/index.ts +14 -14
- package/src/api/machine/index.ts +2 -2
- package/src/api/machine/machine.ts +2 -2
- package/src/api/org/env-delete.ts +2 -2
- package/src/api/org/env-get.ts +2 -2
- package/src/api/org/env-update.ts +2 -2
- package/src/api/org/index.ts +6 -6
- package/src/api/org/list.ts +2 -2
- package/src/api/org/resources.ts +2 -2
- package/src/api/project/agent.ts +3 -3
- package/src/api/project/create.ts +2 -2
- package/src/api/project/delete.ts +2 -2
- package/src/api/project/deploy.ts +2 -2
- package/src/api/project/deployment.ts +2 -2
- package/src/api/project/env-delete.ts +2 -2
- package/src/api/project/env-update.ts +4 -4
- package/src/api/project/exists.ts +2 -2
- package/src/api/project/get.ts +2 -2
- package/src/api/project/hostname.ts +2 -2
- package/src/api/project/index.ts +13 -13
- package/src/api/project/list.ts +2 -2
- package/src/api/project/malware.ts +6 -2
- package/src/api/project/update-region.ts +2 -2
- package/src/api/project/util.ts +3 -0
- package/src/api/queue/analytics.ts +22 -28
- package/src/api/queue/destinations.ts +55 -119
- package/src/api/queue/dlq.ts +32 -72
- package/src/api/queue/index.ts +10 -10
- package/src/api/queue/messages.ts +92 -185
- package/src/api/queue/queues.ts +50 -71
- package/src/api/queue/sources.ts +50 -140
- package/src/api/queue/util.ts +74 -0
- package/src/api/queue/websocket.ts +8 -8
- package/src/api/region/create.ts +8 -2
- package/src/api/region/delete.ts +2 -2
- package/src/api/region/index.ts +4 -4
- package/src/api/region/list.ts +2 -2
- package/src/api/region/resources.ts +2 -2
- package/src/api/sandbox/cli-list.ts +11 -3
- package/src/api/sandbox/client.ts +17 -11
- package/src/api/sandbox/create.ts +17 -4
- package/src/api/sandbox/destroy.ts +2 -2
- package/src/api/sandbox/execute.ts +2 -2
- package/src/api/sandbox/execution.ts +2 -2
- package/src/api/sandbox/files.ts +2 -2
- package/src/api/sandbox/get.ts +17 -3
- package/src/api/sandbox/index.ts +34 -30
- package/src/api/sandbox/list.ts +17 -3
- package/src/api/sandbox/pause.ts +39 -0
- package/src/api/sandbox/resolve.ts +1 -1
- package/src/api/sandbox/resume.ts +39 -0
- package/src/api/sandbox/run.ts +6 -6
- package/src/api/sandbox/runtime.ts +2 -2
- package/src/api/sandbox/snapshot.ts +3 -3
- package/src/api/sandbox/util.ts +6 -0
- package/src/api/session/get.ts +3 -3
- package/src/api/session/index.ts +3 -3
- package/src/api/session/list.ts +2 -2
- package/src/api/session/logs.ts +2 -2
- package/src/api/stream/get.ts +2 -2
- package/src/api/stream/index.ts +3 -3
- package/src/api/stream/list.ts +2 -2
- package/src/api/thread/delete.ts +2 -2
- package/src/api/thread/get.ts +3 -3
- package/src/api/thread/index.ts +4 -4
- package/src/api/thread/list.ts +2 -2
- package/src/api/user/index.ts +1 -1
- package/src/api/user/whoami.ts +2 -2
- package/src/index.ts +8 -8
- package/src/runtime-bootstrap.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
|
-
import type { Project } from './get';
|
|
4
|
-
import { projectGet } from './get';
|
|
5
|
-
import { ProjectResponseError } from './util';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import type { Project } from './get.ts';
|
|
4
|
+
import { projectGet } from './get.ts';
|
|
5
|
+
import { ProjectResponseError } from './util.ts';
|
|
6
6
|
|
|
7
7
|
export const ProjectEnvUpdateRequestSchema = z.object({
|
|
8
8
|
id: z.string().describe('the project id'),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIError, APIResponseSchema } from '../api';
|
|
3
|
-
import { ProjectResponseError } from './util';
|
|
2
|
+
import { type APIClient, APIError, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { ProjectResponseError } from './util.ts';
|
|
4
4
|
|
|
5
5
|
export const ProjectExistsRequestSchema = z.object({
|
|
6
6
|
name: z.string().max(255).min(1).describe('the name of the new project'),
|
package/src/api/project/get.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
|
-
import { ProjectResponseError } from './util';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { ProjectResponseError } from './util.ts';
|
|
4
4
|
|
|
5
5
|
export const ProjectGetRequestSchema = z.object({
|
|
6
6
|
id: z.string().describe('the project id'),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
|
-
import { ProjectResponseError } from './util';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { ProjectResponseError } from './util.ts';
|
|
4
4
|
|
|
5
5
|
// --- GET hostname ---
|
|
6
6
|
|
package/src/api/project/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from './agent';
|
|
2
|
-
export * from './create';
|
|
3
|
-
export * from './delete';
|
|
4
|
-
export * from './deploy';
|
|
5
|
-
export * from './deployment';
|
|
6
|
-
export * from './env-delete';
|
|
7
|
-
export * from './env-update';
|
|
8
|
-
export * from './exists';
|
|
9
|
-
export * from './get';
|
|
10
|
-
export * from './hostname';
|
|
11
|
-
export * from './list';
|
|
12
|
-
export * from './malware';
|
|
13
|
-
export * from './update-region';
|
|
1
|
+
export * from './agent.ts';
|
|
2
|
+
export * from './create.ts';
|
|
3
|
+
export * from './delete.ts';
|
|
4
|
+
export * from './deploy.ts';
|
|
5
|
+
export * from './deployment.ts';
|
|
6
|
+
export * from './env-delete.ts';
|
|
7
|
+
export * from './env-update.ts';
|
|
8
|
+
export * from './exists.ts';
|
|
9
|
+
export * from './get.ts';
|
|
10
|
+
export * from './hostname.ts';
|
|
11
|
+
export * from './list.ts';
|
|
12
|
+
export * from './malware.ts';
|
|
13
|
+
export * from './update-region.ts';
|
package/src/api/project/list.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
|
-
import { ProjectResponseError } from './util';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { ProjectResponseError } from './util.ts';
|
|
4
4
|
|
|
5
5
|
export const ProjectListItemSchema = z.object({
|
|
6
6
|
id: z.string().describe('the project id'),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { MalwareCheckError } from './util.ts';
|
|
3
4
|
|
|
4
5
|
export const PackageRefSchema = z.object({
|
|
5
6
|
name: z.string(),
|
|
@@ -57,7 +58,10 @@ export async function projectDeploymentMalwareCheck(
|
|
|
57
58
|
);
|
|
58
59
|
|
|
59
60
|
if (!resp.success) {
|
|
60
|
-
throw new
|
|
61
|
+
throw new MalwareCheckError({
|
|
62
|
+
message: resp.message || 'Malware check request failed',
|
|
63
|
+
deploymentId,
|
|
64
|
+
});
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
return resp.data;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
|
-
import { ProjectResponseError } from './util';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import { ProjectResponseError } from './util.ts';
|
|
4
4
|
|
|
5
5
|
export const UpdateRegionRequestSchema = z.object({
|
|
6
6
|
cloudRegion: z.string().describe('the cloud region to update the project to'),
|
package/src/api/project/util.ts
CHANGED
|
@@ -3,3 +3,6 @@ import { StructuredError } from '@agentuity/core';
|
|
|
3
3
|
export const ProjectResponseError = StructuredError('ProjectResponseError');
|
|
4
4
|
export const ProjectNotFoundError = StructuredError('ProjectNotFoundError')<{ id: string }>();
|
|
5
5
|
export const AgentNotFoundError = StructuredError('AgentNotFoundError')<{ id: string }>();
|
|
6
|
+
export const MalwareCheckError = StructuredError('MalwareCheckError')<{
|
|
7
|
+
deploymentId: string;
|
|
8
|
+
}>();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema } from '../api';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
3
|
import {
|
|
4
4
|
type AnalyticsOptions,
|
|
5
5
|
type OrgAnalytics,
|
|
@@ -11,9 +11,15 @@ import {
|
|
|
11
11
|
type StreamAnalyticsOptions,
|
|
12
12
|
type TimeSeriesData,
|
|
13
13
|
TimeSeriesDataSchema,
|
|
14
|
-
} from './types';
|
|
15
|
-
import {
|
|
16
|
-
|
|
14
|
+
} from './types.ts';
|
|
15
|
+
import {
|
|
16
|
+
buildQueueHeaders,
|
|
17
|
+
QueueError,
|
|
18
|
+
QueueNotFoundError,
|
|
19
|
+
queueApiPathWithQuery,
|
|
20
|
+
withQueueErrorHandling,
|
|
21
|
+
} from './util.ts';
|
|
22
|
+
import { validateQueueName } from './validation.ts';
|
|
17
23
|
|
|
18
24
|
export const OrgAnalyticsResponseSchema = APIResponseSchema(
|
|
19
25
|
z.object({ analytics: OrgAnalyticsSchema })
|
|
@@ -113,24 +119,21 @@ export async function getQueueAnalytics(
|
|
|
113
119
|
validateQueueName(name);
|
|
114
120
|
const queryString = buildAnalyticsQuery(options);
|
|
115
121
|
const url = queueApiPathWithQuery('analytics/queue', queryString, name);
|
|
116
|
-
const resp = await
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
const resp = await withQueueErrorHandling(
|
|
123
|
+
() =>
|
|
124
|
+
client.get(
|
|
125
|
+
url,
|
|
126
|
+
QueueAnalyticsResponseSchema,
|
|
127
|
+
undefined,
|
|
128
|
+
buildQueueHeaders(options?.orgId)
|
|
129
|
+
),
|
|
130
|
+
{ queueName: name }
|
|
121
131
|
);
|
|
122
132
|
|
|
123
133
|
if (resp.success) {
|
|
124
134
|
return resp.data.analytics;
|
|
125
135
|
}
|
|
126
136
|
|
|
127
|
-
if (resp.message?.includes('not found')) {
|
|
128
|
-
throw new QueueNotFoundError({
|
|
129
|
-
queueName: name,
|
|
130
|
-
message: resp.message,
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
137
|
throw new QueueError({
|
|
135
138
|
queueName: name,
|
|
136
139
|
message: resp.message || 'Failed to get queue analytics',
|
|
@@ -168,24 +171,15 @@ export async function getQueueTimeSeries(
|
|
|
168
171
|
validateQueueName(name);
|
|
169
172
|
const queryString = buildAnalyticsQuery(options);
|
|
170
173
|
const url = queueApiPathWithQuery('analytics/timeseries', queryString, name);
|
|
171
|
-
const resp = await
|
|
172
|
-
url,
|
|
173
|
-
|
|
174
|
-
undefined,
|
|
175
|
-
buildQueueHeaders(options?.orgId)
|
|
174
|
+
const resp = await withQueueErrorHandling(
|
|
175
|
+
() => client.get(url, TimeSeriesResponseSchema, undefined, buildQueueHeaders(options?.orgId)),
|
|
176
|
+
{ queueName: name }
|
|
176
177
|
);
|
|
177
178
|
|
|
178
179
|
if (resp.success) {
|
|
179
180
|
return resp.data.timeseries;
|
|
180
181
|
}
|
|
181
182
|
|
|
182
|
-
if (resp.message?.includes('not found')) {
|
|
183
|
-
throw new QueueNotFoundError({
|
|
184
|
-
queueName: name,
|
|
185
|
-
message: resp.message,
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
183
|
throw new QueueError({
|
|
190
184
|
queueName: name,
|
|
191
185
|
message: resp.message || 'Failed to get queue time series',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient,
|
|
2
|
+
import { type APIClient, APIResponseSchema, APIResponseSchemaNoData } from '../api.ts';
|
|
3
3
|
import {
|
|
4
4
|
type CreateDestinationRequest,
|
|
5
5
|
CreateDestinationRequestSchema,
|
|
@@ -8,16 +8,13 @@ import {
|
|
|
8
8
|
type QueueApiOptions,
|
|
9
9
|
type UpdateDestinationRequest,
|
|
10
10
|
UpdateDestinationRequestSchema,
|
|
11
|
-
} from './types';
|
|
11
|
+
} from './types.ts';
|
|
12
|
+
import { buildQueueHeaders, QueueError, queueApiPath, withQueueErrorHandling } from './util.ts';
|
|
12
13
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
QueueNotFoundError,
|
|
18
|
-
queueApiPath,
|
|
19
|
-
} from './util';
|
|
20
|
-
import { validateDestinationConfig, validateDestinationId, validateQueueName } from './validation';
|
|
14
|
+
validateDestinationConfig,
|
|
15
|
+
validateDestinationId,
|
|
16
|
+
validateQueueName,
|
|
17
|
+
} from './validation.ts';
|
|
21
18
|
|
|
22
19
|
export const DestinationResponseSchema = APIResponseSchema(
|
|
23
20
|
z.object({ destination: DestinationSchema })
|
|
@@ -68,63 +65,27 @@ export async function createDestination(
|
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
const url = queueApiPath('destinations/create', queueName);
|
|
68
|
+
const resp = await withQueueErrorHandling(
|
|
69
|
+
() =>
|
|
70
|
+
client.post(
|
|
71
|
+
url,
|
|
72
|
+
params,
|
|
73
|
+
DestinationResponseSchema,
|
|
74
|
+
CreateDestinationRequestSchema,
|
|
75
|
+
undefined,
|
|
76
|
+
buildQueueHeaders(options?.orgId)
|
|
77
|
+
),
|
|
78
|
+
{ queueName, destinationUrl: params.config?.url }
|
|
79
|
+
);
|
|
71
80
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
url,
|
|
75
|
-
params,
|
|
76
|
-
DestinationResponseSchema,
|
|
77
|
-
CreateDestinationRequestSchema,
|
|
78
|
-
undefined,
|
|
79
|
-
buildQueueHeaders(options?.orgId)
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
if (resp.success) {
|
|
83
|
-
return resp.data.destination;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (resp.message?.includes('queue') && resp.message?.includes('not found')) {
|
|
87
|
-
throw new QueueNotFoundError({
|
|
88
|
-
queueName,
|
|
89
|
-
message: resp.message,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (resp.message?.includes('already exists')) {
|
|
94
|
-
throw new DestinationAlreadyExistsError({
|
|
95
|
-
queueName,
|
|
96
|
-
url: params.config?.url,
|
|
97
|
-
message: `A destination with URL "${params.config?.url}" already exists for queue "${queueName}"`,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
throw new QueueError({
|
|
102
|
-
queueName,
|
|
103
|
-
message: resp.message || 'Failed to create destination',
|
|
104
|
-
});
|
|
105
|
-
} catch (error) {
|
|
106
|
-
if (error instanceof APIError) {
|
|
107
|
-
const message = error.message || '';
|
|
108
|
-
if (message.includes('already exists')) {
|
|
109
|
-
throw new DestinationAlreadyExistsError({
|
|
110
|
-
queueName,
|
|
111
|
-
url: params.config?.url,
|
|
112
|
-
message: `A destination with URL "${params.config?.url}" already exists for queue "${queueName}"`,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
if (message.includes('queue') && message.includes('not found')) {
|
|
116
|
-
throw new QueueNotFoundError({
|
|
117
|
-
queueName,
|
|
118
|
-
message,
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
throw new QueueError({
|
|
122
|
-
queueName,
|
|
123
|
-
message: message || 'Failed to create destination',
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
throw error;
|
|
81
|
+
if (resp.success) {
|
|
82
|
+
return resp.data.destination;
|
|
127
83
|
}
|
|
84
|
+
|
|
85
|
+
throw new QueueError({
|
|
86
|
+
queueName,
|
|
87
|
+
message: resp.message || 'Failed to create destination',
|
|
88
|
+
});
|
|
128
89
|
}
|
|
129
90
|
|
|
130
91
|
/**
|
|
@@ -155,24 +116,21 @@ export async function listDestinations(
|
|
|
155
116
|
): Promise<Destination[]> {
|
|
156
117
|
validateQueueName(queueName);
|
|
157
118
|
const url = queueApiPath('destinations/list', queueName);
|
|
158
|
-
const resp = await
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
119
|
+
const resp = await withQueueErrorHandling(
|
|
120
|
+
() =>
|
|
121
|
+
client.get(
|
|
122
|
+
url,
|
|
123
|
+
DestinationsListResponseSchema,
|
|
124
|
+
undefined,
|
|
125
|
+
buildQueueHeaders(options?.orgId)
|
|
126
|
+
),
|
|
127
|
+
{ queueName }
|
|
163
128
|
);
|
|
164
129
|
|
|
165
130
|
if (resp.success) {
|
|
166
131
|
return resp.data.destinations;
|
|
167
132
|
}
|
|
168
133
|
|
|
169
|
-
if (resp.message?.includes('not found')) {
|
|
170
|
-
throw new QueueNotFoundError({
|
|
171
|
-
queueName,
|
|
172
|
-
message: resp.message,
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
|
|
176
134
|
throw new QueueError({
|
|
177
135
|
queueName,
|
|
178
136
|
message: resp.message || 'Failed to list destinations',
|
|
@@ -225,34 +183,23 @@ export async function updateDestination(
|
|
|
225
183
|
}
|
|
226
184
|
|
|
227
185
|
const url = queueApiPath('destinations/update', queueName, destinationId);
|
|
228
|
-
const resp = await
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
186
|
+
const resp = await withQueueErrorHandling(
|
|
187
|
+
() =>
|
|
188
|
+
client.patch(
|
|
189
|
+
url,
|
|
190
|
+
params,
|
|
191
|
+
DestinationResponseSchema,
|
|
192
|
+
UpdateDestinationRequestSchema,
|
|
193
|
+
undefined,
|
|
194
|
+
buildQueueHeaders(options?.orgId)
|
|
195
|
+
),
|
|
196
|
+
{ queueName, destinationId }
|
|
235
197
|
);
|
|
236
198
|
|
|
237
199
|
if (resp.success) {
|
|
238
200
|
return resp.data.destination;
|
|
239
201
|
}
|
|
240
202
|
|
|
241
|
-
if (resp.message?.includes('destination') && resp.message?.includes('not found')) {
|
|
242
|
-
throw new DestinationNotFoundError({
|
|
243
|
-
queueName,
|
|
244
|
-
destinationId,
|
|
245
|
-
message: resp.message,
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
if (resp.message?.includes('queue') && resp.message?.includes('not found')) {
|
|
250
|
-
throw new QueueNotFoundError({
|
|
251
|
-
queueName,
|
|
252
|
-
message: resp.message,
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
|
|
256
203
|
throw new QueueError({
|
|
257
204
|
queueName,
|
|
258
205
|
message: resp.message || 'Failed to update destination',
|
|
@@ -290,32 +237,21 @@ export async function deleteDestination(
|
|
|
290
237
|
validateDestinationId(destinationId);
|
|
291
238
|
|
|
292
239
|
const url = queueApiPath('destinations/delete', queueName, destinationId);
|
|
293
|
-
const resp = await
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
240
|
+
const resp = await withQueueErrorHandling(
|
|
241
|
+
() =>
|
|
242
|
+
client.delete(
|
|
243
|
+
url,
|
|
244
|
+
DeleteDestinationResponseSchema,
|
|
245
|
+
undefined,
|
|
246
|
+
buildQueueHeaders(options?.orgId)
|
|
247
|
+
),
|
|
248
|
+
{ queueName, destinationId }
|
|
298
249
|
);
|
|
299
250
|
|
|
300
251
|
if (resp.success) {
|
|
301
252
|
return;
|
|
302
253
|
}
|
|
303
254
|
|
|
304
|
-
if (resp.message?.includes('destination') && resp.message?.includes('not found')) {
|
|
305
|
-
throw new DestinationNotFoundError({
|
|
306
|
-
queueName,
|
|
307
|
-
destinationId,
|
|
308
|
-
message: resp.message,
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
if (resp.message?.includes('queue') && resp.message?.includes('not found')) {
|
|
313
|
-
throw new QueueNotFoundError({
|
|
314
|
-
queueName,
|
|
315
|
-
message: resp.message,
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
|
|
319
255
|
throw new QueueError({
|
|
320
256
|
queueName,
|
|
321
257
|
message: resp.message || 'Failed to delete destination',
|
package/src/api/queue/dlq.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema, APIResponseSchemaNoData } from '../api';
|
|
2
|
+
import { type APIClient, APIResponseSchema, APIResponseSchemaNoData } from '../api.ts';
|
|
3
3
|
import {
|
|
4
4
|
type DeadLetterMessage,
|
|
5
5
|
DeadLetterMessageSchema,
|
|
@@ -7,16 +7,20 @@ import {
|
|
|
7
7
|
type Message,
|
|
8
8
|
MessageSchema,
|
|
9
9
|
type QueueApiOptions,
|
|
10
|
-
} from './types';
|
|
10
|
+
} from './types.ts';
|
|
11
11
|
import {
|
|
12
12
|
buildQueueHeaders,
|
|
13
|
-
MessageNotFoundError,
|
|
14
13
|
QueueError,
|
|
15
|
-
QueueNotFoundError,
|
|
16
14
|
queueApiPath,
|
|
17
15
|
queueApiPathWithQuery,
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
withQueueErrorHandling,
|
|
17
|
+
} from './util.ts';
|
|
18
|
+
import {
|
|
19
|
+
validateLimit,
|
|
20
|
+
validateMessageId,
|
|
21
|
+
validateOffset,
|
|
22
|
+
validateQueueName,
|
|
23
|
+
} from './validation.ts';
|
|
20
24
|
|
|
21
25
|
export const DlqListResponseSchema = APIResponseSchema(
|
|
22
26
|
z.object({
|
|
@@ -75,24 +79,15 @@ export async function listDeadLetterMessages(
|
|
|
75
79
|
|
|
76
80
|
const queryString = searchParams.toString();
|
|
77
81
|
const url = queueApiPathWithQuery('dlq/list', queryString || undefined, queueName);
|
|
78
|
-
const resp = await
|
|
79
|
-
url,
|
|
80
|
-
|
|
81
|
-
undefined,
|
|
82
|
-
buildQueueHeaders(options?.orgId)
|
|
82
|
+
const resp = await withQueueErrorHandling(
|
|
83
|
+
() => client.get(url, DlqListResponseSchema, undefined, buildQueueHeaders(options?.orgId)),
|
|
84
|
+
{ queueName }
|
|
83
85
|
);
|
|
84
86
|
|
|
85
87
|
if (resp.success) {
|
|
86
88
|
return { messages: resp.data.messages, total: resp.data.total };
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
if (resp.message?.includes('not found')) {
|
|
90
|
-
throw new QueueNotFoundError({
|
|
91
|
-
queueName,
|
|
92
|
-
message: resp.message,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
91
|
throw new QueueError({
|
|
97
92
|
queueName,
|
|
98
93
|
message: resp.message || 'Failed to list dead letter messages',
|
|
@@ -132,34 +127,23 @@ export async function replayDeadLetterMessage(
|
|
|
132
127
|
validateMessageId(messageId);
|
|
133
128
|
|
|
134
129
|
const url = queueApiPath('dlq/replay', queueName, messageId);
|
|
135
|
-
const resp = await
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
130
|
+
const resp = await withQueueErrorHandling(
|
|
131
|
+
() =>
|
|
132
|
+
client.post(
|
|
133
|
+
url,
|
|
134
|
+
undefined,
|
|
135
|
+
ReplayDlqResponseSchema,
|
|
136
|
+
undefined,
|
|
137
|
+
undefined,
|
|
138
|
+
buildQueueHeaders(options?.orgId)
|
|
139
|
+
),
|
|
140
|
+
{ queueName, messageId }
|
|
142
141
|
);
|
|
143
142
|
|
|
144
143
|
if (resp.success) {
|
|
145
144
|
return resp.data.message;
|
|
146
145
|
}
|
|
147
146
|
|
|
148
|
-
if (resp.message?.includes('message') && resp.message?.includes('not found')) {
|
|
149
|
-
throw new MessageNotFoundError({
|
|
150
|
-
queueName,
|
|
151
|
-
messageId,
|
|
152
|
-
message: resp.message,
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (resp.message?.includes('queue') && resp.message?.includes('not found')) {
|
|
157
|
-
throw new QueueNotFoundError({
|
|
158
|
-
queueName,
|
|
159
|
-
message: resp.message,
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
|
|
163
147
|
throw new QueueError({
|
|
164
148
|
queueName,
|
|
165
149
|
message: resp.message || 'Failed to replay dead letter message',
|
|
@@ -194,24 +178,16 @@ export async function purgeDeadLetter(
|
|
|
194
178
|
): Promise<void> {
|
|
195
179
|
validateQueueName(queueName);
|
|
196
180
|
const url = queueApiPath('dlq/purge', queueName);
|
|
197
|
-
const resp = await
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
buildQueueHeaders(options?.orgId)
|
|
181
|
+
const resp = await withQueueErrorHandling(
|
|
182
|
+
() =>
|
|
183
|
+
client.delete(url, DeleteDlqResponseSchema, undefined, buildQueueHeaders(options?.orgId)),
|
|
184
|
+
{ queueName }
|
|
202
185
|
);
|
|
203
186
|
|
|
204
187
|
if (resp.success) {
|
|
205
188
|
return;
|
|
206
189
|
}
|
|
207
190
|
|
|
208
|
-
if (resp.message?.includes('not found')) {
|
|
209
|
-
throw new QueueNotFoundError({
|
|
210
|
-
queueName,
|
|
211
|
-
message: resp.message,
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
|
|
215
191
|
throw new QueueError({
|
|
216
192
|
queueName,
|
|
217
193
|
message: resp.message || 'Failed to purge dead letter queue',
|
|
@@ -250,32 +226,16 @@ export async function deleteDeadLetterMessage(
|
|
|
250
226
|
validateMessageId(messageId);
|
|
251
227
|
|
|
252
228
|
const url = queueApiPath('dlq/delete', queueName, messageId);
|
|
253
|
-
const resp = await
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
buildQueueHeaders(options?.orgId)
|
|
229
|
+
const resp = await withQueueErrorHandling(
|
|
230
|
+
() =>
|
|
231
|
+
client.delete(url, DeleteDlqResponseSchema, undefined, buildQueueHeaders(options?.orgId)),
|
|
232
|
+
{ queueName, messageId }
|
|
258
233
|
);
|
|
259
234
|
|
|
260
235
|
if (resp.success) {
|
|
261
236
|
return;
|
|
262
237
|
}
|
|
263
238
|
|
|
264
|
-
if (resp.message?.includes('queue') && resp.message?.includes('not found')) {
|
|
265
|
-
throw new QueueNotFoundError({
|
|
266
|
-
queueName,
|
|
267
|
-
message: resp.message,
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
if (resp.message?.includes('message') && resp.message?.includes('not found')) {
|
|
272
|
-
throw new MessageNotFoundError({
|
|
273
|
-
queueName,
|
|
274
|
-
messageId,
|
|
275
|
-
message: resp.message,
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
|
|
279
239
|
throw new QueueError({
|
|
280
240
|
queueName,
|
|
281
241
|
message: resp.message || 'Failed to delete dead letter message',
|