@agentuity/server 1.0.31 → 1.0.33
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/AGENTS.md +1 -0
- package/dist/api/api.d.ts +1 -227
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/api.js +1 -637
- package/dist/api/api.js.map +1 -1
- package/dist/api/index.d.ts +1 -17
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -17
- package/dist/api/index.js.map +1 -1
- package/dist/api/org/env-delete.d.ts +1 -22
- package/dist/api/org/env-delete.d.ts.map +1 -1
- package/dist/api/org/env-delete.js +1 -24
- package/dist/api/org/env-delete.js.map +1 -1
- package/dist/api/org/env-get.d.ts +1 -32
- package/dist/api/org/env-get.d.ts.map +1 -1
- package/dist/api/org/env-get.js +1 -25
- package/dist/api/org/env-get.js.map +1 -1
- package/dist/api/org/env-update.d.ts +1 -23
- package/dist/api/org/env-update.d.ts.map +1 -1
- package/dist/api/org/env-update.js +1 -25
- package/dist/api/org/env-update.js.map +1 -1
- package/dist/api/project/get.d.ts +1 -42
- package/dist/api/project/get.d.ts.map +1 -1
- package/dist/api/project/get.js +1 -35
- package/dist/api/project/get.js.map +1 -1
- package/dist/api/project/list.d.ts +1 -47
- package/dist/api/project/list.d.ts.map +1 -1
- package/dist/api/project/list.js +1 -37
- package/dist/api/project/list.js.map +1 -1
- package/dist/api/project/malware.d.ts +1 -70
- package/dist/api/project/malware.d.ts.map +1 -1
- package/dist/api/project/malware.js +1 -41
- package/dist/api/project/malware.js.map +1 -1
- package/dist/api/region/create.d.ts +1 -80
- package/dist/api/region/create.d.ts.map +1 -1
- package/dist/api/region/create.js +1 -176
- package/dist/api/region/create.js.map +1 -1
- package/dist/api/sandbox/client.d.ts +1 -190
- package/dist/api/sandbox/client.d.ts.map +1 -1
- package/dist/api/sandbox/client.js +1 -260
- package/dist/api/sandbox/client.js.map +1 -1
- package/dist/api/sandbox/pause.d.ts +1 -21
- package/dist/api/sandbox/pause.d.ts.map +1 -1
- package/dist/api/sandbox/pause.js +1 -24
- package/dist/api/sandbox/pause.js.map +1 -1
- package/dist/api/sandbox/resume.d.ts +1 -21
- package/dist/api/sandbox/resume.d.ts.map +1 -1
- package/dist/api/sandbox/resume.js +1 -24
- package/dist/api/sandbox/resume.js.map +1 -1
- package/dist/api/sandbox/util.d.ts +1 -284
- package/dist/api/sandbox/util.d.ts.map +1 -1
- package/dist/api/sandbox/util.js +1 -210
- package/dist/api/sandbox/util.js.map +1 -1
- package/dist/api/user/whoami.d.ts +1 -38
- package/dist/api/user/whoami.d.ts.map +1 -1
- package/dist/api/user/whoami.js +1 -26
- package/dist/api/user/whoami.js.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -12
- package/dist/index.js.map +1 -1
- package/dist/util/resources.js +2 -2
- package/dist/util/resources.js.map +1 -1
- package/package.json +4 -4
- package/src/api/api.ts +1 -936
- package/src/api/index.ts +1 -17
- package/src/api/org/env-delete.ts +1 -37
- package/src/api/org/env-get.ts +1 -43
- package/src/api/org/env-update.ts +1 -38
- package/src/api/project/get.ts +1 -49
- package/src/api/project/list.ts +1 -54
- package/src/api/project/malware.ts +1 -68
- package/src/api/region/create.ts +1 -207
- package/src/api/sandbox/client.ts +1 -460
- package/src/api/sandbox/pause.ts +1 -39
- package/src/api/sandbox/resume.ts +1 -39
- package/src/api/sandbox/util.ts +1 -276
- package/src/api/user/whoami.ts +1 -32
- package/src/index.ts +3 -30
- package/src/util/resources.ts +2 -2
- package/dist/api/apikey/create.d.ts +0 -33
- package/dist/api/apikey/create.d.ts.map +0 -1
- package/dist/api/apikey/create.js +0 -23
- package/dist/api/apikey/create.js.map +0 -1
- package/dist/api/apikey/delete.d.ts +0 -19
- package/dist/api/apikey/delete.d.ts.map +0 -1
- package/dist/api/apikey/delete.js +0 -19
- package/dist/api/apikey/delete.js.map +0 -1
- package/dist/api/apikey/get.d.ts +0 -45
- package/dist/api/apikey/get.d.ts.map +0 -1
- package/dist/api/apikey/get.js +0 -36
- package/dist/api/apikey/get.js.map +0 -1
- package/dist/api/apikey/index.d.ts +0 -6
- package/dist/api/apikey/index.d.ts.map +0 -1
- package/dist/api/apikey/index.js +0 -6
- package/dist/api/apikey/index.js.map +0 -1
- package/dist/api/apikey/list.d.ts +0 -64
- package/dist/api/apikey/list.d.ts.map +0 -1
- package/dist/api/apikey/list.js +0 -46
- package/dist/api/apikey/list.js.map +0 -1
- package/dist/api/apikey/util.d.ts +0 -23
- package/dist/api/apikey/util.d.ts.map +0 -1
- package/dist/api/apikey/util.js +0 -3
- package/dist/api/apikey/util.js.map +0 -1
- package/dist/api/db/index.d.ts +0 -5
- package/dist/api/db/index.d.ts.map +0 -1
- package/dist/api/db/index.js +0 -5
- package/dist/api/db/index.js.map +0 -1
- package/dist/api/db/logs.d.ts +0 -70
- package/dist/api/db/logs.d.ts.map +0 -1
- package/dist/api/db/logs.js +0 -59
- package/dist/api/db/logs.js.map +0 -1
- package/dist/api/db/query.d.ts +0 -39
- package/dist/api/db/query.d.ts.map +0 -1
- package/dist/api/db/query.js +0 -49
- package/dist/api/db/query.js.map +0 -1
- package/dist/api/db/tables.d.ts +0 -49
- package/dist/api/db/tables.d.ts.map +0 -1
- package/dist/api/db/tables.js +0 -59
- package/dist/api/db/tables.js.map +0 -1
- package/dist/api/db/util.d.ts +0 -31
- package/dist/api/db/util.d.ts.map +0 -1
- package/dist/api/db/util.js +0 -4
- package/dist/api/db/util.js.map +0 -1
- package/dist/api/eval/get.d.ts +0 -36
- package/dist/api/eval/get.d.ts.map +0 -1
- package/dist/api/eval/get.js +0 -23
- package/dist/api/eval/get.js.map +0 -1
- package/dist/api/eval/index.d.ts +0 -5
- package/dist/api/eval/index.d.ts.map +0 -1
- package/dist/api/eval/index.js +0 -5
- package/dist/api/eval/index.js.map +0 -1
- package/dist/api/eval/list.d.ts +0 -50
- package/dist/api/eval/list.d.ts.map +0 -1
- package/dist/api/eval/list.js +0 -32
- package/dist/api/eval/list.js.map +0 -1
- package/dist/api/eval/run-get.d.ts +0 -48
- package/dist/api/eval/run-get.d.ts.map +0 -1
- package/dist/api/eval/run-get.js +0 -29
- package/dist/api/eval/run-get.js.map +0 -1
- package/dist/api/eval/run-list.d.ts +0 -70
- package/dist/api/eval/run-list.d.ts.map +0 -1
- package/dist/api/eval/run-list.js +0 -42
- package/dist/api/eval/run-list.js.map +0 -1
- package/dist/api/machine/index.d.ts +0 -3
- package/dist/api/machine/index.d.ts.map +0 -1
- package/dist/api/machine/index.js +0 -3
- package/dist/api/machine/index.js.map +0 -1
- package/dist/api/machine/machine.d.ts +0 -192
- package/dist/api/machine/machine.d.ts.map +0 -1
- package/dist/api/machine/machine.js +0 -109
- package/dist/api/machine/machine.js.map +0 -1
- package/dist/api/machine/util.d.ts +0 -14
- package/dist/api/machine/util.d.ts.map +0 -1
- package/dist/api/machine/util.js +0 -3
- package/dist/api/machine/util.js.map +0 -1
- package/dist/api/org/index.d.ts +0 -7
- package/dist/api/org/index.d.ts.map +0 -1
- package/dist/api/org/index.js +0 -7
- package/dist/api/org/index.js.map +0 -1
- package/dist/api/org/list.d.ts +0 -27
- package/dist/api/org/list.d.ts.map +0 -1
- package/dist/api/org/list.js +0 -22
- package/dist/api/org/list.js.map +0 -1
- package/dist/api/org/resources.d.ts +0 -141
- package/dist/api/org/resources.d.ts.map +0 -1
- package/dist/api/org/resources.js +0 -92
- package/dist/api/org/resources.js.map +0 -1
- package/dist/api/org/util.d.ts +0 -45
- package/dist/api/org/util.d.ts.map +0 -1
- package/dist/api/org/util.js +0 -4
- package/dist/api/org/util.js.map +0 -1
- package/dist/api/project/agent.d.ts +0 -89
- package/dist/api/project/agent.d.ts.map +0 -1
- package/dist/api/project/agent.js +0 -60
- package/dist/api/project/agent.js.map +0 -1
- package/dist/api/project/create.d.ts +0 -37
- package/dist/api/project/create.d.ts.map +0 -1
- package/dist/api/project/create.js +0 -31
- package/dist/api/project/create.js.map +0 -1
- package/dist/api/project/delete.d.ts +0 -15
- package/dist/api/project/delete.d.ts.map +0 -1
- package/dist/api/project/delete.js +0 -13
- package/dist/api/project/delete.js.map +0 -1
- package/dist/api/project/deploy.d.ts +0 -490
- package/dist/api/project/deploy.d.ts.map +0 -1
- package/dist/api/project/deploy.js +0 -313
- package/dist/api/project/deploy.js.map +0 -1
- package/dist/api/project/deployment.d.ts +0 -237
- package/dist/api/project/deployment.d.ts.map +0 -1
- package/dist/api/project/deployment.js +0 -127
- package/dist/api/project/deployment.js.map +0 -1
- package/dist/api/project/env-delete.d.ts +0 -22
- package/dist/api/project/env-delete.d.ts.map +0 -1
- package/dist/api/project/env-delete.js +0 -29
- package/dist/api/project/env-delete.js.map +0 -1
- package/dist/api/project/env-update.d.ts +0 -31
- package/dist/api/project/env-update.d.ts.map +0 -1
- package/dist/api/project/env-update.js +0 -36
- package/dist/api/project/env-update.js.map +0 -1
- package/dist/api/project/exists.d.ts +0 -25
- package/dist/api/project/exists.d.ts.map +0 -1
- package/dist/api/project/exists.js +0 -45
- package/dist/api/project/exists.js.map +0 -1
- package/dist/api/project/hostname.d.ts +0 -25
- package/dist/api/project/hostname.d.ts.map +0 -1
- package/dist/api/project/hostname.js +0 -37
- package/dist/api/project/hostname.js.map +0 -1
- package/dist/api/project/index.d.ts +0 -14
- package/dist/api/project/index.d.ts.map +0 -1
- package/dist/api/project/index.js +0 -14
- package/dist/api/project/index.js.map +0 -1
- package/dist/api/project/update-region.d.ts +0 -27
- package/dist/api/project/update-region.d.ts.map +0 -1
- package/dist/api/project/update-region.js +0 -25
- package/dist/api/project/update-region.js.map +0 -1
- package/dist/api/project/util.d.ts +0 -62
- package/dist/api/project/util.d.ts.map +0 -1
- package/dist/api/project/util.js +0 -6
- package/dist/api/project/util.js.map +0 -1
- package/dist/api/queue/analytics.d.ts +0 -250
- package/dist/api/queue/analytics.d.ts.map +0 -1
- package/dist/api/queue/analytics.js +0 -233
- package/dist/api/queue/analytics.js.map +0 -1
- package/dist/api/queue/destinations.d.ts +0 -202
- package/dist/api/queue/destinations.d.ts.map +0 -1
- package/dist/api/queue/destinations.js +0 -168
- package/dist/api/queue/destinations.js.map +0 -1
- package/dist/api/queue/dlq.d.ts +0 -168
- package/dist/api/queue/dlq.d.ts.map +0 -1
- package/dist/api/queue/dlq.js +0 -166
- package/dist/api/queue/dlq.js.map +0 -1
- package/dist/api/queue/index.d.ts +0 -56
- package/dist/api/queue/index.d.ts.map +0 -1
- package/dist/api/queue/index.js +0 -90
- package/dist/api/queue/index.js.map +0 -1
- package/dist/api/queue/messages.d.ts +0 -503
- package/dist/api/queue/messages.d.ts.map +0 -1
- package/dist/api/queue/messages.js +0 -549
- package/dist/api/queue/messages.js.map +0 -1
- package/dist/api/queue/queues.d.ts +0 -226
- package/dist/api/queue/queues.d.ts.map +0 -1
- package/dist/api/queue/queues.js +0 -321
- package/dist/api/queue/queues.js.map +0 -1
- package/dist/api/queue/sources.d.ts +0 -202
- package/dist/api/queue/sources.d.ts.map +0 -1
- package/dist/api/queue/sources.js +0 -202
- package/dist/api/queue/sources.js.map +0 -1
- package/dist/api/queue/types.d.ts +0 -1218
- package/dist/api/queue/types.d.ts.map +0 -1
- package/dist/api/queue/types.js +0 -1002
- package/dist/api/queue/types.js.map +0 -1
- package/dist/api/queue/util.d.ts +0 -278
- package/dist/api/queue/util.d.ts.map +0 -1
- package/dist/api/queue/util.js +0 -235
- package/dist/api/queue/util.js.map +0 -1
- package/dist/api/queue/validation.d.ts +0 -247
- package/dist/api/queue/validation.d.ts.map +0 -1
- package/dist/api/queue/validation.js +0 -513
- package/dist/api/queue/validation.js.map +0 -1
- package/dist/api/queue/websocket.d.ts +0 -168
- package/dist/api/queue/websocket.d.ts.map +0 -1
- package/dist/api/queue/websocket.js +0 -394
- package/dist/api/queue/websocket.js.map +0 -1
- package/dist/api/region/delete.d.ts +0 -62
- package/dist/api/region/delete.d.ts.map +0 -1
- package/dist/api/region/delete.js +0 -37
- package/dist/api/region/delete.js.map +0 -1
- package/dist/api/region/index.d.ts +0 -5
- package/dist/api/region/index.d.ts.map +0 -1
- package/dist/api/region/index.js +0 -5
- package/dist/api/region/index.js.map +0 -1
- package/dist/api/region/list.d.ts +0 -27
- package/dist/api/region/list.d.ts.map +0 -1
- package/dist/api/region/list.js +0 -22
- package/dist/api/region/list.js.map +0 -1
- package/dist/api/region/resources.d.ts +0 -71
- package/dist/api/region/resources.d.ts.map +0 -1
- package/dist/api/region/resources.js +0 -53
- package/dist/api/region/resources.js.map +0 -1
- package/dist/api/region/util.d.ts +0 -23
- package/dist/api/region/util.d.ts.map +0 -1
- package/dist/api/region/util.js +0 -3
- package/dist/api/region/util.js.map +0 -1
- package/dist/api/sandbox/cli-list.d.ts +0 -114
- package/dist/api/sandbox/cli-list.d.ts.map +0 -1
- package/dist/api/sandbox/cli-list.js +0 -71
- package/dist/api/sandbox/cli-list.js.map +0 -1
- package/dist/api/sandbox/create.d.ts +0 -118
- package/dist/api/sandbox/create.d.ts.map +0 -1
- package/dist/api/sandbox/create.js +0 -211
- package/dist/api/sandbox/create.js.map +0 -1
- package/dist/api/sandbox/destroy.d.ts +0 -22
- package/dist/api/sandbox/destroy.d.ts.map +0 -1
- package/dist/api/sandbox/destroy.js +0 -25
- package/dist/api/sandbox/destroy.js.map +0 -1
- package/dist/api/sandbox/disk-checkpoint.d.ts +0 -103
- package/dist/api/sandbox/disk-checkpoint.d.ts.map +0 -1
- package/dist/api/sandbox/disk-checkpoint.js +0 -104
- package/dist/api/sandbox/disk-checkpoint.js.map +0 -1
- package/dist/api/sandbox/execute.d.ts +0 -69
- package/dist/api/sandbox/execute.d.ts.map +0 -1
- package/dist/api/sandbox/execute.js +0 -103
- package/dist/api/sandbox/execute.js.map +0 -1
- package/dist/api/sandbox/execution.d.ts +0 -169
- package/dist/api/sandbox/execution.d.ts.map +0 -1
- package/dist/api/sandbox/execution.js +0 -118
- package/dist/api/sandbox/execution.js.map +0 -1
- package/dist/api/sandbox/files.d.ts +0 -261
- package/dist/api/sandbox/files.d.ts.map +0 -1
- package/dist/api/sandbox/files.js +0 -386
- package/dist/api/sandbox/files.js.map +0 -1
- package/dist/api/sandbox/get.d.ts +0 -283
- package/dist/api/sandbox/get.d.ts.map +0 -1
- package/dist/api/sandbox/get.js +0 -215
- package/dist/api/sandbox/get.js.map +0 -1
- package/dist/api/sandbox/getStatus.d.ts +0 -16
- package/dist/api/sandbox/getStatus.d.ts.map +0 -1
- package/dist/api/sandbox/getStatus.js +0 -32
- package/dist/api/sandbox/getStatus.js.map +0 -1
- package/dist/api/sandbox/index.d.ts +0 -39
- package/dist/api/sandbox/index.d.ts.map +0 -1
- package/dist/api/sandbox/index.js +0 -20
- package/dist/api/sandbox/index.js.map +0 -1
- package/dist/api/sandbox/list.d.ts +0 -293
- package/dist/api/sandbox/list.d.ts.map +0 -1
- package/dist/api/sandbox/list.js +0 -191
- package/dist/api/sandbox/list.js.map +0 -1
- package/dist/api/sandbox/resolve.d.ts +0 -82
- package/dist/api/sandbox/resolve.d.ts.map +0 -1
- package/dist/api/sandbox/resolve.js +0 -71
- package/dist/api/sandbox/resolve.js.map +0 -1
- package/dist/api/sandbox/run.d.ts +0 -28
- package/dist/api/sandbox/run.d.ts.map +0 -1
- package/dist/api/sandbox/run.js +0 -342
- package/dist/api/sandbox/run.js.map +0 -1
- package/dist/api/sandbox/runtime.d.ts +0 -83
- package/dist/api/sandbox/runtime.d.ts.map +0 -1
- package/dist/api/sandbox/runtime.js +0 -78
- package/dist/api/sandbox/runtime.js.map +0 -1
- package/dist/api/sandbox/snapshot-build.d.ts +0 -48
- package/dist/api/sandbox/snapshot-build.d.ts.map +0 -1
- package/dist/api/sandbox/snapshot-build.js +0 -74
- package/dist/api/sandbox/snapshot-build.js.map +0 -1
- package/dist/api/sandbox/snapshot.d.ts +0 -595
- package/dist/api/sandbox/snapshot.d.ts.map +0 -1
- package/dist/api/sandbox/snapshot.js +0 -598
- package/dist/api/sandbox/snapshot.js.map +0 -1
- package/dist/api/services/index.d.ts +0 -2
- package/dist/api/services/index.d.ts.map +0 -1
- package/dist/api/services/index.js +0 -2
- package/dist/api/services/index.js.map +0 -1
- package/dist/api/services/stats.d.ts +0 -263
- package/dist/api/services/stats.d.ts.map +0 -1
- package/dist/api/services/stats.js +0 -144
- package/dist/api/services/stats.js.map +0 -1
- package/dist/api/session/get.d.ts +0 -169
- package/dist/api/session/get.d.ts.map +0 -1
- package/dist/api/session/get.js +0 -56
- package/dist/api/session/get.js.map +0 -1
- package/dist/api/session/index.d.ts +0 -4
- package/dist/api/session/index.d.ts.map +0 -1
- package/dist/api/session/index.js +0 -4
- package/dist/api/session/index.js.map +0 -1
- package/dist/api/session/list.d.ts +0 -143
- package/dist/api/session/list.d.ts.map +0 -1
- package/dist/api/session/list.js +0 -91
- package/dist/api/session/list.js.map +0 -1
- package/dist/api/session/logs.d.ts +0 -40
- package/dist/api/session/logs.d.ts.map +0 -1
- package/dist/api/session/logs.js +0 -28
- package/dist/api/session/logs.js.map +0 -1
- package/dist/api/session/util.d.ts +0 -23
- package/dist/api/session/util.d.ts.map +0 -1
- package/dist/api/session/util.js +0 -3
- package/dist/api/session/util.js.map +0 -1
- package/dist/api/storage/config.d.ts +0 -99
- package/dist/api/storage/config.d.ts.map +0 -1
- package/dist/api/storage/config.js +0 -61
- package/dist/api/storage/config.js.map +0 -1
- package/dist/api/storage/index.d.ts +0 -5
- package/dist/api/storage/index.d.ts.map +0 -1
- package/dist/api/storage/index.js +0 -5
- package/dist/api/storage/index.js.map +0 -1
- package/dist/api/storage/objects.d.ts +0 -155
- package/dist/api/storage/objects.d.ts.map +0 -1
- package/dist/api/storage/objects.js +0 -142
- package/dist/api/storage/objects.js.map +0 -1
- package/dist/api/storage/types.d.ts +0 -161
- package/dist/api/storage/types.d.ts.map +0 -1
- package/dist/api/storage/types.js +0 -101
- package/dist/api/storage/types.js.map +0 -1
- package/dist/api/storage/util.d.ts +0 -48
- package/dist/api/storage/util.d.ts.map +0 -1
- package/dist/api/storage/util.js +0 -8
- package/dist/api/storage/util.js.map +0 -1
- package/dist/api/stream/get.d.ts +0 -58
- package/dist/api/stream/get.d.ts.map +0 -1
- package/dist/api/stream/get.js +0 -40
- package/dist/api/stream/get.js.map +0 -1
- package/dist/api/stream/index.d.ts +0 -4
- package/dist/api/stream/index.d.ts.map +0 -1
- package/dist/api/stream/index.js +0 -4
- package/dist/api/stream/index.js.map +0 -1
- package/dist/api/stream/list.d.ts +0 -120
- package/dist/api/stream/list.d.ts.map +0 -1
- package/dist/api/stream/list.js +0 -77
- package/dist/api/stream/list.js.map +0 -1
- package/dist/api/stream/util.d.ts +0 -23
- package/dist/api/stream/util.d.ts.map +0 -1
- package/dist/api/stream/util.js +0 -3
- package/dist/api/stream/util.js.map +0 -1
- package/dist/api/thread/delete.d.ts +0 -23
- package/dist/api/thread/delete.d.ts.map +0 -1
- package/dist/api/thread/delete.js +0 -21
- package/dist/api/thread/delete.js.map +0 -1
- package/dist/api/thread/get.d.ts +0 -36
- package/dist/api/thread/get.d.ts.map +0 -1
- package/dist/api/thread/get.js +0 -23
- package/dist/api/thread/get.js.map +0 -1
- package/dist/api/thread/index.d.ts +0 -5
- package/dist/api/thread/index.d.ts.map +0 -1
- package/dist/api/thread/index.js +0 -5
- package/dist/api/thread/index.js.map +0 -1
- package/dist/api/thread/list.d.ts +0 -69
- package/dist/api/thread/list.d.ts.map +0 -1
- package/dist/api/thread/list.js +0 -51
- package/dist/api/thread/list.js.map +0 -1
- package/dist/api/thread/util.d.ts +0 -23
- package/dist/api/thread/util.d.ts.map +0 -1
- package/dist/api/thread/util.js +0 -3
- package/dist/api/thread/util.js.map +0 -1
- package/dist/api/user/index.d.ts +0 -2
- package/dist/api/user/index.d.ts.map +0 -1
- package/dist/api/user/index.js +0 -2
- package/dist/api/user/index.js.map +0 -1
- package/dist/api/user/util.d.ts +0 -23
- package/dist/api/user/util.d.ts.map +0 -1
- package/dist/api/user/util.js +0 -3
- package/dist/api/user/util.js.map +0 -1
- package/dist/api/webhook/deliveries.d.ts +0 -94
- package/dist/api/webhook/deliveries.d.ts.map +0 -1
- package/dist/api/webhook/deliveries.js +0 -79
- package/dist/api/webhook/deliveries.js.map +0 -1
- package/dist/api/webhook/destinations.d.ts +0 -136
- package/dist/api/webhook/destinations.d.ts.map +0 -1
- package/dist/api/webhook/destinations.js +0 -137
- package/dist/api/webhook/destinations.js.map +0 -1
- package/dist/api/webhook/index.d.ts +0 -41
- package/dist/api/webhook/index.d.ts.map +0 -1
- package/dist/api/webhook/index.js +0 -59
- package/dist/api/webhook/index.js.map +0 -1
- package/dist/api/webhook/receipts.d.ts +0 -77
- package/dist/api/webhook/receipts.d.ts.map +0 -1
- package/dist/api/webhook/receipts.js +0 -78
- package/dist/api/webhook/receipts.js.map +0 -1
- package/dist/api/webhook/types.d.ts +0 -249
- package/dist/api/webhook/types.d.ts.map +0 -1
- package/dist/api/webhook/types.js +0 -221
- package/dist/api/webhook/types.js.map +0 -1
- package/dist/api/webhook/util.d.ts +0 -202
- package/dist/api/webhook/util.d.ts.map +0 -1
- package/dist/api/webhook/util.js +0 -201
- package/dist/api/webhook/util.js.map +0 -1
- package/dist/api/webhook/webhooks.d.ts +0 -146
- package/dist/api/webhook/webhooks.d.ts.map +0 -1
- package/dist/api/webhook/webhooks.js +0 -165
- package/dist/api/webhook/webhooks.js.map +0 -1
- package/src/api/api-example.md +0 -164
- package/src/api/apikey/create.ts +0 -41
- package/src/api/apikey/delete.ts +0 -30
- package/src/api/apikey/get.ts +0 -48
- package/src/api/apikey/index.ts +0 -5
- package/src/api/apikey/list.ts +0 -64
- package/src/api/apikey/util.ts +0 -3
- package/src/api/db/index.ts +0 -27
- package/src/api/db/logs.ts +0 -75
- package/src/api/db/query.ts +0 -67
- package/src/api/db/tables.ts +0 -92
- package/src/api/db/util.ts +0 -9
- package/src/api/eval/get.ts +0 -33
- package/src/api/eval/index.ts +0 -28
- package/src/api/eval/list.ts +0 -49
- package/src/api/eval/run-get.ts +0 -39
- package/src/api/eval/run-list.ts +0 -59
- package/src/api/machine/index.ts +0 -2
- package/src/api/machine/machine.ts +0 -160
- package/src/api/machine/util.ts +0 -5
- package/src/api/org/index.ts +0 -6
- package/src/api/org/list.ts +0 -28
- package/src/api/org/resources.ts +0 -135
- package/src/api/org/util.ts +0 -4
- package/src/api/project/agent.ts +0 -86
- package/src/api/project/create.ts +0 -47
- package/src/api/project/delete.ts +0 -25
- package/src/api/project/deploy.ts +0 -458
- package/src/api/project/deployment.ts +0 -195
- package/src/api/project/env-delete.ts +0 -45
- package/src/api/project/env-update.ts +0 -55
- package/src/api/project/exists.ts +0 -58
- package/src/api/project/hostname.ts +0 -73
- package/src/api/project/index.ts +0 -13
- package/src/api/project/update-region.ts +0 -44
- package/src/api/project/util.ts +0 -8
- package/src/api/queue/analytics.ts +0 -311
- package/src/api/queue/destinations.ts +0 -259
- package/src/api/queue/dlq.ts +0 -243
- package/src/api/queue/index.ts +0 -308
- package/src/api/queue/messages.ts +0 -784
- package/src/api/queue/queues.ts +0 -460
- package/src/api/queue/sources.ts +0 -294
- package/src/api/queue/types.ts +0 -1325
- package/src/api/queue/util.ts +0 -278
- package/src/api/queue/validation.ts +0 -560
- package/src/api/queue/websocket.ts +0 -514
- package/src/api/region/delete.ts +0 -57
- package/src/api/region/index.ts +0 -4
- package/src/api/region/list.ts +0 -32
- package/src/api/region/resources.ts +0 -69
- package/src/api/region/util.ts +0 -3
- package/src/api/sandbox/cli-list.ts +0 -127
- package/src/api/sandbox/create.ts +0 -256
- package/src/api/sandbox/destroy.ts +0 -41
- package/src/api/sandbox/disk-checkpoint.ts +0 -179
- package/src/api/sandbox/execute.ts +0 -132
- package/src/api/sandbox/execution.ts +0 -183
- package/src/api/sandbox/files.ts +0 -596
- package/src/api/sandbox/get.ts +0 -249
- package/src/api/sandbox/getStatus.ts +0 -54
- package/src/api/sandbox/index.ts +0 -211
- package/src/api/sandbox/list.ts +0 -224
- package/src/api/sandbox/resolve.ts +0 -98
- package/src/api/sandbox/run.ts +0 -439
- package/src/api/sandbox/runtime.ts +0 -100
- package/src/api/sandbox/snapshot-build.ts +0 -98
- package/src/api/sandbox/snapshot.ts +0 -781
- package/src/api/services/index.ts +0 -1
- package/src/api/services/stats.ts +0 -213
- package/src/api/session/get.ts +0 -106
- package/src/api/session/index.ts +0 -3
- package/src/api/session/list.ts +0 -136
- package/src/api/session/logs.ts +0 -47
- package/src/api/session/util.ts +0 -3
- package/src/api/storage/config.ts +0 -103
- package/src/api/storage/index.ts +0 -4
- package/src/api/storage/objects.ts +0 -240
- package/src/api/storage/types.ts +0 -134
- package/src/api/storage/util.ts +0 -10
- package/src/api/stream/get.ts +0 -51
- package/src/api/stream/index.ts +0 -3
- package/src/api/stream/list.ts +0 -127
- package/src/api/stream/util.ts +0 -3
- package/src/api/thread/delete.ts +0 -31
- package/src/api/thread/get.ts +0 -34
- package/src/api/thread/index.ts +0 -4
- package/src/api/thread/list.ts +0 -76
- package/src/api/thread/util.ts +0 -3
- package/src/api/user/index.ts +0 -1
- package/src/api/user/util.ts +0 -3
- package/src/api/webhook/deliveries.ts +0 -129
- package/src/api/webhook/destinations.ts +0 -224
- package/src/api/webhook/index.ts +0 -133
- package/src/api/webhook/receipts.ts +0 -124
- package/src/api/webhook/types.ts +0 -309
- package/src/api/webhook/util.ts +0 -237
- package/src/api/webhook/webhooks.ts +0 -260
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
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
|
-
|
|
7
|
-
export const ProjectEnvUpdateRequestSchema = z.object({
|
|
8
|
-
id: z.string().describe('the project id'),
|
|
9
|
-
env: z.record(z.string(), z.string()).optional().describe('environment variables to set/update'),
|
|
10
|
-
secrets: z.record(z.string(), z.string()).optional().describe('secrets to set/update'),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export const ProjectEnvUpdateResponseSchema = APIResponseSchema(
|
|
14
|
-
z
|
|
15
|
-
.object({
|
|
16
|
-
id: z.string().describe('the project id'),
|
|
17
|
-
orgId: z.string().describe('the organization id'),
|
|
18
|
-
api_key: z.string().optional().describe('the SDK api key for the project'),
|
|
19
|
-
env: z.record(z.string(), z.string()).optional().describe('the environment key/values'),
|
|
20
|
-
secrets: z.record(z.string(), z.string()).optional().describe('the secrets key/values'),
|
|
21
|
-
})
|
|
22
|
-
.optional()
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
type ProjectEnvUpdateRequest = z.infer<typeof ProjectEnvUpdateRequestSchema>;
|
|
26
|
-
type ProjectEnvUpdateResponse = z.infer<typeof ProjectEnvUpdateResponseSchema>;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Update environment variables and/or secrets for a project.
|
|
30
|
-
* This will merge the provided env/secrets with existing values.
|
|
31
|
-
* Keys starting with 'AGENTUITY_' should be filtered out before calling this function.
|
|
32
|
-
*/
|
|
33
|
-
export async function projectEnvUpdate(
|
|
34
|
-
client: APIClient,
|
|
35
|
-
request: ProjectEnvUpdateRequest
|
|
36
|
-
): Promise<Project> {
|
|
37
|
-
const { id, env, secrets } = request;
|
|
38
|
-
|
|
39
|
-
const resp = await client.request<ProjectEnvUpdateResponse, Omit<ProjectEnvUpdateRequest, 'id'>>(
|
|
40
|
-
'PUT',
|
|
41
|
-
`/cli/project/${id}/env`,
|
|
42
|
-
ProjectEnvUpdateResponseSchema,
|
|
43
|
-
{
|
|
44
|
-
env,
|
|
45
|
-
secrets,
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
if (!resp.success) {
|
|
50
|
-
throw new ProjectResponseError({ message: resp.message ?? 'failed to update project env' });
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Fetch the updated project to ensure we have complete data including name
|
|
54
|
-
return projectGet(client, { id, mask: false });
|
|
55
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIError, APIResponseSchema } from '../api.ts';
|
|
3
|
-
import { ProjectResponseError } from './util.ts';
|
|
4
|
-
|
|
5
|
-
export const ProjectExistsRequestSchema = z.object({
|
|
6
|
-
name: z.string().max(255).min(1).describe('the name of the new project'),
|
|
7
|
-
organization_id: z
|
|
8
|
-
.string()
|
|
9
|
-
.max(255)
|
|
10
|
-
.min(1)
|
|
11
|
-
.describe('the organization id to create the project in'),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const ProjectExistsResponseSchema = APIResponseSchema(z.boolean());
|
|
15
|
-
|
|
16
|
-
export type ProjectExistsRequest = z.infer<typeof ProjectExistsRequestSchema>;
|
|
17
|
-
export type ProjectExistsResponse = z.infer<typeof ProjectExistsResponseSchema>;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Check if a project exists by name within an organization
|
|
21
|
-
*
|
|
22
|
-
* @param client
|
|
23
|
-
* @param body
|
|
24
|
-
* @returns
|
|
25
|
-
*/
|
|
26
|
-
export async function projectExists(
|
|
27
|
-
client: APIClient,
|
|
28
|
-
body: ProjectExistsRequest
|
|
29
|
-
): Promise<boolean> {
|
|
30
|
-
const qs = new URLSearchParams();
|
|
31
|
-
qs.set('orgId', body.organization_id);
|
|
32
|
-
try {
|
|
33
|
-
const resp = await client.request<ProjectExistsResponse, ProjectExistsRequest>(
|
|
34
|
-
'GET',
|
|
35
|
-
`/cli/project/exists/${encodeURIComponent(body.name)}?${qs.toString()}`,
|
|
36
|
-
ProjectExistsResponseSchema
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
if (resp.success) {
|
|
40
|
-
return resp.data;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return false;
|
|
44
|
-
} catch (ex) {
|
|
45
|
-
const _ex = ex as Error;
|
|
46
|
-
if (_ex instanceof APIError) {
|
|
47
|
-
switch (_ex.status) {
|
|
48
|
-
case 409:
|
|
49
|
-
return true;
|
|
50
|
-
case 422:
|
|
51
|
-
return false;
|
|
52
|
-
default:
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
throw new ProjectResponseError({ cause: ex });
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
-
import { ProjectResponseError } from './util.ts';
|
|
4
|
-
|
|
5
|
-
// --- GET hostname ---
|
|
6
|
-
|
|
7
|
-
export const ProjectHostnameGetRequestSchema = z.object({
|
|
8
|
-
projectId: z.string().describe('the project id'),
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
const HostnameGetDataSchema = z.object({
|
|
12
|
-
hostname: z.string().nullable(),
|
|
13
|
-
url: z.string().nullable(),
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const ProjectHostnameGetResponseSchema = APIResponseSchema(HostnameGetDataSchema);
|
|
17
|
-
|
|
18
|
-
type ProjectHostnameGetRequest = z.infer<typeof ProjectHostnameGetRequestSchema>;
|
|
19
|
-
type ProjectHostnameGetResponse = z.infer<typeof ProjectHostnameGetResponseSchema>;
|
|
20
|
-
|
|
21
|
-
export type ProjectHostnameGetResult = z.infer<typeof HostnameGetDataSchema>;
|
|
22
|
-
|
|
23
|
-
export async function projectHostnameGet(
|
|
24
|
-
client: APIClient,
|
|
25
|
-
request: ProjectHostnameGetRequest
|
|
26
|
-
): Promise<ProjectHostnameGetResult> {
|
|
27
|
-
const resp = await client.get<ProjectHostnameGetResponse>(
|
|
28
|
-
`/cli/project/${request.projectId}/hostname`,
|
|
29
|
-
ProjectHostnameGetResponseSchema
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
if (resp.success) {
|
|
33
|
-
return resp.data;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
throw new ProjectResponseError({ message: resp.message });
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// --- SET hostname ---
|
|
40
|
-
|
|
41
|
-
export const ProjectHostnameSetRequestSchema = z.object({
|
|
42
|
-
projectId: z.string().describe('the project id'),
|
|
43
|
-
hostname: z.string().describe('the vanity hostname to set'),
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const HostnameSetDataSchema = z.object({
|
|
47
|
-
hostname: z.string(),
|
|
48
|
-
url: z.string(),
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const ProjectHostnameSetResponseSchema = APIResponseSchema(HostnameSetDataSchema);
|
|
52
|
-
|
|
53
|
-
type ProjectHostnameSetRequest = z.infer<typeof ProjectHostnameSetRequestSchema>;
|
|
54
|
-
type ProjectHostnameSetResponse = z.infer<typeof ProjectHostnameSetResponseSchema>;
|
|
55
|
-
|
|
56
|
-
export type ProjectHostnameSetResult = z.infer<typeof HostnameSetDataSchema>;
|
|
57
|
-
|
|
58
|
-
export async function projectHostnameSet(
|
|
59
|
-
client: APIClient,
|
|
60
|
-
request: ProjectHostnameSetRequest
|
|
61
|
-
): Promise<ProjectHostnameSetResult> {
|
|
62
|
-
const resp = await client.put<ProjectHostnameSetResponse>(
|
|
63
|
-
`/cli/project/${request.projectId}/hostname`,
|
|
64
|
-
{ hostname: request.hostname },
|
|
65
|
-
ProjectHostnameSetResponseSchema
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
if (resp.success) {
|
|
69
|
-
return resp.data;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
throw new ProjectResponseError({ message: resp.message });
|
|
73
|
-
}
|
package/src/api/project/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
-
import { ProjectResponseError } from './util.ts';
|
|
4
|
-
|
|
5
|
-
export const UpdateRegionRequestSchema = z.object({
|
|
6
|
-
cloudRegion: z.string().describe('the cloud region to update the project to'),
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const UpdateRegionResponseSchema = APIResponseSchema(
|
|
10
|
-
z.object({
|
|
11
|
-
id: z.string().describe('the project id'),
|
|
12
|
-
})
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
type UpdateRegionRequest = z.infer<typeof UpdateRegionRequestSchema>;
|
|
16
|
-
type UpdateRegionResponse = z.infer<typeof UpdateRegionResponseSchema>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Update a project's cloud region
|
|
20
|
-
*
|
|
21
|
-
* @param client - The API client
|
|
22
|
-
* @param projectId - The project id to update
|
|
23
|
-
* @param region - The new cloud region
|
|
24
|
-
* @returns The project id on success
|
|
25
|
-
*/
|
|
26
|
-
export async function projectUpdateRegion(
|
|
27
|
-
client: APIClient,
|
|
28
|
-
projectId: string,
|
|
29
|
-
region: string
|
|
30
|
-
): Promise<{ id: string }> {
|
|
31
|
-
const resp = await client.request<UpdateRegionResponse, UpdateRegionRequest>(
|
|
32
|
-
'PATCH',
|
|
33
|
-
`/cli/project/${projectId}`,
|
|
34
|
-
UpdateRegionResponseSchema,
|
|
35
|
-
{ cloudRegion: region },
|
|
36
|
-
UpdateRegionRequestSchema
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
if (resp.success) {
|
|
40
|
-
return resp.data;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
throw new ProjectResponseError({ message: resp.message ?? 'failed to update project region' });
|
|
44
|
-
}
|
package/src/api/project/util.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { StructuredError } from '@agentuity/core';
|
|
2
|
-
|
|
3
|
-
export const ProjectResponseError = StructuredError('ProjectResponseError');
|
|
4
|
-
export const ProjectNotFoundError = StructuredError('ProjectNotFoundError')<{ id: string }>();
|
|
5
|
-
export const AgentNotFoundError = StructuredError('AgentNotFoundError')<{ id: string }>();
|
|
6
|
-
export const MalwareCheckError = StructuredError('MalwareCheckError')<{
|
|
7
|
-
deploymentId: string;
|
|
8
|
-
}>();
|
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
-
import {
|
|
4
|
-
type AnalyticsOptions,
|
|
5
|
-
type OrgAnalytics,
|
|
6
|
-
OrgAnalyticsSchema,
|
|
7
|
-
type QueueAnalytics,
|
|
8
|
-
QueueAnalyticsSchema,
|
|
9
|
-
type SSEStatsEvent,
|
|
10
|
-
SSEStatsEventSchema,
|
|
11
|
-
type StreamAnalyticsOptions,
|
|
12
|
-
type TimeSeriesData,
|
|
13
|
-
TimeSeriesDataSchema,
|
|
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';
|
|
23
|
-
|
|
24
|
-
export const OrgAnalyticsResponseSchema = APIResponseSchema(
|
|
25
|
-
z.object({ analytics: OrgAnalyticsSchema })
|
|
26
|
-
);
|
|
27
|
-
export const QueueAnalyticsResponseSchema = APIResponseSchema(
|
|
28
|
-
z.object({ analytics: QueueAnalyticsSchema })
|
|
29
|
-
);
|
|
30
|
-
export const TimeSeriesResponseSchema = APIResponseSchema(
|
|
31
|
-
z.object({ timeseries: TimeSeriesDataSchema })
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Build query string from analytics options.
|
|
36
|
-
*/
|
|
37
|
-
function buildAnalyticsQuery(options?: AnalyticsOptions): string | undefined {
|
|
38
|
-
if (!options) return undefined;
|
|
39
|
-
|
|
40
|
-
const params = new URLSearchParams();
|
|
41
|
-
if (options.start) params.set('start', options.start);
|
|
42
|
-
if (options.end) params.set('end', options.end);
|
|
43
|
-
if (options.granularity) params.set('granularity', options.granularity);
|
|
44
|
-
if (options.projectId) params.set('project_id', options.projectId);
|
|
45
|
-
if (options.agentId) params.set('agent_id', options.agentId);
|
|
46
|
-
|
|
47
|
-
const query = params.toString();
|
|
48
|
-
return query || undefined;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Get org-level analytics for all queues.
|
|
53
|
-
*
|
|
54
|
-
* Returns aggregated statistics across all queues in the organization.
|
|
55
|
-
*
|
|
56
|
-
* @param client - The API client instance
|
|
57
|
-
* @param options - Analytics options (time range, filters)
|
|
58
|
-
* @returns Org-level analytics summary
|
|
59
|
-
* @throws {QueueError} If the API request fails
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* ```typescript
|
|
63
|
-
* const analytics = await getOrgAnalytics(client, {
|
|
64
|
-
* start: '2026-01-14T00:00:00Z',
|
|
65
|
-
* end: '2026-01-15T00:00:00Z',
|
|
66
|
-
* });
|
|
67
|
-
* console.log(`Total queues: ${analytics.summary.total_queues}`);
|
|
68
|
-
* console.log(`Messages published: ${analytics.summary.total_messages_published}`);
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
export async function getOrgAnalytics(
|
|
72
|
-
client: APIClient,
|
|
73
|
-
options?: AnalyticsOptions
|
|
74
|
-
): Promise<OrgAnalytics> {
|
|
75
|
-
const queryString = buildAnalyticsQuery(options);
|
|
76
|
-
const url = queueApiPathWithQuery('analytics/org', queryString);
|
|
77
|
-
const resp = await client.get(
|
|
78
|
-
url,
|
|
79
|
-
OrgAnalyticsResponseSchema,
|
|
80
|
-
undefined,
|
|
81
|
-
buildQueueHeaders(options?.orgId)
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
if (resp.success) {
|
|
85
|
-
return resp.data.analytics;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
throw new QueueError({
|
|
89
|
-
message: resp.message || 'Failed to get org analytics',
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Get detailed analytics for a specific queue.
|
|
95
|
-
*
|
|
96
|
-
* Returns current state, period statistics, latency metrics, and destination stats.
|
|
97
|
-
*
|
|
98
|
-
* @param client - The API client instance
|
|
99
|
-
* @param name - The queue name
|
|
100
|
-
* @param options - Analytics options (time range, filters)
|
|
101
|
-
* @returns Queue analytics
|
|
102
|
-
* @throws {QueueNotFoundError} If the queue does not exist
|
|
103
|
-
* @throws {QueueError} If the API request fails
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```typescript
|
|
107
|
-
* const analytics = await getQueueAnalytics(client, 'order-processing', {
|
|
108
|
-
* start: '2026-01-14T00:00:00Z',
|
|
109
|
-
* });
|
|
110
|
-
* console.log(`Backlog: ${analytics.current.backlog}`);
|
|
111
|
-
* console.log(`P95 latency: ${analytics.latency.p95_ms}ms`);
|
|
112
|
-
* ```
|
|
113
|
-
*/
|
|
114
|
-
export async function getQueueAnalytics(
|
|
115
|
-
client: APIClient,
|
|
116
|
-
name: string,
|
|
117
|
-
options?: AnalyticsOptions
|
|
118
|
-
): Promise<QueueAnalytics> {
|
|
119
|
-
validateQueueName(name);
|
|
120
|
-
const queryString = buildAnalyticsQuery(options);
|
|
121
|
-
const url = queueApiPathWithQuery('analytics/queue', queryString, name);
|
|
122
|
-
const resp = await withQueueErrorHandling(
|
|
123
|
-
() =>
|
|
124
|
-
client.get(
|
|
125
|
-
url,
|
|
126
|
-
QueueAnalyticsResponseSchema,
|
|
127
|
-
undefined,
|
|
128
|
-
buildQueueHeaders(options?.orgId)
|
|
129
|
-
),
|
|
130
|
-
{ queueName: name }
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
if (resp.success) {
|
|
134
|
-
return resp.data.analytics;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
throw new QueueError({
|
|
138
|
-
queueName: name,
|
|
139
|
-
message: resp.message || 'Failed to get queue analytics',
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Get time series analytics data for a queue.
|
|
145
|
-
*
|
|
146
|
-
* Returns time-bucketed metrics for visualization in charts and graphs.
|
|
147
|
-
*
|
|
148
|
-
* @param client - The API client instance
|
|
149
|
-
* @param name - The queue name
|
|
150
|
-
* @param options - Analytics options (time range, granularity)
|
|
151
|
-
* @returns Time series data
|
|
152
|
-
* @throws {QueueNotFoundError} If the queue does not exist
|
|
153
|
-
* @throws {QueueError} If the API request fails
|
|
154
|
-
*
|
|
155
|
-
* @example
|
|
156
|
-
* ```typescript
|
|
157
|
-
* const timeseries = await getQueueTimeSeries(client, 'order-processing', {
|
|
158
|
-
* granularity: 'hour',
|
|
159
|
-
* start: '2026-01-14T00:00:00Z',
|
|
160
|
-
* });
|
|
161
|
-
* for (const point of timeseries.series) {
|
|
162
|
-
* console.log(`${point.timestamp}: ${point.throughput} msg/h`);
|
|
163
|
-
* }
|
|
164
|
-
* ```
|
|
165
|
-
*/
|
|
166
|
-
export async function getQueueTimeSeries(
|
|
167
|
-
client: APIClient,
|
|
168
|
-
name: string,
|
|
169
|
-
options?: AnalyticsOptions
|
|
170
|
-
): Promise<TimeSeriesData> {
|
|
171
|
-
validateQueueName(name);
|
|
172
|
-
const queryString = buildAnalyticsQuery(options);
|
|
173
|
-
const url = queueApiPathWithQuery('analytics/timeseries', queryString, name);
|
|
174
|
-
const resp = await withQueueErrorHandling(
|
|
175
|
-
() => client.get(url, TimeSeriesResponseSchema, undefined, buildQueueHeaders(options?.orgId)),
|
|
176
|
-
{ queueName: name }
|
|
177
|
-
);
|
|
178
|
-
|
|
179
|
-
if (resp.success) {
|
|
180
|
-
return resp.data.timeseries;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
throw new QueueError({
|
|
184
|
-
queueName: name,
|
|
185
|
-
message: resp.message || 'Failed to get queue time series',
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Stream real-time analytics for all queues via SSE.
|
|
191
|
-
*
|
|
192
|
-
* Returns an async iterator that yields stats events at the specified interval.
|
|
193
|
-
* The connection stays open until the iterator is closed or an error occurs.
|
|
194
|
-
*
|
|
195
|
-
* @param client - The API client instance
|
|
196
|
-
* @param options - Stream options (interval, orgId)
|
|
197
|
-
* @returns Async iterator of SSE stats events
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* ```typescript
|
|
201
|
-
* const stream = streamOrgAnalytics(client, { interval: 5 });
|
|
202
|
-
* for await (const event of stream) {
|
|
203
|
-
* console.log(`Backlog: ${event.backlog}, Throughput: ${event.throughput_1m}/min`);
|
|
204
|
-
* }
|
|
205
|
-
* ```
|
|
206
|
-
*/
|
|
207
|
-
export async function* streamOrgAnalytics(
|
|
208
|
-
client: APIClient,
|
|
209
|
-
options?: StreamAnalyticsOptions
|
|
210
|
-
): AsyncGenerator<SSEStatsEvent, void, unknown> {
|
|
211
|
-
const params = new URLSearchParams();
|
|
212
|
-
if (options?.interval) params.set('interval', String(options.interval));
|
|
213
|
-
const queryString = params.toString() || undefined;
|
|
214
|
-
|
|
215
|
-
const url = queueApiPathWithQuery('analytics/stream', queryString);
|
|
216
|
-
|
|
217
|
-
yield* streamSSE(client, url, options?.orgId);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Stream real-time analytics for a specific queue via SSE.
|
|
222
|
-
*
|
|
223
|
-
* Returns an async iterator that yields stats events at the specified interval.
|
|
224
|
-
*
|
|
225
|
-
* @param client - The API client instance
|
|
226
|
-
* @param name - The queue name
|
|
227
|
-
* @param options - Stream options (interval, orgId)
|
|
228
|
-
* @returns Async iterator of SSE stats events
|
|
229
|
-
*
|
|
230
|
-
* @example
|
|
231
|
-
* ```typescript
|
|
232
|
-
* const stream = streamQueueAnalytics(client, 'order-processing', { interval: 5 });
|
|
233
|
-
* for await (const event of stream) {
|
|
234
|
-
* console.log(`Backlog: ${event.backlog}, In-flight: ${event.messages_in_flight}`);
|
|
235
|
-
* }
|
|
236
|
-
* ```
|
|
237
|
-
*/
|
|
238
|
-
export async function* streamQueueAnalytics(
|
|
239
|
-
client: APIClient,
|
|
240
|
-
name: string,
|
|
241
|
-
options?: StreamAnalyticsOptions
|
|
242
|
-
): AsyncGenerator<SSEStatsEvent, void, unknown> {
|
|
243
|
-
validateQueueName(name);
|
|
244
|
-
|
|
245
|
-
const params = new URLSearchParams();
|
|
246
|
-
if (options?.interval) params.set('interval', String(options.interval));
|
|
247
|
-
const queryString = params.toString() || undefined;
|
|
248
|
-
|
|
249
|
-
const url = queueApiPathWithQuery('analytics/stream', queryString, name);
|
|
250
|
-
|
|
251
|
-
yield* streamSSE(client, url, options?.orgId, name);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Internal helper to stream SSE events from a URL.
|
|
256
|
-
* Uses rawGet for streaming response access.
|
|
257
|
-
*/
|
|
258
|
-
async function* streamSSE(
|
|
259
|
-
client: APIClient,
|
|
260
|
-
url: string,
|
|
261
|
-
orgId?: string,
|
|
262
|
-
queueName?: string
|
|
263
|
-
): AsyncGenerator<SSEStatsEvent, void, unknown> {
|
|
264
|
-
const response = await client.rawGet(url, undefined, buildQueueHeaders(orgId));
|
|
265
|
-
|
|
266
|
-
if (!response.ok) {
|
|
267
|
-
if (response.status === 404 && queueName) {
|
|
268
|
-
throw new QueueNotFoundError({ queueName });
|
|
269
|
-
}
|
|
270
|
-
throw new QueueError({
|
|
271
|
-
message: `SSE connection failed: ${response.status} ${response.statusText}`,
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
const reader = response.body?.getReader();
|
|
276
|
-
if (!reader) {
|
|
277
|
-
throw new QueueError({ message: 'No response body for SSE stream' });
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
const decoder = new TextDecoder();
|
|
281
|
-
let buffer = '';
|
|
282
|
-
|
|
283
|
-
try {
|
|
284
|
-
while (true) {
|
|
285
|
-
const { done, value } = await reader.read();
|
|
286
|
-
if (done) break;
|
|
287
|
-
|
|
288
|
-
buffer += decoder.decode(value, { stream: true });
|
|
289
|
-
const lines = buffer.split('\n');
|
|
290
|
-
buffer = lines.pop() || '';
|
|
291
|
-
|
|
292
|
-
for (const line of lines) {
|
|
293
|
-
if (line.startsWith('data: ')) {
|
|
294
|
-
const jsonStr = line.slice(6).trim();
|
|
295
|
-
if (jsonStr && jsonStr !== '{}') {
|
|
296
|
-
try {
|
|
297
|
-
const parsed = JSON.parse(jsonStr);
|
|
298
|
-
const event = SSEStatsEventSchema.parse(parsed);
|
|
299
|
-
yield event;
|
|
300
|
-
} catch {
|
|
301
|
-
// Skip malformed events
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
} finally {
|
|
308
|
-
await reader.cancel();
|
|
309
|
-
reader.releaseLock();
|
|
310
|
-
}
|
|
311
|
-
}
|