agentmail 0.5.11 → 0.5.13
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/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/drafts/types/CreateDraftForwardRequest.d.ts +21 -0
- package/dist/cjs/api/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +17 -0
- package/dist/cjs/api/resources/drafts/types/CreateDraftReplyRequest.d.ts +22 -0
- package/dist/cjs/api/resources/drafts/types/Draft.d.ts +1 -0
- package/dist/cjs/api/resources/drafts/types/DraftForwardOf.d.ts +4 -0
- package/dist/cjs/api/resources/drafts/types/DraftForwardOf.js +3 -0
- package/dist/cjs/api/resources/drafts/types/DraftItem.d.ts +1 -0
- package/dist/cjs/api/resources/drafts/types/DraftReplyAll.d.ts +4 -0
- package/dist/cjs/api/resources/drafts/types/DraftReplyAll.js +3 -0
- package/dist/cjs/api/resources/drafts/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/drafts/types/index.js +5 -0
- package/dist/cjs/api/resources/inboxes/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/inboxes/client/Client.js +5 -0
- package/dist/cjs/api/resources/inboxes/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/index.js +3 -1
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +69 -0
- package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +264 -0
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.d.ts +30 -4
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.js +102 -7
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/requests/{QueryMetricsRequest.d.ts → QueryEventsRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/requests/QueryEventsRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/requests/QueryUsageRequest.d.ts +13 -0
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/requests/QueryUsageRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/metrics/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.d.ts +103 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.js +411 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/index.js +17 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.d.ts +10 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.js +3 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.d.ts +2 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/exports.js +21 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/index.d.ts +1 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/index.js +17 -0
- package/dist/cjs/api/resources/metrics/client/Client.d.ts +27 -4
- package/dist/cjs/api/resources/metrics/client/Client.js +99 -7
- package/dist/cjs/api/resources/metrics/client/requests/{QueryMetricsRequest.d.ts → QueryEventsRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/metrics/client/requests/QueryEventsRequest.js +3 -0
- package/dist/cjs/api/resources/metrics/client/requests/QueryUsageRequest.d.ts +13 -0
- package/dist/cjs/api/resources/metrics/client/requests/QueryUsageRequest.js +3 -0
- package/dist/cjs/api/resources/metrics/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/metrics/types/MetricEventType.d.ts +6 -3
- package/dist/cjs/api/resources/metrics/types/MetricEventType.js +6 -3
- package/dist/cjs/api/resources/metrics/types/Period.d.ts +2 -2
- package/dist/cjs/api/resources/metrics/types/QueryUsageResponse.d.ts +5 -0
- package/dist/cjs/api/resources/metrics/types/QueryUsageResponse.js +3 -0
- package/dist/cjs/api/resources/metrics/types/UsagePoint.d.ts +6 -0
- package/dist/cjs/api/resources/metrics/types/UsagePoint.js +3 -0
- package/dist/cjs/api/resources/metrics/types/UsageType.d.ts +14 -0
- package/dist/cjs/api/resources/metrics/types/UsageType.js +17 -0
- package/dist/cjs/api/resources/metrics/types/UsageTypes.d.ts +5 -0
- package/dist/cjs/api/resources/metrics/types/UsageTypes.js +3 -0
- package/dist/cjs/api/resources/metrics/types/index.d.ts +4 -0
- package/dist/cjs/api/resources/metrics/types/index.js +4 -0
- package/dist/cjs/api/resources/pods/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/pods/client/Client.js +5 -0
- package/dist/cjs/api/resources/pods/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/pods/resources/index.js +3 -1
- package/dist/cjs/api/resources/pods/resources/metrics/client/Client.d.ts +30 -4
- package/dist/cjs/api/resources/pods/resources/metrics/client/Client.js +102 -7
- package/dist/cjs/api/resources/pods/resources/metrics/client/requests/{QueryMetricsRequest.d.ts → QueryEventsRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/pods/resources/metrics/client/requests/QueryEventsRequest.js +3 -0
- package/dist/cjs/api/resources/pods/resources/metrics/client/requests/QueryUsageRequest.d.ts +13 -0
- package/dist/cjs/api/resources/pods/resources/metrics/client/requests/QueryUsageRequest.js +3 -0
- package/dist/cjs/api/resources/pods/resources/metrics/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.d.ts +103 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.js +411 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/index.js +17 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.d.ts +10 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.js +3 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/exports.d.ts +2 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/exports.js +21 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/index.d.ts +1 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +10 -0
- package/dist/cjs/api/resources/webhooks/types/CreateInboxWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/CreatePodWebhookRequest.d.ts +9 -0
- package/dist/cjs/api/resources/webhooks/types/CreatePodWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/CreateWebhookEventTypes.d.ts +7 -0
- package/dist/cjs/api/resources/webhooks/types/CreateWebhookEventTypes.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/CreateWebhookRequest.d.ts +1 -10
- package/dist/cjs/api/resources/webhooks/types/UpdateInboxWebhookRequest.d.ts +7 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateInboxWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/UpdatePodWebhookRequest.d.ts +11 -0
- package/dist/cjs/api/resources/webhooks/types/UpdatePodWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookEventTypes.d.ts +10 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookEventTypes.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequest.d.ts +1 -14
- package/dist/cjs/api/resources/webhooks/types/index.d.ts +6 -0
- package/dist/cjs/api/resources/webhooks/types/index.js +6 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftForwardRequest.d.ts +30 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftForwardRequest.js +62 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.ts +24 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyAllRequest.js +56 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.d.ts +32 -0
- package/dist/cjs/serialization/resources/drafts/types/CreateDraftReplyRequest.js +64 -0
- package/dist/cjs/serialization/resources/drafts/types/Draft.d.ts +2 -0
- package/dist/cjs/serialization/resources/drafts/types/Draft.js +2 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftForwardOf.d.ts +7 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftForwardOf.js +39 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftItem.d.ts +2 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftItem.js +2 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftReplyAll.d.ts +7 -0
- package/dist/cjs/serialization/resources/drafts/types/DraftReplyAll.js +39 -0
- package/dist/cjs/serialization/resources/drafts/types/index.d.ts +5 -0
- package/dist/cjs/serialization/resources/drafts/types/index.js +5 -0
- package/dist/cjs/serialization/resources/metrics/types/MetricEventType.d.ts +1 -1
- package/dist/cjs/serialization/resources/metrics/types/MetricEventType.js +6 -3
- package/dist/cjs/serialization/resources/metrics/types/Period.d.ts +1 -1
- package/dist/cjs/serialization/resources/metrics/types/Period.js +1 -1
- package/dist/cjs/serialization/resources/metrics/types/QueryUsageResponse.d.ts +9 -0
- package/dist/cjs/serialization/resources/metrics/types/QueryUsageResponse.js +41 -0
- package/dist/cjs/serialization/resources/metrics/types/UsagePoint.d.ts +10 -0
- package/dist/cjs/serialization/resources/metrics/types/UsagePoint.js +42 -0
- package/dist/cjs/serialization/resources/metrics/types/UsageType.d.ts +7 -0
- package/dist/cjs/serialization/resources/metrics/types/UsageType.js +46 -0
- package/dist/cjs/serialization/resources/metrics/types/UsageTypes.d.ts +8 -0
- package/dist/cjs/serialization/resources/metrics/types/UsageTypes.js +40 -0
- package/dist/cjs/serialization/resources/metrics/types/index.d.ts +4 -0
- package/dist/cjs/serialization/resources/metrics/types/index.js +4 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +14 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.js +46 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreatePodWebhookRequest.d.ts +11 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreatePodWebhookRequest.js +45 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookEventTypes.d.ts +8 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookEventTypes.js +6 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookRequest.d.ts +2 -9
- package/dist/cjs/serialization/resources/webhooks/types/CreateWebhookRequest.js +5 -10
- package/dist/cjs/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.d.ts +10 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.js +42 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdatePodWebhookRequest.d.ts +12 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdatePodWebhookRequest.js +46 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookEventTypes.d.ts +8 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookEventTypes.js +6 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookRequest.d.ts +2 -6
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookRequest.js +5 -7
- package/dist/cjs/serialization/resources/webhooks/types/index.d.ts +6 -0
- package/dist/cjs/serialization/resources/webhooks/types/index.js +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/drafts/types/CreateDraftForwardRequest.d.mts +21 -0
- package/dist/esm/api/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +17 -0
- package/dist/esm/api/resources/drafts/types/CreateDraftReplyRequest.d.mts +22 -0
- package/dist/esm/api/resources/drafts/types/Draft.d.mts +1 -0
- package/dist/esm/api/resources/drafts/types/DraftForwardOf.d.mts +4 -0
- package/dist/esm/api/resources/drafts/types/DraftForwardOf.mjs +2 -0
- package/dist/esm/api/resources/drafts/types/DraftItem.d.mts +1 -0
- package/dist/esm/api/resources/drafts/types/DraftReplyAll.d.mts +4 -0
- package/dist/esm/api/resources/drafts/types/DraftReplyAll.mjs +2 -0
- package/dist/esm/api/resources/drafts/types/index.d.mts +5 -0
- package/dist/esm/api/resources/drafts/types/index.mjs +5 -0
- package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
- package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +69 -0
- package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +264 -0
- package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.d.mts +30 -4
- package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.mjs +102 -7
- package/dist/esm/api/resources/{pods/resources/metrics/client/requests/QueryMetricsRequest.d.mts → inboxes/resources/metrics/client/requests/QueryEventsRequest.d.mts} +1 -1
- package/dist/esm/api/resources/inboxes/resources/metrics/client/requests/QueryEventsRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/metrics/client/requests/QueryUsageRequest.d.mts +13 -0
- package/dist/esm/api/resources/inboxes/resources/metrics/client/requests/QueryUsageRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/metrics/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.d.mts +103 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.mjs +374 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.d.mts +10 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/InboxListWebhooksRequest.mjs +2 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/exports.d.mts +2 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/exports.mjs +3 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/index.d.mts +1 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/index.mjs +1 -0
- package/dist/esm/api/resources/metrics/client/Client.d.mts +27 -4
- package/dist/esm/api/resources/metrics/client/Client.mjs +99 -7
- package/dist/esm/api/resources/metrics/client/requests/{QueryMetricsRequest.d.mts → QueryEventsRequest.d.mts} +1 -1
- package/dist/esm/api/resources/metrics/client/requests/QueryEventsRequest.mjs +2 -0
- package/dist/esm/api/resources/metrics/client/requests/QueryUsageRequest.d.mts +13 -0
- package/dist/esm/api/resources/metrics/client/requests/QueryUsageRequest.mjs +2 -0
- package/dist/esm/api/resources/metrics/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/metrics/types/MetricEventType.d.mts +6 -3
- package/dist/esm/api/resources/metrics/types/MetricEventType.mjs +6 -3
- package/dist/esm/api/resources/metrics/types/Period.d.mts +2 -2
- package/dist/esm/api/resources/metrics/types/QueryUsageResponse.d.mts +5 -0
- package/dist/esm/api/resources/metrics/types/QueryUsageResponse.mjs +2 -0
- package/dist/esm/api/resources/metrics/types/UsagePoint.d.mts +6 -0
- package/dist/esm/api/resources/metrics/types/UsagePoint.mjs +2 -0
- package/dist/esm/api/resources/metrics/types/UsageType.d.mts +14 -0
- package/dist/esm/api/resources/metrics/types/UsageType.mjs +14 -0
- package/dist/esm/api/resources/metrics/types/UsageTypes.d.mts +5 -0
- package/dist/esm/api/resources/metrics/types/UsageTypes.mjs +2 -0
- package/dist/esm/api/resources/metrics/types/index.d.mts +4 -0
- package/dist/esm/api/resources/metrics/types/index.mjs +4 -0
- package/dist/esm/api/resources/pods/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/pods/client/Client.mjs +5 -0
- package/dist/esm/api/resources/pods/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/pods/resources/index.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/metrics/client/Client.d.mts +30 -4
- package/dist/esm/api/resources/pods/resources/metrics/client/Client.mjs +102 -7
- package/dist/esm/api/resources/{inboxes/resources/metrics/client/requests/QueryMetricsRequest.d.mts → pods/resources/metrics/client/requests/QueryEventsRequest.d.mts} +1 -1
- package/dist/esm/api/resources/pods/resources/metrics/client/requests/QueryEventsRequest.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/metrics/client/requests/QueryUsageRequest.d.mts +13 -0
- package/dist/esm/api/resources/pods/resources/metrics/client/requests/QueryUsageRequest.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/metrics/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/pods/resources/webhooks/client/Client.d.mts +103 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/Client.mjs +374 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.d.mts +10 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/requests/PodListWebhooksRequest.mjs +2 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/exports.d.mts +2 -0
- package/dist/esm/api/resources/pods/resources/webhooks/exports.mjs +3 -0
- package/dist/esm/api/resources/pods/resources/webhooks/index.d.mts +1 -0
- package/dist/esm/api/resources/pods/resources/webhooks/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/types/CreateInboxWebhookRequest.d.mts +10 -0
- package/dist/esm/api/resources/webhooks/types/CreateInboxWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/CreatePodWebhookRequest.d.mts +9 -0
- package/dist/esm/api/resources/webhooks/types/CreatePodWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/CreateWebhookEventTypes.d.mts +7 -0
- package/dist/esm/api/resources/webhooks/types/CreateWebhookEventTypes.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/CreateWebhookRequest.d.mts +1 -10
- package/dist/esm/api/resources/webhooks/types/UpdateInboxWebhookRequest.d.mts +7 -0
- package/dist/esm/api/resources/webhooks/types/UpdateInboxWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/UpdatePodWebhookRequest.d.mts +11 -0
- package/dist/esm/api/resources/webhooks/types/UpdatePodWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookEventTypes.d.mts +10 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookEventTypes.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequest.d.mts +1 -14
- package/dist/esm/api/resources/webhooks/types/index.d.mts +6 -0
- package/dist/esm/api/resources/webhooks/types/index.mjs +6 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.d.mts +30 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftForwardRequest.mjs +26 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.d.mts +24 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyAllRequest.mjs +20 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.d.mts +32 -0
- package/dist/esm/serialization/resources/drafts/types/CreateDraftReplyRequest.mjs +28 -0
- package/dist/esm/serialization/resources/drafts/types/Draft.d.mts +2 -0
- package/dist/esm/serialization/resources/drafts/types/Draft.mjs +2 -0
- package/dist/esm/serialization/resources/drafts/types/DraftForwardOf.d.mts +7 -0
- package/dist/esm/serialization/resources/drafts/types/DraftForwardOf.mjs +3 -0
- package/dist/esm/serialization/resources/drafts/types/DraftItem.d.mts +2 -0
- package/dist/esm/serialization/resources/drafts/types/DraftItem.mjs +2 -0
- package/dist/esm/serialization/resources/drafts/types/DraftReplyAll.d.mts +7 -0
- package/dist/esm/serialization/resources/drafts/types/DraftReplyAll.mjs +3 -0
- package/dist/esm/serialization/resources/drafts/types/index.d.mts +5 -0
- package/dist/esm/serialization/resources/drafts/types/index.mjs +5 -0
- package/dist/esm/serialization/resources/metrics/types/MetricEventType.d.mts +1 -1
- package/dist/esm/serialization/resources/metrics/types/MetricEventType.mjs +6 -3
- package/dist/esm/serialization/resources/metrics/types/Period.d.mts +1 -1
- package/dist/esm/serialization/resources/metrics/types/Period.mjs +1 -1
- package/dist/esm/serialization/resources/metrics/types/QueryUsageResponse.d.mts +9 -0
- package/dist/esm/serialization/resources/metrics/types/QueryUsageResponse.mjs +5 -0
- package/dist/esm/serialization/resources/metrics/types/UsagePoint.d.mts +10 -0
- package/dist/esm/serialization/resources/metrics/types/UsagePoint.mjs +6 -0
- package/dist/esm/serialization/resources/metrics/types/UsageType.d.mts +7 -0
- package/dist/esm/serialization/resources/metrics/types/UsageType.mjs +10 -0
- package/dist/esm/serialization/resources/metrics/types/UsageTypes.d.mts +8 -0
- package/dist/esm/serialization/resources/metrics/types/UsageTypes.mjs +4 -0
- package/dist/esm/serialization/resources/metrics/types/index.d.mts +4 -0
- package/dist/esm/serialization/resources/metrics/types/index.mjs +4 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.mts +14 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.mjs +10 -0
- package/dist/esm/serialization/resources/webhooks/types/CreatePodWebhookRequest.d.mts +11 -0
- package/dist/esm/serialization/resources/webhooks/types/CreatePodWebhookRequest.mjs +9 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateWebhookEventTypes.d.mts +8 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateWebhookEventTypes.mjs +3 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateWebhookRequest.d.mts +2 -9
- package/dist/esm/serialization/resources/webhooks/types/CreateWebhookRequest.mjs +5 -10
- package/dist/esm/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.d.mts +10 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateInboxWebhookRequest.mjs +6 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdatePodWebhookRequest.d.mts +12 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdatePodWebhookRequest.mjs +10 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookEventTypes.d.mts +8 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookEventTypes.mjs +3 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookRequest.d.mts +2 -6
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookRequest.mjs +5 -7
- package/dist/esm/serialization/resources/webhooks/types/index.d.mts +6 -0
- package/dist/esm/serialization/resources/webhooks/types/index.mjs +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms.txt +8 -4
- package/package.json +23 -1
- package/reference.md +1702 -437
- /package/dist/cjs/api/resources/{inboxes/resources/metrics/client/requests/QueryMetricsRequest.js → drafts/types/CreateDraftForwardRequest.js} +0 -0
- /package/dist/cjs/api/resources/{metrics/client/requests/QueryMetricsRequest.js → drafts/types/CreateDraftReplyAllRequest.js} +0 -0
- /package/dist/cjs/api/resources/{pods/resources/metrics/client/requests/QueryMetricsRequest.js → drafts/types/CreateDraftReplyRequest.js} +0 -0
- /package/dist/esm/api/resources/{inboxes/resources/metrics/client/requests/QueryMetricsRequest.mjs → drafts/types/CreateDraftForwardRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{metrics/client/requests/QueryMetricsRequest.mjs → drafts/types/CreateDraftReplyAllRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{pods/resources/metrics/client/requests/QueryMetricsRequest.mjs → drafts/types/CreateDraftReplyRequest.mjs} +0 -0
|
@@ -58,23 +58,29 @@ class MetricsClient {
|
|
|
58
58
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
+
* Counts of email events (sent, delivered, bounced, etc.) over time for
|
|
62
|
+
* the organization. Defaults to the last 24 hours; `start` must be within
|
|
63
|
+
* the last 90 days, and a future `end` is clamped to now. Omit `period`
|
|
64
|
+
* for individual event counts, or set it to sum counts into buckets of
|
|
65
|
+
* that many seconds.
|
|
66
|
+
*
|
|
61
67
|
* **CLI:**
|
|
62
68
|
* ```bash
|
|
63
69
|
* agentmail metrics list
|
|
64
70
|
* ```
|
|
65
71
|
*
|
|
66
|
-
* @param {AgentMail.
|
|
72
|
+
* @param {AgentMail.QueryEventsRequest} request
|
|
67
73
|
* @param {MetricsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
74
|
*
|
|
69
75
|
* @throws {@link AgentMail.ValidationError}
|
|
70
76
|
*
|
|
71
77
|
* @example
|
|
72
|
-
* await client.metrics.
|
|
78
|
+
* await client.metrics.queryEvents()
|
|
73
79
|
*/
|
|
74
|
-
|
|
75
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
80
|
+
queryEvents(request = {}, requestOptions) {
|
|
81
|
+
return core.HttpResponsePromise.fromPromise(this.__queryEvents(request, requestOptions));
|
|
76
82
|
}
|
|
77
|
-
|
|
83
|
+
__queryEvents() {
|
|
78
84
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
79
85
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
80
86
|
const { eventTypes, start, end, period, limit, descending } = request;
|
|
@@ -99,7 +105,7 @@ class MetricsClient {
|
|
|
99
105
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
100
106
|
const _response = yield core.fetcher({
|
|
101
107
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
102
|
-
.http, "/v0/metrics"),
|
|
108
|
+
.http, "/v0/metrics/events"),
|
|
103
109
|
method: "GET",
|
|
104
110
|
headers: _headers,
|
|
105
111
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -139,7 +145,93 @@ class MetricsClient {
|
|
|
139
145
|
});
|
|
140
146
|
}
|
|
141
147
|
}
|
|
142
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/metrics");
|
|
148
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/metrics/events");
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Cumulative usage series for the organization. Each point is the running
|
|
153
|
+
* total of the usage type at that timestamp, not the change within the
|
|
154
|
+
* bucket. Defaults to the last 24 hours; `start` must be within the last
|
|
155
|
+
* 90 days, and a future `end` is clamped to now. The range divided by
|
|
156
|
+
* `period` must not exceed 1000 buckets.
|
|
157
|
+
*
|
|
158
|
+
* @param {AgentMail.QueryUsageRequest} request
|
|
159
|
+
* @param {MetricsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
160
|
+
*
|
|
161
|
+
* @throws {@link AgentMail.ValidationError}
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* await client.metrics.queryUsage()
|
|
165
|
+
*/
|
|
166
|
+
queryUsage(request = {}, requestOptions) {
|
|
167
|
+
return core.HttpResponsePromise.fromPromise(this.__queryUsage(request, requestOptions));
|
|
168
|
+
}
|
|
169
|
+
__queryUsage() {
|
|
170
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
171
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
172
|
+
const { usageTypes, start, end, period, limit, descending } = request;
|
|
173
|
+
const _queryParams = {
|
|
174
|
+
usage_types: usageTypes != null
|
|
175
|
+
? (0, json_js_1.toJson)(serializers.UsageTypes.jsonOrThrow(usageTypes, {
|
|
176
|
+
unrecognizedObjectKeys: "strip",
|
|
177
|
+
omitUndefined: true,
|
|
178
|
+
}))
|
|
179
|
+
: undefined,
|
|
180
|
+
start: start != null
|
|
181
|
+
? serializers.Start.jsonOrThrow(start, { unrecognizedObjectKeys: "strip", omitUndefined: true })
|
|
182
|
+
: undefined,
|
|
183
|
+
end: end != null
|
|
184
|
+
? serializers.End.jsonOrThrow(end, { unrecognizedObjectKeys: "strip", omitUndefined: true })
|
|
185
|
+
: undefined,
|
|
186
|
+
period,
|
|
187
|
+
limit,
|
|
188
|
+
descending,
|
|
189
|
+
};
|
|
190
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
191
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
192
|
+
const _response = yield core.fetcher({
|
|
193
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
194
|
+
.http, "/v0/metrics/usage"),
|
|
195
|
+
method: "GET",
|
|
196
|
+
headers: _headers,
|
|
197
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
198
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
199
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
200
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
201
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
202
|
+
logging: this._options.logging,
|
|
203
|
+
});
|
|
204
|
+
if (_response.ok) {
|
|
205
|
+
return {
|
|
206
|
+
data: serializers.QueryUsageResponse.parseOrThrow(_response.body, {
|
|
207
|
+
unrecognizedObjectKeys: "passthrough",
|
|
208
|
+
allowUnrecognizedUnionMembers: true,
|
|
209
|
+
allowUnrecognizedEnumValues: true,
|
|
210
|
+
skipValidation: true,
|
|
211
|
+
breadcrumbsPrefix: ["response"],
|
|
212
|
+
}),
|
|
213
|
+
rawResponse: _response.rawResponse,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
if (_response.error.reason === "status-code") {
|
|
217
|
+
switch (_response.error.statusCode) {
|
|
218
|
+
case 400:
|
|
219
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
220
|
+
unrecognizedObjectKeys: "passthrough",
|
|
221
|
+
allowUnrecognizedUnionMembers: true,
|
|
222
|
+
allowUnrecognizedEnumValues: true,
|
|
223
|
+
skipValidation: true,
|
|
224
|
+
breadcrumbsPrefix: ["response"],
|
|
225
|
+
}), _response.rawResponse);
|
|
226
|
+
default:
|
|
227
|
+
throw new errors.AgentMailError({
|
|
228
|
+
statusCode: _response.error.statusCode,
|
|
229
|
+
body: _response.error.body,
|
|
230
|
+
rawResponse: _response.rawResponse,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/metrics/usage");
|
|
143
235
|
});
|
|
144
236
|
}
|
|
145
237
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {}
|
|
5
|
+
*/
|
|
6
|
+
export interface QueryUsageRequest {
|
|
7
|
+
usageTypes?: AgentMail.UsageTypes;
|
|
8
|
+
start?: AgentMail.Start;
|
|
9
|
+
end?: AgentMail.End;
|
|
10
|
+
period?: AgentMail.Period;
|
|
11
|
+
limit?: AgentMail.MetricLimit;
|
|
12
|
+
descending?: AgentMail.Descending;
|
|
13
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { QueryEventsRequest } from "./QueryEventsRequest.js";
|
|
2
|
+
export type { QueryUsageRequest } from "./QueryUsageRequest.js";
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/** Type of metric event. */
|
|
2
2
|
export declare const MetricEventType: {
|
|
3
|
+
readonly MessageReceived: "message.received";
|
|
4
|
+
readonly MessageReceivedSpam: "message.received.spam";
|
|
5
|
+
readonly MessageReceivedBlocked: "message.received.blocked";
|
|
6
|
+
readonly MessageReceivedUnauthenticated: "message.received.unauthenticated";
|
|
3
7
|
readonly MessageSent: "message.sent";
|
|
4
8
|
readonly MessageDelivered: "message.delivered";
|
|
5
9
|
readonly MessageBounced: "message.bounced";
|
|
6
|
-
readonly MessageDelayed: "message.delayed";
|
|
7
|
-
readonly MessageRejected: "message.rejected";
|
|
8
10
|
readonly MessageComplained: "message.complained";
|
|
9
|
-
readonly
|
|
11
|
+
readonly MessageRejected: "message.rejected";
|
|
12
|
+
readonly DomainVerified: "domain.verified";
|
|
10
13
|
};
|
|
11
14
|
export type MetricEventType = (typeof MetricEventType)[keyof typeof MetricEventType];
|
|
@@ -4,11 +4,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.MetricEventType = void 0;
|
|
5
5
|
/** Type of metric event. */
|
|
6
6
|
exports.MetricEventType = {
|
|
7
|
+
MessageReceived: "message.received",
|
|
8
|
+
MessageReceivedSpam: "message.received.spam",
|
|
9
|
+
MessageReceivedBlocked: "message.received.blocked",
|
|
10
|
+
MessageReceivedUnauthenticated: "message.received.unauthenticated",
|
|
7
11
|
MessageSent: "message.sent",
|
|
8
12
|
MessageDelivered: "message.delivered",
|
|
9
13
|
MessageBounced: "message.bounced",
|
|
10
|
-
MessageDelayed: "message.delayed",
|
|
11
|
-
MessageRejected: "message.rejected",
|
|
12
14
|
MessageComplained: "message.complained",
|
|
13
|
-
|
|
15
|
+
MessageRejected: "message.rejected",
|
|
16
|
+
DomainVerified: "domain.verified",
|
|
14
17
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type of usage metric. Inbox-scoped queries carry `storage_bytes`,
|
|
3
|
+
* `message_count`, and `thread_count`; pod-scoped queries add `inbox_count`
|
|
4
|
+
* and `domain_count`; organization-scoped queries add `pod_count`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const UsageType: {
|
|
7
|
+
readonly StorageBytes: "storage_bytes";
|
|
8
|
+
readonly MessageCount: "message_count";
|
|
9
|
+
readonly ThreadCount: "thread_count";
|
|
10
|
+
readonly InboxCount: "inbox_count";
|
|
11
|
+
readonly PodCount: "pod_count";
|
|
12
|
+
readonly DomainCount: "domain_count";
|
|
13
|
+
};
|
|
14
|
+
export type UsageType = (typeof UsageType)[keyof typeof UsageType];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.UsageType = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Type of usage metric. Inbox-scoped queries carry `storage_bytes`,
|
|
7
|
+
* `message_count`, and `thread_count`; pod-scoped queries add `inbox_count`
|
|
8
|
+
* and `domain_count`; organization-scoped queries add `pod_count`.
|
|
9
|
+
*/
|
|
10
|
+
exports.UsageType = {
|
|
11
|
+
StorageBytes: "storage_bytes",
|
|
12
|
+
MessageCount: "message_count",
|
|
13
|
+
ThreadCount: "thread_count",
|
|
14
|
+
InboxCount: "inbox_count",
|
|
15
|
+
PodCount: "pod_count",
|
|
16
|
+
DomainCount: "domain_count",
|
|
17
|
+
};
|
|
@@ -6,4 +6,8 @@ export * from "./MetricEventTypes.js";
|
|
|
6
6
|
export * from "./MetricLimit.js";
|
|
7
7
|
export * from "./Period.js";
|
|
8
8
|
export * from "./QueryMetricsResponse.js";
|
|
9
|
+
export * from "./QueryUsageResponse.js";
|
|
9
10
|
export * from "./Start.js";
|
|
11
|
+
export * from "./UsagePoint.js";
|
|
12
|
+
export * from "./UsageType.js";
|
|
13
|
+
export * from "./UsageTypes.js";
|
|
@@ -22,4 +22,8 @@ __exportStar(require("./MetricEventTypes.js"), exports);
|
|
|
22
22
|
__exportStar(require("./MetricLimit.js"), exports);
|
|
23
23
|
__exportStar(require("./Period.js"), exports);
|
|
24
24
|
__exportStar(require("./QueryMetricsResponse.js"), exports);
|
|
25
|
+
__exportStar(require("./QueryUsageResponse.js"), exports);
|
|
25
26
|
__exportStar(require("./Start.js"), exports);
|
|
27
|
+
__exportStar(require("./UsagePoint.js"), exports);
|
|
28
|
+
__exportStar(require("./UsageType.js"), exports);
|
|
29
|
+
__exportStar(require("./UsageTypes.js"), exports);
|
|
@@ -9,6 +9,7 @@ import { InboxesClient } from "../resources/inboxes/client/Client.js";
|
|
|
9
9
|
import { ListsClient } from "../resources/lists/client/Client.js";
|
|
10
10
|
import { MetricsClient } from "../resources/metrics/client/Client.js";
|
|
11
11
|
import { ThreadsClient } from "../resources/threads/client/Client.js";
|
|
12
|
+
import { WebhooksClient } from "../resources/webhooks/client/Client.js";
|
|
12
13
|
export declare namespace PodsClient {
|
|
13
14
|
type Options = BaseClientOptions;
|
|
14
15
|
interface RequestOptions extends BaseRequestOptions {
|
|
@@ -19,6 +20,7 @@ export declare class PodsClient {
|
|
|
19
20
|
protected _inboxes: InboxesClient | undefined;
|
|
20
21
|
protected _threads: ThreadsClient | undefined;
|
|
21
22
|
protected _drafts: DraftsClient | undefined;
|
|
23
|
+
protected _webhooks: WebhooksClient | undefined;
|
|
22
24
|
protected _domains: DomainsClient | undefined;
|
|
23
25
|
protected _lists: ListsClient | undefined;
|
|
24
26
|
protected _metrics: MetricsClient | undefined;
|
|
@@ -27,6 +29,7 @@ export declare class PodsClient {
|
|
|
27
29
|
get inboxes(): InboxesClient;
|
|
28
30
|
get threads(): ThreadsClient;
|
|
29
31
|
get drafts(): DraftsClient;
|
|
32
|
+
get webhooks(): WebhooksClient;
|
|
30
33
|
get domains(): DomainsClient;
|
|
31
34
|
get lists(): ListsClient;
|
|
32
35
|
get metrics(): MetricsClient;
|
|
@@ -59,6 +59,7 @@ const Client_js_4 = require("../resources/inboxes/client/Client.js");
|
|
|
59
59
|
const Client_js_5 = require("../resources/lists/client/Client.js");
|
|
60
60
|
const Client_js_6 = require("../resources/metrics/client/Client.js");
|
|
61
61
|
const Client_js_7 = require("../resources/threads/client/Client.js");
|
|
62
|
+
const Client_js_8 = require("../resources/webhooks/client/Client.js");
|
|
62
63
|
class PodsClient {
|
|
63
64
|
constructor(options = {}) {
|
|
64
65
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
@@ -75,6 +76,10 @@ class PodsClient {
|
|
|
75
76
|
var _a;
|
|
76
77
|
return ((_a = this._drafts) !== null && _a !== void 0 ? _a : (this._drafts = new Client_js_3.DraftsClient(this._options)));
|
|
77
78
|
}
|
|
79
|
+
get webhooks() {
|
|
80
|
+
var _a;
|
|
81
|
+
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_8.WebhooksClient(this._options)));
|
|
82
|
+
}
|
|
78
83
|
get domains() {
|
|
79
84
|
var _a;
|
|
80
85
|
return ((_a = this._domains) !== null && _a !== void 0 ? _a : (this._domains = new Client_js_2.DomainsClient(this._options)));
|
|
@@ -12,3 +12,5 @@ export * from "./metrics/client/requests/index.js";
|
|
|
12
12
|
export * as metrics from "./metrics/index.js";
|
|
13
13
|
export * from "./threads/client/requests/index.js";
|
|
14
14
|
export * as threads from "./threads/index.js";
|
|
15
|
+
export * from "./webhooks/client/requests/index.js";
|
|
16
|
+
export * as webhooks from "./webhooks/index.js";
|
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.threads = exports.metrics = exports.lists = exports.inboxes = exports.drafts = exports.domains = exports.apiKeys = void 0;
|
|
39
|
+
exports.webhooks = exports.threads = exports.metrics = exports.lists = exports.inboxes = exports.drafts = exports.domains = exports.apiKeys = void 0;
|
|
40
40
|
__exportStar(require("./apiKeys/client/requests/index.js"), exports);
|
|
41
41
|
exports.apiKeys = __importStar(require("./apiKeys/index.js"));
|
|
42
42
|
__exportStar(require("./domains/client/requests/index.js"), exports);
|
|
@@ -51,3 +51,5 @@ __exportStar(require("./metrics/client/requests/index.js"), exports);
|
|
|
51
51
|
exports.metrics = __importStar(require("./metrics/index.js"));
|
|
52
52
|
__exportStar(require("./threads/client/requests/index.js"), exports);
|
|
53
53
|
exports.threads = __importStar(require("./threads/index.js"));
|
|
54
|
+
__exportStar(require("./webhooks/client/requests/index.js"), exports);
|
|
55
|
+
exports.webhooks = __importStar(require("./webhooks/index.js"));
|
|
@@ -11,20 +11,46 @@ export declare class MetricsClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<MetricsClient.Options>;
|
|
12
12
|
constructor(options?: MetricsClient.Options);
|
|
13
13
|
/**
|
|
14
|
+
* Counts of email events (sent, delivered, bounced, etc.) over time for
|
|
15
|
+
* the pod. Defaults to the last 24 hours; `start` must be within the last
|
|
16
|
+
* 90 days, and a future `end` is clamped to now. Omit `period` for
|
|
17
|
+
* individual event counts, or set it to sum counts into buckets of that
|
|
18
|
+
* many seconds.
|
|
19
|
+
*
|
|
14
20
|
* **CLI:**
|
|
15
21
|
* ```bash
|
|
16
22
|
* agentmail pods:metrics query --pod-id <pod_id>
|
|
17
23
|
* ```
|
|
18
24
|
*
|
|
19
25
|
* @param {AgentMail.pods.PodId} pod_id
|
|
20
|
-
* @param {AgentMail.pods.
|
|
26
|
+
* @param {AgentMail.pods.QueryEventsRequest} request
|
|
27
|
+
* @param {MetricsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @throws {@link AgentMail.ValidationError}
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* await client.pods.metrics.queryEvents("pod_id")
|
|
33
|
+
*/
|
|
34
|
+
queryEvents(pod_id: AgentMail.pods.PodId, request?: AgentMail.pods.QueryEventsRequest, requestOptions?: MetricsClient.RequestOptions): core.HttpResponsePromise<AgentMail.QueryMetricsResponse>;
|
|
35
|
+
private __queryEvents;
|
|
36
|
+
/**
|
|
37
|
+
* Cumulative usage series for the pod. Each point is the running total of
|
|
38
|
+
* the usage type at that timestamp, not the change within the bucket.
|
|
39
|
+
* Pod-scoped queries carry every usage type except `pod_count`; requested
|
|
40
|
+
* types that don't apply to the scope are ignored. Defaults to the last
|
|
41
|
+
* 24 hours; `start` must be within the last 90 days, and a future `end`
|
|
42
|
+
* is clamped to now. The range divided by `period` must not exceed 1000
|
|
43
|
+
* buckets.
|
|
44
|
+
*
|
|
45
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
46
|
+
* @param {AgentMail.pods.QueryUsageRequest} request
|
|
21
47
|
* @param {MetricsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
22
48
|
*
|
|
23
49
|
* @throws {@link AgentMail.ValidationError}
|
|
24
50
|
*
|
|
25
51
|
* @example
|
|
26
|
-
* await client.pods.metrics.
|
|
52
|
+
* await client.pods.metrics.queryUsage("pod_id")
|
|
27
53
|
*/
|
|
28
|
-
|
|
29
|
-
private
|
|
54
|
+
queryUsage(pod_id: AgentMail.pods.PodId, request?: AgentMail.pods.QueryUsageRequest, requestOptions?: MetricsClient.RequestOptions): core.HttpResponsePromise<AgentMail.QueryUsageResponse>;
|
|
55
|
+
private __queryUsage;
|
|
30
56
|
}
|
|
@@ -58,24 +58,30 @@ class MetricsClient {
|
|
|
58
58
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
+
* Counts of email events (sent, delivered, bounced, etc.) over time for
|
|
62
|
+
* the pod. Defaults to the last 24 hours; `start` must be within the last
|
|
63
|
+
* 90 days, and a future `end` is clamped to now. Omit `period` for
|
|
64
|
+
* individual event counts, or set it to sum counts into buckets of that
|
|
65
|
+
* many seconds.
|
|
66
|
+
*
|
|
61
67
|
* **CLI:**
|
|
62
68
|
* ```bash
|
|
63
69
|
* agentmail pods:metrics query --pod-id <pod_id>
|
|
64
70
|
* ```
|
|
65
71
|
*
|
|
66
72
|
* @param {AgentMail.pods.PodId} pod_id
|
|
67
|
-
* @param {AgentMail.pods.
|
|
73
|
+
* @param {AgentMail.pods.QueryEventsRequest} request
|
|
68
74
|
* @param {MetricsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
69
75
|
*
|
|
70
76
|
* @throws {@link AgentMail.ValidationError}
|
|
71
77
|
*
|
|
72
78
|
* @example
|
|
73
|
-
* await client.pods.metrics.
|
|
79
|
+
* await client.pods.metrics.queryEvents("pod_id")
|
|
74
80
|
*/
|
|
75
|
-
|
|
76
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
81
|
+
queryEvents(pod_id, request = {}, requestOptions) {
|
|
82
|
+
return core.HttpResponsePromise.fromPromise(this.__queryEvents(pod_id, request, requestOptions));
|
|
77
83
|
}
|
|
78
|
-
|
|
84
|
+
__queryEvents(pod_id_1) {
|
|
79
85
|
return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
|
|
80
86
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
81
87
|
const { eventTypes, start, end, period, limit, descending } = request;
|
|
@@ -100,7 +106,7 @@ class MetricsClient {
|
|
|
100
106
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
101
107
|
const _response = yield core.fetcher({
|
|
102
108
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
103
|
-
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/metrics`),
|
|
109
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/metrics/events`),
|
|
104
110
|
method: "GET",
|
|
105
111
|
headers: _headers,
|
|
106
112
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -140,7 +146,96 @@ class MetricsClient {
|
|
|
140
146
|
});
|
|
141
147
|
}
|
|
142
148
|
}
|
|
143
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/metrics");
|
|
149
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/metrics/events");
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Cumulative usage series for the pod. Each point is the running total of
|
|
154
|
+
* the usage type at that timestamp, not the change within the bucket.
|
|
155
|
+
* Pod-scoped queries carry every usage type except `pod_count`; requested
|
|
156
|
+
* types that don't apply to the scope are ignored. Defaults to the last
|
|
157
|
+
* 24 hours; `start` must be within the last 90 days, and a future `end`
|
|
158
|
+
* is clamped to now. The range divided by `period` must not exceed 1000
|
|
159
|
+
* buckets.
|
|
160
|
+
*
|
|
161
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
162
|
+
* @param {AgentMail.pods.QueryUsageRequest} request
|
|
163
|
+
* @param {MetricsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
164
|
+
*
|
|
165
|
+
* @throws {@link AgentMail.ValidationError}
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* await client.pods.metrics.queryUsage("pod_id")
|
|
169
|
+
*/
|
|
170
|
+
queryUsage(pod_id, request = {}, requestOptions) {
|
|
171
|
+
return core.HttpResponsePromise.fromPromise(this.__queryUsage(pod_id, request, requestOptions));
|
|
172
|
+
}
|
|
173
|
+
__queryUsage(pod_id_1) {
|
|
174
|
+
return __awaiter(this, arguments, void 0, function* (pod_id, request = {}, requestOptions) {
|
|
175
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
176
|
+
const { usageTypes, start, end, period, limit, descending } = request;
|
|
177
|
+
const _queryParams = {
|
|
178
|
+
usage_types: usageTypes != null
|
|
179
|
+
? (0, json_js_1.toJson)(serializers.UsageTypes.jsonOrThrow(usageTypes, {
|
|
180
|
+
unrecognizedObjectKeys: "strip",
|
|
181
|
+
omitUndefined: true,
|
|
182
|
+
}))
|
|
183
|
+
: undefined,
|
|
184
|
+
start: start != null
|
|
185
|
+
? serializers.Start.jsonOrThrow(start, { unrecognizedObjectKeys: "strip", omitUndefined: true })
|
|
186
|
+
: undefined,
|
|
187
|
+
end: end != null
|
|
188
|
+
? serializers.End.jsonOrThrow(end, { unrecognizedObjectKeys: "strip", omitUndefined: true })
|
|
189
|
+
: undefined,
|
|
190
|
+
period,
|
|
191
|
+
limit,
|
|
192
|
+
descending,
|
|
193
|
+
};
|
|
194
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
195
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
196
|
+
const _response = yield core.fetcher({
|
|
197
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
198
|
+
.http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/metrics/usage`),
|
|
199
|
+
method: "GET",
|
|
200
|
+
headers: _headers,
|
|
201
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
202
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
203
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
204
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
205
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
206
|
+
logging: this._options.logging,
|
|
207
|
+
});
|
|
208
|
+
if (_response.ok) {
|
|
209
|
+
return {
|
|
210
|
+
data: serializers.QueryUsageResponse.parseOrThrow(_response.body, {
|
|
211
|
+
unrecognizedObjectKeys: "passthrough",
|
|
212
|
+
allowUnrecognizedUnionMembers: true,
|
|
213
|
+
allowUnrecognizedEnumValues: true,
|
|
214
|
+
skipValidation: true,
|
|
215
|
+
breadcrumbsPrefix: ["response"],
|
|
216
|
+
}),
|
|
217
|
+
rawResponse: _response.rawResponse,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
if (_response.error.reason === "status-code") {
|
|
221
|
+
switch (_response.error.statusCode) {
|
|
222
|
+
case 400:
|
|
223
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
224
|
+
unrecognizedObjectKeys: "passthrough",
|
|
225
|
+
allowUnrecognizedUnionMembers: true,
|
|
226
|
+
allowUnrecognizedEnumValues: true,
|
|
227
|
+
skipValidation: true,
|
|
228
|
+
breadcrumbsPrefix: ["response"],
|
|
229
|
+
}), _response.rawResponse);
|
|
230
|
+
default:
|
|
231
|
+
throw new errors.AgentMailError({
|
|
232
|
+
statusCode: _response.error.statusCode,
|
|
233
|
+
body: _response.error.body,
|
|
234
|
+
rawResponse: _response.rawResponse,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/metrics/usage");
|
|
144
239
|
});
|
|
145
240
|
}
|
|
146
241
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {}
|
|
5
|
+
*/
|
|
6
|
+
export interface QueryUsageRequest {
|
|
7
|
+
usageTypes?: AgentMail.UsageTypes;
|
|
8
|
+
start?: AgentMail.Start;
|
|
9
|
+
end?: AgentMail.End;
|
|
10
|
+
period?: AgentMail.Period;
|
|
11
|
+
limit?: AgentMail.MetricLimit;
|
|
12
|
+
descending?: AgentMail.Descending;
|
|
13
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { QueryEventsRequest } from "./QueryEventsRequest.js";
|
|
2
|
+
export type { QueryUsageRequest } from "./QueryUsageRequest.js";
|