From 650f929f38ccd04b735ddfe597508204cfe91126 Mon Sep 17 00:00:00 2001 From: Mendy Man Date: Tue, 18 Feb 2025 10:25:34 -0500 Subject: [PATCH] js: Add non-pubic methods --- javascript/src/api_internal/application.ts | 29 +++ javascript/src/api_internal/authentication.ts | 121 ++++++++++++ javascript/src/api_internal/endpoint.ts | 185 ++++++++++++++++++ javascript/src/api_internal/environment.ts | 21 ++ javascript/src/api_internal/eventType.ts | 89 +++++++++ javascript/src/api_internal/inbound.ts | 57 ++++++ javascript/src/api_internal/message.ts | 121 ++++++++++++ javascript/src/api_internal/messageAttempt.ts | 76 +++++++ .../api_internal/messageEventsSubscription.ts | 36 ++++ javascript/src/api_internal/sink.ts | 67 +++++++ javascript/src/api_internal/stats.ts | 64 ++++++ .../src/api_internal/streamEventType.ts | 113 +++++++++++ javascript/src/api_internal/streamEvents.ts | 52 +++++ javascript/src/api_internal/streamStream.ts | 90 +++++++++ .../api_internal/transformationTemplate.ts | 169 ++++++++++++++++ .../transformationTemplateOauth.ts | 79 ++++++++ javascript/src/models/applicationStats.ts | 28 +++ .../src/models/attemptStatisticsData.ts | 23 +++ .../src/models/attemptStatisticsResponse.ts | 34 ++++ javascript/src/models/authTokenOut.ts | 36 ++++ javascript/src/models/borderRadiusConfig.ts | 31 +++ javascript/src/models/borderRadiusEnum.ts | 20 ++ .../src/models/clientSecretJwtParamsIn.ts | 41 ++++ javascript/src/models/completionChoice.ts | 27 +++ javascript/src/models/completionMessage.ts | 23 +++ javascript/src/models/countOut.ts | 25 +++ javascript/src/models/createStreamIn.ts | 32 +++ javascript/src/models/createStreamOut.ts | 16 ++ javascript/src/models/createTokenIn.ts | 25 +++ javascript/src/models/customColorPalette.ts | 44 +++++ .../src/models/customStringsOverride.ts | 26 +++ javascript/src/models/customThemeOverride.ts | 29 +++ javascript/src/models/duration.ts | 23 +++ javascript/src/models/endpointMtlsConfigIn.ts | 25 +++ .../src/models/endpointMtlsConfigOut.ts | 20 ++ .../src/models/endpointOauthConfigIn.ts | 70 +++++++ .../src/models/endpointOauthConfigOut.ts | 43 ++++ .../endpointTransformationSimulateIn.ts | 30 +++ .../endpointTransformationSimulateOut.ts | 32 +++ .../src/models/environmentSettingsOut.ts | 96 +++++++++ javascript/src/models/eventIn.ts | 24 +++ javascript/src/models/eventOut.ts | 27 +++ javascript/src/models/eventStreamOut.ts | 29 +++ javascript/src/models/eventTypeExampleOut.ts | 20 ++ javascript/src/models/eventTypeSchemaIn.ts | 20 ++ javascript/src/models/exportEventTypeOut.ts | 32 +++ javascript/src/models/fontSizeConfig.ts | 20 ++ javascript/src/models/generateIn.ts | 20 ++ javascript/src/models/generateOut.ts | 35 ++++ javascript/src/models/hubspotOauthConfigIn.ts | 20 ++ .../src/models/incomingWebhookPayloadOut.ts | 26 +++ .../src/models/kafkaSecurityProtocolType.ts | 18 ++ javascript/src/models/listResponseSinkOut.ts | 32 +++ .../models/listResponseStreamEventTypeOut.ts | 32 +++ .../src/models/listResponseStreamOut.ts | 32 +++ .../src/models/listResponseTemplateOut.ts | 32 +++ .../src/models/messageAttemptHeadersOut.ts | 26 +++ javascript/src/models/messageEventsOut.ts | 29 +++ javascript/src/models/messagePrecheckIn.ts | 24 +++ javascript/src/models/messagePrecheckOut.ts | 20 ++ javascript/src/models/messageRawPayloadOut.ts | 20 ++ .../models/messageSubscriberAuthTokenOut.ts | 23 +++ javascript/src/models/oAuthPayloadIn.ts | 23 +++ javascript/src/models/oAuthPayloadOut.ts | 26 +++ .../src/models/oauth2AuthMethodInOut.ts | 22 +++ javascript/src/models/oauth2GrantTypeInOut.ts | 17 ++ .../src/models/oauthJwsSigningAlgorithm.ts | 16 ++ javascript/src/models/oneTimeTokenIn.ts | 20 ++ javascript/src/models/oneTimeTokenOut.ts | 20 ++ javascript/src/models/retrySchedule.ts | 14 ++ javascript/src/models/retryScheduleInOut.ts | 23 +++ javascript/src/models/rotatePollerTokenIn.ts | 31 +++ javascript/src/models/rotatedUrlOut.ts | 20 ++ javascript/src/models/sinkIn.ts | 53 +++++ javascript/src/models/sinkInType.ts | 172 ++++++++++++++++ javascript/src/models/sinkOut.ts | 55 ++++++ javascript/src/models/sinkOutType.ts | 172 ++++++++++++++++ javascript/src/models/statisticsPeriod.ts | 17 ++ javascript/src/models/streamEventTypeIn.ts | 24 +++ javascript/src/models/streamEventTypeOut.ts | 30 +++ javascript/src/models/streamEventTypePatch.ts | 24 +++ javascript/src/models/streamIn.ts | 25 +++ javascript/src/models/streamOut.ts | 35 ++++ javascript/src/models/streamPatch.ts | 25 +++ javascript/src/models/streamPortalAccessIn.ts | 33 ++++ javascript/src/models/templatePatch.ts | 45 +++++ javascript/src/models/templateUpdate.ts | 45 +++++ .../src/models/transformationHttpMethod.ts | 18 ++ .../src/models/transformationSimulateIn.ts | 30 +++ .../src/models/transformationSimulateOut.ts | 32 +++ 90 files changed, 3796 insertions(+) create mode 100644 javascript/src/api_internal/application.ts create mode 100644 javascript/src/api_internal/authentication.ts create mode 100644 javascript/src/api_internal/endpoint.ts create mode 100644 javascript/src/api_internal/environment.ts create mode 100644 javascript/src/api_internal/eventType.ts create mode 100644 javascript/src/api_internal/inbound.ts create mode 100644 javascript/src/api_internal/message.ts create mode 100644 javascript/src/api_internal/messageAttempt.ts create mode 100644 javascript/src/api_internal/messageEventsSubscription.ts create mode 100644 javascript/src/api_internal/sink.ts create mode 100644 javascript/src/api_internal/stats.ts create mode 100644 javascript/src/api_internal/streamEventType.ts create mode 100644 javascript/src/api_internal/streamEvents.ts create mode 100644 javascript/src/api_internal/streamStream.ts create mode 100644 javascript/src/api_internal/transformationTemplate.ts create mode 100644 javascript/src/api_internal/transformationTemplateOauth.ts create mode 100644 javascript/src/models/applicationStats.ts create mode 100644 javascript/src/models/attemptStatisticsData.ts create mode 100644 javascript/src/models/attemptStatisticsResponse.ts create mode 100644 javascript/src/models/authTokenOut.ts create mode 100644 javascript/src/models/borderRadiusConfig.ts create mode 100644 javascript/src/models/borderRadiusEnum.ts create mode 100644 javascript/src/models/clientSecretJwtParamsIn.ts create mode 100644 javascript/src/models/completionChoice.ts create mode 100644 javascript/src/models/completionMessage.ts create mode 100644 javascript/src/models/countOut.ts create mode 100644 javascript/src/models/createStreamIn.ts create mode 100644 javascript/src/models/createStreamOut.ts create mode 100644 javascript/src/models/createTokenIn.ts create mode 100644 javascript/src/models/customColorPalette.ts create mode 100644 javascript/src/models/customStringsOverride.ts create mode 100644 javascript/src/models/customThemeOverride.ts create mode 100644 javascript/src/models/duration.ts create mode 100644 javascript/src/models/endpointMtlsConfigIn.ts create mode 100644 javascript/src/models/endpointMtlsConfigOut.ts create mode 100644 javascript/src/models/endpointOauthConfigIn.ts create mode 100644 javascript/src/models/endpointOauthConfigOut.ts create mode 100644 javascript/src/models/endpointTransformationSimulateIn.ts create mode 100644 javascript/src/models/endpointTransformationSimulateOut.ts create mode 100644 javascript/src/models/environmentSettingsOut.ts create mode 100644 javascript/src/models/eventIn.ts create mode 100644 javascript/src/models/eventOut.ts create mode 100644 javascript/src/models/eventStreamOut.ts create mode 100644 javascript/src/models/eventTypeExampleOut.ts create mode 100644 javascript/src/models/eventTypeSchemaIn.ts create mode 100644 javascript/src/models/exportEventTypeOut.ts create mode 100644 javascript/src/models/fontSizeConfig.ts create mode 100644 javascript/src/models/generateIn.ts create mode 100644 javascript/src/models/generateOut.ts create mode 100644 javascript/src/models/hubspotOauthConfigIn.ts create mode 100644 javascript/src/models/incomingWebhookPayloadOut.ts create mode 100644 javascript/src/models/kafkaSecurityProtocolType.ts create mode 100644 javascript/src/models/listResponseSinkOut.ts create mode 100644 javascript/src/models/listResponseStreamEventTypeOut.ts create mode 100644 javascript/src/models/listResponseStreamOut.ts create mode 100644 javascript/src/models/listResponseTemplateOut.ts create mode 100644 javascript/src/models/messageAttemptHeadersOut.ts create mode 100644 javascript/src/models/messageEventsOut.ts create mode 100644 javascript/src/models/messagePrecheckIn.ts create mode 100644 javascript/src/models/messagePrecheckOut.ts create mode 100644 javascript/src/models/messageRawPayloadOut.ts create mode 100644 javascript/src/models/messageSubscriberAuthTokenOut.ts create mode 100644 javascript/src/models/oAuthPayloadIn.ts create mode 100644 javascript/src/models/oAuthPayloadOut.ts create mode 100644 javascript/src/models/oauth2AuthMethodInOut.ts create mode 100644 javascript/src/models/oauth2GrantTypeInOut.ts create mode 100644 javascript/src/models/oauthJwsSigningAlgorithm.ts create mode 100644 javascript/src/models/oneTimeTokenIn.ts create mode 100644 javascript/src/models/oneTimeTokenOut.ts create mode 100644 javascript/src/models/retrySchedule.ts create mode 100644 javascript/src/models/retryScheduleInOut.ts create mode 100644 javascript/src/models/rotatePollerTokenIn.ts create mode 100644 javascript/src/models/rotatedUrlOut.ts create mode 100644 javascript/src/models/sinkIn.ts create mode 100644 javascript/src/models/sinkInType.ts create mode 100644 javascript/src/models/sinkOut.ts create mode 100644 javascript/src/models/sinkOutType.ts create mode 100644 javascript/src/models/statisticsPeriod.ts create mode 100644 javascript/src/models/streamEventTypeIn.ts create mode 100644 javascript/src/models/streamEventTypeOut.ts create mode 100644 javascript/src/models/streamEventTypePatch.ts create mode 100644 javascript/src/models/streamIn.ts create mode 100644 javascript/src/models/streamOut.ts create mode 100644 javascript/src/models/streamPatch.ts create mode 100644 javascript/src/models/streamPortalAccessIn.ts create mode 100644 javascript/src/models/templatePatch.ts create mode 100644 javascript/src/models/templateUpdate.ts create mode 100644 javascript/src/models/transformationHttpMethod.ts create mode 100644 javascript/src/models/transformationSimulateIn.ts create mode 100644 javascript/src/models/transformationSimulateOut.ts diff --git a/javascript/src/api_internal/application.ts b/javascript/src/api_internal/application.ts new file mode 100644 index 0000000000..9285d94720 --- /dev/null +++ b/javascript/src/api_internal/application.ts @@ -0,0 +1,29 @@ +// this file is @generated +import { ApplicationStats, ApplicationStatsSerializer } from "../models/applicationStats"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface ApplicationGetStatsOptions { + /** Filter the range to data starting from this date. */ + since: Date | null; + /** Filter the range to data ending by this date. */ + until: Date | null; +} + +export class Application { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Get basic statistics for the application. */ + public getStats( + appId: string, + options: ApplicationGetStatsOptions + ): Promise { + // v1.application.get-stats is hidden + const request = new SvixRequest(HttpMethod.GET, "/api/v1/app/{app_id}/stats"); + + request.setPathParam("app_id", appId); + request.setQueryParam("since", options.since); + request.setQueryParam("until", options.until); + + return request.send(this.requestCtx, ApplicationStatsSerializer._fromJsonObject); + } +} diff --git a/javascript/src/api_internal/authentication.ts b/javascript/src/api_internal/authentication.ts new file mode 100644 index 0000000000..36ef05ccd5 --- /dev/null +++ b/javascript/src/api_internal/authentication.ts @@ -0,0 +1,121 @@ +// this file is @generated +import { + AppPortalAccessOut, + AppPortalAccessOutSerializer, +} from "../models/appPortalAccessOut"; +import { AuthTokenOut, AuthTokenOutSerializer } from "../models/authTokenOut"; +import { CreateTokenIn, CreateTokenInSerializer } from "../models/createTokenIn"; +import { OneTimeTokenIn, OneTimeTokenInSerializer } from "../models/oneTimeTokenIn"; +import { OneTimeTokenOut, OneTimeTokenOutSerializer } from "../models/oneTimeTokenOut"; +import { + RotatePollerTokenIn, + RotatePollerTokenInSerializer, +} from "../models/rotatePollerTokenIn"; +import { + StreamPortalAccessIn, + StreamPortalAccessInSerializer, +} from "../models/streamPortalAccessIn"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface AuthenticationCreateMessageTokenOptions { + idempotencyKey?: string; +} + +export interface AuthenticationRotatePollerTokenOptions { + idempotencyKey?: string; +} + +export interface AuthenticationExchangeOneTimeTokenOptions { + idempotencyKey?: string; +} + +export interface AuthenticationStreamPortalAccessOptions { + idempotencyKey?: string; +} + +export class Authentication { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Create a new access token that only allows creating messages inside this application. */ + public createMessageToken( + appId: string, + createTokenIn: CreateTokenIn, + options?: AuthenticationCreateMessageTokenOptions + ): Promise { + // v1.authentication.create-message-token is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/auth/app/{app_id}/create-message-token" + ); + + request.setPathParam("app_id", appId); + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(CreateTokenInSerializer._toJsonObject(createTokenIn)); + + return request.send(this.requestCtx, AuthTokenOutSerializer._fromJsonObject); + } + /** Get the current auth token for the poller. */ + public getPollerToken(appId: string, endpointId: string): Promise { + // v1.authentication.get-poller-token is hidden + const request = new SvixRequest( + HttpMethod.GET, + "/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + + return request.send(this.requestCtx, AuthTokenOutSerializer._fromJsonObject); + } + /** Create a new auth token that can for the poller API. */ + public rotatePollerToken( + appId: string, + endpointId: string, + rotatePollerTokenIn: RotatePollerTokenIn, + options?: AuthenticationRotatePollerTokenOptions + ): Promise { + // v1.authentication.rotate-poller-token is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token/rotate" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(RotatePollerTokenInSerializer._toJsonObject(rotatePollerTokenIn)); + + return request.send(this.requestCtx, AuthTokenOutSerializer._fromJsonObject); + } + /** This is a one time token. */ + public exchangeOneTimeToken( + oneTimeTokenIn: OneTimeTokenIn, + options?: AuthenticationExchangeOneTimeTokenOptions + ): Promise { + // v1.authentication.exchange-one-time-token is hidden + const request = new SvixRequest(HttpMethod.POST, "/api/v1/auth/one-time-token"); + + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(OneTimeTokenInSerializer._toJsonObject(oneTimeTokenIn)); + + return request.send(this.requestCtx, OneTimeTokenOutSerializer._fromJsonObject); + } + /** Use this function to get magic links (and authentication codes) for connecting your users to the Stream Consumer Portal. */ + public streamPortalAccess( + streamId: string, + streamPortalAccessIn: StreamPortalAccessIn, + options?: AuthenticationStreamPortalAccessOptions + ): Promise { + // v1.authentication.stream-portal-access is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/auth/stream-portal-access/{stream_id}" + ); + + request.setPathParam("stream_id", streamId); + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(StreamPortalAccessInSerializer._toJsonObject(streamPortalAccessIn)); + + return request.send(this.requestCtx, AppPortalAccessOutSerializer._fromJsonObject); + } +} diff --git a/javascript/src/api_internal/endpoint.ts b/javascript/src/api_internal/endpoint.ts new file mode 100644 index 0000000000..9d7bd0493d --- /dev/null +++ b/javascript/src/api_internal/endpoint.ts @@ -0,0 +1,185 @@ +// this file is @generated +import { + EndpointMtlsConfigIn, + EndpointMtlsConfigInSerializer, +} from "../models/endpointMtlsConfigIn"; +import { + EndpointMtlsConfigOut, + EndpointMtlsConfigOutSerializer, +} from "../models/endpointMtlsConfigOut"; +import { + EndpointOauthConfigIn, + EndpointOauthConfigInSerializer, +} from "../models/endpointOauthConfigIn"; +import { + EndpointOauthConfigOut, + EndpointOauthConfigOutSerializer, +} from "../models/endpointOauthConfigOut"; +import { + EndpointTransformationSimulateIn, + EndpointTransformationSimulateInSerializer, +} from "../models/endpointTransformationSimulateIn"; +import { + EndpointTransformationSimulateOut, + EndpointTransformationSimulateOutSerializer, +} from "../models/endpointTransformationSimulateOut"; +import { + HubspotOauthConfigIn, + HubspotOauthConfigInSerializer, +} from "../models/hubspotOauthConfigIn"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface EndpointTransformationSimulateOptions { + idempotencyKey?: string; +} + +export class Endpoint { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Get endpoint mTLS configuration. */ + public getMtlsConfig( + appId: string, + endpointId: string + ): Promise { + // v1.endpoint.get-mtls-config is hidden + const request = new SvixRequest( + HttpMethod.GET, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + + return request.send(this.requestCtx, EndpointMtlsConfigOutSerializer._fromJsonObject); + } + /** Create / update endpoint mTLS configuration. */ + public updateMtlsConfig( + appId: string, + endpointId: string, + endpointMtlsConfigIn: EndpointMtlsConfigIn + ): Promise { + // v1.endpoint.update-mtls-config is hidden + const request = new SvixRequest( + HttpMethod.PUT, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + request.setBody(EndpointMtlsConfigInSerializer._toJsonObject(endpointMtlsConfigIn)); + + return request.sendNoResponseBody(this.requestCtx); + } + /** Delete endpoint mTLS configuration. */ + public deleteMtlsConfig(appId: string, endpointId: string): Promise { + // v1.endpoint.delete-mtls-config is hidden + const request = new SvixRequest( + HttpMethod.DELETE, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + + return request.sendNoResponseBody(this.requestCtx); + } + /** Get endpoint OAuth configuration. */ + public getOauthConfig( + appId: string, + endpointId: string + ): Promise { + // v1.endpoint.get-oauth-config is hidden + const request = new SvixRequest( + HttpMethod.GET, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + + return request.send( + this.requestCtx, + EndpointOauthConfigOutSerializer._fromJsonObject + ); + } + /** Create / update endpoint OAuth configuration. */ + public updateOauthConfig( + appId: string, + endpointId: string, + endpointOauthConfigIn: EndpointOauthConfigIn + ): Promise { + // v1.endpoint.update-oauth-config is hidden + const request = new SvixRequest( + HttpMethod.PUT, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + request.setBody(EndpointOauthConfigInSerializer._toJsonObject(endpointOauthConfigIn)); + + return request.sendNoResponseBody(this.requestCtx); + } + /** Delete endpoint OAuth configuration. */ + public deleteOauthConfig(appId: string, endpointId: string): Promise { + // v1.endpoint.delete-oauth-config is hidden + const request = new SvixRequest( + HttpMethod.DELETE, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + + return request.sendNoResponseBody(this.requestCtx); + } + /** + * Create / update endpoint Hubspot OAuth configuration. + * + * Specific private endpoint just for us, to avoid exposing the Hubspot secret to the client. + */ + public updateHubspotOauthConfig( + appId: string, + endpointId: string, + hubspotOauthConfigIn: HubspotOauthConfigIn + ): Promise { + // v1.endpoint.update-hubspot-oauth-config is hidden + const request = new SvixRequest( + HttpMethod.PUT, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation-template/oauth/hubspot" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + request.setBody(HubspotOauthConfigInSerializer._toJsonObject(hubspotOauthConfigIn)); + + return request.sendNoResponseBody(this.requestCtx); + } + /** Simulate running the transformation on the payload and code. */ + public transformationSimulate( + appId: string, + endpointId: string, + endpointTransformationSimulateIn: EndpointTransformationSimulateIn, + options?: EndpointTransformationSimulateOptions + ): Promise { + // v1.endpoint.transformation-simulate is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody( + EndpointTransformationSimulateInSerializer._toJsonObject( + endpointTransformationSimulateIn + ) + ); + + return request.send( + this.requestCtx, + EndpointTransformationSimulateOutSerializer._fromJsonObject + ); + } +} diff --git a/javascript/src/api_internal/environment.ts b/javascript/src/api_internal/environment.ts new file mode 100644 index 0000000000..bb5e38fb2b --- /dev/null +++ b/javascript/src/api_internal/environment.ts @@ -0,0 +1,21 @@ +// this file is @generated +import { + EnvironmentSettingsOut, + EnvironmentSettingsOutSerializer, +} from "../models/environmentSettingsOut"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export class Environment { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Get the environment's settings. */ + public getSettings(): Promise { + // v1.environment.get-settings is hidden + const request = new SvixRequest(HttpMethod.GET, "/api/v1/environment/settings"); + + return request.send( + this.requestCtx, + EnvironmentSettingsOutSerializer._fromJsonObject + ); + } +} diff --git a/javascript/src/api_internal/eventType.ts b/javascript/src/api_internal/eventType.ts new file mode 100644 index 0000000000..67c7d1f00a --- /dev/null +++ b/javascript/src/api_internal/eventType.ts @@ -0,0 +1,89 @@ +// this file is @generated +import { + EventTypeExampleOut, + EventTypeExampleOutSerializer, +} from "../models/eventTypeExampleOut"; +import { + EventTypeSchemaIn, + EventTypeSchemaInSerializer, +} from "../models/eventTypeSchemaIn"; +import { + ExportEventTypeOut, + ExportEventTypeOutSerializer, +} from "../models/exportEventTypeOut"; +import { + RetryScheduleInOut, + RetryScheduleInOutSerializer, +} from "../models/retryScheduleInOut"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface EventTypeExportOpenapiOptions { + idempotencyKey?: string; +} + +export interface EventTypeGenerateExampleOptions { + idempotencyKey?: string; +} + +export class EventType { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** + * Exports event type definitions based on the OpenAPI schemas associated + * with each existing event type. + */ + public exportOpenapi( + options?: EventTypeExportOpenapiOptions + ): Promise { + // v1.event-type.export-openapi is hidden + const request = new SvixRequest(HttpMethod.POST, "/api/v1/event-type/export/openapi"); + + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + + return request.send(this.requestCtx, ExportEventTypeOutSerializer._fromJsonObject); + } + /** Generates a fake example from the given JSONSchema. */ + public generateExample( + eventTypeSchemaIn: EventTypeSchemaIn, + options?: EventTypeGenerateExampleOptions + ): Promise { + // v1.event-type.generate-example is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/event-type/schema/generate-example" + ); + + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(EventTypeSchemaInSerializer._toJsonObject(eventTypeSchemaIn)); + + return request.send(this.requestCtx, EventTypeExampleOutSerializer._fromJsonObject); + } + /** Gets the retry schedule for messages using the given event type. */ + public getRetrySchedule(eventTypeName: string): Promise { + // v1.event-type.get-retry-schedule is hidden + const request = new SvixRequest( + HttpMethod.GET, + "/api/v1/event-type/{event_type_name}/retry-schedule" + ); + + request.setPathParam("event_type_name", eventTypeName); + + return request.send(this.requestCtx, RetryScheduleInOutSerializer._fromJsonObject); + } + /** Sets a retry schedule for all messages using the given event type. */ + public updateRetrySchedule( + eventTypeName: string, + retryScheduleInOut: RetryScheduleInOut + ): Promise { + // v1.event-type.update-retry-schedule is hidden + const request = new SvixRequest( + HttpMethod.PUT, + "/api/v1/event-type/{event_type_name}/retry-schedule" + ); + + request.setPathParam("event_type_name", eventTypeName); + request.setBody(RetryScheduleInOutSerializer._toJsonObject(retryScheduleInOut)); + + return request.send(this.requestCtx, RetryScheduleInOutSerializer._fromJsonObject); + } +} diff --git a/javascript/src/api_internal/inbound.ts b/javascript/src/api_internal/inbound.ts new file mode 100644 index 0000000000..4146f3505d --- /dev/null +++ b/javascript/src/api_internal/inbound.ts @@ -0,0 +1,57 @@ +// this file is @generated +import { MessageOut, MessageOutSerializer } from "../models/messageOut"; +import { RotatedUrlOut, RotatedUrlOutSerializer } from "../models/rotatedUrlOut"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface InboundMsgOptions { + /** The event type's name */ + eventType?: string; + idempotencyKey?: string; +} + +export interface InboundRotateUrlOptions { + idempotencyKey?: string; +} + +export class Inbound { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Handles a raw inbound webhook for the application. */ + public msg( + appId: string, + inboundToken: string, + options?: InboundMsgOptions + ): Promise { + // v1.inbound.msg is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/app/{app_id}/inbound/msg/{inbound_token}" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("inbound_token", inboundToken); + request.setQueryParam("event_type", options?.eventType); + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + + return request.send(this.requestCtx, MessageOutSerializer._fromJsonObject); + } + /** + * Invalidates the previous inbound url (if one exists), producing a new inbound + * URL for this app. + */ + public rotateUrl( + appId: string, + options?: InboundRotateUrlOptions + ): Promise { + // v1.inbound.rotate-url is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/app/{app_id}/inbound/rotate-url" + ); + + request.setPathParam("app_id", appId); + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + + return request.send(this.requestCtx, RotatedUrlOutSerializer._fromJsonObject); + } +} diff --git a/javascript/src/api_internal/message.ts b/javascript/src/api_internal/message.ts new file mode 100644 index 0000000000..de7215f61c --- /dev/null +++ b/javascript/src/api_internal/message.ts @@ -0,0 +1,121 @@ +// this file is @generated +import { MessageEventsOut, MessageEventsOutSerializer } from "../models/messageEventsOut"; +import { + MessagePrecheckIn, + MessagePrecheckInSerializer, +} from "../models/messagePrecheckIn"; +import { + MessagePrecheckOut, + MessagePrecheckOutSerializer, +} from "../models/messagePrecheckOut"; +import { + MessageRawPayloadOut, + MessageRawPayloadOutSerializer, +} from "../models/messageRawPayloadOut"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface MessageEventsOptions { + /** Limit the number of returned items */ + limit?: number; + /** The iterator returned from a prior invocation */ + iterator?: string | null; + /** Filter response based on the event type */ + eventTypes?: string[]; + /** Filter response based on the event type. */ + channels?: string[]; + after?: Date | null; +} + +export interface MessageEventsSubscriptionOptions { + /** Limit the number of returned items */ + limit?: number; + /** The iterator returned from a prior invocation */ + iterator?: string | null; + /** Filter response based on the event type */ + eventTypes?: string[]; + /** Filter response based on the event type. */ + channels?: string[]; + after?: Date | null; +} + +export interface MessagePrecheckOptions { + idempotencyKey?: string; +} + +export class Message { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Reads the stream of created messages for an application. */ + public events( + appId: string, + options?: MessageEventsOptions + ): Promise { + // v1.message.events is hidden + const request = new SvixRequest(HttpMethod.GET, "/api/v1/app/{app_id}/events"); + + request.setPathParam("app_id", appId); + request.setQueryParam("limit", options?.limit); + request.setQueryParam("iterator", options?.iterator); + request.setQueryParam("event_types", options?.eventTypes); + request.setQueryParam("channels", options?.channels); + request.setQueryParam("after", options?.after); + + return request.send(this.requestCtx, MessageEventsOutSerializer._fromJsonObject); + } + /** Reads the stream of created messages for an application, but using server-managed iterator tracking. */ + public eventsSubscription( + appId: string, + subscriptionId: string, + options?: MessageEventsSubscriptionOptions + ): Promise { + // v1.message.events-subscription is hidden + const request = new SvixRequest( + HttpMethod.GET, + "/api/v1/app/{app_id}/events/subscription/{subscription_id}" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("subscription_id", subscriptionId); + request.setQueryParam("limit", options?.limit); + request.setQueryParam("iterator", options?.iterator); + request.setQueryParam("event_types", options?.eventTypes); + request.setQueryParam("channels", options?.channels); + request.setQueryParam("after", options?.after); + + return request.send(this.requestCtx, MessageEventsOutSerializer._fromJsonObject); + } + /** + * A pre-check call for `create.message` that checks whether endpoints are actively listening to + * this message. + */ + public precheck( + appId: string, + messagePrecheckIn: MessagePrecheckIn, + options?: MessagePrecheckOptions + ): Promise { + // v1.message.precheck is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/app/{app_id}/msg/precheck/active" + ); + + request.setPathParam("app_id", appId); + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(MessagePrecheckInSerializer._toJsonObject(messagePrecheckIn)); + + return request.send(this.requestCtx, MessagePrecheckOutSerializer._fromJsonObject); + } + /** Get a message raw payload by its ID or eventID. */ + public getRawPayload(appId: string, msgId: string): Promise { + // v1.message.get-raw-payload is hidden + const request = new SvixRequest( + HttpMethod.GET, + "/api/v1/app/{app_id}/msg/{msg_id}/raw" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("msg_id", msgId); + + return request.send(this.requestCtx, MessageRawPayloadOutSerializer._fromJsonObject); + } +} diff --git a/javascript/src/api_internal/messageAttempt.ts b/javascript/src/api_internal/messageAttempt.ts new file mode 100644 index 0000000000..c4e51f31cc --- /dev/null +++ b/javascript/src/api_internal/messageAttempt.ts @@ -0,0 +1,76 @@ +// this file is @generated +import { CountOut, CountOutSerializer } from "../models/countOut"; +import { + MessageAttemptHeadersOut, + MessageAttemptHeadersOutSerializer, +} from "../models/messageAttemptHeadersOut"; +import { MessageStatus } from "../models/messageStatus"; +import { StatusCodeClass } from "../models/statusCodeClass"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface MessageAttemptCountByEndpointOptions { + /** Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) */ + status?: MessageStatus; + /** Filter response based on the HTTP status code */ + statusCodeClass?: StatusCodeClass; + /** Filter response based on the channel */ + channel?: string; + /** Filter response based on the tag */ + tag?: string; + /** Only include items created before a certain date */ + before?: Date | null; + /** Only include items created after a certain date */ + after?: Date | null; + /** Filter response based on the event type */ + eventTypes?: string[]; +} + +export class MessageAttempt { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Like `v1.message-attempt.list-by-endpoint` but returning a count only. */ + public countByEndpoint( + appId: string, + endpointId: string, + options?: MessageAttemptCountByEndpointOptions + ): Promise { + // v1.message-attempt.count-by-endpoint is hidden + const request = new SvixRequest( + HttpMethod.GET, + "/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}/count" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + request.setQueryParam("status", options?.status); + request.setQueryParam("status_code_class", options?.statusCodeClass); + request.setQueryParam("channel", options?.channel); + request.setQueryParam("tag", options?.tag); + request.setQueryParam("before", options?.before); + request.setQueryParam("after", options?.after); + request.setQueryParam("event_types", options?.eventTypes); + + return request.send(this.requestCtx, CountOutSerializer._fromJsonObject); + } + /** Calculate and return headers used on a given message attempt */ + public getHeaders( + appId: string, + msgId: string, + attemptId: string + ): Promise { + // v1.message-attempt.get-headers is hidden + const request = new SvixRequest( + HttpMethod.GET, + "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/headers" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("msg_id", msgId); + request.setPathParam("attempt_id", attemptId); + + return request.send( + this.requestCtx, + MessageAttemptHeadersOutSerializer._fromJsonObject + ); + } +} diff --git a/javascript/src/api_internal/messageEventsSubscription.ts b/javascript/src/api_internal/messageEventsSubscription.ts new file mode 100644 index 0000000000..0d1fc79741 --- /dev/null +++ b/javascript/src/api_internal/messageEventsSubscription.ts @@ -0,0 +1,36 @@ +// this file is @generated +import { + MessageSubscriberAuthTokenOut, + MessageSubscriberAuthTokenOutSerializer, +} from "../models/messageSubscriberAuthTokenOut"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface MessageEventsSubscriptionCreateTokenOptions { + idempotencyKey?: string; +} + +export class MessageEventsSubscription { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Creates an auth token that can be used with the `v1.message.events-subscription` endpoint. */ + public createToken( + appId: string, + subscriptionId: string, + options?: MessageEventsSubscriptionCreateTokenOptions + ): Promise { + // v1.message.events-subscription.create-token is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/app/{app_id}/events/subscription/{subscription_id}/create-token" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("subscription_id", subscriptionId); + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + + return request.send( + this.requestCtx, + MessageSubscriberAuthTokenOutSerializer._fromJsonObject + ); + } +} diff --git a/javascript/src/api_internal/sink.ts b/javascript/src/api_internal/sink.ts new file mode 100644 index 0000000000..18b5a05ba1 --- /dev/null +++ b/javascript/src/api_internal/sink.ts @@ -0,0 +1,67 @@ +// this file is @generated +import { + ListResponseSinkOut, + ListResponseSinkOutSerializer, +} from "../models/listResponseSinkOut"; +import { Ordering } from "../models/ordering"; +import { SinkIn, SinkInSerializer } from "../models/sinkIn"; +import { SinkOut, SinkOutSerializer } from "../models/sinkOut"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface SinkListOptions { + /** Limit the number of returned items */ + limit?: number; + /** The iterator returned from a prior invocation */ + iterator?: string | null; + /** The sorting order of the returned items */ + order?: Ordering; +} + +export interface SinkCreateOptions { + idempotencyKey?: string; +} + +export class Sink { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** List the application's sinks. */ + public list(appId: string, options?: SinkListOptions): Promise { + // v1.sink.list is hidden + const request = new SvixRequest(HttpMethod.GET, "/api/v1/app/{app_id}/sink"); + + request.setPathParam("app_id", appId); + request.setQueryParam("limit", options?.limit); + request.setQueryParam("iterator", options?.iterator); + request.setQueryParam("order", options?.order); + + return request.send(this.requestCtx, ListResponseSinkOutSerializer._fromJsonObject); + } + /** Create a new sink for the application. */ + public create( + appId: string, + sinkIn: SinkIn, + options?: SinkCreateOptions + ): Promise { + // v1.sink.create is hidden + const request = new SvixRequest(HttpMethod.POST, "/api/v1/app/{app_id}/sink"); + + request.setPathParam("app_id", appId); + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(SinkInSerializer._toJsonObject(sinkIn)); + + return request.send(this.requestCtx, SinkOutSerializer._fromJsonObject); + } + /** Get a sink. */ + public get(appId: string, sinkId: string): Promise { + // v1.sink.get is hidden + const request = new SvixRequest( + HttpMethod.GET, + "/api/v1/app/{app_id}/sink/{sink_id}" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("sink_id", sinkId); + + return request.send(this.requestCtx, SinkOutSerializer._fromJsonObject); + } +} diff --git a/javascript/src/api_internal/stats.ts b/javascript/src/api_internal/stats.ts new file mode 100644 index 0000000000..08369617c7 --- /dev/null +++ b/javascript/src/api_internal/stats.ts @@ -0,0 +1,64 @@ +// this file is @generated +import { + AttemptStatisticsResponse, + AttemptStatisticsResponseSerializer, +} from "../models/attemptStatisticsResponse"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface StatsAppAttemptsOptions { + /** Filter the range to data starting from this date. */ + startDate?: Date | null; + /** Filter the range to data ending by this date. */ + endDate?: Date | null; +} + +export interface StatsEndpointAttemptsOptions { + /** Filter the range to data starting from this date. */ + startDate?: Date | null; + /** Filter the range to data ending by this date. */ + endDate?: Date | null; +} + +export class Stats { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Returns application-level statistics on message attempts */ + public appAttempts( + appId: string, + options?: StatsAppAttemptsOptions + ): Promise { + // v1.stats.app-attempts is hidden + const request = new SvixRequest(HttpMethod.GET, "/api/v1/stats/app/{app_id}/attempt"); + + request.setPathParam("app_id", appId); + request.setQueryParam("startDate", options?.startDate); + request.setQueryParam("endDate", options?.endDate); + + return request.send( + this.requestCtx, + AttemptStatisticsResponseSerializer._fromJsonObject + ); + } + /** Returns endpoint-level statistics on message attempts. */ + public endpointAttempts( + appId: string, + endpointId: string, + options?: StatsEndpointAttemptsOptions + ): Promise { + // v1.stats.endpoint-attempts is hidden + const request = new SvixRequest( + HttpMethod.GET, + "/api/v1/stats/app/{app_id}/ep/{endpoint_id}/attempt" + ); + + request.setPathParam("app_id", appId); + request.setPathParam("endpoint_id", endpointId); + request.setQueryParam("startDate", options?.startDate); + request.setQueryParam("endDate", options?.endDate); + + return request.send( + this.requestCtx, + AttemptStatisticsResponseSerializer._fromJsonObject + ); + } +} diff --git a/javascript/src/api_internal/streamEventType.ts b/javascript/src/api_internal/streamEventType.ts new file mode 100644 index 0000000000..2f6ec4decb --- /dev/null +++ b/javascript/src/api_internal/streamEventType.ts @@ -0,0 +1,113 @@ +// this file is @generated +import { + ListResponseStreamEventTypeOut, + ListResponseStreamEventTypeOutSerializer, +} from "../models/listResponseStreamEventTypeOut"; +import { Ordering } from "../models/ordering"; +import { + StreamEventTypeIn, + StreamEventTypeInSerializer, +} from "../models/streamEventTypeIn"; +import { + StreamEventTypeOut, + StreamEventTypeOutSerializer, +} from "../models/streamEventTypeOut"; +import { + StreamEventTypePatch, + StreamEventTypePatchSerializer, +} from "../models/streamEventTypePatch"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface StreamEventTypeListOptions { + /** Limit the number of returned items */ + limit?: number; + /** The iterator returned from a prior invocation */ + iterator?: string | null; + /** The sorting order of the returned items */ + order?: Ordering; +} + +export interface StreamEventTypeCreateOptions { + idempotencyKey?: string; +} + +export class StreamEventType { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** List of all the organization's event types for streaming. */ + public list( + options?: StreamEventTypeListOptions + ): Promise { + // v1.stream.event-type.list is hidden + const request = new SvixRequest(HttpMethod.GET, "/api/v1/stream/event-type"); + + request.setQueryParam("limit", options?.limit); + request.setQueryParam("iterator", options?.iterator); + request.setQueryParam("order", options?.order); + + return request.send( + this.requestCtx, + ListResponseStreamEventTypeOutSerializer._fromJsonObject + ); + } + /** Create an event type for Streams. */ + public create( + streamEventTypeIn: StreamEventTypeIn, + options?: StreamEventTypeCreateOptions + ): Promise { + // v1.stream.event-type.create is hidden + const request = new SvixRequest(HttpMethod.POST, "/api/v1/stream/event-type"); + + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(StreamEventTypeInSerializer._toJsonObject(streamEventTypeIn)); + + return request.send(this.requestCtx, StreamEventTypeOutSerializer._fromJsonObject); + } + /** Get an event type. */ + public get(name: string): Promise { + // v1.stream.event-type.get is hidden + const request = new SvixRequest(HttpMethod.GET, "/api/v1/stream/event-type/{name}"); + + request.setPathParam("name", name); + + return request.send(this.requestCtx, StreamEventTypeOutSerializer._fromJsonObject); + } + /** Update or create a event type for Streams. */ + public update( + name: string, + streamEventTypeIn: StreamEventTypeIn + ): Promise { + // v1.stream.event-type.update is hidden + const request = new SvixRequest(HttpMethod.PUT, "/api/v1/stream/event-type/{name}"); + + request.setPathParam("name", name); + request.setBody(StreamEventTypeInSerializer._toJsonObject(streamEventTypeIn)); + + return request.send(this.requestCtx, StreamEventTypeOutSerializer._fromJsonObject); + } + /** Delete an event type. */ + public delete(name: string): Promise { + // v1.stream.event-type.delete is hidden + const request = new SvixRequest( + HttpMethod.DELETE, + "/api/v1/stream/event-type/{name}" + ); + + request.setPathParam("name", name); + + return request.sendNoResponseBody(this.requestCtx); + } + /** Patch an event type for Streams. */ + public patch( + name: string, + streamEventTypePatch: StreamEventTypePatch + ): Promise { + // v1.stream.event-type.patch is hidden + const request = new SvixRequest(HttpMethod.PATCH, "/api/v1/stream/event-type/{name}"); + + request.setPathParam("name", name); + request.setBody(StreamEventTypePatchSerializer._toJsonObject(streamEventTypePatch)); + + return request.send(this.requestCtx, StreamEventTypeOutSerializer._fromJsonObject); + } +} diff --git a/javascript/src/api_internal/streamEvents.ts b/javascript/src/api_internal/streamEvents.ts new file mode 100644 index 0000000000..00d638a323 --- /dev/null +++ b/javascript/src/api_internal/streamEvents.ts @@ -0,0 +1,52 @@ +// this file is @generated +import { CreateStreamIn, CreateStreamInSerializer } from "../models/createStreamIn"; +import { CreateStreamOut, CreateStreamOutSerializer } from "../models/createStreamOut"; +import { EventStreamOut, EventStreamOutSerializer } from "../models/eventStreamOut"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface StreamEventsGetOptions { + /** Limit the number of returned items */ + limit?: number; + /** The iterator returned from a prior invocation */ + iterator?: string | null; + after?: Date | null; +} + +export interface StreamEventsCreateOptions { + idempotencyKey?: string; +} + +export class StreamEvents { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Iterate over a stream of events. */ + public get( + streamId: string, + options?: StreamEventsGetOptions + ): Promise { + // v1.stream.events.get is hidden + const request = new SvixRequest(HttpMethod.GET, "/api/v1/stream/{stream_id}/events"); + + request.setPathParam("stream_id", streamId); + request.setQueryParam("limit", options?.limit); + request.setQueryParam("iterator", options?.iterator); + request.setQueryParam("after", options?.after); + + return request.send(this.requestCtx, EventStreamOutSerializer._fromJsonObject); + } + /** Creates events on the Stream. */ + public create( + streamId: string, + createStreamIn: CreateStreamIn, + options?: StreamEventsCreateOptions + ): Promise { + // v1.stream.events.create is hidden + const request = new SvixRequest(HttpMethod.POST, "/api/v1/stream/{stream_id}/events"); + + request.setPathParam("stream_id", streamId); + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(CreateStreamInSerializer._toJsonObject(createStreamIn)); + + return request.send(this.requestCtx, CreateStreamOutSerializer._fromJsonObject); + } +} diff --git a/javascript/src/api_internal/streamStream.ts b/javascript/src/api_internal/streamStream.ts new file mode 100644 index 0000000000..cd3fd2262d --- /dev/null +++ b/javascript/src/api_internal/streamStream.ts @@ -0,0 +1,90 @@ +// this file is @generated +import { + ListResponseStreamOut, + ListResponseStreamOutSerializer, +} from "../models/listResponseStreamOut"; +import { Ordering } from "../models/ordering"; +import { StreamIn, StreamInSerializer } from "../models/streamIn"; +import { StreamOut, StreamOutSerializer } from "../models/streamOut"; +import { StreamPatch, StreamPatchSerializer } from "../models/streamPatch"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface StreamStreamListOptions { + /** Limit the number of returned items */ + limit?: number; + /** The iterator returned from a prior invocation */ + iterator?: string | null; + /** The sorting order of the returned items */ + order?: Ordering; +} + +export interface StreamStreamCreateOptions { + idempotencyKey?: string; +} + +export class StreamStream { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** List of all the organization's streams. */ + public list(options?: StreamStreamListOptions): Promise { + // v1.stream.stream.list is hidden + const request = new SvixRequest(HttpMethod.GET, "/api/v1/stream"); + + request.setQueryParam("limit", options?.limit); + request.setQueryParam("iterator", options?.iterator); + request.setQueryParam("order", options?.order); + + return request.send(this.requestCtx, ListResponseStreamOutSerializer._fromJsonObject); + } + /** Creates a new stream. */ + public create( + streamIn: StreamIn, + options?: StreamStreamCreateOptions + ): Promise { + // v1.stream.stream.create is hidden + const request = new SvixRequest(HttpMethod.POST, "/api/v1/stream"); + + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(StreamInSerializer._toJsonObject(streamIn)); + + return request.send(this.requestCtx, StreamOutSerializer._fromJsonObject); + } + /** Get a stream by id or uid. */ + public get(streamId: string): Promise { + // v1.stream.stream.get is hidden + const request = new SvixRequest(HttpMethod.GET, "/api/v1/stream/{stream_id}"); + + request.setPathParam("stream_id", streamId); + + return request.send(this.requestCtx, StreamOutSerializer._fromJsonObject); + } + /** Update a stream. */ + public update(streamId: string, streamIn: StreamIn): Promise { + // v1.stream.stream.update is hidden + const request = new SvixRequest(HttpMethod.PUT, "/api/v1/stream/{stream_id}"); + + request.setPathParam("stream_id", streamId); + request.setBody(StreamInSerializer._toJsonObject(streamIn)); + + return request.send(this.requestCtx, StreamOutSerializer._fromJsonObject); + } + /** Delete a stream. */ + public delete(streamId: string): Promise { + // v1.stream.stream.delete is hidden + const request = new SvixRequest(HttpMethod.DELETE, "/api/v1/stream/{stream_id}"); + + request.setPathParam("stream_id", streamId); + + return request.sendNoResponseBody(this.requestCtx); + } + /** Partially update a stream. */ + public patch(streamId: string, streamPatch: StreamPatch): Promise { + // v1.stream.stream.patch is hidden + const request = new SvixRequest(HttpMethod.PATCH, "/api/v1/stream/{stream_id}"); + + request.setPathParam("stream_id", streamId); + request.setBody(StreamPatchSerializer._toJsonObject(streamPatch)); + + return request.send(this.requestCtx, StreamOutSerializer._fromJsonObject); + } +} diff --git a/javascript/src/api_internal/transformationTemplate.ts b/javascript/src/api_internal/transformationTemplate.ts new file mode 100644 index 0000000000..fb4e396b70 --- /dev/null +++ b/javascript/src/api_internal/transformationTemplate.ts @@ -0,0 +1,169 @@ +// this file is @generated +import { ConnectorIn, ConnectorInSerializer } from "../models/connectorIn"; +import { GenerateIn, GenerateInSerializer } from "../models/generateIn"; +import { GenerateOut, GenerateOutSerializer } from "../models/generateOut"; +import { + ListResponseTemplateOut, + ListResponseTemplateOutSerializer, +} from "../models/listResponseTemplateOut"; +import { Ordering } from "../models/ordering"; +import { TemplateOut, TemplateOutSerializer } from "../models/templateOut"; +import { TemplatePatch, TemplatePatchSerializer } from "../models/templatePatch"; +import { TemplateUpdate, TemplateUpdateSerializer } from "../models/templateUpdate"; +import { + TransformationSimulateIn, + TransformationSimulateInSerializer, +} from "../models/transformationSimulateIn"; +import { + TransformationSimulateOut, + TransformationSimulateOutSerializer, +} from "../models/transformationSimulateOut"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface TransformationTemplateListOptions { + /** Limit the number of returned items */ + limit?: number; + /** The iterator returned from a prior invocation */ + iterator?: string | null; + /** The sorting order of the returned items */ + order?: Ordering; +} + +export interface TransformationTemplateCreateOptions { + idempotencyKey?: string; +} + +export interface TransformationTemplateGenerateOptions { + idempotencyKey?: string; +} + +export interface TransformationTemplateSimulateOptions { + idempotencyKey?: string; +} + +export class TransformationTemplate { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** List all transformation templates for an application. */ + public list( + options?: TransformationTemplateListOptions + ): Promise { + // v1.transformation-template.list is hidden + const request = new SvixRequest(HttpMethod.GET, "/api/v1/transformation-template"); + + request.setQueryParam("limit", options?.limit); + request.setQueryParam("iterator", options?.iterator); + request.setQueryParam("order", options?.order); + + return request.send( + this.requestCtx, + ListResponseTemplateOutSerializer._fromJsonObject + ); + } + /** Create a new transformation template. */ + public create( + connectorIn: ConnectorIn, + options?: TransformationTemplateCreateOptions + ): Promise { + // v1.transformation-template.create is hidden + const request = new SvixRequest(HttpMethod.POST, "/api/v1/transformation-template"); + + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(ConnectorInSerializer._toJsonObject(connectorIn)); + + return request.send(this.requestCtx, TemplateOutSerializer._fromJsonObject); + } + /** Use OpenAI's Completion API to generate code for a transformation template. */ + public generate( + generateIn: GenerateIn, + options?: TransformationTemplateGenerateOptions + ): Promise { + // v1.transformation-template.generate is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/transformation-template/generate" + ); + + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(GenerateInSerializer._toJsonObject(generateIn)); + + return request.send(this.requestCtx, GenerateOutSerializer._fromJsonObject); + } + /** Simulate running the transformation on the payload and code. */ + public simulate( + transformationSimulateIn: TransformationSimulateIn, + options?: TransformationTemplateSimulateOptions + ): Promise { + // v1.transformation-template.simulate is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/transformation-template/simulate" + ); + + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody( + TransformationSimulateInSerializer._toJsonObject(transformationSimulateIn) + ); + + return request.send( + this.requestCtx, + TransformationSimulateOutSerializer._fromJsonObject + ); + } + /** Get a transformation template. */ + public get(transformationTemplateId: string): Promise { + // v1.transformation-template.get is hidden + const request = new SvixRequest( + HttpMethod.GET, + "/api/v1/transformation-template/{transformation_template_id}" + ); + + request.setPathParam("transformation_template_id", transformationTemplateId); + + return request.send(this.requestCtx, TemplateOutSerializer._fromJsonObject); + } + /** Update a transformation template. */ + public update( + transformationTemplateId: string, + templateUpdate: TemplateUpdate + ): Promise { + // v1.transformation-template.update is hidden + const request = new SvixRequest( + HttpMethod.PUT, + "/api/v1/transformation-template/{transformation_template_id}" + ); + + request.setPathParam("transformation_template_id", transformationTemplateId); + request.setBody(TemplateUpdateSerializer._toJsonObject(templateUpdate)); + + return request.send(this.requestCtx, TemplateOutSerializer._fromJsonObject); + } + /** Delete a transformation template. */ + public delete(transformationTemplateId: string): Promise { + // v1.transformation-template.delete is hidden + const request = new SvixRequest( + HttpMethod.DELETE, + "/api/v1/transformation-template/{transformation_template_id}" + ); + + request.setPathParam("transformation_template_id", transformationTemplateId); + + return request.sendNoResponseBody(this.requestCtx); + } + /** Partially update a transformation template. */ + public patch( + transformationTemplateId: string, + templatePatch: TemplatePatch + ): Promise { + // v1.transformation-template.patch is hidden + const request = new SvixRequest( + HttpMethod.PATCH, + "/api/v1/transformation-template/{transformation_template_id}" + ); + + request.setPathParam("transformation_template_id", transformationTemplateId); + request.setBody(TemplatePatchSerializer._toJsonObject(templatePatch)); + + return request.send(this.requestCtx, TemplateOutSerializer._fromJsonObject); + } +} diff --git a/javascript/src/api_internal/transformationTemplateOauth.ts b/javascript/src/api_internal/transformationTemplateOauth.ts new file mode 100644 index 0000000000..ce58bbc255 --- /dev/null +++ b/javascript/src/api_internal/transformationTemplateOauth.ts @@ -0,0 +1,79 @@ +// this file is @generated +import { + IncomingWebhookPayloadOut, + IncomingWebhookPayloadOutSerializer, +} from "../models/incomingWebhookPayloadOut"; +import { OAuthPayloadIn, OAuthPayloadInSerializer } from "../models/oAuthPayloadIn"; +import { OAuthPayloadOut, OAuthPayloadOutSerializer } from "../models/oAuthPayloadOut"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export interface TransformationTemplateOauthDiscordOptions { + idempotencyKey?: string; +} + +export interface TransformationTemplateOauthHubspotOptions { + idempotencyKey?: string; +} + +export interface TransformationTemplateOauthSlackOptions { + idempotencyKey?: string; +} + +export class TransformationTemplateOauth { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Get Discord Incoming webhook URL. */ + public discord( + oAuthPayloadIn: OAuthPayloadIn, + options?: TransformationTemplateOauthDiscordOptions + ): Promise { + // v1.transformation-template.oauth.discord is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/transformation-template/oauth/discord" + ); + + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(OAuthPayloadInSerializer._toJsonObject(oAuthPayloadIn)); + + return request.send( + this.requestCtx, + IncomingWebhookPayloadOutSerializer._fromJsonObject + ); + } + /** Get Hubspot access token using authorization code. */ + public hubspot( + oAuthPayloadIn: OAuthPayloadIn, + options?: TransformationTemplateOauthHubspotOptions + ): Promise { + // v1.transformation-template.oauth.hubspot is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/transformation-template/oauth/hubspot" + ); + + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(OAuthPayloadInSerializer._toJsonObject(oAuthPayloadIn)); + + return request.send(this.requestCtx, OAuthPayloadOutSerializer._fromJsonObject); + } + /** Get Slack Incoming webhook URL. */ + public slack( + oAuthPayloadIn: OAuthPayloadIn, + options?: TransformationTemplateOauthSlackOptions + ): Promise { + // v1.transformation-template.oauth.slack is hidden + const request = new SvixRequest( + HttpMethod.POST, + "/api/v1/transformation-template/oauth/slack" + ); + + request.setHeaderParam("idempotency-key", options?.idempotencyKey); + request.setBody(OAuthPayloadInSerializer._toJsonObject(oAuthPayloadIn)); + + return request.send( + this.requestCtx, + IncomingWebhookPayloadOutSerializer._fromJsonObject + ); + } +} diff --git a/javascript/src/models/applicationStats.ts b/javascript/src/models/applicationStats.ts new file mode 100644 index 0000000000..57a28a05b3 --- /dev/null +++ b/javascript/src/models/applicationStats.ts @@ -0,0 +1,28 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface ApplicationStats { + /** The Application's ID. */ + appId: string; + /** The Application's UID. */ + appUid?: string | null; + messageDestinations: number; +} + +export const ApplicationStatsSerializer = { + _fromJsonObject(object: any): ApplicationStats { + return { + appId: object["appId"], + appUid: object["appUid"], + messageDestinations: object["messageDestinations"], + }; + }, + + _toJsonObject(self: ApplicationStats): any { + return { + appId: self.appId, + appUid: self.appUid, + messageDestinations: self.messageDestinations, + }; + }, +}; diff --git a/javascript/src/models/attemptStatisticsData.ts b/javascript/src/models/attemptStatisticsData.ts new file mode 100644 index 0000000000..8b7020640e --- /dev/null +++ b/javascript/src/models/attemptStatisticsData.ts @@ -0,0 +1,23 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface AttemptStatisticsData { + failureCount?: number[] | null; + successCount?: number[] | null; +} + +export const AttemptStatisticsDataSerializer = { + _fromJsonObject(object: any): AttemptStatisticsData { + return { + failureCount: object["failureCount"], + successCount: object["successCount"], + }; + }, + + _toJsonObject(self: AttemptStatisticsData): any { + return { + failureCount: self.failureCount, + successCount: self.successCount, + }; + }, +}; diff --git a/javascript/src/models/attemptStatisticsResponse.ts b/javascript/src/models/attemptStatisticsResponse.ts new file mode 100644 index 0000000000..d0b4a2781a --- /dev/null +++ b/javascript/src/models/attemptStatisticsResponse.ts @@ -0,0 +1,34 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { + AttemptStatisticsData, + AttemptStatisticsDataSerializer, +} from "./attemptStatisticsData"; +import { StatisticsPeriod, StatisticsPeriodSerializer } from "./statisticsPeriod"; + +export interface AttemptStatisticsResponse { + data: AttemptStatisticsData; + endDate: Date | null; + period: StatisticsPeriod; + startDate: Date | null; +} + +export const AttemptStatisticsResponseSerializer = { + _fromJsonObject(object: any): AttemptStatisticsResponse { + return { + data: AttemptStatisticsDataSerializer._fromJsonObject(object["data"]), + endDate: new Date(object["endDate"]), + period: StatisticsPeriodSerializer._fromJsonObject(object["period"]), + startDate: new Date(object["startDate"]), + }; + }, + + _toJsonObject(self: AttemptStatisticsResponse): any { + return { + data: AttemptStatisticsDataSerializer._toJsonObject(self.data), + endDate: self.endDate, + period: StatisticsPeriodSerializer._toJsonObject(self.period), + startDate: self.startDate, + }; + }, +}; diff --git a/javascript/src/models/authTokenOut.ts b/javascript/src/models/authTokenOut.ts new file mode 100644 index 0000000000..2f3de4c452 --- /dev/null +++ b/javascript/src/models/authTokenOut.ts @@ -0,0 +1,36 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface AuthTokenOut { + createdAt: Date | null; + expiresAt?: Date | null | null; + /** The ApplicationToken's ID. */ + id: string; + name?: string | null; + scopes?: string[] | null; + token: string; +} + +export const AuthTokenOutSerializer = { + _fromJsonObject(object: any): AuthTokenOut { + return { + createdAt: new Date(object["createdAt"]), + expiresAt: new Date(object["expiresAt"]), + id: object["id"], + name: object["name"], + scopes: object["scopes"], + token: object["token"], + }; + }, + + _toJsonObject(self: AuthTokenOut): any { + return { + createdAt: self.createdAt, + expiresAt: self.expiresAt, + id: self.id, + name: self.name, + scopes: self.scopes, + token: self.token, + }; + }, +}; diff --git a/javascript/src/models/borderRadiusConfig.ts b/javascript/src/models/borderRadiusConfig.ts new file mode 100644 index 0000000000..e2830cf90e --- /dev/null +++ b/javascript/src/models/borderRadiusConfig.ts @@ -0,0 +1,31 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { BorderRadiusEnum, BorderRadiusEnumSerializer } from "./borderRadiusEnum"; + +export interface BorderRadiusConfig { + button?: BorderRadiusEnum | null; + card?: BorderRadiusEnum | null; + input?: BorderRadiusEnum | null; +} + +export const BorderRadiusConfigSerializer = { + _fromJsonObject(object: any): BorderRadiusConfig { + return { + button: BorderRadiusEnumSerializer._fromJsonObject(object["button"]), + card: BorderRadiusEnumSerializer._fromJsonObject(object["card"]), + input: BorderRadiusEnumSerializer._fromJsonObject(object["input"]), + }; + }, + + _toJsonObject(self: BorderRadiusConfig): any { + return { + button: self.button + ? BorderRadiusEnumSerializer._toJsonObject(self.button) + : undefined, + card: self.card ? BorderRadiusEnumSerializer._toJsonObject(self.card) : undefined, + input: self.input + ? BorderRadiusEnumSerializer._toJsonObject(self.input) + : undefined, + }; + }, +}; diff --git a/javascript/src/models/borderRadiusEnum.ts b/javascript/src/models/borderRadiusEnum.ts new file mode 100644 index 0000000000..489347a5ef --- /dev/null +++ b/javascript/src/models/borderRadiusEnum.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export enum BorderRadiusEnum { + None = "none", + Lg = "lg", + Md = "md", + Sm = "sm", + Full = "full", +} + +export const BorderRadiusEnumSerializer = { + _fromJsonObject(object: any): BorderRadiusEnum { + return object; + }, + + _toJsonObject(self: BorderRadiusEnum): any { + return self; + }, +}; diff --git a/javascript/src/models/clientSecretJwtParamsIn.ts b/javascript/src/models/clientSecretJwtParamsIn.ts new file mode 100644 index 0000000000..74f01c1ad7 --- /dev/null +++ b/javascript/src/models/clientSecretJwtParamsIn.ts @@ -0,0 +1,41 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { + OauthJwsSigningAlgorithm, + OauthJwsSigningAlgorithmSerializer, +} from "./oauthJwsSigningAlgorithm"; + +export interface ClientSecretJwtParamsIn { + /** The base64-encoded secret used for signing the JWT. */ + secretBase64: string; + /** Optional secret identifier. If supplied, this will be populated in the JWT header in the `kid` field. */ + secretId?: string | null; + /** The algorithm used to sign the JWT. */ + signingAlgorithm: OauthJwsSigningAlgorithm; + /** Optional number of seconds after which the JWT should expire. Defaults to 300 seconds. */ + tokenExpirySecs?: number | null; +} + +export const ClientSecretJwtParamsInSerializer = { + _fromJsonObject(object: any): ClientSecretJwtParamsIn { + return { + secretBase64: object["secretBase64"], + secretId: object["secretId"], + signingAlgorithm: OauthJwsSigningAlgorithmSerializer._fromJsonObject( + object["signingAlgorithm"] + ), + tokenExpirySecs: object["tokenExpirySecs"], + }; + }, + + _toJsonObject(self: ClientSecretJwtParamsIn): any { + return { + secretBase64: self.secretBase64, + secretId: self.secretId, + signingAlgorithm: OauthJwsSigningAlgorithmSerializer._toJsonObject( + self.signingAlgorithm + ), + tokenExpirySecs: self.tokenExpirySecs, + }; + }, +}; diff --git a/javascript/src/models/completionChoice.ts b/javascript/src/models/completionChoice.ts new file mode 100644 index 0000000000..443a0cf080 --- /dev/null +++ b/javascript/src/models/completionChoice.ts @@ -0,0 +1,27 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { CompletionMessage, CompletionMessageSerializer } from "./completionMessage"; + +export interface CompletionChoice { + finishReason: string; + index: number; + message: CompletionMessage; +} + +export const CompletionChoiceSerializer = { + _fromJsonObject(object: any): CompletionChoice { + return { + finishReason: object["finish_reason"], + index: object["index"], + message: CompletionMessageSerializer._fromJsonObject(object["message"]), + }; + }, + + _toJsonObject(self: CompletionChoice): any { + return { + finish_reason: self.finishReason, + index: self.index, + message: CompletionMessageSerializer._toJsonObject(self.message), + }; + }, +}; diff --git a/javascript/src/models/completionMessage.ts b/javascript/src/models/completionMessage.ts new file mode 100644 index 0000000000..fd7aef240a --- /dev/null +++ b/javascript/src/models/completionMessage.ts @@ -0,0 +1,23 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface CompletionMessage { + content: string; + role: string; +} + +export const CompletionMessageSerializer = { + _fromJsonObject(object: any): CompletionMessage { + return { + content: object["content"], + role: object["role"], + }; + }, + + _toJsonObject(self: CompletionMessage): any { + return { + content: self.content, + role: self.role, + }; + }, +}; diff --git a/javascript/src/models/countOut.ts b/javascript/src/models/countOut.ts new file mode 100644 index 0000000000..52bbb6d413 --- /dev/null +++ b/javascript/src/models/countOut.ts @@ -0,0 +1,25 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface CountOut { + /** There's a ceiling to how many attempts we count. When the limit is reached, this will be `true` to indicate the actual count is higher than given. */ + approximated: boolean; + /** The count of attempts matching the query. */ + count: number; +} + +export const CountOutSerializer = { + _fromJsonObject(object: any): CountOut { + return { + approximated: object["approximated"], + count: object["count"], + }; + }, + + _toJsonObject(self: CountOut): any { + return { + approximated: self.approximated, + count: self.count, + }; + }, +}; diff --git a/javascript/src/models/createStreamIn.ts b/javascript/src/models/createStreamIn.ts new file mode 100644 index 0000000000..5078c3d6f7 --- /dev/null +++ b/javascript/src/models/createStreamIn.ts @@ -0,0 +1,32 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { EventIn, EventInSerializer } from "./eventIn"; +import { StreamIn, StreamInSerializer } from "./streamIn"; + +export interface CreateStreamIn { + events: EventIn[]; + /** + * Optionally creates a new Stream alongside the events. + * + * If the stream id or uid that is used in the path already exists, this argument is ignored. + */ + stream?: StreamIn | null; +} + +export const CreateStreamInSerializer = { + _fromJsonObject(object: any): CreateStreamIn { + return { + events: object["events"].map((item: EventIn) => + EventInSerializer._fromJsonObject(item) + ), + stream: StreamInSerializer._fromJsonObject(object["stream"]), + }; + }, + + _toJsonObject(self: CreateStreamIn): any { + return { + events: self.events.map((item) => EventInSerializer._toJsonObject(item)), + stream: self.stream ? StreamInSerializer._toJsonObject(self.stream) : undefined, + }; + }, +}; diff --git a/javascript/src/models/createStreamOut.ts b/javascript/src/models/createStreamOut.ts new file mode 100644 index 0000000000..09be08dde8 --- /dev/null +++ b/javascript/src/models/createStreamOut.ts @@ -0,0 +1,16 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +/* eslint @typescript-eslint/no-unused-vars: 0 */ +/* eslint @typescript-eslint/no-empty-interface: 0 */ + +export interface CreateStreamOut {} + +export const CreateStreamOutSerializer = { + _fromJsonObject(object: any): CreateStreamOut { + return {}; + }, + + _toJsonObject(self: CreateStreamOut): any { + return {}; + }, +}; diff --git a/javascript/src/models/createTokenIn.ts b/javascript/src/models/createTokenIn.ts new file mode 100644 index 0000000000..ebcb6848bd --- /dev/null +++ b/javascript/src/models/createTokenIn.ts @@ -0,0 +1,25 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface CreateTokenIn { + /** How long the token will be valid for, in seconds. */ + expiry?: number | null; + /** The name of the token. */ + name: string; +} + +export const CreateTokenInSerializer = { + _fromJsonObject(object: any): CreateTokenIn { + return { + expiry: object["expiry"], + name: object["name"], + }; + }, + + _toJsonObject(self: CreateTokenIn): any { + return { + expiry: self.expiry, + name: self.name, + }; + }, +}; diff --git a/javascript/src/models/customColorPalette.ts b/javascript/src/models/customColorPalette.ts new file mode 100644 index 0000000000..9450164983 --- /dev/null +++ b/javascript/src/models/customColorPalette.ts @@ -0,0 +1,44 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface CustomColorPalette { + backgroundHover?: string | null; + backgroundPrimary?: string | null; + backgroundSecondary?: string | null; + buttonPrimary?: string | null; + interactiveAccent?: string | null; + navigationAccent?: string | null; + primary?: string | null; + textDanger?: string | null; + textPrimary?: string | null; +} + +export const CustomColorPaletteSerializer = { + _fromJsonObject(object: any): CustomColorPalette { + return { + backgroundHover: object["backgroundHover"], + backgroundPrimary: object["backgroundPrimary"], + backgroundSecondary: object["backgroundSecondary"], + buttonPrimary: object["buttonPrimary"], + interactiveAccent: object["interactiveAccent"], + navigationAccent: object["navigationAccent"], + primary: object["primary"], + textDanger: object["textDanger"], + textPrimary: object["textPrimary"], + }; + }, + + _toJsonObject(self: CustomColorPalette): any { + return { + backgroundHover: self.backgroundHover, + backgroundPrimary: self.backgroundPrimary, + backgroundSecondary: self.backgroundSecondary, + buttonPrimary: self.buttonPrimary, + interactiveAccent: self.interactiveAccent, + navigationAccent: self.navigationAccent, + primary: self.primary, + textDanger: self.textDanger, + textPrimary: self.textPrimary, + }; + }, +}; diff --git a/javascript/src/models/customStringsOverride.ts b/javascript/src/models/customStringsOverride.ts new file mode 100644 index 0000000000..73a8eab557 --- /dev/null +++ b/javascript/src/models/customStringsOverride.ts @@ -0,0 +1,26 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface CustomStringsOverride { + channelsHelp?: string | null; + channelsMany?: string | null; + channelsOne?: string | null; +} + +export const CustomStringsOverrideSerializer = { + _fromJsonObject(object: any): CustomStringsOverride { + return { + channelsHelp: object["channelsHelp"], + channelsMany: object["channelsMany"], + channelsOne: object["channelsOne"], + }; + }, + + _toJsonObject(self: CustomStringsOverride): any { + return { + channelsHelp: self.channelsHelp, + channelsMany: self.channelsMany, + channelsOne: self.channelsOne, + }; + }, +}; diff --git a/javascript/src/models/customThemeOverride.ts b/javascript/src/models/customThemeOverride.ts new file mode 100644 index 0000000000..d446013d21 --- /dev/null +++ b/javascript/src/models/customThemeOverride.ts @@ -0,0 +1,29 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { BorderRadiusConfig, BorderRadiusConfigSerializer } from "./borderRadiusConfig"; +import { FontSizeConfig, FontSizeConfigSerializer } from "./fontSizeConfig"; + +export interface CustomThemeOverride { + borderRadius?: BorderRadiusConfig | null; + fontSize?: FontSizeConfig | null; +} + +export const CustomThemeOverrideSerializer = { + _fromJsonObject(object: any): CustomThemeOverride { + return { + borderRadius: BorderRadiusConfigSerializer._fromJsonObject(object["borderRadius"]), + fontSize: FontSizeConfigSerializer._fromJsonObject(object["fontSize"]), + }; + }, + + _toJsonObject(self: CustomThemeOverride): any { + return { + borderRadius: self.borderRadius + ? BorderRadiusConfigSerializer._toJsonObject(self.borderRadius) + : undefined, + fontSize: self.fontSize + ? FontSizeConfigSerializer._toJsonObject(self.fontSize) + : undefined, + }; + }, +}; diff --git a/javascript/src/models/duration.ts b/javascript/src/models/duration.ts new file mode 100644 index 0000000000..1eb1550222 --- /dev/null +++ b/javascript/src/models/duration.ts @@ -0,0 +1,23 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface Duration { + nanos: number; + secs: number; +} + +export const DurationSerializer = { + _fromJsonObject(object: any): Duration { + return { + nanos: object["nanos"], + secs: object["secs"], + }; + }, + + _toJsonObject(self: Duration): any { + return { + nanos: self.nanos, + secs: self.secs, + }; + }, +}; diff --git a/javascript/src/models/endpointMtlsConfigIn.ts b/javascript/src/models/endpointMtlsConfigIn.ts new file mode 100644 index 0000000000..c1ce22d774 --- /dev/null +++ b/javascript/src/models/endpointMtlsConfigIn.ts @@ -0,0 +1,25 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface EndpointMtlsConfigIn { + /** A PEM encoded private key and X509 certificate to identify the webhook sender. */ + identity: string; + /** A PEM encoded X509 certificate used to verify the webhook receiver's certificate. */ + serverCaCert?: string | null; +} + +export const EndpointMtlsConfigInSerializer = { + _fromJsonObject(object: any): EndpointMtlsConfigIn { + return { + identity: object["identity"], + serverCaCert: object["serverCaCert"], + }; + }, + + _toJsonObject(self: EndpointMtlsConfigIn): any { + return { + identity: self.identity, + serverCaCert: self.serverCaCert, + }; + }, +}; diff --git a/javascript/src/models/endpointMtlsConfigOut.ts b/javascript/src/models/endpointMtlsConfigOut.ts new file mode 100644 index 0000000000..402d463e4c --- /dev/null +++ b/javascript/src/models/endpointMtlsConfigOut.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface EndpointMtlsConfigOut { + serverCaCert?: string | null; +} + +export const EndpointMtlsConfigOutSerializer = { + _fromJsonObject(object: any): EndpointMtlsConfigOut { + return { + serverCaCert: object["serverCaCert"], + }; + }, + + _toJsonObject(self: EndpointMtlsConfigOut): any { + return { + serverCaCert: self.serverCaCert, + }; + }, +}; diff --git a/javascript/src/models/endpointOauthConfigIn.ts b/javascript/src/models/endpointOauthConfigIn.ts new file mode 100644 index 0000000000..7cfaebb808 --- /dev/null +++ b/javascript/src/models/endpointOauthConfigIn.ts @@ -0,0 +1,70 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { + ClientSecretJwtParamsIn, + ClientSecretJwtParamsInSerializer, +} from "./clientSecretJwtParamsIn"; +import { + Oauth2AuthMethodInOut, + Oauth2AuthMethodInOutSerializer, +} from "./oauth2AuthMethodInOut"; +import { + Oauth2GrantTypeInOut, + Oauth2GrantTypeInOutSerializer, +} from "./oauth2GrantTypeInOut"; + +export interface EndpointOauthConfigIn { + authMethod: Oauth2AuthMethodInOut; + /** The client ID. Required for all authentication types. */ + clientId: string; + /** + * Optional client secret. This is only used for `clientSecretBasic` and `clientSecretPost`. + * + * For `clientSecretBasic`, the secret will be appended to the `Authorization` header. For `clientSecretPost`, this will be added to the body in a `client_secret` parameter. + */ + clientSecret?: string | null; + /** Extra parameters added to the request body as key-value pairs. */ + extraParams?: { [key: string]: string } | null; + /** The OAuth grant type. */ + grantType: Oauth2GrantTypeInOut; + /** Optional JWT parameters. Only required for `clientSecretJwt` */ + jwtParams?: ClientSecretJwtParamsIn | null; + /** For `refreshToken` grant type. */ + refreshToken?: string | null; + /** Optional OAuth scopes added to the request body. */ + scopes?: string[] | null; + /** The URL of the authorization server. */ + tokenUrl: string; +} + +export const EndpointOauthConfigInSerializer = { + _fromJsonObject(object: any): EndpointOauthConfigIn { + return { + authMethod: Oauth2AuthMethodInOutSerializer._fromJsonObject(object["authMethod"]), + clientId: object["clientId"], + clientSecret: object["clientSecret"], + extraParams: object["extraParams"], + grantType: Oauth2GrantTypeInOutSerializer._fromJsonObject(object["grantType"]), + jwtParams: ClientSecretJwtParamsInSerializer._fromJsonObject(object["jwtParams"]), + refreshToken: object["refreshToken"], + scopes: object["scopes"], + tokenUrl: object["tokenUrl"], + }; + }, + + _toJsonObject(self: EndpointOauthConfigIn): any { + return { + authMethod: Oauth2AuthMethodInOutSerializer._toJsonObject(self.authMethod), + clientId: self.clientId, + clientSecret: self.clientSecret, + extraParams: self.extraParams, + grantType: Oauth2GrantTypeInOutSerializer._toJsonObject(self.grantType), + jwtParams: self.jwtParams + ? ClientSecretJwtParamsInSerializer._toJsonObject(self.jwtParams) + : undefined, + refreshToken: self.refreshToken, + scopes: self.scopes, + tokenUrl: self.tokenUrl, + }; + }, +}; diff --git a/javascript/src/models/endpointOauthConfigOut.ts b/javascript/src/models/endpointOauthConfigOut.ts new file mode 100644 index 0000000000..dff824aa38 --- /dev/null +++ b/javascript/src/models/endpointOauthConfigOut.ts @@ -0,0 +1,43 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { + Oauth2AuthMethodInOut, + Oauth2AuthMethodInOutSerializer, +} from "./oauth2AuthMethodInOut"; +import { + Oauth2GrantTypeInOut, + Oauth2GrantTypeInOutSerializer, +} from "./oauth2GrantTypeInOut"; + +export interface EndpointOauthConfigOut { + authMethod: Oauth2AuthMethodInOut; + clientId: string; + extraParams?: { [key: string]: string } | null; + grantType: Oauth2GrantTypeInOut; + scopes?: string[] | null; + tokenUrl: string; +} + +export const EndpointOauthConfigOutSerializer = { + _fromJsonObject(object: any): EndpointOauthConfigOut { + return { + authMethod: Oauth2AuthMethodInOutSerializer._fromJsonObject(object["authMethod"]), + clientId: object["clientId"], + extraParams: object["extraParams"], + grantType: Oauth2GrantTypeInOutSerializer._fromJsonObject(object["grantType"]), + scopes: object["scopes"], + tokenUrl: object["tokenUrl"], + }; + }, + + _toJsonObject(self: EndpointOauthConfigOut): any { + return { + authMethod: Oauth2AuthMethodInOutSerializer._toJsonObject(self.authMethod), + clientId: self.clientId, + extraParams: self.extraParams, + grantType: Oauth2GrantTypeInOutSerializer._toJsonObject(self.grantType), + scopes: self.scopes, + tokenUrl: self.tokenUrl, + }; + }, +}; diff --git a/javascript/src/models/endpointTransformationSimulateIn.ts b/javascript/src/models/endpointTransformationSimulateIn.ts new file mode 100644 index 0000000000..c532f7fedd --- /dev/null +++ b/javascript/src/models/endpointTransformationSimulateIn.ts @@ -0,0 +1,30 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface EndpointTransformationSimulateIn { + channels?: string[] | null; + code: string; + /** The event type's name */ + eventType: string; + payload: any; +} + +export const EndpointTransformationSimulateInSerializer = { + _fromJsonObject(object: any): EndpointTransformationSimulateIn { + return { + channels: object["channels"], + code: object["code"], + eventType: object["eventType"], + payload: object["payload"], + }; + }, + + _toJsonObject(self: EndpointTransformationSimulateIn): any { + return { + channels: self.channels, + code: self.code, + eventType: self.eventType, + payload: self.payload, + }; + }, +}; diff --git a/javascript/src/models/endpointTransformationSimulateOut.ts b/javascript/src/models/endpointTransformationSimulateOut.ts new file mode 100644 index 0000000000..5bb738e36d --- /dev/null +++ b/javascript/src/models/endpointTransformationSimulateOut.ts @@ -0,0 +1,32 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { + TransformationHttpMethod, + TransformationHttpMethodSerializer, +} from "./transformationHttpMethod"; + +export interface EndpointTransformationSimulateOut { + method?: TransformationHttpMethod | null; + payload: string; + url: string; +} + +export const EndpointTransformationSimulateOutSerializer = { + _fromJsonObject(object: any): EndpointTransformationSimulateOut { + return { + method: TransformationHttpMethodSerializer._fromJsonObject(object["method"]), + payload: object["payload"], + url: object["url"], + }; + }, + + _toJsonObject(self: EndpointTransformationSimulateOut): any { + return { + method: self.method + ? TransformationHttpMethodSerializer._toJsonObject(self.method) + : undefined, + payload: self.payload, + url: self.url, + }; + }, +}; diff --git a/javascript/src/models/environmentSettingsOut.ts b/javascript/src/models/environmentSettingsOut.ts new file mode 100644 index 0000000000..8a9e7e7ba7 --- /dev/null +++ b/javascript/src/models/environmentSettingsOut.ts @@ -0,0 +1,96 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { CustomColorPalette, CustomColorPaletteSerializer } from "./customColorPalette"; +import { + CustomStringsOverride, + CustomStringsOverrideSerializer, +} from "./customStringsOverride"; +import { + CustomThemeOverride, + CustomThemeOverrideSerializer, +} from "./customThemeOverride"; + +export interface EnvironmentSettingsOut { + colorPaletteDark?: CustomColorPalette | null; + colorPaletteLight?: CustomColorPalette | null; + customColor?: string | null; + customFontFamily?: string | null; + customFontFamilyUrl?: string | null; + customLogoUrl?: string | null; + customStringsOverride?: CustomStringsOverride | null; + customThemeOverride?: CustomThemeOverride | null; + displayName?: string | null; + enableChannels?: boolean; + enableEndpointMtlsConfig?: boolean; + enableEndpointOauthConfig?: boolean; + enableIntegrationManagement?: boolean; + enableMessageStream?: boolean; + enableMessageTags?: boolean; + enableTransformations?: boolean; + showUseSvixPlay?: boolean; + wipeSuccessfulPayload?: boolean; +} + +export const EnvironmentSettingsOutSerializer = { + _fromJsonObject(object: any): EnvironmentSettingsOut { + return { + colorPaletteDark: CustomColorPaletteSerializer._fromJsonObject( + object["colorPaletteDark"] + ), + colorPaletteLight: CustomColorPaletteSerializer._fromJsonObject( + object["colorPaletteLight"] + ), + customColor: object["customColor"], + customFontFamily: object["customFontFamily"], + customFontFamilyUrl: object["customFontFamilyUrl"], + customLogoUrl: object["customLogoUrl"], + customStringsOverride: CustomStringsOverrideSerializer._fromJsonObject( + object["customStringsOverride"] + ), + customThemeOverride: CustomThemeOverrideSerializer._fromJsonObject( + object["customThemeOverride"] + ), + displayName: object["displayName"], + enableChannels: object["enableChannels"], + enableEndpointMtlsConfig: object["enableEndpointMtlsConfig"], + enableEndpointOauthConfig: object["enableEndpointOauthConfig"], + enableIntegrationManagement: object["enableIntegrationManagement"], + enableMessageStream: object["enableMessageStream"], + enableMessageTags: object["enableMessageTags"], + enableTransformations: object["enableTransformations"], + showUseSvixPlay: object["showUseSvixPlay"], + wipeSuccessfulPayload: object["wipeSuccessfulPayload"], + }; + }, + + _toJsonObject(self: EnvironmentSettingsOut): any { + return { + colorPaletteDark: self.colorPaletteDark + ? CustomColorPaletteSerializer._toJsonObject(self.colorPaletteDark) + : undefined, + colorPaletteLight: self.colorPaletteLight + ? CustomColorPaletteSerializer._toJsonObject(self.colorPaletteLight) + : undefined, + customColor: self.customColor, + customFontFamily: self.customFontFamily, + customFontFamilyUrl: self.customFontFamilyUrl, + customLogoUrl: self.customLogoUrl, + customStringsOverride: self.customStringsOverride + ? CustomStringsOverrideSerializer._toJsonObject(self.customStringsOverride) + : undefined, + customThemeOverride: self.customThemeOverride + ? CustomThemeOverrideSerializer._toJsonObject(self.customThemeOverride) + : undefined, + displayName: self.displayName, + enableChannels: self.enableChannels, + enableEndpointMtlsConfig: self.enableEndpointMtlsConfig, + enableEndpointOauthConfig: self.enableEndpointOauthConfig, + enableIntegrationManagement: self.enableIntegrationManagement, + enableMessageStream: self.enableMessageStream, + enableMessageTags: self.enableMessageTags, + enableTransformations: self.enableTransformations, + showUseSvixPlay: self.showUseSvixPlay, + wipeSuccessfulPayload: self.wipeSuccessfulPayload, + }; + }, +}; diff --git a/javascript/src/models/eventIn.ts b/javascript/src/models/eventIn.ts new file mode 100644 index 0000000000..f2e2efa48d --- /dev/null +++ b/javascript/src/models/eventIn.ts @@ -0,0 +1,24 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface EventIn { + /** The event type's name */ + eventType?: string | null; + payload: string; +} + +export const EventInSerializer = { + _fromJsonObject(object: any): EventIn { + return { + eventType: object["eventType"], + payload: object["payload"], + }; + }, + + _toJsonObject(self: EventIn): any { + return { + eventType: self.eventType, + payload: self.payload, + }; + }, +}; diff --git a/javascript/src/models/eventOut.ts b/javascript/src/models/eventOut.ts new file mode 100644 index 0000000000..e9f9639035 --- /dev/null +++ b/javascript/src/models/eventOut.ts @@ -0,0 +1,27 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface EventOut { + /** The event type's name */ + eventType?: string | null; + payload: string; + timestamp: Date | null; +} + +export const EventOutSerializer = { + _fromJsonObject(object: any): EventOut { + return { + eventType: object["eventType"], + payload: object["payload"], + timestamp: new Date(object["timestamp"]), + }; + }, + + _toJsonObject(self: EventOut): any { + return { + eventType: self.eventType, + payload: self.payload, + timestamp: self.timestamp, + }; + }, +}; diff --git a/javascript/src/models/eventStreamOut.ts b/javascript/src/models/eventStreamOut.ts new file mode 100644 index 0000000000..e2aba06fd4 --- /dev/null +++ b/javascript/src/models/eventStreamOut.ts @@ -0,0 +1,29 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { EventOut, EventOutSerializer } from "./eventOut"; + +export interface EventStreamOut { + data: EventOut[]; + done: boolean; + iterator: string; +} + +export const EventStreamOutSerializer = { + _fromJsonObject(object: any): EventStreamOut { + return { + data: object["data"].map((item: EventOut) => + EventOutSerializer._fromJsonObject(item) + ), + done: object["done"], + iterator: object["iterator"], + }; + }, + + _toJsonObject(self: EventStreamOut): any { + return { + data: self.data.map((item) => EventOutSerializer._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + }; + }, +}; diff --git a/javascript/src/models/eventTypeExampleOut.ts b/javascript/src/models/eventTypeExampleOut.ts new file mode 100644 index 0000000000..4615a3e9f8 --- /dev/null +++ b/javascript/src/models/eventTypeExampleOut.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface EventTypeExampleOut { + example: any; +} + +export const EventTypeExampleOutSerializer = { + _fromJsonObject(object: any): EventTypeExampleOut { + return { + example: object["example"], + }; + }, + + _toJsonObject(self: EventTypeExampleOut): any { + return { + example: self.example, + }; + }, +}; diff --git a/javascript/src/models/eventTypeSchemaIn.ts b/javascript/src/models/eventTypeSchemaIn.ts new file mode 100644 index 0000000000..66836fd1c1 --- /dev/null +++ b/javascript/src/models/eventTypeSchemaIn.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface EventTypeSchemaIn { + schema: any; +} + +export const EventTypeSchemaInSerializer = { + _fromJsonObject(object: any): EventTypeSchemaIn { + return { + schema: object["schema"], + }; + }, + + _toJsonObject(self: EventTypeSchemaIn): any { + return { + schema: self.schema, + }; + }, +}; diff --git a/javascript/src/models/exportEventTypeOut.ts b/javascript/src/models/exportEventTypeOut.ts new file mode 100644 index 0000000000..c1f49b882e --- /dev/null +++ b/javascript/src/models/exportEventTypeOut.ts @@ -0,0 +1,32 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { + BackgroundTaskStatus, + BackgroundTaskStatusSerializer, +} from "./backgroundTaskStatus"; +import { BackgroundTaskType, BackgroundTaskTypeSerializer } from "./backgroundTaskType"; + +export interface ExportEventTypeOut { + /** The QueueBackgroundTask's ID. */ + id: string; + status: BackgroundTaskStatus; + task: BackgroundTaskType; +} + +export const ExportEventTypeOutSerializer = { + _fromJsonObject(object: any): ExportEventTypeOut { + return { + id: object["id"], + status: BackgroundTaskStatusSerializer._fromJsonObject(object["status"]), + task: BackgroundTaskTypeSerializer._fromJsonObject(object["task"]), + }; + }, + + _toJsonObject(self: ExportEventTypeOut): any { + return { + id: self.id, + status: BackgroundTaskStatusSerializer._toJsonObject(self.status), + task: BackgroundTaskTypeSerializer._toJsonObject(self.task), + }; + }, +}; diff --git a/javascript/src/models/fontSizeConfig.ts b/javascript/src/models/fontSizeConfig.ts new file mode 100644 index 0000000000..eb90d90146 --- /dev/null +++ b/javascript/src/models/fontSizeConfig.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface FontSizeConfig { + base?: number | null; +} + +export const FontSizeConfigSerializer = { + _fromJsonObject(object: any): FontSizeConfig { + return { + base: object["base"], + }; + }, + + _toJsonObject(self: FontSizeConfig): any { + return { + base: self.base, + }; + }, +}; diff --git a/javascript/src/models/generateIn.ts b/javascript/src/models/generateIn.ts new file mode 100644 index 0000000000..dda8330b2c --- /dev/null +++ b/javascript/src/models/generateIn.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface GenerateIn { + prompt: string; +} + +export const GenerateInSerializer = { + _fromJsonObject(object: any): GenerateIn { + return { + prompt: object["prompt"], + }; + }, + + _toJsonObject(self: GenerateIn): any { + return { + prompt: self.prompt, + }; + }, +}; diff --git a/javascript/src/models/generateOut.ts b/javascript/src/models/generateOut.ts new file mode 100644 index 0000000000..c0e520a10c --- /dev/null +++ b/javascript/src/models/generateOut.ts @@ -0,0 +1,35 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { CompletionChoice, CompletionChoiceSerializer } from "./completionChoice"; + +export interface GenerateOut { + choices: CompletionChoice[]; + created: number; + id: string; + model: string; + object: string; +} + +export const GenerateOutSerializer = { + _fromJsonObject(object: any): GenerateOut { + return { + choices: object["choices"].map((item: CompletionChoice) => + CompletionChoiceSerializer._fromJsonObject(item) + ), + created: object["created"], + id: object["id"], + model: object["model"], + object: object["object"], + }; + }, + + _toJsonObject(self: GenerateOut): any { + return { + choices: self.choices.map((item) => CompletionChoiceSerializer._toJsonObject(item)), + created: self.created, + id: self.id, + model: self.model, + object: self.object, + }; + }, +}; diff --git a/javascript/src/models/hubspotOauthConfigIn.ts b/javascript/src/models/hubspotOauthConfigIn.ts new file mode 100644 index 0000000000..f545e3e2e0 --- /dev/null +++ b/javascript/src/models/hubspotOauthConfigIn.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface HubspotOauthConfigIn { + refreshToken: string; +} + +export const HubspotOauthConfigInSerializer = { + _fromJsonObject(object: any): HubspotOauthConfigIn { + return { + refreshToken: object["refresh_token"], + }; + }, + + _toJsonObject(self: HubspotOauthConfigIn): any { + return { + refresh_token: self.refreshToken, + }; + }, +}; diff --git a/javascript/src/models/incomingWebhookPayloadOut.ts b/javascript/src/models/incomingWebhookPayloadOut.ts new file mode 100644 index 0000000000..6bd79bab77 --- /dev/null +++ b/javascript/src/models/incomingWebhookPayloadOut.ts @@ -0,0 +1,26 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface IncomingWebhookPayloadOut { + channel?: string | null; + error?: string | null; + incomingWebhookUrl?: string | null; +} + +export const IncomingWebhookPayloadOutSerializer = { + _fromJsonObject(object: any): IncomingWebhookPayloadOut { + return { + channel: object["channel"], + error: object["error"], + incomingWebhookUrl: object["incomingWebhookUrl"], + }; + }, + + _toJsonObject(self: IncomingWebhookPayloadOut): any { + return { + channel: self.channel, + error: self.error, + incomingWebhookUrl: self.incomingWebhookUrl, + }; + }, +}; diff --git a/javascript/src/models/kafkaSecurityProtocolType.ts b/javascript/src/models/kafkaSecurityProtocolType.ts new file mode 100644 index 0000000000..cd778e22c6 --- /dev/null +++ b/javascript/src/models/kafkaSecurityProtocolType.ts @@ -0,0 +1,18 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export enum KafkaSecurityProtocolType { + Plaintext = "plaintext", + Ssl = "ssl", + SaslSsl = "sasl-ssl", +} + +export const KafkaSecurityProtocolTypeSerializer = { + _fromJsonObject(object: any): KafkaSecurityProtocolType { + return object; + }, + + _toJsonObject(self: KafkaSecurityProtocolType): any { + return self; + }, +}; diff --git a/javascript/src/models/listResponseSinkOut.ts b/javascript/src/models/listResponseSinkOut.ts new file mode 100644 index 0000000000..48de55c809 --- /dev/null +++ b/javascript/src/models/listResponseSinkOut.ts @@ -0,0 +1,32 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { SinkOut, SinkOutSerializer } from "./sinkOut"; + +export interface ListResponseSinkOut { + data: SinkOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export const ListResponseSinkOutSerializer = { + _fromJsonObject(object: any): ListResponseSinkOut { + return { + data: object["data"].map((item: SinkOut) => + SinkOutSerializer._fromJsonObject(item) + ), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + }, + + _toJsonObject(self: ListResponseSinkOut): any { + return { + data: self.data.map((item) => SinkOutSerializer._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + }, +}; diff --git a/javascript/src/models/listResponseStreamEventTypeOut.ts b/javascript/src/models/listResponseStreamEventTypeOut.ts new file mode 100644 index 0000000000..1707ba5a73 --- /dev/null +++ b/javascript/src/models/listResponseStreamEventTypeOut.ts @@ -0,0 +1,32 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { StreamEventTypeOut, StreamEventTypeOutSerializer } from "./streamEventTypeOut"; + +export interface ListResponseStreamEventTypeOut { + data: StreamEventTypeOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export const ListResponseStreamEventTypeOutSerializer = { + _fromJsonObject(object: any): ListResponseStreamEventTypeOut { + return { + data: object["data"].map((item: StreamEventTypeOut) => + StreamEventTypeOutSerializer._fromJsonObject(item) + ), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + }, + + _toJsonObject(self: ListResponseStreamEventTypeOut): any { + return { + data: self.data.map((item) => StreamEventTypeOutSerializer._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + }, +}; diff --git a/javascript/src/models/listResponseStreamOut.ts b/javascript/src/models/listResponseStreamOut.ts new file mode 100644 index 0000000000..0bb6be5557 --- /dev/null +++ b/javascript/src/models/listResponseStreamOut.ts @@ -0,0 +1,32 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { StreamOut, StreamOutSerializer } from "./streamOut"; + +export interface ListResponseStreamOut { + data: StreamOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export const ListResponseStreamOutSerializer = { + _fromJsonObject(object: any): ListResponseStreamOut { + return { + data: object["data"].map((item: StreamOut) => + StreamOutSerializer._fromJsonObject(item) + ), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + }, + + _toJsonObject(self: ListResponseStreamOut): any { + return { + data: self.data.map((item) => StreamOutSerializer._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + }, +}; diff --git a/javascript/src/models/listResponseTemplateOut.ts b/javascript/src/models/listResponseTemplateOut.ts new file mode 100644 index 0000000000..f476e5365e --- /dev/null +++ b/javascript/src/models/listResponseTemplateOut.ts @@ -0,0 +1,32 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { TemplateOut, TemplateOutSerializer } from "./templateOut"; + +export interface ListResponseTemplateOut { + data: TemplateOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export const ListResponseTemplateOutSerializer = { + _fromJsonObject(object: any): ListResponseTemplateOut { + return { + data: object["data"].map((item: TemplateOut) => + TemplateOutSerializer._fromJsonObject(item) + ), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + }, + + _toJsonObject(self: ListResponseTemplateOut): any { + return { + data: self.data.map((item) => TemplateOutSerializer._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + }, +}; diff --git a/javascript/src/models/messageAttemptHeadersOut.ts b/javascript/src/models/messageAttemptHeadersOut.ts new file mode 100644 index 0000000000..a31eaf4ee6 --- /dev/null +++ b/javascript/src/models/messageAttemptHeadersOut.ts @@ -0,0 +1,26 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface MessageAttemptHeadersOut { + responseHeaders?: string[][] | null; + sensitive: string[]; + sentHeaders: { [key: string]: string }; +} + +export const MessageAttemptHeadersOutSerializer = { + _fromJsonObject(object: any): MessageAttemptHeadersOut { + return { + responseHeaders: object["responseHeaders"].map((item: string[]) => item), + sensitive: object["sensitive"], + sentHeaders: object["sentHeaders"], + }; + }, + + _toJsonObject(self: MessageAttemptHeadersOut): any { + return { + responseHeaders: self.responseHeaders?.map((item) => item), + sensitive: self.sensitive, + sentHeaders: self.sentHeaders, + }; + }, +}; diff --git a/javascript/src/models/messageEventsOut.ts b/javascript/src/models/messageEventsOut.ts new file mode 100644 index 0000000000..26bb86c615 --- /dev/null +++ b/javascript/src/models/messageEventsOut.ts @@ -0,0 +1,29 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { MessageOut, MessageOutSerializer } from "./messageOut"; + +export interface MessageEventsOut { + data: MessageOut[]; + done: boolean; + iterator: string; +} + +export const MessageEventsOutSerializer = { + _fromJsonObject(object: any): MessageEventsOut { + return { + data: object["data"].map((item: MessageOut) => + MessageOutSerializer._fromJsonObject(item) + ), + done: object["done"], + iterator: object["iterator"], + }; + }, + + _toJsonObject(self: MessageEventsOut): any { + return { + data: self.data.map((item) => MessageOutSerializer._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + }; + }, +}; diff --git a/javascript/src/models/messagePrecheckIn.ts b/javascript/src/models/messagePrecheckIn.ts new file mode 100644 index 0000000000..e96f95dd3c --- /dev/null +++ b/javascript/src/models/messagePrecheckIn.ts @@ -0,0 +1,24 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface MessagePrecheckIn { + channels?: string[] | null; + /** The event type's name */ + eventType: string; +} + +export const MessagePrecheckInSerializer = { + _fromJsonObject(object: any): MessagePrecheckIn { + return { + channels: object["channels"], + eventType: object["eventType"], + }; + }, + + _toJsonObject(self: MessagePrecheckIn): any { + return { + channels: self.channels, + eventType: self.eventType, + }; + }, +}; diff --git a/javascript/src/models/messagePrecheckOut.ts b/javascript/src/models/messagePrecheckOut.ts new file mode 100644 index 0000000000..ba4d3e1b32 --- /dev/null +++ b/javascript/src/models/messagePrecheckOut.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface MessagePrecheckOut { + active: boolean; +} + +export const MessagePrecheckOutSerializer = { + _fromJsonObject(object: any): MessagePrecheckOut { + return { + active: object["active"], + }; + }, + + _toJsonObject(self: MessagePrecheckOut): any { + return { + active: self.active, + }; + }, +}; diff --git a/javascript/src/models/messageRawPayloadOut.ts b/javascript/src/models/messageRawPayloadOut.ts new file mode 100644 index 0000000000..51f45fbd38 --- /dev/null +++ b/javascript/src/models/messageRawPayloadOut.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface MessageRawPayloadOut { + payload: string; +} + +export const MessageRawPayloadOutSerializer = { + _fromJsonObject(object: any): MessageRawPayloadOut { + return { + payload: object["payload"], + }; + }, + + _toJsonObject(self: MessageRawPayloadOut): any { + return { + payload: self.payload, + }; + }, +}; diff --git a/javascript/src/models/messageSubscriberAuthTokenOut.ts b/javascript/src/models/messageSubscriberAuthTokenOut.ts new file mode 100644 index 0000000000..8e58462a7b --- /dev/null +++ b/javascript/src/models/messageSubscriberAuthTokenOut.ts @@ -0,0 +1,23 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface MessageSubscriberAuthTokenOut { + bridgeToken: string; + token: string; +} + +export const MessageSubscriberAuthTokenOutSerializer = { + _fromJsonObject(object: any): MessageSubscriberAuthTokenOut { + return { + bridgeToken: object["bridgeToken"], + token: object["token"], + }; + }, + + _toJsonObject(self: MessageSubscriberAuthTokenOut): any { + return { + bridgeToken: self.bridgeToken, + token: self.token, + }; + }, +}; diff --git a/javascript/src/models/oAuthPayloadIn.ts b/javascript/src/models/oAuthPayloadIn.ts new file mode 100644 index 0000000000..1914025ca0 --- /dev/null +++ b/javascript/src/models/oAuthPayloadIn.ts @@ -0,0 +1,23 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface OAuthPayloadIn { + code: string; + redirectUri: string; +} + +export const OAuthPayloadInSerializer = { + _fromJsonObject(object: any): OAuthPayloadIn { + return { + code: object["code"], + redirectUri: object["redirectUri"], + }; + }, + + _toJsonObject(self: OAuthPayloadIn): any { + return { + code: self.code, + redirectUri: self.redirectUri, + }; + }, +}; diff --git a/javascript/src/models/oAuthPayloadOut.ts b/javascript/src/models/oAuthPayloadOut.ts new file mode 100644 index 0000000000..d288bec28f --- /dev/null +++ b/javascript/src/models/oAuthPayloadOut.ts @@ -0,0 +1,26 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface OAuthPayloadOut { + accessToken?: string | null; + error?: string | null; + refreshToken?: string | null; +} + +export const OAuthPayloadOutSerializer = { + _fromJsonObject(object: any): OAuthPayloadOut { + return { + accessToken: object["accessToken"], + error: object["error"], + refreshToken: object["refreshToken"], + }; + }, + + _toJsonObject(self: OAuthPayloadOut): any { + return { + accessToken: self.accessToken, + error: self.error, + refreshToken: self.refreshToken, + }; + }, +}; diff --git a/javascript/src/models/oauth2AuthMethodInOut.ts b/javascript/src/models/oauth2AuthMethodInOut.ts new file mode 100644 index 0000000000..d45d6b6d2e --- /dev/null +++ b/javascript/src/models/oauth2AuthMethodInOut.ts @@ -0,0 +1,22 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +/** + * The method used for authenticating to the OAuth authorization server. + * + * `clientSecretJwt` will construct a JWT used for authentication with the oauth authorization server. This method is less commonly used and may not be supported by all oauth providers. `clientSecretBasic` will authenticate to the oauth authorization server using an `Authorization` header with the client secret as the value. This is the most common means of authentication. `clientSecretPost` will authenticate to the oauth authorization server by passing the client secret in a `client_secret` field in the request body. This method may not be supported by all oauth providers, and in general `clientSecretBasic` should be preferred. + */ +export enum Oauth2AuthMethodInOut { + ClientSecretJwt = "clientSecretJwt", + ClientSecretBasic = "clientSecretBasic", + ClientSecretPost = "clientSecretPost", +} + +export const Oauth2AuthMethodInOutSerializer = { + _fromJsonObject(object: any): Oauth2AuthMethodInOut { + return object; + }, + + _toJsonObject(self: Oauth2AuthMethodInOut): any { + return self; + }, +}; diff --git a/javascript/src/models/oauth2GrantTypeInOut.ts b/javascript/src/models/oauth2GrantTypeInOut.ts new file mode 100644 index 0000000000..d1c8c6db19 --- /dev/null +++ b/javascript/src/models/oauth2GrantTypeInOut.ts @@ -0,0 +1,17 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export enum Oauth2GrantTypeInOut { + ClientCredentials = "clientCredentials", + RefreshToken = "refreshToken", +} + +export const Oauth2GrantTypeInOutSerializer = { + _fromJsonObject(object: any): Oauth2GrantTypeInOut { + return object; + }, + + _toJsonObject(self: Oauth2GrantTypeInOut): any { + return self; + }, +}; diff --git a/javascript/src/models/oauthJwsSigningAlgorithm.ts b/javascript/src/models/oauthJwsSigningAlgorithm.ts new file mode 100644 index 0000000000..c07c2af720 --- /dev/null +++ b/javascript/src/models/oauthJwsSigningAlgorithm.ts @@ -0,0 +1,16 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export enum OauthJwsSigningAlgorithm { + Rs256 = "RS256", +} + +export const OauthJwsSigningAlgorithmSerializer = { + _fromJsonObject(object: any): OauthJwsSigningAlgorithm { + return object; + }, + + _toJsonObject(self: OauthJwsSigningAlgorithm): any { + return self; + }, +}; diff --git a/javascript/src/models/oneTimeTokenIn.ts b/javascript/src/models/oneTimeTokenIn.ts new file mode 100644 index 0000000000..42f976e1ee --- /dev/null +++ b/javascript/src/models/oneTimeTokenIn.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface OneTimeTokenIn { + oneTimeToken: string; +} + +export const OneTimeTokenInSerializer = { + _fromJsonObject(object: any): OneTimeTokenIn { + return { + oneTimeToken: object["oneTimeToken"], + }; + }, + + _toJsonObject(self: OneTimeTokenIn): any { + return { + oneTimeToken: self.oneTimeToken, + }; + }, +}; diff --git a/javascript/src/models/oneTimeTokenOut.ts b/javascript/src/models/oneTimeTokenOut.ts new file mode 100644 index 0000000000..c0ceed15e2 --- /dev/null +++ b/javascript/src/models/oneTimeTokenOut.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface OneTimeTokenOut { + token: string; +} + +export const OneTimeTokenOutSerializer = { + _fromJsonObject(object: any): OneTimeTokenOut { + return { + token: object["token"], + }; + }, + + _toJsonObject(self: OneTimeTokenOut): any { + return { + token: self.token, + }; + }, +}; diff --git a/javascript/src/models/retrySchedule.ts b/javascript/src/models/retrySchedule.ts new file mode 100644 index 0000000000..c5d40c113d --- /dev/null +++ b/javascript/src/models/retrySchedule.ts @@ -0,0 +1,14 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { Duration } from "./duration"; +export type RetrySchedule = Duration[]; + +export const RetryScheduleSerializer = { + _fromJsonObject(object: any): RetrySchedule { + return object; + }, + + _toJsonObject(self: RetrySchedule): any { + return self; + }, +}; diff --git a/javascript/src/models/retryScheduleInOut.ts b/javascript/src/models/retryScheduleInOut.ts new file mode 100644 index 0000000000..1fd84284a2 --- /dev/null +++ b/javascript/src/models/retryScheduleInOut.ts @@ -0,0 +1,23 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { RetrySchedule, RetryScheduleSerializer } from "./retrySchedule"; + +export interface RetryScheduleInOut { + retrySchedule?: RetrySchedule | null; +} + +export const RetryScheduleInOutSerializer = { + _fromJsonObject(object: any): RetryScheduleInOut { + return { + retrySchedule: RetryScheduleSerializer._fromJsonObject(object["retrySchedule"]), + }; + }, + + _toJsonObject(self: RetryScheduleInOut): any { + return { + retrySchedule: self.retrySchedule + ? RetryScheduleSerializer._toJsonObject(self.retrySchedule) + : undefined, + }; + }, +}; diff --git a/javascript/src/models/rotatePollerTokenIn.ts b/javascript/src/models/rotatePollerTokenIn.ts new file mode 100644 index 0000000000..98b6f5eb3a --- /dev/null +++ b/javascript/src/models/rotatePollerTokenIn.ts @@ -0,0 +1,31 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface RotatePollerTokenIn { + /** How long the token will be valid for, in seconds. Can be up to 31,536,000 seconds (1 year). */ + expiry?: number | null; + /** + * Updates the previous token's expiration, in seconds. + * + * If set to 0, the old token will immediately be revoked. Must be between 0 and 86,400 seconds (1 day). + * + * Defaults to 300 seconds (5 minutes). + */ + oldTokenExpiry?: number; +} + +export const RotatePollerTokenInSerializer = { + _fromJsonObject(object: any): RotatePollerTokenIn { + return { + expiry: object["expiry"], + oldTokenExpiry: object["oldTokenExpiry"], + }; + }, + + _toJsonObject(self: RotatePollerTokenIn): any { + return { + expiry: self.expiry, + oldTokenExpiry: self.oldTokenExpiry, + }; + }, +}; diff --git a/javascript/src/models/rotatedUrlOut.ts b/javascript/src/models/rotatedUrlOut.ts new file mode 100644 index 0000000000..ce35489129 --- /dev/null +++ b/javascript/src/models/rotatedUrlOut.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface RotatedUrlOut { + url: string; +} + +export const RotatedUrlOutSerializer = { + _fromJsonObject(object: any): RotatedUrlOut { + return { + url: object["url"], + }; + }, + + _toJsonObject(self: RotatedUrlOut): any { + return { + url: self.url, + }; + }, +}; diff --git a/javascript/src/models/sinkIn.ts b/javascript/src/models/sinkIn.ts new file mode 100644 index 0000000000..bd4a85813e --- /dev/null +++ b/javascript/src/models/sinkIn.ts @@ -0,0 +1,53 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { SinkInType, SinkInTypeSerializer } from "./sinkInType"; + +export interface SinkIn { + /** List of message channels this sink listens to (omit for all). */ + channels?: string[] | null; + description?: string; + disabled?: boolean; + filterTypes?: string[] | null; + metadata?: { [key: string]: string }; + rateLimit?: number | null; + /** + * The endpoint's verification secret. + * + * Format: `base64` encoded random bytes optionally prefixed with `whsec_`. + * It is recommended to not set this and let the server generate the secret. + */ + secret?: string | null; + /** Optional unique identifier for the sink. */ + uid?: string | null; + type: SinkInType; +} + +export const SinkInSerializer = { + _fromJsonObject(object: any): SinkIn { + return { + channels: object["channels"], + description: object["description"], + disabled: object["disabled"], + filterTypes: object["filterTypes"], + metadata: object["metadata"], + rateLimit: object["rateLimit"], + secret: object["secret"], + uid: object["uid"], + type: SinkInTypeSerializer._fromJsonObject(object["type"]), + }; + }, + + _toJsonObject(self: SinkIn): any { + return { + channels: self.channels, + description: self.description, + disabled: self.disabled, + filterTypes: self.filterTypes, + metadata: self.metadata, + rateLimit: self.rateLimit, + secret: self.secret, + uid: self.uid, + type: SinkInTypeSerializer._toJsonObject(self.type), + }; + }, +}; diff --git a/javascript/src/models/sinkInType.ts b/javascript/src/models/sinkInType.ts new file mode 100644 index 0000000000..215cc010aa --- /dev/null +++ b/javascript/src/models/sinkInType.ts @@ -0,0 +1,172 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +/* eslint @typescript-eslint/no-unused-vars: 0 */ + +import { + KafkaSecurityProtocolType, + KafkaSecurityProtocolTypeSerializer, +} from "./kafkaSecurityProtocolType"; + +export interface RabbitMq { + routingKey: string; + uri: string; + type: "rabbitMQ"; +} + +export const RabbitMqSerializer = { + _fromJsonObject(object: any): RabbitMq { + return { + routingKey: object["routingKey"], + uri: object["uri"], + type: "rabbitMQ", + }; + }, + + _toJsonObject(self: RabbitMq): any { + return { + routingKey: self.routingKey, + uri: self.uri, + type: self.type, + }; + }, +}; +export interface Sqs { + accessKey: string; + queueDsn: string; + region: string; + secretKey: string; + type: "sqs"; +} + +export const SqsSerializer = { + _fromJsonObject(object: any): Sqs { + return { + accessKey: object["accessKey"], + queueDsn: object["queueDsn"], + region: object["region"], + secretKey: object["secretKey"], + type: "sqs", + }; + }, + + _toJsonObject(self: Sqs): any { + return { + accessKey: self.accessKey, + queueDsn: self.queueDsn, + region: self.region, + secretKey: self.secretKey, + type: self.type, + }; + }, +}; +export interface Kafka { + brokers: string; + /** Password for SASL, if `security_protocol` is `sasl-ssl`. */ + saslPassword?: string | null; + /** Username for SASL, if `security_protocol` is `sasl-ssl`. */ + saslUsername?: string | null; + securityProtocol: KafkaSecurityProtocolType; + topic: string; + type: "kafka"; +} + +export const KafkaSerializer = { + _fromJsonObject(object: any): Kafka { + return { + brokers: object["brokers"], + saslPassword: object["saslPassword"], + saslUsername: object["saslUsername"], + securityProtocol: KafkaSecurityProtocolTypeSerializer._fromJsonObject( + object["securityProtocol"] + ), + topic: object["topic"], + type: "kafka", + }; + }, + + _toJsonObject(self: Kafka): any { + return { + brokers: self.brokers, + saslPassword: self.saslPassword, + saslUsername: self.saslUsername, + securityProtocol: KafkaSecurityProtocolTypeSerializer._toJsonObject( + self.securityProtocol + ), + topic: self.topic, + type: self.type, + }; + }, +}; +export interface Http { + url: string; + type: "http"; +} + +export const HttpSerializer = { + _fromJsonObject(object: any): Http { + return { + url: object["url"], + type: "http", + }; + }, + + _toJsonObject(self: Http): any { + return { + url: self.url, + type: self.type, + }; + }, +}; +export interface EventStream { + type: "eventStream"; +} + +export const EventStreamSerializer = { + _fromJsonObject(object: any): EventStream { + return { + type: "eventStream", + }; + }, + + _toJsonObject(self: EventStream): any { + return { + type: self.type, + }; + }, +}; + +export type SinkInType = RabbitMq | Sqs | Kafka | Http | EventStream; + +export const SinkInTypeSerializer = { + _fromJsonObject(object: any): SinkInType { + switch (object["type"]) { + case "rabbitMQ": + return RabbitMqSerializer._fromJsonObject(object); + case "sqs": + return SqsSerializer._fromJsonObject(object); + case "kafka": + return KafkaSerializer._fromJsonObject(object); + case "http": + return HttpSerializer._fromJsonObject(object); + case "eventStream": + return EventStreamSerializer._fromJsonObject(object); + default: + throw new SyntaxError("Unexpected type " + object["type"]); + } + }, + // eslint-disable-next-line consistent-return + _toJsonObject(self: SinkInType): any { + switch (self.type) { + case "rabbitMQ": + return RabbitMqSerializer._toJsonObject(self); + case "sqs": + return SqsSerializer._toJsonObject(self); + case "kafka": + return KafkaSerializer._toJsonObject(self); + case "http": + return HttpSerializer._toJsonObject(self); + case "eventStream": + return EventStreamSerializer._toJsonObject(self); + } + }, +}; diff --git a/javascript/src/models/sinkOut.ts b/javascript/src/models/sinkOut.ts new file mode 100644 index 0000000000..47006c9505 --- /dev/null +++ b/javascript/src/models/sinkOut.ts @@ -0,0 +1,55 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { SinkOutType, SinkOutTypeSerializer } from "./sinkOutType"; + +export interface SinkOut { + /** List of message channels this endpoint listens to (omit for all). */ + channels?: string[] | null; + createdAt: Date | null; + /** An example endpoint name. */ + description: string; + disabled?: boolean; + filterTypes?: string[] | null; + /** The Endpoint's ID. */ + id: string; + metadata: { [key: string]: string }; + rateLimit?: number | null; + /** Optional unique identifier for the endpoint. */ + uid?: string | null; + updatedAt: Date | null; + type: SinkOutType; +} + +export const SinkOutSerializer = { + _fromJsonObject(object: any): SinkOut { + return { + channels: object["channels"], + createdAt: new Date(object["createdAt"]), + description: object["description"], + disabled: object["disabled"], + filterTypes: object["filterTypes"], + id: object["id"], + metadata: object["metadata"], + rateLimit: object["rateLimit"], + uid: object["uid"], + updatedAt: new Date(object["updatedAt"]), + type: SinkOutTypeSerializer._fromJsonObject(object["type"]), + }; + }, + + _toJsonObject(self: SinkOut): any { + return { + channels: self.channels, + createdAt: self.createdAt, + description: self.description, + disabled: self.disabled, + filterTypes: self.filterTypes, + id: self.id, + metadata: self.metadata, + rateLimit: self.rateLimit, + uid: self.uid, + updatedAt: self.updatedAt, + type: SinkOutTypeSerializer._toJsonObject(self.type), + }; + }, +}; diff --git a/javascript/src/models/sinkOutType.ts b/javascript/src/models/sinkOutType.ts new file mode 100644 index 0000000000..97d7c97049 --- /dev/null +++ b/javascript/src/models/sinkOutType.ts @@ -0,0 +1,172 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +/* eslint @typescript-eslint/no-unused-vars: 0 */ + +import { + KafkaSecurityProtocolType, + KafkaSecurityProtocolTypeSerializer, +} from "./kafkaSecurityProtocolType"; + +export interface RabbitMq { + routingKey: string; + uri: string; + type: "rabbitMQ"; +} + +export const RabbitMqSerializer = { + _fromJsonObject(object: any): RabbitMq { + return { + routingKey: object["routingKey"], + uri: object["uri"], + type: "rabbitMQ", + }; + }, + + _toJsonObject(self: RabbitMq): any { + return { + routingKey: self.routingKey, + uri: self.uri, + type: self.type, + }; + }, +}; +export interface Sqs { + accessKey: string; + queueDsn: string; + region: string; + secretKey: string; + type: "sqs"; +} + +export const SqsSerializer = { + _fromJsonObject(object: any): Sqs { + return { + accessKey: object["accessKey"], + queueDsn: object["queueDsn"], + region: object["region"], + secretKey: object["secretKey"], + type: "sqs", + }; + }, + + _toJsonObject(self: Sqs): any { + return { + accessKey: self.accessKey, + queueDsn: self.queueDsn, + region: self.region, + secretKey: self.secretKey, + type: self.type, + }; + }, +}; +export interface Kafka { + brokers: string; + /** Password for SASL, if `security_protocol` is `sasl-ssl`. */ + saslPassword?: string | null; + /** Username for SASL, if `security_protocol` is `sasl-ssl`. */ + saslUsername?: string | null; + securityProtocol: KafkaSecurityProtocolType; + topic: string; + type: "kafka"; +} + +export const KafkaSerializer = { + _fromJsonObject(object: any): Kafka { + return { + brokers: object["brokers"], + saslPassword: object["saslPassword"], + saslUsername: object["saslUsername"], + securityProtocol: KafkaSecurityProtocolTypeSerializer._fromJsonObject( + object["securityProtocol"] + ), + topic: object["topic"], + type: "kafka", + }; + }, + + _toJsonObject(self: Kafka): any { + return { + brokers: self.brokers, + saslPassword: self.saslPassword, + saslUsername: self.saslUsername, + securityProtocol: KafkaSecurityProtocolTypeSerializer._toJsonObject( + self.securityProtocol + ), + topic: self.topic, + type: self.type, + }; + }, +}; +export interface Http { + url: string; + type: "http"; +} + +export const HttpSerializer = { + _fromJsonObject(object: any): Http { + return { + url: object["url"], + type: "http", + }; + }, + + _toJsonObject(self: Http): any { + return { + url: self.url, + type: self.type, + }; + }, +}; +export interface EventStream { + type: "eventStream"; +} + +export const EventStreamSerializer = { + _fromJsonObject(object: any): EventStream { + return { + type: "eventStream", + }; + }, + + _toJsonObject(self: EventStream): any { + return { + type: self.type, + }; + }, +}; + +export type SinkOutType = RabbitMq | Sqs | Kafka | Http | EventStream; + +export const SinkOutTypeSerializer = { + _fromJsonObject(object: any): SinkOutType { + switch (object["type"]) { + case "rabbitMQ": + return RabbitMqSerializer._fromJsonObject(object); + case "sqs": + return SqsSerializer._fromJsonObject(object); + case "kafka": + return KafkaSerializer._fromJsonObject(object); + case "http": + return HttpSerializer._fromJsonObject(object); + case "eventStream": + return EventStreamSerializer._fromJsonObject(object); + default: + throw new SyntaxError("Unexpected type " + object["type"]); + } + }, + // eslint-disable-next-line consistent-return + _toJsonObject(self: SinkOutType): any { + switch (self.type) { + case "rabbitMQ": + return RabbitMqSerializer._toJsonObject(self); + case "sqs": + return SqsSerializer._toJsonObject(self); + case "kafka": + return KafkaSerializer._toJsonObject(self); + case "http": + return HttpSerializer._toJsonObject(self); + case "eventStream": + return EventStreamSerializer._toJsonObject(self); + } + }, +}; diff --git a/javascript/src/models/statisticsPeriod.ts b/javascript/src/models/statisticsPeriod.ts new file mode 100644 index 0000000000..4f14f7734f --- /dev/null +++ b/javascript/src/models/statisticsPeriod.ts @@ -0,0 +1,17 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +/** Period length for a statistics data point. */ +export enum StatisticsPeriod { + OneDay = "OneDay", + FiveMinutes = "FiveMinutes", +} + +export const StatisticsPeriodSerializer = { + _fromJsonObject(object: any): StatisticsPeriod { + return object; + }, + + _toJsonObject(self: StatisticsPeriod): any { + return self; + }, +}; diff --git a/javascript/src/models/streamEventTypeIn.ts b/javascript/src/models/streamEventTypeIn.ts new file mode 100644 index 0000000000..8a5ea57b0b --- /dev/null +++ b/javascript/src/models/streamEventTypeIn.ts @@ -0,0 +1,24 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface StreamEventTypeIn { + description?: string | null; + /** The event type's name */ + name: string; +} + +export const StreamEventTypeInSerializer = { + _fromJsonObject(object: any): StreamEventTypeIn { + return { + description: object["description"], + name: object["name"], + }; + }, + + _toJsonObject(self: StreamEventTypeIn): any { + return { + description: self.description, + name: self.name, + }; + }, +}; diff --git a/javascript/src/models/streamEventTypeOut.ts b/javascript/src/models/streamEventTypeOut.ts new file mode 100644 index 0000000000..0e2b5031dd --- /dev/null +++ b/javascript/src/models/streamEventTypeOut.ts @@ -0,0 +1,30 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface StreamEventTypeOut { + createdAt: Date | null; + description?: string | null; + /** The event type's name */ + name: string; + updatedAt: Date | null; +} + +export const StreamEventTypeOutSerializer = { + _fromJsonObject(object: any): StreamEventTypeOut { + return { + createdAt: new Date(object["createdAt"]), + description: object["description"], + name: object["name"], + updatedAt: new Date(object["updatedAt"]), + }; + }, + + _toJsonObject(self: StreamEventTypeOut): any { + return { + createdAt: self.createdAt, + description: self.description, + name: self.name, + updatedAt: self.updatedAt, + }; + }, +}; diff --git a/javascript/src/models/streamEventTypePatch.ts b/javascript/src/models/streamEventTypePatch.ts new file mode 100644 index 0000000000..4c5ab72fcb --- /dev/null +++ b/javascript/src/models/streamEventTypePatch.ts @@ -0,0 +1,24 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface StreamEventTypePatch { + description: string | null; + /** The event type's name */ + name?: string | null; +} + +export const StreamEventTypePatchSerializer = { + _fromJsonObject(object: any): StreamEventTypePatch { + return { + description: object["description"], + name: object["name"], + }; + }, + + _toJsonObject(self: StreamEventTypePatch): any { + return { + description: self.description, + name: self.name, + }; + }, +}; diff --git a/javascript/src/models/streamIn.ts b/javascript/src/models/streamIn.ts new file mode 100644 index 0000000000..ff9f054080 --- /dev/null +++ b/javascript/src/models/streamIn.ts @@ -0,0 +1,25 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface StreamIn { + /** The stream's description. */ + description: string; + /** An optional unique identifier for the stream. */ + uid?: string | null; +} + +export const StreamInSerializer = { + _fromJsonObject(object: any): StreamIn { + return { + description: object["description"], + uid: object["uid"], + }; + }, + + _toJsonObject(self: StreamIn): any { + return { + description: self.description, + uid: self.uid, + }; + }, +}; diff --git a/javascript/src/models/streamOut.ts b/javascript/src/models/streamOut.ts new file mode 100644 index 0000000000..760cad3157 --- /dev/null +++ b/javascript/src/models/streamOut.ts @@ -0,0 +1,35 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface StreamOut { + createdAt: Date | null; + /** The stream's description. */ + description?: string | null; + /** The stream's ID. */ + id: string; + /** The stream's UID. */ + uid?: string | null; + updatedAt: Date | null; +} + +export const StreamOutSerializer = { + _fromJsonObject(object: any): StreamOut { + return { + createdAt: new Date(object["createdAt"]), + description: object["description"], + id: object["id"], + uid: object["uid"], + updatedAt: new Date(object["updatedAt"]), + }; + }, + + _toJsonObject(self: StreamOut): any { + return { + createdAt: self.createdAt, + description: self.description, + id: self.id, + uid: self.uid, + updatedAt: self.updatedAt, + }; + }, +}; diff --git a/javascript/src/models/streamPatch.ts b/javascript/src/models/streamPatch.ts new file mode 100644 index 0000000000..85275c2f33 --- /dev/null +++ b/javascript/src/models/streamPatch.ts @@ -0,0 +1,25 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface StreamPatch { + /** The Stream's description. */ + description?: string; + /** An optional unique identifier for the stream. */ + uid?: string | null; +} + +export const StreamPatchSerializer = { + _fromJsonObject(object: any): StreamPatch { + return { + description: object["description"], + uid: object["uid"], + }; + }, + + _toJsonObject(self: StreamPatch): any { + return { + description: self.description, + uid: self.uid, + }; + }, +}; diff --git a/javascript/src/models/streamPortalAccessIn.ts b/javascript/src/models/streamPortalAccessIn.ts new file mode 100644 index 0000000000..7ae6f297d6 --- /dev/null +++ b/javascript/src/models/streamPortalAccessIn.ts @@ -0,0 +1,33 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface StreamPortalAccessIn { + /** + * How long the token will be valid for, in seconds. + * + * Valid values are between 1 hour and 7 days. The default is 7 days. + */ + expiry?: number | null; + /** The set of feature flags the created token will have access to. */ + featureFlags?: string[]; + /** Whether the app portal should be in read-only mode. */ + readOnly?: boolean | null; +} + +export const StreamPortalAccessInSerializer = { + _fromJsonObject(object: any): StreamPortalAccessIn { + return { + expiry: object["expiry"], + featureFlags: object["featureFlags"], + readOnly: object["readOnly"], + }; + }, + + _toJsonObject(self: StreamPortalAccessIn): any { + return { + expiry: self.expiry, + featureFlags: self.featureFlags, + readOnly: self.readOnly, + }; + }, +}; diff --git a/javascript/src/models/templatePatch.ts b/javascript/src/models/templatePatch.ts new file mode 100644 index 0000000000..491747a01a --- /dev/null +++ b/javascript/src/models/templatePatch.ts @@ -0,0 +1,45 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { ConnectorKind, ConnectorKindSerializer } from "./connectorKind"; + +export interface TemplatePatch { + description?: string; + featureFlag?: string | null; + filterTypes?: string[] | null; + instructions?: string; + instructionsLink?: string | null; + kind?: ConnectorKind; + logo?: string; + name?: string; + transformation?: string; +} + +export const TemplatePatchSerializer = { + _fromJsonObject(object: any): TemplatePatch { + return { + description: object["description"], + featureFlag: object["featureFlag"], + filterTypes: object["filterTypes"], + instructions: object["instructions"], + instructionsLink: object["instructionsLink"], + kind: ConnectorKindSerializer._fromJsonObject(object["kind"]), + logo: object["logo"], + name: object["name"], + transformation: object["transformation"], + }; + }, + + _toJsonObject(self: TemplatePatch): any { + return { + description: self.description, + featureFlag: self.featureFlag, + filterTypes: self.filterTypes, + instructions: self.instructions, + instructionsLink: self.instructionsLink, + kind: self.kind ? ConnectorKindSerializer._toJsonObject(self.kind) : undefined, + logo: self.logo, + name: self.name, + transformation: self.transformation, + }; + }, +}; diff --git a/javascript/src/models/templateUpdate.ts b/javascript/src/models/templateUpdate.ts new file mode 100644 index 0000000000..d9946fa179 --- /dev/null +++ b/javascript/src/models/templateUpdate.ts @@ -0,0 +1,45 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { ConnectorKind, ConnectorKindSerializer } from "./connectorKind"; + +export interface TemplateUpdate { + description?: string; + featureFlag?: string | null; + filterTypes?: string[] | null; + instructions?: string; + instructionsLink?: string | null; + kind?: ConnectorKind; + logo: string; + name?: string; + transformation: string; +} + +export const TemplateUpdateSerializer = { + _fromJsonObject(object: any): TemplateUpdate { + return { + description: object["description"], + featureFlag: object["featureFlag"], + filterTypes: object["filterTypes"], + instructions: object["instructions"], + instructionsLink: object["instructionsLink"], + kind: ConnectorKindSerializer._fromJsonObject(object["kind"]), + logo: object["logo"], + name: object["name"], + transformation: object["transformation"], + }; + }, + + _toJsonObject(self: TemplateUpdate): any { + return { + description: self.description, + featureFlag: self.featureFlag, + filterTypes: self.filterTypes, + instructions: self.instructions, + instructionsLink: self.instructionsLink, + kind: self.kind ? ConnectorKindSerializer._toJsonObject(self.kind) : undefined, + logo: self.logo, + name: self.name, + transformation: self.transformation, + }; + }, +}; diff --git a/javascript/src/models/transformationHttpMethod.ts b/javascript/src/models/transformationHttpMethod.ts new file mode 100644 index 0000000000..4b064e320f --- /dev/null +++ b/javascript/src/models/transformationHttpMethod.ts @@ -0,0 +1,18 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export enum TransformationHttpMethod { + Post = "POST", + Put = "PUT", + Patch = "PATCH", +} + +export const TransformationHttpMethodSerializer = { + _fromJsonObject(object: any): TransformationHttpMethod { + return object; + }, + + _toJsonObject(self: TransformationHttpMethod): any { + return self; + }, +}; diff --git a/javascript/src/models/transformationSimulateIn.ts b/javascript/src/models/transformationSimulateIn.ts new file mode 100644 index 0000000000..bae15f76c2 --- /dev/null +++ b/javascript/src/models/transformationSimulateIn.ts @@ -0,0 +1,30 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface TransformationSimulateIn { + channels?: string[] | null; + code: string; + /** The event type's name */ + eventType: string; + payload: any; +} + +export const TransformationSimulateInSerializer = { + _fromJsonObject(object: any): TransformationSimulateIn { + return { + channels: object["channels"], + code: object["code"], + eventType: object["eventType"], + payload: object["payload"], + }; + }, + + _toJsonObject(self: TransformationSimulateIn): any { + return { + channels: self.channels, + code: self.code, + eventType: self.eventType, + payload: self.payload, + }; + }, +}; diff --git a/javascript/src/models/transformationSimulateOut.ts b/javascript/src/models/transformationSimulateOut.ts new file mode 100644 index 0000000000..ad5d3d0f24 --- /dev/null +++ b/javascript/src/models/transformationSimulateOut.ts @@ -0,0 +1,32 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { + TransformationHttpMethod, + TransformationHttpMethodSerializer, +} from "./transformationHttpMethod"; + +export interface TransformationSimulateOut { + method?: TransformationHttpMethod | null; + payload: string; + url: string; +} + +export const TransformationSimulateOutSerializer = { + _fromJsonObject(object: any): TransformationSimulateOut { + return { + method: TransformationHttpMethodSerializer._fromJsonObject(object["method"]), + payload: object["payload"], + url: object["url"], + }; + }, + + _toJsonObject(self: TransformationSimulateOut): any { + return { + method: self.method + ? TransformationHttpMethodSerializer._toJsonObject(self.method) + : undefined, + payload: self.payload, + url: self.url, + }; + }, +};