From 69203091bc5518c975802d4509433c062d425e05 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 3 Sep 2025 18:04:10 +0000 Subject: [PATCH] ## Typescript SDK Changes Detected: * `outpost.events.list()`: * `request` **Changed** * `response` **Changed** **Breaking** :warning: * `outpost.events.listByDestination()`: * `request` **Changed** * `response` **Changed** **Breaking** :warning: * `outpost.destinations.list()`: * `request.type` **Changed** * `response.[].[awsS3]` **Added** * `outpost.destinations.create()`: * `request.destinationCreate.[awsS3]` **Added** * `response.[aws_s3]` **Added** * `outpost.destinations.get()`: `response.[aws_s3]` **Added** * `outpost.destinations.update()`: * `request.destinationUpdate.[destinationUpdateAwss3]` **Added** * `response.[destination].[awsS3]` **Added** * `outpost.destinations.enable()`: `response.[aws_s3]` **Added** * `outpost.destinations.disable()`: `response.[aws_s3]` **Added** * `outpost.schemas.get()`: * `request.type` **Changed** * `outpost.schemas.getDestinationTypeJwt()`: * `request.type` **Changed** --- .speakeasy/workflow.lock | 7 +- sdks/outpost-typescript/.speakeasy/gen.lock | 45 +++- sdks/outpost-typescript/.speakeasy/gen.yaml | 3 +- sdks/outpost-typescript/README.md | 36 +++ sdks/outpost-typescript/RELEASES.md | 12 +- .../docs/models/components/awss3config.md | 24 ++ .../models/components/awss3credentials.md | 21 ++ .../docs/models/components/destination.md | 36 ++- .../models/components/destinationawss3.md | 39 ++++ .../models/components/destinationawss3type.md | 17 ++ .../models/components/destinationcreate.md | 22 ++ .../components/destinationcreateawss3.md | 35 +++ .../components/destinationcreateawss3type.md | 17 ++ .../models/components/destinationupdate.md | 20 ++ .../components/destinationupdateawss3.md | 31 +++ .../createtenantdestinationrequest.md | 6 +- .../getdestinationtypeschemarequest.md | 2 +- .../getdestinationtypeschematype.md | 4 +- .../gettenantdestinationtypeschemarequest.md | 2 +- .../gettenantdestinationtypeschematype.md | 4 +- .../listtenantdestinationstypeenum1.md | 4 +- .../listtenantdestinationstypeenum2.md | 4 +- .../listtenanteventsbydestinationrequest.md | 7 +- .../listtenanteventsbydestinationresponse.md | 37 +++ ...sttenanteventsbydestinationresponsebody.md | 25 ++ .../operations/listtenanteventsrequest.md | 15 +- .../operations/listtenanteventsresponse.md | 22 ++ .../listtenanteventsresponsebody.md | 25 ++ .../docs/models/operations/type.md | 2 +- .../docs/sdks/events/README.md | 20 +- .../examples/healthCheck.example.ts | 2 +- .../examples/package-lock.json | 6 +- sdks/outpost-typescript/jsr.json | 2 +- sdks/outpost-typescript/package-lock.json | 8 +- sdks/outpost-typescript/package.json | 6 +- .../src/funcs/eventsList.ts | 164 +++++++++---- .../src/funcs/eventsListByDestination.ts | 166 ++++++++++---- sdks/outpost-typescript/src/lib/config.ts | 6 +- sdks/outpost-typescript/src/lib/security.ts | 5 +- .../src/mcp-server/mcp-server.ts | 2 +- .../src/mcp-server/server.ts | 2 +- .../src/mcp-server/tools/eventsList.ts | 2 +- .../tools/eventsListByDestination.ts | 2 +- .../src/models/components/awss3config.ts | 97 ++++++++ .../src/models/components/awss3credentials.ts | 83 +++++++ .../src/models/components/destination.ts | 18 ++ .../src/models/components/destinationawss3.ts | 185 +++++++++++++++ .../models/components/destinationcreate.ts | 18 ++ .../components/destinationcreateawss3.ts | 144 ++++++++++++ .../models/components/destinationupdate.ts | 14 +- .../components/destinationupdateawss3.ts | 95 ++++++++ .../src/models/components/index.ts | 5 + .../operations/getdestinationtypeschema.ts | 1 + .../gettenantdestinationtypeschema.ts | 1 + .../operations/listtenantdestinations.ts | 2 + .../src/models/operations/listtenantevents.ts | 198 ++++++++++++++++ .../listtenanteventsbydestination.ts | 215 ++++++++++++++++++ sdks/outpost-typescript/src/sdk/events.ts | 16 +- 58 files changed, 1849 insertions(+), 160 deletions(-) create mode 100644 sdks/outpost-typescript/docs/models/components/awss3config.md create mode 100644 sdks/outpost-typescript/docs/models/components/awss3credentials.md create mode 100644 sdks/outpost-typescript/docs/models/components/destinationawss3.md create mode 100644 sdks/outpost-typescript/docs/models/components/destinationawss3type.md create mode 100644 sdks/outpost-typescript/docs/models/components/destinationcreateawss3.md create mode 100644 sdks/outpost-typescript/docs/models/components/destinationcreateawss3type.md create mode 100644 sdks/outpost-typescript/docs/models/components/destinationupdateawss3.md create mode 100644 sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationresponse.md create mode 100644 sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationresponsebody.md create mode 100644 sdks/outpost-typescript/docs/models/operations/listtenanteventsresponse.md create mode 100644 sdks/outpost-typescript/docs/models/operations/listtenanteventsresponsebody.md create mode 100644 sdks/outpost-typescript/src/models/components/awss3config.ts create mode 100644 sdks/outpost-typescript/src/models/components/awss3credentials.ts create mode 100644 sdks/outpost-typescript/src/models/components/destinationawss3.ts create mode 100644 sdks/outpost-typescript/src/models/components/destinationcreateawss3.ts create mode 100644 sdks/outpost-typescript/src/models/components/destinationupdateawss3.ts diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 51261738..8aa3bbe5 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -6,6 +6,7 @@ sources: sourceBlobDigest: sha256:c405cfc4f2de092323a9dd68a09f7c08b563d363bce7463fc8b426d10acacf99 tags: - latest + - speakeasy-sdk-regen-1756922597 - 0.0.1 targets: outpost-go: @@ -25,10 +26,10 @@ targets: outpost-ts: source: Outpost API sourceNamespace: outpost-api - sourceRevisionDigest: sha256:837897b6e2774d7ba547d9616639367bfce651d53d84190c3ee0cd32cee7e8b1 - sourceBlobDigest: sha256:3b1cd63370e0cf368a2049eaa26c9f94cd94a929de42592f8488adb5a6a3f182 + sourceRevisionDigest: sha256:e09cf02de047cf6d007545274c477e2a90c561074b9de170d844d9ab9ffbbca6 + sourceBlobDigest: sha256:c405cfc4f2de092323a9dd68a09f7c08b563d363bce7463fc8b426d10acacf99 codeSamplesNamespace: outpost-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:73273078c2416ff9b541f2cc8e95cf2a8254fc9ae40d2788122ca4f3e7e74416 + codeSamplesRevisionDigest: sha256:b1155400f3addb67547999bf99f4eb4f009470ab62329d57488f78843ff6f9b6 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/sdks/outpost-typescript/.speakeasy/gen.lock b/sdks/outpost-typescript/.speakeasy/gen.lock index 82ecf926..01f8c839 100644 --- a/sdks/outpost-typescript/.speakeasy/gen.lock +++ b/sdks/outpost-typescript/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: edb58086-83b9-45a3-9095-52bf57a11009 management: - docChecksum: 3d3f028a2fdd56804d9ae8a2d95a414b + docChecksum: f88900fa0dfdee97044181ff0fbb5027 docVersion: 0.0.1 - speakeasyVersion: 1.593.0 - generationVersion: 2.669.0 - releaseVersion: 0.3.0 - configChecksum: f5c74e03d72ead5a348c5b677ad4b9cc + speakeasyVersion: 1.609.0 + generationVersion: 2.692.0 + releaseVersion: 0.4.0 + configChecksum: 261fce5d39cf94a38cacbbd5e21d37f2 repoURL: https://github.com/hookdeck/outpost.git repoSubDirectory: sdks/outpost-typescript installationURL: https://gitpkg.now.sh/hookdeck/outpost/sdks/outpost-typescript @@ -15,7 +15,8 @@ features: typescript: additionalDependencies: 0.1.0 additionalProperties: 0.1.1 - core: 3.21.17 + constsAndDefaults: 0.1.12 + core: 3.21.22 defaultEnabledRetries: 0.1.0 enumUnions: 0.1.0 envVarSecurityUsage: 0.1.2 @@ -26,6 +27,7 @@ features: mcpServer: 0.9.3 nameOverrides: 2.81.2 nullables: 0.1.1 + pagination: 2.83.0 responseFormat: 0.2.3 retries: 2.83.0 sdkHooks: 0.3.0 @@ -39,6 +41,8 @@ generatedFiles: - docs/lib/utils/retryconfig.md - docs/models/components/awskinesisconfig.md - docs/models/components/awskinesiscredentials.md + - docs/models/components/awss3config.md + - docs/models/components/awss3credentials.md - docs/models/components/awssqsconfig.md - docs/models/components/awssqscredentials.md - docs/models/components/azureservicebusconfig.md @@ -47,6 +51,8 @@ generatedFiles: - docs/models/components/destination.md - docs/models/components/destinationawskinesis.md - docs/models/components/destinationawskinesistype.md + - docs/models/components/destinationawss3.md + - docs/models/components/destinationawss3type.md - docs/models/components/destinationawssqs.md - docs/models/components/destinationawssqstype.md - docs/models/components/destinationazureservicebus.md @@ -54,6 +60,8 @@ generatedFiles: - docs/models/components/destinationcreate.md - docs/models/components/destinationcreateawskinesis.md - docs/models/components/destinationcreateawskinesistype.md + - docs/models/components/destinationcreateawss3.md + - docs/models/components/destinationcreateawss3type.md - docs/models/components/destinationcreateawssqs.md - docs/models/components/destinationcreateawssqstype.md - docs/models/components/destinationcreateazureservicebus.md @@ -73,6 +81,7 @@ generatedFiles: - docs/models/components/destinationtypeschema.md - docs/models/components/destinationupdate.md - docs/models/components/destinationupdateawskinesis.md + - docs/models/components/destinationupdateawss3.md - docs/models/components/destinationupdateawssqs.md - docs/models/components/destinationupdatehookdeck.md - docs/models/components/destinationupdaterabbitmq.md @@ -141,9 +150,13 @@ generatedFiles: - docs/models/operations/listtenanteventdeliveriesrequest.md - docs/models/operations/listtenanteventsbydestinationglobals.md - docs/models/operations/listtenanteventsbydestinationrequest.md + - docs/models/operations/listtenanteventsbydestinationresponse.md + - docs/models/operations/listtenanteventsbydestinationresponsebody.md - docs/models/operations/listtenanteventsbydestinationstatus.md - docs/models/operations/listtenanteventsglobals.md - docs/models/operations/listtenanteventsrequest.md + - docs/models/operations/listtenanteventsresponse.md + - docs/models/operations/listtenanteventsresponsebody.md - docs/models/operations/listtenanteventsstatus.md - docs/models/operations/listtenanttopicsglobals.md - docs/models/operations/listtenanttopicsrequest.md @@ -259,6 +272,8 @@ generatedFiles: - src/mcp-server/tools/topicsListJwt.ts - src/models/components/awskinesisconfig.ts - src/models/components/awskinesiscredentials.ts + - src/models/components/awss3config.ts + - src/models/components/awss3credentials.ts - src/models/components/awssqsconfig.ts - src/models/components/awssqscredentials.ts - src/models/components/azureservicebusconfig.ts @@ -266,10 +281,12 @@ generatedFiles: - src/models/components/deliveryattempt.ts - src/models/components/destination.ts - src/models/components/destinationawskinesis.ts + - src/models/components/destinationawss3.ts - src/models/components/destinationawssqs.ts - src/models/components/destinationazureservicebus.ts - src/models/components/destinationcreate.ts - src/models/components/destinationcreateawskinesis.ts + - src/models/components/destinationcreateawss3.ts - src/models/components/destinationcreateawssqs.ts - src/models/components/destinationcreateazureservicebus.ts - src/models/components/destinationcreatehookdeck.ts @@ -281,6 +298,7 @@ generatedFiles: - src/models/components/destinationtypeschema.ts - src/models/components/destinationupdate.ts - src/models/components/destinationupdateawskinesis.ts + - src/models/components/destinationupdateawss3.ts - src/models/components/destinationupdateawssqs.ts - src/models/components/destinationupdatehookdeck.ts - src/models/components/destinationupdaterabbitmq.ts @@ -431,7 +449,7 @@ examples: query: {} responses: "200": - application/json: [{"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}}, {"id": "des_sqs_456", "type": "aws_sqs", "topics": ["*"], "disabled_at": "2024-03-01T12:00:00Z", "created_at": "2024-02-20T11:30:00Z", "config": {"endpoint": "https://sqs.us-west-2.amazonaws.com", "queue_url": "https://sqs.us-west-2.amazonaws.com/123456789012/my-app-queue"}, "credentials": {"key": "AKIAIOSFODNN7EXAMPLE", "secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}] + application/json: [{"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}}, {"id": "des_sqs_456", "type": "aws_sqs", "topics": ["*"], "disabled_at": "2024-03-01T12:00:00Z", "created_at": "2024-02-20T11:30:00Z", "config": {"endpoint": "https://sqs.us-west-2.amazonaws.com", "queue_url": "https://sqs.us-west-2.amazonaws.com/123456789012/my-app-queue"}, "credentials": {"key": "AKIAIOSFODNN7EXAMPLE", "secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}, {"id": "des_s3_789", "type": "aws_s3", "topics": ["*"], "disabled_at": null, "created_at": "2024-03-20T12:00:00Z", "config": {"bucket": "my-bucket", "region": "us-east-1"}, "credentials": {"key": "AKIAIOSFODNN7EXAMPLE", "secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}] createTenantDestination: WebhookCreatedExample: parameters: @@ -523,7 +541,7 @@ examples: tenant_id: "" responses: "200": - application/json: [{"type": "webhook", "label": "Webhook", "description": "Send event via an HTTP POST request to a URL", "icon": "", "instructions": "Enter the URL...", "config_fields": [{"type": "text", "label": "URL", "description": "The URL to send the webhook to.", "required": true, "pattern": "^https?://.*"}], "credential_fields": [{"type": "text", "label": "Secret", "description": "Optional signing secret.", "required": false, "sensitive": true}]}, {"type": "aws_sqs", "label": "AWS SQS", "description": "Send event to an AWS SQS queue", "icon": "", "instructions": "Enter Queue URL...", "config_fields": [{"type": "text", "label": "Queue URL", "description": "The URL of the SQS queue.", "required": true}, {"type": "text", "label": "Endpoint", "description": "Optional custom AWS endpoint URL.", "required": false}], "credential_fields": [{"type": "text", "label": "Key", "description": "AWS Access Key ID.", "required": true, "sensitive": true}, {"type": "text", "label": "Secret", "description": "AWS Secret Access Key.", "required": true, "sensitive": true}, {"type": "text", "label": "Session", "description": "Optional AWS Session Token.", "required": false, "sensitive": true}]}] + application/json: [{"type": "webhook", "label": "Webhook", "description": "Send event via an HTTP POST request to a URL", "icon": "", "instructions": "Enter the URL...", "config_fields": [{"type": "text", "label": "URL", "description": "The URL to send the webhook to.", "required": true, "pattern": "^https?://.*"}], "credential_fields": [{"type": "text", "label": "Secret", "description": "Optional signing secret.", "required": false, "sensitive": true}]}, {"type": "aws_sqs", "label": "AWS SQS", "description": "Send event to an AWS SQS queue", "icon": "", "instructions": "Enter Queue URL...", "config_fields": [{"type": "text", "label": "Queue URL", "description": "The URL of the SQS queue.", "required": true}, {"type": "text", "label": "Endpoint", "description": "Optional custom AWS endpoint URL.", "required": false}], "credential_fields": [{"type": "text", "label": "Key", "description": "AWS Access Key ID.", "required": true, "sensitive": true}, {"type": "text", "label": "Secret", "description": "AWS Secret Access Key.", "required": true, "sensitive": true}, {"type": "text", "label": "Session", "description": "Optional AWS Session Token.", "required": false, "sensitive": true}]}, {"type": "aws_s3", "label": "AWS S3", "description": "Store events in an Amazon S3 bucket", "icon": "", "instructions": "Enter bucket and region...", "config_fields": [{"type": "text", "label": "Bucket Name", "description": "The name of the S3 bucket.", "required": true}, {"type": "text", "label": "AWS Region", "description": "The AWS region where the bucket is located.", "required": true}], "credential_fields": [{"type": "text", "label": "Key", "description": "AWS Access Key ID.", "required": true, "sensitive": true}, {"type": "text", "label": "Secret", "description": "AWS Secret Access Key.", "required": true, "sensitive": true}]}, {"type": "aws_s3", "label": "AWS S3", "description": "Store events in an Amazon S3 bucket", "icon": "", "instructions": "Enter bucket and region...", "config_fields": [{"type": "text", "label": "Bucket Name", "description": "The name of the S3 bucket.", "required": true}, {"type": "text", "label": "AWS Region", "description": "The AWS region where the bucket is located.", "required": true}], "credential_fields": [{"type": "text", "label": "Key", "description": "AWS Access Key ID.", "required": true, "sensitive": true}, {"type": "text", "label": "Secret", "description": "AWS Secret Access Key.", "required": true, "sensitive": true}]}] getTenantDestinationTypeSchema: WebhookSchemaExample: parameters: @@ -564,10 +582,11 @@ examples: parameters: path: tenant_id: "" - query: {} + query: + limit: 100 responses: "200": - application/json: [{"id": "evt_123", "destination_id": "des_456", "topic": "user.created", "time": "2024-01-01T00:00:00Z", "successful_at": "2024-01-01T00:00:05Z", "metadata": {"source": "crm"}, "data": {"user_id": "userid", "status": "active"}}, {"id": "evt_789", "destination_id": "des_456", "topic": "order.shipped", "time": "2024-01-02T10:00:00Z", "successful_at": null, "metadata": {"source": "oms"}, "data": {"order_id": "orderid", "tracking": "1Z..."}}] + application/json: {"count": 2, "data": [{"id": "evt_123", "destination_id": "des_456", "topic": "user.created", "time": "2024-01-01T00:00:00Z", "successful_at": "2024-01-01T00:00:05Z", "metadata": {"source": "crm"}, "data": {"user_id": "userid", "status": "active"}}, {"id": "evt_789", "destination_id": "des_456", "topic": "order.shipped", "time": "2024-01-02T10:00:00Z", "successful_at": null, "metadata": {"source": "oms"}, "data": {"order_id": "orderid", "tracking": "1Z..."}}], "next": "", "prev": ""} getTenantEvent: EventExample: parameters: @@ -592,10 +611,11 @@ examples: path: tenant_id: "" destination_id: "" - query: {} + query: + limit: 100 responses: "200": - application/json: [{"id": "evt_123", "destination_id": "des_456", "topic": "user.created", "time": "2024-01-01T00:00:00Z", "successful_at": "2024-01-01T00:00:05Z", "metadata": {"source": "crm"}, "data": {"user_id": "userid", "status": "active"}}, {"id": "evt_789", "destination_id": "des_456", "topic": "order.shipped", "time": "2024-01-02T10:00:00Z", "successful_at": null, "metadata": {"source": "oms"}, "data": {"order_id": "orderid", "tracking": "1Z..."}}] + application/json: {"count": 2, "data": [{"id": "evt_123", "destination_id": "des_456", "topic": "user.created", "time": "2024-01-01T00:00:00Z", "successful_at": "2024-01-01T00:00:05Z", "metadata": {"source": "crm"}, "data": {"user_id": "userid", "status": "active"}}, {"id": "evt_789", "destination_id": "des_456", "topic": "order.shipped", "time": "2024-01-02T10:00:00Z", "successful_at": null, "metadata": {"source": "oms"}, "data": {"order_id": "orderid", "tracking": "1Z..."}}], "next": "", "prev": ""} getTenantEventByDestination: EventExample: parameters: @@ -634,3 +654,4 @@ examples: application/json: {} examplesVersion: 1.0.2 generatedTests: {} +releaseNotes: "## Typescript SDK Changes Detected:\n* `outpost.events.list()`: \n * `request` **Changed**\n * `response` **Changed** **Breaking** :warning:\n* `outpost.events.listByDestination()`: \n * `request` **Changed**\n * `response` **Changed** **Breaking** :warning:\n* `outpost.destinations.list()`: \n * `request.type` **Changed**\n * `response.[].[awsS3]` **Added**\n* `outpost.destinations.create()`: \n * `request.destinationCreate.[awsS3]` **Added**\n * `response.[aws_s3]` **Added**\n* `outpost.destinations.get()`: `response.[aws_s3]` **Added**\n* `outpost.destinations.update()`: \n * `request.destinationUpdate.[destinationUpdateAwss3]` **Added**\n * `response.[destination].[awsS3]` **Added**\n* `outpost.destinations.enable()`: `response.[aws_s3]` **Added**\n* `outpost.destinations.disable()`: `response.[aws_s3]` **Added**\n* `outpost.schemas.get()`: \n * `request.type` **Changed**\n* `outpost.schemas.getDestinationTypeJwt()`: \n * `request.type` **Changed**\n" diff --git a/sdks/outpost-typescript/.speakeasy/gen.yaml b/sdks/outpost-typescript/.speakeasy/gen.yaml index 97568d64..7fc10973 100644 --- a/sdks/outpost-typescript/.speakeasy/gen.yaml +++ b/sdks/outpost-typescript/.speakeasy/gen.yaml @@ -21,7 +21,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false typescript: - version: 0.3.0 + version: 0.4.0 additionalDependencies: dependencies: {} devDependencies: {} @@ -56,4 +56,5 @@ typescript: packageName: '@hookdeck/outpost-sdk' responseFormat: flat templateVersion: v2 + usageSDKInitImports: [] useIndexModules: true diff --git a/sdks/outpost-typescript/README.md b/sdks/outpost-typescript/README.md index 8a693dbe..0e0bdfc5 100644 --- a/sdks/outpost-typescript/README.md +++ b/sdks/outpost-typescript/README.md @@ -26,6 +26,7 @@ Outpost API: The Outpost API is a REST-based JSON API for managing tenants, dest * [Available Resources and Operations](#available-resources-and-operations) * [Standalone functions](#standalone-functions) * [Global Parameters](#global-parameters) + * [Pagination](#pagination) * [Retries](#retries) * [Error Handling](#error-handling) * [Server Selection](#server-selection) @@ -362,6 +363,41 @@ run(); ``` + +## Pagination + +Some of the endpoints in this SDK support pagination. To use pagination, you +make your SDK calls as usual, but the returned response object will also be an +async iterable that can be consumed using the [`for await...of`][for-await-of] +syntax. + +[for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of + +Here's an example of one such pagination call: + +```typescript +import { Outpost } from "@hookdeck/outpost-sdk"; + +const outpost = new Outpost({ + tenantId: "", + security: { + adminApiKey: "", + }, +}); + +async function run() { + const result = await outpost.events.list({}); + + for await (const page of result) { + console.log(page); + } +} + +run(); + +``` + + ## Retries diff --git a/sdks/outpost-typescript/RELEASES.md b/sdks/outpost-typescript/RELEASES.md index d3ebe5dd..e567096e 100644 --- a/sdks/outpost-typescript/RELEASES.md +++ b/sdks/outpost-typescript/RELEASES.md @@ -28,4 +28,14 @@ Based on: ### Generated - [typescript v0.3.0] sdks/outpost-typescript ### Releases -- [NPM v0.3.0] https://www.npmjs.com/package/@hookdeck/outpost-sdk/v/0.3.0 - sdks/outpost-typescript \ No newline at end of file +- [NPM v0.3.0] https://www.npmjs.com/package/@hookdeck/outpost-sdk/v/0.3.0 - sdks/outpost-typescript + +## 2025-09-03 18:02:59 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.609.0 (2.692.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.4.0] sdks/outpost-typescript +### Releases +- [NPM v0.4.0] https://www.npmjs.com/package/@hookdeck/outpost-sdk/v/0.4.0 - sdks/outpost-typescript \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/components/awss3config.md b/sdks/outpost-typescript/docs/models/components/awss3config.md new file mode 100644 index 00000000..87d40525 --- /dev/null +++ b/sdks/outpost-typescript/docs/models/components/awss3config.md @@ -0,0 +1,24 @@ +# Awss3Config + +## Example Usage + +```typescript +import { Awss3Config } from "@hookdeck/outpost-sdk/models/components"; + +let value: Awss3Config = { + bucket: "my-bucket", + region: "us-east-1", + keyTemplate: + "join('/', [time.year, time.month, time.day, metadata.`\"event-id\"`, '.json'])", + storageClass: "STANDARD", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `bucket` | *string* | :heavy_check_mark: | The name of your AWS S3 bucket. | my-bucket | +| `region` | *string* | :heavy_check_mark: | The AWS region where your bucket is located. | us-east-1 | +| `keyTemplate` | *string* | :heavy_minus_sign: | JMESPath expression for generating S3 object keys. Default is join('', [time.rfc3339_nano, '_', metadata."event-id", '.json']). | join('/', [time.year, time.month, time.day, metadata.`"event-id"`, '.json']) | +| `storageClass` | *string* | :heavy_minus_sign: | The storage class for the S3 objects (e.g., STANDARD, INTELLIGENT_TIERING, GLACIER, etc.). Defaults to "STANDARD". | STANDARD | \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/components/awss3credentials.md b/sdks/outpost-typescript/docs/models/components/awss3credentials.md new file mode 100644 index 00000000..eba880e9 --- /dev/null +++ b/sdks/outpost-typescript/docs/models/components/awss3credentials.md @@ -0,0 +1,21 @@ +# Awss3Credentials + +## Example Usage + +```typescript +import { Awss3Credentials } from "@hookdeck/outpost-sdk/models/components"; + +let value: Awss3Credentials = { + key: "AKIAIOSFODNN7EXAMPLE", + secret: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + session: "AQoDYXdzEPT//////////wEXAMPLE...", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `key` | *string* | :heavy_check_mark: | AWS Access Key ID. | AKIAIOSFODNN7EXAMPLE | +| `secret` | *string* | :heavy_check_mark: | AWS Secret Access Key. | wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY | +| `session` | *string* | :heavy_minus_sign: | Optional AWS Session Token (for temporary credentials). | AQoDYXdzEPT//////////wEXAMPLE... | \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/components/destination.md b/sdks/outpost-typescript/docs/models/components/destination.md index 11c6b118..f93fda05 100644 --- a/sdks/outpost-typescript/docs/models/components/destination.md +++ b/sdks/outpost-typescript/docs/models/components/destination.md @@ -71,6 +71,24 @@ const value: components.DestinationRabbitMQ = { }; ``` +### `components.DestinationHookdeck` + +```typescript +const value: components.DestinationHookdeck = { + id: "des_hkd_abc", + type: "hookdeck", + topics: [ + "*", + ], + disabledAt: null, + createdAt: new Date("2024-04-01T10:00:00Z"), + config: {}, + credentials: { + token: "hd_token_...", + }, +}; +``` + ### `components.DestinationAWSKinesis` ```typescript @@ -115,20 +133,24 @@ const value: components.DestinationAzureServiceBus = { }; ``` -### `components.DestinationHookdeck` +### `components.DestinationAwss3` ```typescript -const value: components.DestinationHookdeck = { - id: "des_hkd_abc", - type: "hookdeck", +const value: components.DestinationAwss3 = { + id: "des_s3_789", + type: "aws_s3", topics: [ "*", ], disabledAt: null, - createdAt: new Date("2024-04-01T10:00:00Z"), - config: {}, + createdAt: new Date("2024-03-20T12:00:00Z"), + config: { + bucket: "my-bucket", + region: "us-east-1", + }, credentials: { - token: "hd_token_...", + key: "AKIAIOSFODNN7EXAMPLE", + secret: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", }, }; ``` diff --git a/sdks/outpost-typescript/docs/models/components/destinationawss3.md b/sdks/outpost-typescript/docs/models/components/destinationawss3.md new file mode 100644 index 00000000..e4966783 --- /dev/null +++ b/sdks/outpost-typescript/docs/models/components/destinationawss3.md @@ -0,0 +1,39 @@ +# DestinationAwss3 + +## Example Usage + +```typescript +import { DestinationAwss3 } from "@hookdeck/outpost-sdk/models/components"; + +let value: DestinationAwss3 = { + id: "des_s3_789", + type: "aws_s3", + topics: [ + "*", + ], + disabledAt: null, + createdAt: new Date("2024-03-20T12:00:00Z"), + config: { + bucket: "my-bucket", + region: "us-east-1", + }, + credentials: { + key: "AKIAIOSFODNN7EXAMPLE", + secret: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | +| `type` | [components.DestinationAwss3Type](../../models/components/destinationawss3type.md) | :heavy_check_mark: | Type of the destination. | aws_s3 | +| `topics` | *components.Topics* | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `disabledAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | +| `config` | [components.Awss3Config](../../models/components/awss3config.md) | :heavy_check_mark: | N/A | | +| `credentials` | [components.Awss3Credentials](../../models/components/awss3credentials.md) | :heavy_check_mark: | N/A | | +| `target` | *string* | :heavy_minus_sign: | A human-readable representation of the destination target (bucket and region). Read-only. | my-bucket in us-east-1 | +| `targetUrl` | *string* | :heavy_minus_sign: | A URL link to the destination target (AWS Console link to the bucket). Read-only. | | \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/components/destinationawss3type.md b/sdks/outpost-typescript/docs/models/components/destinationawss3type.md new file mode 100644 index 00000000..3091d1cd --- /dev/null +++ b/sdks/outpost-typescript/docs/models/components/destinationawss3type.md @@ -0,0 +1,17 @@ +# DestinationAwss3Type + +Type of the destination. + +## Example Usage + +```typescript +import { DestinationAwss3Type } from "@hookdeck/outpost-sdk/models/components"; + +let value: DestinationAwss3Type = "aws_s3"; +``` + +## Values + +```typescript +"aws_s3" +``` \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/components/destinationcreate.md b/sdks/outpost-typescript/docs/models/components/destinationcreate.md index 6dddc2ec..03a498c7 100644 --- a/sdks/outpost-typescript/docs/models/components/destinationcreate.md +++ b/sdks/outpost-typescript/docs/models/components/destinationcreate.md @@ -79,6 +79,28 @@ const value: components.DestinationCreateAzureServiceBus = { }; ``` +### `components.DestinationCreateAwss3` + +```typescript +const value: components.DestinationCreateAwss3 = { + id: "user-provided-id", + type: "aws_s3", + topics: "*", + config: { + bucket: "my-bucket", + region: "us-east-1", + keyTemplate: + "join('/', [time.year, time.month, time.day, metadata.`\"event-id\"`, '.json'])", + storageClass: "STANDARD", + }, + credentials: { + key: "AKIAIOSFODNN7EXAMPLE", + secret: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + session: "AQoDYXdzEPT//////////wEXAMPLE...", + }, +}; +``` + ### `components.DestinationCreateWebhook` ```typescript diff --git a/sdks/outpost-typescript/docs/models/components/destinationcreateawss3.md b/sdks/outpost-typescript/docs/models/components/destinationcreateawss3.md new file mode 100644 index 00000000..b06a12e2 --- /dev/null +++ b/sdks/outpost-typescript/docs/models/components/destinationcreateawss3.md @@ -0,0 +1,35 @@ +# DestinationCreateAwss3 + +## Example Usage + +```typescript +import { DestinationCreateAwss3 } from "@hookdeck/outpost-sdk/models/components"; + +let value: DestinationCreateAwss3 = { + id: "user-provided-id", + type: "aws_s3", + topics: "*", + config: { + bucket: "my-bucket", + region: "us-east-1", + keyTemplate: + "join('/', [time.year, time.month, time.day, metadata.`\"event-id\"`, '.json'])", + storageClass: "STANDARD", + }, + credentials: { + key: "AKIAIOSFODNN7EXAMPLE", + secret: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + session: "AQoDYXdzEPT//////////wEXAMPLE...", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | +| `type` | [components.DestinationCreateAwss3Type](../../models/components/destinationcreateawss3type.md) | :heavy_check_mark: | Type of the destination. Must be 'aws_s3'. | | +| `topics` | *components.Topics* | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `config` | [components.Awss3Config](../../models/components/awss3config.md) | :heavy_check_mark: | N/A | | +| `credentials` | [components.Awss3Credentials](../../models/components/awss3credentials.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/components/destinationcreateawss3type.md b/sdks/outpost-typescript/docs/models/components/destinationcreateawss3type.md new file mode 100644 index 00000000..bd7b90bc --- /dev/null +++ b/sdks/outpost-typescript/docs/models/components/destinationcreateawss3type.md @@ -0,0 +1,17 @@ +# DestinationCreateAwss3Type + +Type of the destination. Must be 'aws_s3'. + +## Example Usage + +```typescript +import { DestinationCreateAwss3Type } from "@hookdeck/outpost-sdk/models/components"; + +let value: DestinationCreateAwss3Type = "aws_s3"; +``` + +## Values + +```typescript +"aws_s3" +``` \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/components/destinationupdate.md b/sdks/outpost-typescript/docs/models/components/destinationupdate.md index 4364b1f5..bbdd0d69 100644 --- a/sdks/outpost-typescript/docs/models/components/destinationupdate.md +++ b/sdks/outpost-typescript/docs/models/components/destinationupdate.md @@ -78,3 +78,23 @@ const value: components.DestinationUpdateAWSKinesis = { }; ``` +### `components.DestinationUpdateAwss3` + +```typescript +const value: components.DestinationUpdateAwss3 = { + topics: "*", + config: { + bucket: "my-bucket", + region: "us-east-1", + keyTemplate: + "join('/', [time.year, time.month, time.day, metadata.`\"event-id\"`, '.json'])", + storageClass: "STANDARD", + }, + credentials: { + key: "AKIAIOSFODNN7EXAMPLE", + secret: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + session: "AQoDYXdzEPT//////////wEXAMPLE...", + }, +}; +``` + diff --git a/sdks/outpost-typescript/docs/models/components/destinationupdateawss3.md b/sdks/outpost-typescript/docs/models/components/destinationupdateawss3.md new file mode 100644 index 00000000..2f8cc206 --- /dev/null +++ b/sdks/outpost-typescript/docs/models/components/destinationupdateawss3.md @@ -0,0 +1,31 @@ +# DestinationUpdateAwss3 + +## Example Usage + +```typescript +import { DestinationUpdateAwss3 } from "@hookdeck/outpost-sdk/models/components"; + +let value: DestinationUpdateAwss3 = { + topics: "*", + config: { + bucket: "my-bucket", + region: "us-east-1", + keyTemplate: + "join('/', [time.year, time.month, time.day, metadata.`\"event-id\"`, '.json'])", + storageClass: "STANDARD", + }, + credentials: { + key: "AKIAIOSFODNN7EXAMPLE", + secret: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + session: "AQoDYXdzEPT//////////wEXAMPLE...", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `topics` | *components.Topics* | :heavy_minus_sign: | "*" or an array of enabled topics. | * | +| `config` | [components.Awss3Config](../../models/components/awss3config.md) | :heavy_minus_sign: | N/A | | +| `credentials` | [components.Awss3Credentials](../../models/components/awss3credentials.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/operations/createtenantdestinationrequest.md b/sdks/outpost-typescript/docs/models/operations/createtenantdestinationrequest.md index a1d36e29..f0de59d1 100644 --- a/sdks/outpost-typescript/docs/models/operations/createtenantdestinationrequest.md +++ b/sdks/outpost-typescript/docs/models/operations/createtenantdestinationrequest.md @@ -7,10 +7,10 @@ import { CreateTenantDestinationRequest } from "@hookdeck/outpost-sdk/models/ope let value: CreateTenantDestinationRequest = { destinationCreate: { - type: "hookdeck", + type: "webhook", topics: "*", - credentials: { - token: "hd_token_...", + config: { + url: "https://example.com/webhooks/user", }, }, }; diff --git a/sdks/outpost-typescript/docs/models/operations/getdestinationtypeschemarequest.md b/sdks/outpost-typescript/docs/models/operations/getdestinationtypeschemarequest.md index 7058c2a4..736aded5 100644 --- a/sdks/outpost-typescript/docs/models/operations/getdestinationtypeschemarequest.md +++ b/sdks/outpost-typescript/docs/models/operations/getdestinationtypeschemarequest.md @@ -6,7 +6,7 @@ import { GetDestinationTypeSchemaRequest } from "@hookdeck/outpost-sdk/models/operations"; let value: GetDestinationTypeSchemaRequest = { - type: "aws_kinesis", + type: "aws_s3", }; ``` diff --git a/sdks/outpost-typescript/docs/models/operations/getdestinationtypeschematype.md b/sdks/outpost-typescript/docs/models/operations/getdestinationtypeschematype.md index a32a7530..95ce98cd 100644 --- a/sdks/outpost-typescript/docs/models/operations/getdestinationtypeschematype.md +++ b/sdks/outpost-typescript/docs/models/operations/getdestinationtypeschematype.md @@ -7,11 +7,11 @@ The type of the destination. ```typescript import { GetDestinationTypeSchemaType } from "@hookdeck/outpost-sdk/models/operations"; -let value: GetDestinationTypeSchemaType = "hookdeck"; +let value: GetDestinationTypeSchemaType = "aws_kinesis"; ``` ## Values ```typescript -"webhook" | "aws_sqs" | "rabbitmq" | "hookdeck" | "aws_kinesis" +"webhook" | "aws_sqs" | "rabbitmq" | "hookdeck" | "aws_kinesis" | "aws_s3" ``` \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/operations/gettenantdestinationtypeschemarequest.md b/sdks/outpost-typescript/docs/models/operations/gettenantdestinationtypeschemarequest.md index 15c4c4e1..200ab314 100644 --- a/sdks/outpost-typescript/docs/models/operations/gettenantdestinationtypeschemarequest.md +++ b/sdks/outpost-typescript/docs/models/operations/gettenantdestinationtypeschemarequest.md @@ -6,7 +6,7 @@ import { GetTenantDestinationTypeSchemaRequest } from "@hookdeck/outpost-sdk/models/operations"; let value: GetTenantDestinationTypeSchemaRequest = { - type: "hookdeck", + type: "aws_kinesis", }; ``` diff --git a/sdks/outpost-typescript/docs/models/operations/gettenantdestinationtypeschematype.md b/sdks/outpost-typescript/docs/models/operations/gettenantdestinationtypeschematype.md index 4e3c075c..6b2a7f34 100644 --- a/sdks/outpost-typescript/docs/models/operations/gettenantdestinationtypeschematype.md +++ b/sdks/outpost-typescript/docs/models/operations/gettenantdestinationtypeschematype.md @@ -7,11 +7,11 @@ The type of the destination. ```typescript import { GetTenantDestinationTypeSchemaType } from "@hookdeck/outpost-sdk/models/operations"; -let value: GetTenantDestinationTypeSchemaType = "hookdeck"; +let value: GetTenantDestinationTypeSchemaType = "aws_kinesis"; ``` ## Values ```typescript -"webhook" | "aws_sqs" | "rabbitmq" | "hookdeck" | "aws_kinesis" +"webhook" | "aws_sqs" | "rabbitmq" | "hookdeck" | "aws_kinesis" | "aws_s3" ``` \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/operations/listtenantdestinationstypeenum1.md b/sdks/outpost-typescript/docs/models/operations/listtenantdestinationstypeenum1.md index 5252510f..5ea0857a 100644 --- a/sdks/outpost-typescript/docs/models/operations/listtenantdestinationstypeenum1.md +++ b/sdks/outpost-typescript/docs/models/operations/listtenantdestinationstypeenum1.md @@ -5,11 +5,11 @@ ```typescript import { ListTenantDestinationsTypeEnum1 } from "@hookdeck/outpost-sdk/models/operations"; -let value: ListTenantDestinationsTypeEnum1 = "rabbitmq"; +let value: ListTenantDestinationsTypeEnum1 = "hookdeck"; ``` ## Values ```typescript -"webhook" | "aws_sqs" | "rabbitmq" | "hookdeck" | "aws_kinesis" +"webhook" | "aws_sqs" | "rabbitmq" | "hookdeck" | "aws_kinesis" | "aws_s3" ``` \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/operations/listtenantdestinationstypeenum2.md b/sdks/outpost-typescript/docs/models/operations/listtenantdestinationstypeenum2.md index 47a70e85..bd847447 100644 --- a/sdks/outpost-typescript/docs/models/operations/listtenantdestinationstypeenum2.md +++ b/sdks/outpost-typescript/docs/models/operations/listtenantdestinationstypeenum2.md @@ -5,11 +5,11 @@ ```typescript import { ListTenantDestinationsTypeEnum2 } from "@hookdeck/outpost-sdk/models/operations"; -let value: ListTenantDestinationsTypeEnum2 = "aws_kinesis"; +let value: ListTenantDestinationsTypeEnum2 = "aws_s3"; ``` ## Values ```typescript -"webhook" | "aws_sqs" | "rabbitmq" | "hookdeck" | "aws_kinesis" +"webhook" | "aws_sqs" | "rabbitmq" | "hookdeck" | "aws_kinesis" | "aws_s3" ``` \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationrequest.md b/sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationrequest.md index 0995963e..d1c6aa75 100644 --- a/sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationrequest.md +++ b/sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationrequest.md @@ -16,4 +16,9 @@ let value: ListTenantEventsByDestinationRequest = { | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | `tenantId` | *string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | | `destinationId` | *string* | :heavy_check_mark: | The ID of the destination. | -| `status` | [operations.ListTenantEventsByDestinationStatus](../../models/operations/listtenanteventsbydestinationstatus.md) | :heavy_minus_sign: | Filter events by delivery status. | \ No newline at end of file +| `status` | [operations.ListTenantEventsByDestinationStatus](../../models/operations/listtenanteventsbydestinationstatus.md) | :heavy_minus_sign: | Filter events by delivery status. | +| `next` | *string* | :heavy_minus_sign: | Cursor for next page of results | +| `prev` | *string* | :heavy_minus_sign: | Cursor for previous page of results | +| `limit` | *number* | :heavy_minus_sign: | Number of items per page (default 100, max 1000) | +| `start` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Start time filter (RFC3339 format) | +| `end` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | End time filter (RFC3339 format) | \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationresponse.md b/sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationresponse.md new file mode 100644 index 00000000..2c308440 --- /dev/null +++ b/sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationresponse.md @@ -0,0 +1,37 @@ +# ListTenantEventsByDestinationResponse + +## Example Usage + +```typescript +import { ListTenantEventsByDestinationResponse } from "@hookdeck/outpost-sdk/models/operations"; + +let value: ListTenantEventsByDestinationResponse = { + result: { + count: 42, + data: [ + { + id: "evt_123", + destinationId: "des_456", + topic: "user.created", + time: new Date("2024-01-01T00:00:00Z"), + successfulAt: new Date("2024-01-01T00:00:00Z"), + metadata: { + "source": "crm", + }, + data: { + "user_id": "userid", + "status": "active", + }, + }, + ], + nextCursor: "", + prevCursor: "", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `result` | [operations.ListTenantEventsByDestinationResponseBody](../../models/operations/listtenanteventsbydestinationresponsebody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationresponsebody.md b/sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationresponsebody.md new file mode 100644 index 00000000..57713ea6 --- /dev/null +++ b/sdks/outpost-typescript/docs/models/operations/listtenanteventsbydestinationresponsebody.md @@ -0,0 +1,25 @@ +# ListTenantEventsByDestinationResponseBody + +A paginated list of events for the destination. + +## Example Usage + +```typescript +import { ListTenantEventsByDestinationResponseBody } from "@hookdeck/outpost-sdk/models/operations"; + +let value: ListTenantEventsByDestinationResponseBody = { + count: 42, + data: [], + nextCursor: "", + prevCursor: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `count` | *number* | :heavy_check_mark: | Total number of items across all pages | 42 | +| `data` | [components.Event](../../models/components/event.md)[] | :heavy_check_mark: | N/A | | +| `nextCursor` | *string* | :heavy_check_mark: | Cursor for next page (empty string if no next page) | | +| `prevCursor` | *string* | :heavy_check_mark: | Cursor for previous page (empty string if no previous page) | | \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/operations/listtenanteventsrequest.md b/sdks/outpost-typescript/docs/models/operations/listtenanteventsrequest.md index ed0acc30..46835ba8 100644 --- a/sdks/outpost-typescript/docs/models/operations/listtenanteventsrequest.md +++ b/sdks/outpost-typescript/docs/models/operations/listtenanteventsrequest.md @@ -10,8 +10,13 @@ let value: ListTenantEventsRequest = {}; ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `tenantId` | *string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | -| `destinationId` | *operations.DestinationId* | :heavy_minus_sign: | Filter events by destination ID(s). | -| `status` | [operations.ListTenantEventsStatus](../../models/operations/listtenanteventsstatus.md) | :heavy_minus_sign: | Filter events by delivery status. | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `tenantId` | *string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | +| `destinationId` | *operations.DestinationId* | :heavy_minus_sign: | Filter events by destination ID(s). | +| `status` | [operations.ListTenantEventsStatus](../../models/operations/listtenanteventsstatus.md) | :heavy_minus_sign: | Filter events by delivery status. | +| `next` | *string* | :heavy_minus_sign: | Cursor for next page of results | +| `prev` | *string* | :heavy_minus_sign: | Cursor for previous page of results | +| `limit` | *number* | :heavy_minus_sign: | Number of items per page (default 100, max 1000) | +| `start` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Start time filter (RFC3339 format) | +| `end` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | End time filter (RFC3339 format) | \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/operations/listtenanteventsresponse.md b/sdks/outpost-typescript/docs/models/operations/listtenanteventsresponse.md new file mode 100644 index 00000000..9717b550 --- /dev/null +++ b/sdks/outpost-typescript/docs/models/operations/listtenanteventsresponse.md @@ -0,0 +1,22 @@ +# ListTenantEventsResponse + +## Example Usage + +```typescript +import { ListTenantEventsResponse } from "@hookdeck/outpost-sdk/models/operations"; + +let value: ListTenantEventsResponse = { + result: { + count: 42, + data: [], + nextCursor: "", + prevCursor: "", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `result` | [operations.ListTenantEventsResponseBody](../../models/operations/listtenanteventsresponsebody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/operations/listtenanteventsresponsebody.md b/sdks/outpost-typescript/docs/models/operations/listtenanteventsresponsebody.md new file mode 100644 index 00000000..b972af55 --- /dev/null +++ b/sdks/outpost-typescript/docs/models/operations/listtenanteventsresponsebody.md @@ -0,0 +1,25 @@ +# ListTenantEventsResponseBody + +A paginated list of events. + +## Example Usage + +```typescript +import { ListTenantEventsResponseBody } from "@hookdeck/outpost-sdk/models/operations"; + +let value: ListTenantEventsResponseBody = { + count: 42, + data: [], + nextCursor: "", + prevCursor: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `count` | *number* | :heavy_check_mark: | Total number of items across all pages | 42 | +| `data` | [components.Event](../../models/components/event.md)[] | :heavy_check_mark: | N/A | | +| `nextCursor` | *string* | :heavy_check_mark: | Cursor for next page (empty string if no next page) | | +| `prevCursor` | *string* | :heavy_check_mark: | Cursor for previous page (empty string if no previous page) | | \ No newline at end of file diff --git a/sdks/outpost-typescript/docs/models/operations/type.md b/sdks/outpost-typescript/docs/models/operations/type.md index 5bd0ea95..94c4f395 100644 --- a/sdks/outpost-typescript/docs/models/operations/type.md +++ b/sdks/outpost-typescript/docs/models/operations/type.md @@ -8,7 +8,7 @@ Filter destinations by type(s). ### `operations.ListTenantDestinationsTypeEnum1` ```typescript -const value: operations.ListTenantDestinationsTypeEnum1 = "rabbitmq"; +const value: operations.ListTenantDestinationsTypeEnum1 = "hookdeck"; ``` ### `operations.ListTenantDestinationsTypeEnum2[]` diff --git a/sdks/outpost-typescript/docs/sdks/events/README.md b/sdks/outpost-typescript/docs/sdks/events/README.md index 6a7a7cd8..7b478cc0 100644 --- a/sdks/outpost-typescript/docs/sdks/events/README.md +++ b/sdks/outpost-typescript/docs/sdks/events/README.md @@ -34,7 +34,9 @@ const outpost = new Outpost({ async function run() { const result = await outpost.events.list({}); - console.log(result); + for await (const page of result) { + console.log(page); + } } run(); @@ -61,7 +63,9 @@ async function run() { const res = await eventsList(outpost, {}); if (res.ok) { const { value: result } = res; - console.log(result); + for await (const page of result) { + console.log(page); + } } else { console.log("eventsList failed:", res.error); } @@ -81,7 +85,7 @@ run(); ### Response -**Promise\<[components.Event[]](../../models/.md)\>** +**Promise\<[operations.ListTenantEventsResponse](../../models/operations/listtenanteventsresponse.md)\>** ### Errors @@ -296,7 +300,9 @@ async function run() { destinationId: "", }); - console.log(result); + for await (const page of result) { + console.log(page); + } } run(); @@ -325,7 +331,9 @@ async function run() { }); if (res.ok) { const { value: result } = res; - console.log(result); + for await (const page of result) { + console.log(page); + } } else { console.log("eventsListByDestination failed:", res.error); } @@ -345,7 +353,7 @@ run(); ### Response -**Promise\<[components.Event[]](../../models/.md)\>** +**Promise\<[operations.ListTenantEventsByDestinationResponse](../../models/operations/listtenanteventsbydestinationresponse.md)\>** ### Errors diff --git a/sdks/outpost-typescript/examples/healthCheck.example.ts b/sdks/outpost-typescript/examples/healthCheck.example.ts index 10eb17a7..044dc119 100644 --- a/sdks/outpost-typescript/examples/healthCheck.example.ts +++ b/sdks/outpost-typescript/examples/healthCheck.example.ts @@ -8,7 +8,7 @@ dotenv.config(); * Example usage of the @hookdeck/outpost-sdk SDK * * To run this example from the examples directory: - * npm run build && npx tsx healthCheck.ts + * npm run build && npx tsx healthCheck.example.ts */ import { Outpost } from "@hookdeck/outpost-sdk"; diff --git a/sdks/outpost-typescript/examples/package-lock.json b/sdks/outpost-typescript/examples/package-lock.json index 1274e3e8..14568dce 100644 --- a/sdks/outpost-typescript/examples/package-lock.json +++ b/sdks/outpost-typescript/examples/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "@hookdeck/outpost-sdk", - "version": "0.3.0", + "version": "0.4.0", "dependencies": { "zod": "^3.20.0" }, @@ -36,8 +36,8 @@ "express": "^4.21.2", "globals": "^15.14.0", "tshy": "^2.0.0", - "typescript": "^5.4.5", - "typescript-eslint": "^8.22.0" + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0" }, "peerDependencies": { "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0" diff --git a/sdks/outpost-typescript/jsr.json b/sdks/outpost-typescript/jsr.json index be6c4dae..2e4e2a68 100644 --- a/sdks/outpost-typescript/jsr.json +++ b/sdks/outpost-typescript/jsr.json @@ -2,7 +2,7 @@ { "name": "@hookdeck/outpost-sdk", - "version": "0.3.0", + "version": "0.4.0", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/sdks/outpost-typescript/package-lock.json b/sdks/outpost-typescript/package-lock.json index 014d79c2..0c87b2bc 100644 --- a/sdks/outpost-typescript/package-lock.json +++ b/sdks/outpost-typescript/package-lock.json @@ -1,12 +1,12 @@ { "name": "@hookdeck/outpost-sdk", - "version": "0.3.0", + "version": "0.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@hookdeck/outpost-sdk", - "version": "0.3.0", + "version": "0.4.0", "dependencies": { "zod": "^3.20.0" }, @@ -24,8 +24,8 @@ "express": "^4.21.2", "globals": "^15.14.0", "tshy": "^2.0.0", - "typescript": "^5.4.5", - "typescript-eslint": "^8.22.0" + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0" }, "peerDependencies": { "@modelcontextprotocol/sdk": ">=1.5.0 <1.10.0" diff --git a/sdks/outpost-typescript/package.json b/sdks/outpost-typescript/package.json index e9ab98c5..e46f548e 100644 --- a/sdks/outpost-typescript/package.json +++ b/sdks/outpost-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@hookdeck/outpost-sdk", - "version": "0.3.0", + "version": "0.4.0", "author": "Speakeasy", "type": "module", "bin": { @@ -52,8 +52,8 @@ "express": "^4.21.2", "globals": "^15.14.0", "tshy": "^2.0.0", - "typescript": "^5.4.5", - "typescript-eslint": "^8.22.0" + "typescript": "~5.8.3", + "typescript-eslint": "^8.26.0" }, "dependencies": { "zod": "^3.20.0" diff --git a/sdks/outpost-typescript/src/funcs/eventsList.ts b/sdks/outpost-typescript/src/funcs/eventsList.ts index f8f097fa..e6d6210b 100644 --- a/sdks/outpost-typescript/src/funcs/eventsList.ts +++ b/sdks/outpost-typescript/src/funcs/eventsList.ts @@ -2,8 +2,8 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; import { OutpostCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; import * as M from "../lib/matchers.js"; import { compactMap } from "../lib/primitives.js"; @@ -11,7 +11,6 @@ import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; -import * as components from "../models/components/index.js"; import { ConnectionError, InvalidRequestError, @@ -26,6 +25,12 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; import { Result } from "../types/fp.js"; +import { + createPageIterator, + haltIterator, + PageIterator, + Paginator, +} from "../types/operations.js"; /** * List Events @@ -38,39 +43,9 @@ export function eventsList( request: operations.ListTenantEventsRequest, options?: RequestOptions, ): APIPromise< - Result< - Array, - | errors.UnauthorizedError - | errors.TimeoutError - | errors.RateLimitedError - | errors.BadRequestError - | errors.NotFoundError - | errors.InternalServerError - | OutpostError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OutpostCore, - request: operations.ListTenantEventsRequest, - options?: RequestOptions, -): Promise< - [ + PageIterator< Result< - Array, + operations.ListTenantEventsResponse, | errors.UnauthorizedError | errors.TimeoutError | errors.RateLimitedError @@ -86,6 +61,42 @@ async function $do( | UnexpectedClientError | SDKValidationError >, + { cursor: string } + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OutpostCore, + request: operations.ListTenantEventsRequest, + options?: RequestOptions, +): Promise< + [ + PageIterator< + Result< + operations.ListTenantEventsResponse, + | errors.UnauthorizedError + | errors.TimeoutError + | errors.RateLimitedError + | errors.BadRequestError + | errors.NotFoundError + | errors.InternalServerError + | OutpostError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { cursor: string } + >, APICall, ] > { @@ -95,7 +106,7 @@ async function $do( "Input validation failed", ); if (!parsed.ok) { - return [parsed, { status: "invalid" }]; + return [haltIterator(parsed), { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -112,6 +123,11 @@ async function $do( const query = encodeFormQuery({ "destination_id": payload.destination_id, + "end": payload.end, + "limit": payload.limit, + "next": payload.next, + "prev": payload.prev, + "start": payload.start, "status": payload.status, }); @@ -149,7 +165,7 @@ async function $do( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; + return [haltIterator(requestRes), { status: "invalid" }]; } const req = requestRes.value; @@ -186,7 +202,7 @@ async function $do( retryCodes: context.retryCodes, }); if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; + return [haltIterator(doResult), { status: "request-error", request: req }]; } const response = doResult.value; @@ -194,8 +210,8 @@ async function $do( HttpMeta: { Response: response, Request: req }, }; - const [result] = await M.match< - Array, + const [result, raw] = await M.match< + operations.ListTenantEventsResponse, | errors.UnauthorizedError | errors.TimeoutError | errors.RateLimitedError @@ -211,7 +227,9 @@ async function $do( | UnexpectedClientError | SDKValidationError >( - M.json(200, z.array(components.Event$inboundSchema)), + M.json(200, operations.ListTenantEventsResponse$inboundSchema, { + key: "Result", + }), M.jsonErr([401, 403, 407], errors.UnauthorizedError$inboundSchema), M.jsonErr(408, errors.TimeoutError$inboundSchema), M.jsonErr(429, errors.RateLimitedError$inboundSchema), @@ -231,8 +249,70 @@ async function $do( M.fail("5XX"), )(response, req, { extraFields: responseFields }); if (!result.ok) { - return [result, { status: "complete", request: req, response }]; + return [haltIterator(result), { + status: "complete", + request: req, + response, + }]; } - return [result, { status: "complete", request: req, response }]; + const nextFunc = ( + responseData: unknown, + ): { + next: Paginator< + Result< + operations.ListTenantEventsResponse, + | errors.UnauthorizedError + | errors.TimeoutError + | errors.RateLimitedError + | errors.BadRequestError + | errors.NotFoundError + | errors.InternalServerError + | OutpostError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > + >; + "~next"?: { cursor: string }; + } => { + const nextCursor = dlv(responseData, "next"); + if (typeof nextCursor !== "string") { + return { next: () => null }; + } + if (nextCursor.trim() === "") { + return { next: () => null }; + } + const results = dlv(responseData, "data"); + if (!Array.isArray(results) || !results.length) { + return { next: () => null }; + } + const limit = request?.limit ?? 100; + if (results.length < limit) { + return { next: () => null }; + } + + const nextVal = () => + eventsList( + client, + { + ...request, + next: nextCursor, + }, + options, + ); + + return { next: nextVal, "~next": { cursor: nextCursor } }; + }; + + const page = { ...result, ...nextFunc(raw) }; + return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, { + status: "complete", + request: req, + response, + }]; } diff --git a/sdks/outpost-typescript/src/funcs/eventsListByDestination.ts b/sdks/outpost-typescript/src/funcs/eventsListByDestination.ts index 171ffedf..4b9296eb 100644 --- a/sdks/outpost-typescript/src/funcs/eventsListByDestination.ts +++ b/sdks/outpost-typescript/src/funcs/eventsListByDestination.ts @@ -2,8 +2,8 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as z from "zod"; import { OutpostCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; import * as M from "../lib/matchers.js"; import { compactMap } from "../lib/primitives.js"; @@ -11,7 +11,6 @@ import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; -import * as components from "../models/components/index.js"; import { ConnectionError, InvalidRequestError, @@ -26,6 +25,12 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { APICall, APIPromise } from "../types/async.js"; import { Result } from "../types/fp.js"; +import { + createPageIterator, + haltIterator, + PageIterator, + Paginator, +} from "../types/operations.js"; /** * List Events by Destination @@ -38,39 +43,9 @@ export function eventsListByDestination( request: operations.ListTenantEventsByDestinationRequest, options?: RequestOptions, ): APIPromise< - Result< - Array, - | errors.UnauthorizedError - | errors.TimeoutError - | errors.RateLimitedError - | errors.BadRequestError - | errors.NotFoundError - | errors.InternalServerError - | OutpostError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OutpostCore, - request: operations.ListTenantEventsByDestinationRequest, - options?: RequestOptions, -): Promise< - [ + PageIterator< Result< - Array, + operations.ListTenantEventsByDestinationResponse, | errors.UnauthorizedError | errors.TimeoutError | errors.RateLimitedError @@ -86,6 +61,42 @@ async function $do( | UnexpectedClientError | SDKValidationError >, + { cursor: string } + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: OutpostCore, + request: operations.ListTenantEventsByDestinationRequest, + options?: RequestOptions, +): Promise< + [ + PageIterator< + Result< + operations.ListTenantEventsByDestinationResponse, + | errors.UnauthorizedError + | errors.TimeoutError + | errors.RateLimitedError + | errors.BadRequestError + | errors.NotFoundError + | errors.InternalServerError + | OutpostError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + { cursor: string } + >, APICall, ] > { @@ -98,7 +109,7 @@ async function $do( "Input validation failed", ); if (!parsed.ok) { - return [parsed, { status: "invalid" }]; + return [haltIterator(parsed), { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -120,6 +131,11 @@ async function $do( ); const query = encodeFormQuery({ + "end": payload.end, + "limit": payload.limit, + "next": payload.next, + "prev": payload.prev, + "start": payload.start, "status": payload.status, }); @@ -157,7 +173,7 @@ async function $do( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; + return [haltIterator(requestRes), { status: "invalid" }]; } const req = requestRes.value; @@ -194,7 +210,7 @@ async function $do( retryCodes: context.retryCodes, }); if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; + return [haltIterator(doResult), { status: "request-error", request: req }]; } const response = doResult.value; @@ -202,8 +218,8 @@ async function $do( HttpMeta: { Response: response, Request: req }, }; - const [result] = await M.match< - Array, + const [result, raw] = await M.match< + operations.ListTenantEventsByDestinationResponse, | errors.UnauthorizedError | errors.TimeoutError | errors.RateLimitedError @@ -219,7 +235,11 @@ async function $do( | UnexpectedClientError | SDKValidationError >( - M.json(200, z.array(components.Event$inboundSchema)), + M.json( + 200, + operations.ListTenantEventsByDestinationResponse$inboundSchema, + { key: "Result" }, + ), M.jsonErr([401, 403, 407], errors.UnauthorizedError$inboundSchema), M.jsonErr(408, errors.TimeoutError$inboundSchema), M.jsonErr(429, errors.RateLimitedError$inboundSchema), @@ -239,8 +259,70 @@ async function $do( M.fail("5XX"), )(response, req, { extraFields: responseFields }); if (!result.ok) { - return [result, { status: "complete", request: req, response }]; + return [haltIterator(result), { + status: "complete", + request: req, + response, + }]; } - return [result, { status: "complete", request: req, response }]; + const nextFunc = ( + responseData: unknown, + ): { + next: Paginator< + Result< + operations.ListTenantEventsByDestinationResponse, + | errors.UnauthorizedError + | errors.TimeoutError + | errors.RateLimitedError + | errors.BadRequestError + | errors.NotFoundError + | errors.InternalServerError + | OutpostError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > + >; + "~next"?: { cursor: string }; + } => { + const nextCursor = dlv(responseData, "next"); + if (typeof nextCursor !== "string") { + return { next: () => null }; + } + if (nextCursor.trim() === "") { + return { next: () => null }; + } + const results = dlv(responseData, "data"); + if (!Array.isArray(results) || !results.length) { + return { next: () => null }; + } + const limit = request?.limit ?? 100; + if (results.length < limit) { + return { next: () => null }; + } + + const nextVal = () => + eventsListByDestination( + client, + { + ...request, + next: nextCursor, + }, + options, + ); + + return { next: nextVal, "~next": { cursor: nextCursor } }; + }; + + const page = { ...result, ...nextFunc(raw) }; + return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, { + status: "complete", + request: req, + response, + }]; } diff --git a/sdks/outpost-typescript/src/lib/config.ts b/sdks/outpost-typescript/src/lib/config.ts index 63ef037a..be5eedbc 100644 --- a/sdks/outpost-typescript/src/lib/config.ts +++ b/sdks/outpost-typescript/src/lib/config.ts @@ -73,8 +73,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.1", - sdkVersion: "0.3.0", - genVersion: "2.669.0", + sdkVersion: "0.4.0", + genVersion: "2.692.0", userAgent: - "speakeasy-sdk/typescript 0.3.0 2.669.0 0.0.1 @hookdeck/outpost-sdk", + "speakeasy-sdk/typescript 0.4.0 2.692.0 0.0.1 @hookdeck/outpost-sdk", } as const; diff --git a/sdks/outpost-typescript/src/lib/security.ts b/sdks/outpost-typescript/src/lib/security.ts index 0a03f804..ca6290f1 100644 --- a/sdks/outpost-typescript/src/lib/security.ts +++ b/sdks/outpost-typescript/src/lib/security.ts @@ -83,7 +83,10 @@ type SecurityInputOAuth2 = { type SecurityInputOAuth2ClientCredentials = { type: "oauth2:client_credentials"; value: - | { clientID?: string | undefined; clientSecret?: string | undefined } + | { + clientID?: string | undefined; + clientSecret?: string | undefined; + } | null | string | undefined; diff --git a/sdks/outpost-typescript/src/mcp-server/mcp-server.ts b/sdks/outpost-typescript/src/mcp-server/mcp-server.ts index a70686a7..f2be1190 100644 --- a/sdks/outpost-typescript/src/mcp-server/mcp-server.ts +++ b/sdks/outpost-typescript/src/mcp-server/mcp-server.ts @@ -19,7 +19,7 @@ const routes = buildRouteMap({ export const app = buildApplication(routes, { name: "mcp", versionInfo: { - currentVersion: "0.3.0", + currentVersion: "0.4.0", }, }); diff --git a/sdks/outpost-typescript/src/mcp-server/server.ts b/sdks/outpost-typescript/src/mcp-server/server.ts index e91d167e..0c63dfb6 100644 --- a/sdks/outpost-typescript/src/mcp-server/server.ts +++ b/sdks/outpost-typescript/src/mcp-server/server.ts @@ -51,7 +51,7 @@ export function createMCPServer(deps: { }) { const server = new McpServer({ name: "Outpost", - version: "0.3.0", + version: "0.4.0", }); const client = new OutpostCore({ diff --git a/sdks/outpost-typescript/src/mcp-server/tools/eventsList.ts b/sdks/outpost-typescript/src/mcp-server/tools/eventsList.ts index 7483f6cf..7ecd0b3e 100644 --- a/sdks/outpost-typescript/src/mcp-server/tools/eventsList.ts +++ b/sdks/outpost-typescript/src/mcp-server/tools/eventsList.ts @@ -30,7 +30,7 @@ Retrieves a list of events for the tenant, supporting cursor navigation (details }; } - const value = result.value; + const value = result.value.result; return formatResult(value, apiCall); }, diff --git a/sdks/outpost-typescript/src/mcp-server/tools/eventsListByDestination.ts b/sdks/outpost-typescript/src/mcp-server/tools/eventsListByDestination.ts index 5899c394..44262891 100644 --- a/sdks/outpost-typescript/src/mcp-server/tools/eventsListByDestination.ts +++ b/sdks/outpost-typescript/src/mcp-server/tools/eventsListByDestination.ts @@ -30,7 +30,7 @@ Retrieves events associated with a specific destination for the tenant.`, }; } - const value = result.value; + const value = result.value.result; return formatResult(value, apiCall); }, diff --git a/sdks/outpost-typescript/src/models/components/awss3config.ts b/sdks/outpost-typescript/src/models/components/awss3config.ts new file mode 100644 index 00000000..bc09b90f --- /dev/null +++ b/sdks/outpost-typescript/src/models/components/awss3config.ts @@ -0,0 +1,97 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type Awss3Config = { + /** + * The name of your AWS S3 bucket. + */ + bucket: string; + /** + * The AWS region where your bucket is located. + */ + region: string; + /** + * JMESPath expression for generating S3 object keys. Default is join('', [time.rfc3339_nano, '_', metadata."event-id", '.json']). + */ + keyTemplate?: string | undefined; + /** + * The storage class for the S3 objects (e.g., STANDARD, INTELLIGENT_TIERING, GLACIER, etc.). Defaults to "STANDARD". + */ + storageClass?: string | undefined; +}; + +/** @internal */ +export const Awss3Config$inboundSchema: z.ZodType< + Awss3Config, + z.ZodTypeDef, + unknown +> = z.object({ + bucket: z.string(), + region: z.string(), + key_template: z.string().optional(), + storage_class: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "key_template": "keyTemplate", + "storage_class": "storageClass", + }); +}); + +/** @internal */ +export type Awss3Config$Outbound = { + bucket: string; + region: string; + key_template?: string | undefined; + storage_class?: string | undefined; +}; + +/** @internal */ +export const Awss3Config$outboundSchema: z.ZodType< + Awss3Config$Outbound, + z.ZodTypeDef, + Awss3Config +> = z.object({ + bucket: z.string(), + region: z.string(), + keyTemplate: z.string().optional(), + storageClass: z.string().optional(), +}).transform((v) => { + return remap$(v, { + keyTemplate: "key_template", + storageClass: "storage_class", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Awss3Config$ { + /** @deprecated use `Awss3Config$inboundSchema` instead. */ + export const inboundSchema = Awss3Config$inboundSchema; + /** @deprecated use `Awss3Config$outboundSchema` instead. */ + export const outboundSchema = Awss3Config$outboundSchema; + /** @deprecated use `Awss3Config$Outbound` instead. */ + export type Outbound = Awss3Config$Outbound; +} + +export function awss3ConfigToJSON(awss3Config: Awss3Config): string { + return JSON.stringify(Awss3Config$outboundSchema.parse(awss3Config)); +} + +export function awss3ConfigFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Awss3Config$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Awss3Config' from JSON`, + ); +} diff --git a/sdks/outpost-typescript/src/models/components/awss3credentials.ts b/sdks/outpost-typescript/src/models/components/awss3credentials.ts new file mode 100644 index 00000000..604985d2 --- /dev/null +++ b/sdks/outpost-typescript/src/models/components/awss3credentials.ts @@ -0,0 +1,83 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type Awss3Credentials = { + /** + * AWS Access Key ID. + */ + key: string; + /** + * AWS Secret Access Key. + */ + secret: string; + /** + * Optional AWS Session Token (for temporary credentials). + */ + session?: string | undefined; +}; + +/** @internal */ +export const Awss3Credentials$inboundSchema: z.ZodType< + Awss3Credentials, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + secret: z.string(), + session: z.string().optional(), +}); + +/** @internal */ +export type Awss3Credentials$Outbound = { + key: string; + secret: string; + session?: string | undefined; +}; + +/** @internal */ +export const Awss3Credentials$outboundSchema: z.ZodType< + Awss3Credentials$Outbound, + z.ZodTypeDef, + Awss3Credentials +> = z.object({ + key: z.string(), + secret: z.string(), + session: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Awss3Credentials$ { + /** @deprecated use `Awss3Credentials$inboundSchema` instead. */ + export const inboundSchema = Awss3Credentials$inboundSchema; + /** @deprecated use `Awss3Credentials$outboundSchema` instead. */ + export const outboundSchema = Awss3Credentials$outboundSchema; + /** @deprecated use `Awss3Credentials$Outbound` instead. */ + export type Outbound = Awss3Credentials$Outbound; +} + +export function awss3CredentialsToJSON( + awss3Credentials: Awss3Credentials, +): string { + return JSON.stringify( + Awss3Credentials$outboundSchema.parse(awss3Credentials), + ); +} + +export function awss3CredentialsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Awss3Credentials$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Awss3Credentials' from JSON`, + ); +} diff --git a/sdks/outpost-typescript/src/models/components/destination.ts b/sdks/outpost-typescript/src/models/components/destination.ts index 294581f7..fc9b7bc4 100644 --- a/sdks/outpost-typescript/src/models/components/destination.ts +++ b/sdks/outpost-typescript/src/models/components/destination.ts @@ -12,6 +12,12 @@ import { DestinationAWSKinesis$Outbound, DestinationAWSKinesis$outboundSchema, } from "./destinationawskinesis.js"; +import { + DestinationAwss3, + DestinationAwss3$inboundSchema, + DestinationAwss3$Outbound, + DestinationAwss3$outboundSchema, +} from "./destinationawss3.js"; import { DestinationAWSSQS, DestinationAWSSQS$inboundSchema, @@ -49,6 +55,7 @@ export type Destination = | (DestinationRabbitMQ & { type: "rabbitmq" }) | (DestinationAWSKinesis & { type: "aws_kinesis" }) | (DestinationAzureServiceBus & { type: "azure_servicebus" }) + | (DestinationAwss3 & { type: "aws_s3" }) | (DestinationHookdeck & { type: "hookdeck" }); /** @internal */ @@ -82,6 +89,11 @@ export const Destination$inboundSchema: z.ZodType< type: v.type, })), ), + DestinationAwss3$inboundSchema.and( + z.object({ type: z.literal("aws_s3") }).transform((v) => ({ + type: v.type, + })), + ), DestinationHookdeck$inboundSchema.and( z.object({ type: z.literal("hookdeck") }).transform((v) => ({ type: v.type, @@ -96,6 +108,7 @@ export type Destination$Outbound = | (DestinationRabbitMQ$Outbound & { type: "rabbitmq" }) | (DestinationAWSKinesis$Outbound & { type: "aws_kinesis" }) | (DestinationAzureServiceBus$Outbound & { type: "azure_servicebus" }) + | (DestinationAwss3$Outbound & { type: "aws_s3" }) | (DestinationHookdeck$Outbound & { type: "hookdeck" }); /** @internal */ @@ -129,6 +142,11 @@ export const Destination$outboundSchema: z.ZodType< type: v.type, })), ), + DestinationAwss3$outboundSchema.and( + z.object({ type: z.literal("aws_s3") }).transform((v) => ({ + type: v.type, + })), + ), DestinationHookdeck$outboundSchema.and( z.object({ type: z.literal("hookdeck") }).transform((v) => ({ type: v.type, diff --git a/sdks/outpost-typescript/src/models/components/destinationawss3.ts b/sdks/outpost-typescript/src/models/components/destinationawss3.ts new file mode 100644 index 00000000..244e1d1e --- /dev/null +++ b/sdks/outpost-typescript/src/models/components/destinationawss3.ts @@ -0,0 +1,185 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + Awss3Config, + Awss3Config$inboundSchema, + Awss3Config$Outbound, + Awss3Config$outboundSchema, +} from "./awss3config.js"; +import { + Awss3Credentials, + Awss3Credentials$inboundSchema, + Awss3Credentials$Outbound, + Awss3Credentials$outboundSchema, +} from "./awss3credentials.js"; +import { + Topics, + Topics$inboundSchema, + Topics$Outbound, + Topics$outboundSchema, +} from "./topics.js"; + +/** + * Type of the destination. + */ +export const DestinationAwss3Type = { + AwsS3: "aws_s3", +} as const; +/** + * Type of the destination. + */ +export type DestinationAwss3Type = ClosedEnum; + +export type DestinationAwss3 = { + /** + * Control plane generated ID or user provided ID for the destination. + */ + id: string; + /** + * Type of the destination. + */ + type: DestinationAwss3Type; + /** + * "*" or an array of enabled topics. + */ + topics: Topics; + /** + * ISO Date when the destination was disabled, or null if enabled. + */ + disabledAt: Date | null; + /** + * ISO Date when the destination was created. + */ + createdAt: Date; + config: Awss3Config; + credentials: Awss3Credentials; + /** + * A human-readable representation of the destination target (bucket and region). Read-only. + */ + target?: string | undefined; + /** + * A URL link to the destination target (AWS Console link to the bucket). Read-only. + */ + targetUrl?: string | null | undefined; +}; + +/** @internal */ +export const DestinationAwss3Type$inboundSchema: z.ZodNativeEnum< + typeof DestinationAwss3Type +> = z.nativeEnum(DestinationAwss3Type); + +/** @internal */ +export const DestinationAwss3Type$outboundSchema: z.ZodNativeEnum< + typeof DestinationAwss3Type +> = DestinationAwss3Type$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DestinationAwss3Type$ { + /** @deprecated use `DestinationAwss3Type$inboundSchema` instead. */ + export const inboundSchema = DestinationAwss3Type$inboundSchema; + /** @deprecated use `DestinationAwss3Type$outboundSchema` instead. */ + export const outboundSchema = DestinationAwss3Type$outboundSchema; +} + +/** @internal */ +export const DestinationAwss3$inboundSchema: z.ZodType< + DestinationAwss3, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), + type: DestinationAwss3Type$inboundSchema, + topics: Topics$inboundSchema, + disabled_at: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ), + created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), + config: Awss3Config$inboundSchema, + credentials: Awss3Credentials$inboundSchema, + target: z.string().optional(), + target_url: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "disabled_at": "disabledAt", + "created_at": "createdAt", + "target_url": "targetUrl", + }); +}); + +/** @internal */ +export type DestinationAwss3$Outbound = { + id: string; + type: string; + topics: Topics$Outbound; + disabled_at: string | null; + created_at: string; + config: Awss3Config$Outbound; + credentials: Awss3Credentials$Outbound; + target?: string | undefined; + target_url?: string | null | undefined; +}; + +/** @internal */ +export const DestinationAwss3$outboundSchema: z.ZodType< + DestinationAwss3$Outbound, + z.ZodTypeDef, + DestinationAwss3 +> = z.object({ + id: z.string(), + type: DestinationAwss3Type$outboundSchema, + topics: Topics$outboundSchema, + disabledAt: z.nullable(z.date().transform(v => v.toISOString())), + createdAt: z.date().transform(v => v.toISOString()), + config: Awss3Config$outboundSchema, + credentials: Awss3Credentials$outboundSchema, + target: z.string().optional(), + targetUrl: z.nullable(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + disabledAt: "disabled_at", + createdAt: "created_at", + targetUrl: "target_url", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DestinationAwss3$ { + /** @deprecated use `DestinationAwss3$inboundSchema` instead. */ + export const inboundSchema = DestinationAwss3$inboundSchema; + /** @deprecated use `DestinationAwss3$outboundSchema` instead. */ + export const outboundSchema = DestinationAwss3$outboundSchema; + /** @deprecated use `DestinationAwss3$Outbound` instead. */ + export type Outbound = DestinationAwss3$Outbound; +} + +export function destinationAwss3ToJSON( + destinationAwss3: DestinationAwss3, +): string { + return JSON.stringify( + DestinationAwss3$outboundSchema.parse(destinationAwss3), + ); +} + +export function destinationAwss3FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DestinationAwss3$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DestinationAwss3' from JSON`, + ); +} diff --git a/sdks/outpost-typescript/src/models/components/destinationcreate.ts b/sdks/outpost-typescript/src/models/components/destinationcreate.ts index bb619ec3..68409184 100644 --- a/sdks/outpost-typescript/src/models/components/destinationcreate.ts +++ b/sdks/outpost-typescript/src/models/components/destinationcreate.ts @@ -12,6 +12,12 @@ import { DestinationCreateAWSKinesis$Outbound, DestinationCreateAWSKinesis$outboundSchema, } from "./destinationcreateawskinesis.js"; +import { + DestinationCreateAwss3, + DestinationCreateAwss3$inboundSchema, + DestinationCreateAwss3$Outbound, + DestinationCreateAwss3$outboundSchema, +} from "./destinationcreateawss3.js"; import { DestinationCreateAWSSQS, DestinationCreateAWSSQS$inboundSchema, @@ -48,6 +54,7 @@ export type DestinationCreate = | (DestinationCreateRabbitMQ & { type: "rabbitmq" }) | (DestinationCreateAWSKinesis & { type: "aws_kinesis" }) | (DestinationCreateAzureServiceBus & { type: "azure_servicebus" }) + | (DestinationCreateAwss3 & { type: "aws_s3" }) | (DestinationCreateWebhook & { type: "webhook" }) | (DestinationCreateHookdeck & { type: "hookdeck" }); @@ -77,6 +84,11 @@ export const DestinationCreate$inboundSchema: z.ZodType< type: v.type, })), ), + DestinationCreateAwss3$inboundSchema.and( + z.object({ type: z.literal("aws_s3") }).transform((v) => ({ + type: v.type, + })), + ), DestinationCreateWebhook$inboundSchema.and( z.object({ type: z.literal("webhook") }).transform((v) => ({ type: v.type, @@ -95,6 +107,7 @@ export type DestinationCreate$Outbound = | (DestinationCreateRabbitMQ$Outbound & { type: "rabbitmq" }) | (DestinationCreateAWSKinesis$Outbound & { type: "aws_kinesis" }) | (DestinationCreateAzureServiceBus$Outbound & { type: "azure_servicebus" }) + | (DestinationCreateAwss3$Outbound & { type: "aws_s3" }) | (DestinationCreateWebhook$Outbound & { type: "webhook" }) | (DestinationCreateHookdeck$Outbound & { type: "hookdeck" }); @@ -124,6 +137,11 @@ export const DestinationCreate$outboundSchema: z.ZodType< type: v.type, })), ), + DestinationCreateAwss3$outboundSchema.and( + z.object({ type: z.literal("aws_s3") }).transform((v) => ({ + type: v.type, + })), + ), DestinationCreateWebhook$outboundSchema.and( z.object({ type: z.literal("webhook") }).transform((v) => ({ type: v.type, diff --git a/sdks/outpost-typescript/src/models/components/destinationcreateawss3.ts b/sdks/outpost-typescript/src/models/components/destinationcreateawss3.ts new file mode 100644 index 00000000..1472cfd3 --- /dev/null +++ b/sdks/outpost-typescript/src/models/components/destinationcreateawss3.ts @@ -0,0 +1,144 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + Awss3Config, + Awss3Config$inboundSchema, + Awss3Config$Outbound, + Awss3Config$outboundSchema, +} from "./awss3config.js"; +import { + Awss3Credentials, + Awss3Credentials$inboundSchema, + Awss3Credentials$Outbound, + Awss3Credentials$outboundSchema, +} from "./awss3credentials.js"; +import { + Topics, + Topics$inboundSchema, + Topics$Outbound, + Topics$outboundSchema, +} from "./topics.js"; + +/** + * Type of the destination. Must be 'aws_s3'. + */ +export const DestinationCreateAwss3Type = { + AwsS3: "aws_s3", +} as const; +/** + * Type of the destination. Must be 'aws_s3'. + */ +export type DestinationCreateAwss3Type = ClosedEnum< + typeof DestinationCreateAwss3Type +>; + +export type DestinationCreateAwss3 = { + /** + * Optional user-provided ID. A UUID will be generated if empty. + */ + id?: string | undefined; + /** + * Type of the destination. Must be 'aws_s3'. + */ + type: DestinationCreateAwss3Type; + /** + * "*" or an array of enabled topics. + */ + topics: Topics; + config: Awss3Config; + credentials: Awss3Credentials; +}; + +/** @internal */ +export const DestinationCreateAwss3Type$inboundSchema: z.ZodNativeEnum< + typeof DestinationCreateAwss3Type +> = z.nativeEnum(DestinationCreateAwss3Type); + +/** @internal */ +export const DestinationCreateAwss3Type$outboundSchema: z.ZodNativeEnum< + typeof DestinationCreateAwss3Type +> = DestinationCreateAwss3Type$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DestinationCreateAwss3Type$ { + /** @deprecated use `DestinationCreateAwss3Type$inboundSchema` instead. */ + export const inboundSchema = DestinationCreateAwss3Type$inboundSchema; + /** @deprecated use `DestinationCreateAwss3Type$outboundSchema` instead. */ + export const outboundSchema = DestinationCreateAwss3Type$outboundSchema; +} + +/** @internal */ +export const DestinationCreateAwss3$inboundSchema: z.ZodType< + DestinationCreateAwss3, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string().optional(), + type: DestinationCreateAwss3Type$inboundSchema, + topics: Topics$inboundSchema, + config: Awss3Config$inboundSchema, + credentials: Awss3Credentials$inboundSchema, +}); + +/** @internal */ +export type DestinationCreateAwss3$Outbound = { + id?: string | undefined; + type: string; + topics: Topics$Outbound; + config: Awss3Config$Outbound; + credentials: Awss3Credentials$Outbound; +}; + +/** @internal */ +export const DestinationCreateAwss3$outboundSchema: z.ZodType< + DestinationCreateAwss3$Outbound, + z.ZodTypeDef, + DestinationCreateAwss3 +> = z.object({ + id: z.string().optional(), + type: DestinationCreateAwss3Type$outboundSchema, + topics: Topics$outboundSchema, + config: Awss3Config$outboundSchema, + credentials: Awss3Credentials$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DestinationCreateAwss3$ { + /** @deprecated use `DestinationCreateAwss3$inboundSchema` instead. */ + export const inboundSchema = DestinationCreateAwss3$inboundSchema; + /** @deprecated use `DestinationCreateAwss3$outboundSchema` instead. */ + export const outboundSchema = DestinationCreateAwss3$outboundSchema; + /** @deprecated use `DestinationCreateAwss3$Outbound` instead. */ + export type Outbound = DestinationCreateAwss3$Outbound; +} + +export function destinationCreateAwss3ToJSON( + destinationCreateAwss3: DestinationCreateAwss3, +): string { + return JSON.stringify( + DestinationCreateAwss3$outboundSchema.parse(destinationCreateAwss3), + ); +} + +export function destinationCreateAwss3FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DestinationCreateAwss3$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DestinationCreateAwss3' from JSON`, + ); +} diff --git a/sdks/outpost-typescript/src/models/components/destinationupdate.ts b/sdks/outpost-typescript/src/models/components/destinationupdate.ts index b27a4ac5..08a08238 100644 --- a/sdks/outpost-typescript/src/models/components/destinationupdate.ts +++ b/sdks/outpost-typescript/src/models/components/destinationupdate.ts @@ -12,6 +12,12 @@ import { DestinationUpdateAWSKinesis$Outbound, DestinationUpdateAWSKinesis$outboundSchema, } from "./destinationupdateawskinesis.js"; +import { + DestinationUpdateAwss3, + DestinationUpdateAwss3$inboundSchema, + DestinationUpdateAwss3$Outbound, + DestinationUpdateAwss3$outboundSchema, +} from "./destinationupdateawss3.js"; import { DestinationUpdateAWSSQS, DestinationUpdateAWSSQS$inboundSchema, @@ -42,7 +48,8 @@ export type DestinationUpdate = | DestinationUpdateAWSSQS | DestinationUpdateRabbitMQ | DestinationUpdateHookdeck - | DestinationUpdateAWSKinesis; + | DestinationUpdateAWSKinesis + | DestinationUpdateAwss3; /** @internal */ export const DestinationUpdate$inboundSchema: z.ZodType< @@ -55,6 +62,7 @@ export const DestinationUpdate$inboundSchema: z.ZodType< DestinationUpdateRabbitMQ$inboundSchema, DestinationUpdateHookdeck$inboundSchema, DestinationUpdateAWSKinesis$inboundSchema, + DestinationUpdateAwss3$inboundSchema, ]); /** @internal */ @@ -63,7 +71,8 @@ export type DestinationUpdate$Outbound = | DestinationUpdateAWSSQS$Outbound | DestinationUpdateRabbitMQ$Outbound | DestinationUpdateHookdeck$Outbound - | DestinationUpdateAWSKinesis$Outbound; + | DestinationUpdateAWSKinesis$Outbound + | DestinationUpdateAwss3$Outbound; /** @internal */ export const DestinationUpdate$outboundSchema: z.ZodType< @@ -76,6 +85,7 @@ export const DestinationUpdate$outboundSchema: z.ZodType< DestinationUpdateRabbitMQ$outboundSchema, DestinationUpdateHookdeck$outboundSchema, DestinationUpdateAWSKinesis$outboundSchema, + DestinationUpdateAwss3$outboundSchema, ]); /** diff --git a/sdks/outpost-typescript/src/models/components/destinationupdateawss3.ts b/sdks/outpost-typescript/src/models/components/destinationupdateawss3.ts new file mode 100644 index 00000000..d9820cd4 --- /dev/null +++ b/sdks/outpost-typescript/src/models/components/destinationupdateawss3.ts @@ -0,0 +1,95 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + Awss3Config, + Awss3Config$inboundSchema, + Awss3Config$Outbound, + Awss3Config$outboundSchema, +} from "./awss3config.js"; +import { + Awss3Credentials, + Awss3Credentials$inboundSchema, + Awss3Credentials$Outbound, + Awss3Credentials$outboundSchema, +} from "./awss3credentials.js"; +import { + Topics, + Topics$inboundSchema, + Topics$Outbound, + Topics$outboundSchema, +} from "./topics.js"; + +export type DestinationUpdateAwss3 = { + /** + * "*" or an array of enabled topics. + */ + topics?: Topics | undefined; + config?: Awss3Config | undefined; + credentials?: Awss3Credentials | undefined; +}; + +/** @internal */ +export const DestinationUpdateAwss3$inboundSchema: z.ZodType< + DestinationUpdateAwss3, + z.ZodTypeDef, + unknown +> = z.object({ + topics: Topics$inboundSchema.optional(), + config: Awss3Config$inboundSchema.optional(), + credentials: Awss3Credentials$inboundSchema.optional(), +}); + +/** @internal */ +export type DestinationUpdateAwss3$Outbound = { + topics?: Topics$Outbound | undefined; + config?: Awss3Config$Outbound | undefined; + credentials?: Awss3Credentials$Outbound | undefined; +}; + +/** @internal */ +export const DestinationUpdateAwss3$outboundSchema: z.ZodType< + DestinationUpdateAwss3$Outbound, + z.ZodTypeDef, + DestinationUpdateAwss3 +> = z.object({ + topics: Topics$outboundSchema.optional(), + config: Awss3Config$outboundSchema.optional(), + credentials: Awss3Credentials$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DestinationUpdateAwss3$ { + /** @deprecated use `DestinationUpdateAwss3$inboundSchema` instead. */ + export const inboundSchema = DestinationUpdateAwss3$inboundSchema; + /** @deprecated use `DestinationUpdateAwss3$outboundSchema` instead. */ + export const outboundSchema = DestinationUpdateAwss3$outboundSchema; + /** @deprecated use `DestinationUpdateAwss3$Outbound` instead. */ + export type Outbound = DestinationUpdateAwss3$Outbound; +} + +export function destinationUpdateAwss3ToJSON( + destinationUpdateAwss3: DestinationUpdateAwss3, +): string { + return JSON.stringify( + DestinationUpdateAwss3$outboundSchema.parse(destinationUpdateAwss3), + ); +} + +export function destinationUpdateAwss3FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DestinationUpdateAwss3$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DestinationUpdateAwss3' from JSON`, + ); +} diff --git a/sdks/outpost-typescript/src/models/components/index.ts b/sdks/outpost-typescript/src/models/components/index.ts index 983fb2b2..a2a9962c 100644 --- a/sdks/outpost-typescript/src/models/components/index.ts +++ b/sdks/outpost-typescript/src/models/components/index.ts @@ -4,6 +4,8 @@ export * from "./awskinesisconfig.js"; export * from "./awskinesiscredentials.js"; +export * from "./awss3config.js"; +export * from "./awss3credentials.js"; export * from "./awssqsconfig.js"; export * from "./awssqscredentials.js"; export * from "./azureservicebusconfig.js"; @@ -11,10 +13,12 @@ export * from "./azureservicebuscredentials.js"; export * from "./deliveryattempt.js"; export * from "./destination.js"; export * from "./destinationawskinesis.js"; +export * from "./destinationawss3.js"; export * from "./destinationawssqs.js"; export * from "./destinationazureservicebus.js"; export * from "./destinationcreate.js"; export * from "./destinationcreateawskinesis.js"; +export * from "./destinationcreateawss3.js"; export * from "./destinationcreateawssqs.js"; export * from "./destinationcreateazureservicebus.js"; export * from "./destinationcreatehookdeck.js"; @@ -26,6 +30,7 @@ export * from "./destinationschemafield.js"; export * from "./destinationtypeschema.js"; export * from "./destinationupdate.js"; export * from "./destinationupdateawskinesis.js"; +export * from "./destinationupdateawss3.js"; export * from "./destinationupdateawssqs.js"; export * from "./destinationupdatehookdeck.js"; export * from "./destinationupdaterabbitmq.js"; diff --git a/sdks/outpost-typescript/src/models/operations/getdestinationtypeschema.ts b/sdks/outpost-typescript/src/models/operations/getdestinationtypeschema.ts index 4148ba8a..02cdf2de 100644 --- a/sdks/outpost-typescript/src/models/operations/getdestinationtypeschema.ts +++ b/sdks/outpost-typescript/src/models/operations/getdestinationtypeschema.ts @@ -17,6 +17,7 @@ export const GetDestinationTypeSchemaType = { Rabbitmq: "rabbitmq", Hookdeck: "hookdeck", AwsKinesis: "aws_kinesis", + AwsS3: "aws_s3", } as const; /** * The type of the destination. diff --git a/sdks/outpost-typescript/src/models/operations/gettenantdestinationtypeschema.ts b/sdks/outpost-typescript/src/models/operations/gettenantdestinationtypeschema.ts index a54ffee8..41af2bc9 100644 --- a/sdks/outpost-typescript/src/models/operations/gettenantdestinationtypeschema.ts +++ b/sdks/outpost-typescript/src/models/operations/gettenantdestinationtypeschema.ts @@ -22,6 +22,7 @@ export const GetTenantDestinationTypeSchemaType = { Rabbitmq: "rabbitmq", Hookdeck: "hookdeck", AwsKinesis: "aws_kinesis", + AwsS3: "aws_s3", } as const; /** * The type of the destination. diff --git a/sdks/outpost-typescript/src/models/operations/listtenantdestinations.ts b/sdks/outpost-typescript/src/models/operations/listtenantdestinations.ts index faed24ee..8bded1ea 100644 --- a/sdks/outpost-typescript/src/models/operations/listtenantdestinations.ts +++ b/sdks/outpost-typescript/src/models/operations/listtenantdestinations.ts @@ -19,6 +19,7 @@ export const ListTenantDestinationsTypeEnum2 = { Rabbitmq: "rabbitmq", Hookdeck: "hookdeck", AwsKinesis: "aws_kinesis", + AwsS3: "aws_s3", } as const; export type ListTenantDestinationsTypeEnum2 = ClosedEnum< typeof ListTenantDestinationsTypeEnum2 @@ -30,6 +31,7 @@ export const ListTenantDestinationsTypeEnum1 = { Rabbitmq: "rabbitmq", Hookdeck: "hookdeck", AwsKinesis: "aws_kinesis", + AwsS3: "aws_s3", } as const; export type ListTenantDestinationsTypeEnum1 = ClosedEnum< typeof ListTenantDestinationsTypeEnum1 diff --git a/sdks/outpost-typescript/src/models/operations/listtenantevents.ts b/sdks/outpost-typescript/src/models/operations/listtenantevents.ts index 152e3c44..a944b345 100644 --- a/sdks/outpost-typescript/src/models/operations/listtenantevents.ts +++ b/sdks/outpost-typescript/src/models/operations/listtenantevents.ts @@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ListTenantEventsGlobals = { @@ -43,6 +44,49 @@ export type ListTenantEventsRequest = { * Filter events by delivery status. */ status?: ListTenantEventsStatus | undefined; + /** + * Cursor for next page of results + */ + next?: string | undefined; + /** + * Cursor for previous page of results + */ + prev?: string | undefined; + /** + * Number of items per page (default 100, max 1000) + */ + limit?: number | undefined; + /** + * Start time filter (RFC3339 format) + */ + start?: Date | undefined; + /** + * End time filter (RFC3339 format) + */ + end?: Date | undefined; +}; + +/** + * A paginated list of events. + */ +export type ListTenantEventsResponseBody = { + /** + * Total number of items across all pages + */ + count: number; + data: Array; + /** + * Cursor for next page (empty string if no next page) + */ + nextCursor: string; + /** + * Cursor for previous page (empty string if no previous page) + */ + prevCursor: string; +}; + +export type ListTenantEventsResponse = { + result: ListTenantEventsResponseBody; }; /** @internal */ @@ -181,6 +225,13 @@ export const ListTenantEventsRequest$inboundSchema: z.ZodType< tenant_id: z.string().optional(), destination_id: z.union([z.string(), z.array(z.string())]).optional(), status: ListTenantEventsStatus$inboundSchema.optional(), + next: z.string().optional(), + prev: z.string().optional(), + limit: z.number().int().default(100), + start: z.string().datetime({ offset: true }).transform(v => new Date(v)) + .optional(), + end: z.string().datetime({ offset: true }).transform(v => new Date(v)) + .optional(), }).transform((v) => { return remap$(v, { "tenant_id": "tenantId", @@ -193,6 +244,11 @@ export type ListTenantEventsRequest$Outbound = { tenant_id?: string | undefined; destination_id?: string | Array | undefined; status?: string | undefined; + next?: string | undefined; + prev?: string | undefined; + limit: number; + start?: string | undefined; + end?: string | undefined; }; /** @internal */ @@ -204,6 +260,11 @@ export const ListTenantEventsRequest$outboundSchema: z.ZodType< tenantId: z.string().optional(), destinationId: z.union([z.string(), z.array(z.string())]).optional(), status: ListTenantEventsStatus$outboundSchema.optional(), + next: z.string().optional(), + prev: z.string().optional(), + limit: z.number().int().default(100), + start: z.date().transform(v => v.toISOString()).optional(), + end: z.date().transform(v => v.toISOString()).optional(), }).transform((v) => { return remap$(v, { tenantId: "tenant_id", @@ -241,3 +302,140 @@ export function listTenantEventsRequestFromJSON( `Failed to parse 'ListTenantEventsRequest' from JSON`, ); } + +/** @internal */ +export const ListTenantEventsResponseBody$inboundSchema: z.ZodType< + ListTenantEventsResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + count: z.number().int(), + data: z.array(components.Event$inboundSchema), + next: z.string(), + prev: z.string(), +}).transform((v) => { + return remap$(v, { + "next": "nextCursor", + "prev": "prevCursor", + }); +}); + +/** @internal */ +export type ListTenantEventsResponseBody$Outbound = { + count: number; + data: Array; + next: string; + prev: string; +}; + +/** @internal */ +export const ListTenantEventsResponseBody$outboundSchema: z.ZodType< + ListTenantEventsResponseBody$Outbound, + z.ZodTypeDef, + ListTenantEventsResponseBody +> = z.object({ + count: z.number().int(), + data: z.array(components.Event$outboundSchema), + nextCursor: z.string(), + prevCursor: z.string(), +}).transform((v) => { + return remap$(v, { + nextCursor: "next", + prevCursor: "prev", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTenantEventsResponseBody$ { + /** @deprecated use `ListTenantEventsResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListTenantEventsResponseBody$inboundSchema; + /** @deprecated use `ListTenantEventsResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListTenantEventsResponseBody$outboundSchema; + /** @deprecated use `ListTenantEventsResponseBody$Outbound` instead. */ + export type Outbound = ListTenantEventsResponseBody$Outbound; +} + +export function listTenantEventsResponseBodyToJSON( + listTenantEventsResponseBody: ListTenantEventsResponseBody, +): string { + return JSON.stringify( + ListTenantEventsResponseBody$outboundSchema.parse( + listTenantEventsResponseBody, + ), + ); +} + +export function listTenantEventsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListTenantEventsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListTenantEventsResponseBody' from JSON`, + ); +} + +/** @internal */ +export const ListTenantEventsResponse$inboundSchema: z.ZodType< + ListTenantEventsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + Result: z.lazy(() => ListTenantEventsResponseBody$inboundSchema), +}).transform((v) => { + return remap$(v, { + "Result": "result", + }); +}); + +/** @internal */ +export type ListTenantEventsResponse$Outbound = { + Result: ListTenantEventsResponseBody$Outbound; +}; + +/** @internal */ +export const ListTenantEventsResponse$outboundSchema: z.ZodType< + ListTenantEventsResponse$Outbound, + z.ZodTypeDef, + ListTenantEventsResponse +> = z.object({ + result: z.lazy(() => ListTenantEventsResponseBody$outboundSchema), +}).transform((v) => { + return remap$(v, { + result: "Result", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTenantEventsResponse$ { + /** @deprecated use `ListTenantEventsResponse$inboundSchema` instead. */ + export const inboundSchema = ListTenantEventsResponse$inboundSchema; + /** @deprecated use `ListTenantEventsResponse$outboundSchema` instead. */ + export const outboundSchema = ListTenantEventsResponse$outboundSchema; + /** @deprecated use `ListTenantEventsResponse$Outbound` instead. */ + export type Outbound = ListTenantEventsResponse$Outbound; +} + +export function listTenantEventsResponseToJSON( + listTenantEventsResponse: ListTenantEventsResponse, +): string { + return JSON.stringify( + ListTenantEventsResponse$outboundSchema.parse(listTenantEventsResponse), + ); +} + +export function listTenantEventsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListTenantEventsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListTenantEventsResponse' from JSON`, + ); +} diff --git a/sdks/outpost-typescript/src/models/operations/listtenanteventsbydestination.ts b/sdks/outpost-typescript/src/models/operations/listtenanteventsbydestination.ts index aea9c0ab..9c4230dc 100644 --- a/sdks/outpost-typescript/src/models/operations/listtenanteventsbydestination.ts +++ b/sdks/outpost-typescript/src/models/operations/listtenanteventsbydestination.ts @@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ListTenantEventsByDestinationGlobals = { @@ -40,6 +41,49 @@ export type ListTenantEventsByDestinationRequest = { * Filter events by delivery status. */ status?: ListTenantEventsByDestinationStatus | undefined; + /** + * Cursor for next page of results + */ + next?: string | undefined; + /** + * Cursor for previous page of results + */ + prev?: string | undefined; + /** + * Number of items per page (default 100, max 1000) + */ + limit?: number | undefined; + /** + * Start time filter (RFC3339 format) + */ + start?: Date | undefined; + /** + * End time filter (RFC3339 format) + */ + end?: Date | undefined; +}; + +/** + * A paginated list of events for the destination. + */ +export type ListTenantEventsByDestinationResponseBody = { + /** + * Total number of items across all pages + */ + count: number; + data: Array; + /** + * Cursor for next page (empty string if no next page) + */ + nextCursor: string; + /** + * Cursor for previous page (empty string if no previous page) + */ + prevCursor: string; +}; + +export type ListTenantEventsByDestinationResponse = { + result: ListTenantEventsByDestinationResponseBody; }; /** @internal */ @@ -141,6 +185,13 @@ export const ListTenantEventsByDestinationRequest$inboundSchema: z.ZodType< tenant_id: z.string().optional(), destination_id: z.string(), status: ListTenantEventsByDestinationStatus$inboundSchema.optional(), + next: z.string().optional(), + prev: z.string().optional(), + limit: z.number().int().default(100), + start: z.string().datetime({ offset: true }).transform(v => new Date(v)) + .optional(), + end: z.string().datetime({ offset: true }).transform(v => new Date(v)) + .optional(), }).transform((v) => { return remap$(v, { "tenant_id": "tenantId", @@ -153,6 +204,11 @@ export type ListTenantEventsByDestinationRequest$Outbound = { tenant_id?: string | undefined; destination_id: string; status?: string | undefined; + next?: string | undefined; + prev?: string | undefined; + limit: number; + start?: string | undefined; + end?: string | undefined; }; /** @internal */ @@ -164,6 +220,11 @@ export const ListTenantEventsByDestinationRequest$outboundSchema: z.ZodType< tenantId: z.string().optional(), destinationId: z.string(), status: ListTenantEventsByDestinationStatus$outboundSchema.optional(), + next: z.string().optional(), + prev: z.string().optional(), + limit: z.number().int().default(100), + start: z.date().transform(v => v.toISOString()).optional(), + end: z.date().transform(v => v.toISOString()).optional(), }).transform((v) => { return remap$(v, { tenantId: "tenant_id", @@ -206,3 +267,157 @@ export function listTenantEventsByDestinationRequestFromJSON( `Failed to parse 'ListTenantEventsByDestinationRequest' from JSON`, ); } + +/** @internal */ +export const ListTenantEventsByDestinationResponseBody$inboundSchema: z.ZodType< + ListTenantEventsByDestinationResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + count: z.number().int(), + data: z.array(components.Event$inboundSchema), + next: z.string(), + prev: z.string(), +}).transform((v) => { + return remap$(v, { + "next": "nextCursor", + "prev": "prevCursor", + }); +}); + +/** @internal */ +export type ListTenantEventsByDestinationResponseBody$Outbound = { + count: number; + data: Array; + next: string; + prev: string; +}; + +/** @internal */ +export const ListTenantEventsByDestinationResponseBody$outboundSchema: + z.ZodType< + ListTenantEventsByDestinationResponseBody$Outbound, + z.ZodTypeDef, + ListTenantEventsByDestinationResponseBody + > = z.object({ + count: z.number().int(), + data: z.array(components.Event$outboundSchema), + nextCursor: z.string(), + prevCursor: z.string(), + }).transform((v) => { + return remap$(v, { + nextCursor: "next", + prevCursor: "prev", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTenantEventsByDestinationResponseBody$ { + /** @deprecated use `ListTenantEventsByDestinationResponseBody$inboundSchema` instead. */ + export const inboundSchema = + ListTenantEventsByDestinationResponseBody$inboundSchema; + /** @deprecated use `ListTenantEventsByDestinationResponseBody$outboundSchema` instead. */ + export const outboundSchema = + ListTenantEventsByDestinationResponseBody$outboundSchema; + /** @deprecated use `ListTenantEventsByDestinationResponseBody$Outbound` instead. */ + export type Outbound = ListTenantEventsByDestinationResponseBody$Outbound; +} + +export function listTenantEventsByDestinationResponseBodyToJSON( + listTenantEventsByDestinationResponseBody: + ListTenantEventsByDestinationResponseBody, +): string { + return JSON.stringify( + ListTenantEventsByDestinationResponseBody$outboundSchema.parse( + listTenantEventsByDestinationResponseBody, + ), + ); +} + +export function listTenantEventsByDestinationResponseBodyFromJSON( + jsonString: string, +): SafeParseResult< + ListTenantEventsByDestinationResponseBody, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + ListTenantEventsByDestinationResponseBody$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'ListTenantEventsByDestinationResponseBody' from JSON`, + ); +} + +/** @internal */ +export const ListTenantEventsByDestinationResponse$inboundSchema: z.ZodType< + ListTenantEventsByDestinationResponse, + z.ZodTypeDef, + unknown +> = z.object({ + Result: z.lazy(() => ListTenantEventsByDestinationResponseBody$inboundSchema), +}).transform((v) => { + return remap$(v, { + "Result": "result", + }); +}); + +/** @internal */ +export type ListTenantEventsByDestinationResponse$Outbound = { + Result: ListTenantEventsByDestinationResponseBody$Outbound; +}; + +/** @internal */ +export const ListTenantEventsByDestinationResponse$outboundSchema: z.ZodType< + ListTenantEventsByDestinationResponse$Outbound, + z.ZodTypeDef, + ListTenantEventsByDestinationResponse +> = z.object({ + result: z.lazy(() => + ListTenantEventsByDestinationResponseBody$outboundSchema + ), +}).transform((v) => { + return remap$(v, { + result: "Result", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTenantEventsByDestinationResponse$ { + /** @deprecated use `ListTenantEventsByDestinationResponse$inboundSchema` instead. */ + export const inboundSchema = + ListTenantEventsByDestinationResponse$inboundSchema; + /** @deprecated use `ListTenantEventsByDestinationResponse$outboundSchema` instead. */ + export const outboundSchema = + ListTenantEventsByDestinationResponse$outboundSchema; + /** @deprecated use `ListTenantEventsByDestinationResponse$Outbound` instead. */ + export type Outbound = ListTenantEventsByDestinationResponse$Outbound; +} + +export function listTenantEventsByDestinationResponseToJSON( + listTenantEventsByDestinationResponse: ListTenantEventsByDestinationResponse, +): string { + return JSON.stringify( + ListTenantEventsByDestinationResponse$outboundSchema.parse( + listTenantEventsByDestinationResponse, + ), + ); +} + +export function listTenantEventsByDestinationResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + ListTenantEventsByDestinationResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListTenantEventsByDestinationResponse' from JSON`, + ); +} diff --git a/sdks/outpost-typescript/src/sdk/events.ts b/sdks/outpost-typescript/src/sdk/events.ts index e426da94..147b1cf5 100644 --- a/sdks/outpost-typescript/src/sdk/events.ts +++ b/sdks/outpost-typescript/src/sdk/events.ts @@ -12,6 +12,7 @@ import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; export class Events extends ClientSDK { /** @@ -23,8 +24,10 @@ export class Events extends ClientSDK { async list( request: operations.ListTenantEventsRequest, options?: RequestOptions, - ): Promise> { - return unwrapAsync(eventsList( + ): Promise< + PageIterator + > { + return unwrapResultIterator(eventsList( this, request, options, @@ -74,8 +77,13 @@ export class Events extends ClientSDK { async listByDestination( request: operations.ListTenantEventsByDestinationRequest, options?: RequestOptions, - ): Promise> { - return unwrapAsync(eventsListByDestination( + ): Promise< + PageIterator< + operations.ListTenantEventsByDestinationResponse, + { cursor: string } + > + > { + return unwrapResultIterator(eventsListByDestination( this, request, options,