diff --git a/javascript/src/api/application.ts b/javascript/src/api/application.ts index 867fbec69d..bc6bf610b0 100644 --- a/javascript/src/api/application.ts +++ b/javascript/src/api/application.ts @@ -1,11 +1,12 @@ // this file is @generated +import { ApplicationIn, ApplicationInUtil } from "../models/application_in"; +import { ApplicationOut, ApplicationOutUtil } from "../models/application_out"; +import { ApplicationPatch, ApplicationPatchUtil } from "../models/application_patch"; import { - ApplicationIn, - ApplicationOut, - ApplicationPatch, ListResponseApplicationOut, - Ordering, -} from "../openapi"; + ListResponseApplicationOutUtil, +} from "../models/list_response_application_out"; +import { Ordering, OrderingUtil } from "../models/ordering"; import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; export interface ApplicationListOptions { @@ -32,7 +33,7 @@ export class Application { request.setQueryParam("iterator", options?.iterator); request.setQueryParam("order", options?.order); - return request.send(this.requestCtx, "ListResponseApplicationOut"); + return request.send(this.requestCtx, ListResponseApplicationOutUtil._fromJsonObject); } /** Create a new application. */ @@ -43,9 +44,9 @@ export class Application { const request = new SvixRequest(HttpMethod.POST, "/api/v1/app"); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(applicationIn, "ApplicationIn"); + request.setBody(ApplicationInUtil._toJsonObject(applicationIn)); - return request.send(this.requestCtx, "ApplicationOut"); + return request.send(this.requestCtx, ApplicationOutUtil._fromJsonObject); } /** Get the application with the UID from `applicationIn`, or create it if it doesn't exist yet. */ @@ -57,9 +58,9 @@ export class Application { request.setQueryParam("get_if_exists", true); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(applicationIn, "ApplicationIn"); + request.setBody(ApplicationInUtil._toJsonObject(applicationIn)); - return request.send(this.requestCtx, "ApplicationOut"); + return request.send(this.requestCtx, ApplicationOutUtil._fromJsonObject); } /** Get an application. */ @@ -68,7 +69,7 @@ export class Application { request.setPathParam("app_id", appId); - return request.send(this.requestCtx, "ApplicationOut"); + return request.send(this.requestCtx, ApplicationOutUtil._fromJsonObject); } /** Update an application. */ @@ -76,9 +77,9 @@ export class Application { const request = new SvixRequest(HttpMethod.PUT, "/api/v1/app/{app_id}"); request.setPathParam("app_id", appId); - request.setBody(applicationIn, "ApplicationIn"); + request.setBody(ApplicationInUtil._toJsonObject(applicationIn)); - return request.send(this.requestCtx, "ApplicationOut"); + return request.send(this.requestCtx, ApplicationOutUtil._fromJsonObject); } /** Delete an application. */ @@ -98,8 +99,8 @@ export class Application { const request = new SvixRequest(HttpMethod.PATCH, "/api/v1/app/{app_id}"); request.setPathParam("app_id", appId); - request.setBody(applicationPatch, "ApplicationPatch"); + request.setBody(ApplicationPatchUtil._toJsonObject(applicationPatch)); - return request.send(this.requestCtx, "ApplicationOut"); + return request.send(this.requestCtx, ApplicationOutUtil._fromJsonObject); } } diff --git a/javascript/src/api/authentication.ts b/javascript/src/api/authentication.ts index 98f9f83d17..4d87b07c3e 100644 --- a/javascript/src/api/authentication.ts +++ b/javascript/src/api/authentication.ts @@ -1,10 +1,17 @@ // this file is @generated +import { AppPortalAccessIn, AppPortalAccessInUtil } from "../models/app_portal_access_in"; import { - AppPortalAccessIn, AppPortalAccessOut, + AppPortalAccessOutUtil, +} from "../models/app_portal_access_out"; +import { ApplicationTokenExpireIn, + ApplicationTokenExpireInUtil, +} from "../models/application_token_expire_in"; +import { DashboardAccessOut, -} from "../openapi"; + DashboardAccessOutUtil, +} from "../models/dashboard_access_out"; import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; export interface AuthenticationAppPortalAccessOptions { @@ -39,9 +46,9 @@ export class Authentication { request.setPathParam("app_id", appId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(appPortalAccessIn, "AppPortalAccessIn"); + request.setBody(AppPortalAccessInUtil._toJsonObject(appPortalAccessIn)); - return request.send(this.requestCtx, "AppPortalAccessOut"); + return request.send(this.requestCtx, AppPortalAccessOutUtil._fromJsonObject); } /** Expire all of the tokens associated with a specific application. */ @@ -57,7 +64,7 @@ export class Authentication { request.setPathParam("app_id", appId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(applicationTokenExpireIn, "ApplicationTokenExpireIn"); + request.setBody(ApplicationTokenExpireInUtil._toJsonObject(applicationTokenExpireIn)); return request.sendNoResponseBody(this.requestCtx); } @@ -81,7 +88,7 @@ export class Authentication { request.setPathParam("app_id", appId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - return request.send(this.requestCtx, "DashboardAccessOut"); + return request.send(this.requestCtx, DashboardAccessOutUtil._fromJsonObject); } /** diff --git a/javascript/src/api/background_task.ts b/javascript/src/api/background_task.ts index 7bf90d5331..f7082f06b8 100644 --- a/javascript/src/api/background_task.ts +++ b/javascript/src/api/background_task.ts @@ -1,11 +1,18 @@ // this file is @generated +import { BackgroundTaskOut, BackgroundTaskOutUtil } from "../models/background_task_out"; import { - BackgroundTaskOut, BackgroundTaskStatus, + BackgroundTaskStatusUtil, +} from "../models/background_task_status"; +import { BackgroundTaskType, + BackgroundTaskTypeUtil, +} from "../models/background_task_type"; +import { ListResponseBackgroundTaskOut, - Ordering, -} from "../openapi"; + ListResponseBackgroundTaskOutUtil, +} from "../models/list_response_background_task_out"; +import { Ordering, OrderingUtil } from "../models/ordering"; import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; export interface BackgroundTaskListOptions { @@ -36,7 +43,10 @@ export class BackgroundTask { request.setQueryParam("iterator", options?.iterator); request.setQueryParam("order", options?.order); - return request.send(this.requestCtx, "ListResponseBackgroundTaskOut"); + return request.send( + this.requestCtx, + ListResponseBackgroundTaskOutUtil._fromJsonObject + ); } /** @@ -56,6 +66,6 @@ export class BackgroundTask { request.setPathParam("task_id", taskId); - return request.send(this.requestCtx, "BackgroundTaskOut"); + return request.send(this.requestCtx, BackgroundTaskOutUtil._fromJsonObject); } } diff --git a/javascript/src/api/endpoint.ts b/javascript/src/api/endpoint.ts index 17f8a19d6a..00c9e79f8c 100644 --- a/javascript/src/api/endpoint.ts +++ b/javascript/src/api/endpoint.ts @@ -1,27 +1,42 @@ // this file is @generated +import { EndpointHeadersIn, EndpointHeadersInUtil } from "../models/endpoint_headers_in"; import { - EndpointHeadersIn, EndpointHeadersOut, + EndpointHeadersOutUtil, +} from "../models/endpoint_headers_out"; +import { EndpointHeadersPatchIn, - EndpointIn, - EndpointOauthConfigIn, - EndpointOut, - EndpointPatch, - EndpointSecretOut, + EndpointHeadersPatchInUtil, +} from "../models/endpoint_headers_patch_in"; +import { EndpointIn, EndpointInUtil } from "../models/endpoint_in"; +import { EndpointOut, EndpointOutUtil } from "../models/endpoint_out"; +import { EndpointPatch, EndpointPatchUtil } from "../models/endpoint_patch"; +import { EndpointSecretOut, EndpointSecretOutUtil } from "../models/endpoint_secret_out"; +import { EndpointSecretRotateIn, - EndpointStats, + EndpointSecretRotateInUtil, +} from "../models/endpoint_secret_rotate_in"; +import { EndpointStats, EndpointStatsUtil } from "../models/endpoint_stats"; +import { EndpointTransformationIn, + EndpointTransformationInUtil, +} from "../models/endpoint_transformation_in"; +import { EndpointTransformationOut, - EndpointUpdate, - EventExampleIn, + EndpointTransformationOutUtil, +} from "../models/endpoint_transformation_out"; +import { EndpointUpdate, EndpointUpdateUtil } from "../models/endpoint_update"; +import { EventExampleIn, EventExampleInUtil } from "../models/event_example_in"; +import { ListResponseEndpointOut, - MessageOut, - Ordering, - RecoverIn, - RecoverOut, - ReplayIn, - ReplayOut, -} from "../openapi"; + ListResponseEndpointOutUtil, +} from "../models/list_response_endpoint_out"; +import { MessageOut, MessageOutUtil } from "../models/message_out"; +import { Ordering, OrderingUtil } from "../models/ordering"; +import { RecoverIn, RecoverInUtil } from "../models/recover_in"; +import { RecoverOut, RecoverOutUtil } from "../models/recover_out"; +import { ReplayIn, ReplayInUtil } from "../models/replay_in"; +import { ReplayOut, ReplayOutUtil } from "../models/replay_out"; import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; export interface EndpointListOptions { @@ -75,7 +90,7 @@ export class Endpoint { request.setQueryParam("iterator", options?.iterator); request.setQueryParam("order", options?.order); - return request.send(this.requestCtx, "ListResponseEndpointOut"); + return request.send(this.requestCtx, ListResponseEndpointOutUtil._fromJsonObject); } /** @@ -92,9 +107,9 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(endpointIn, "EndpointIn"); + request.setBody(EndpointInUtil._toJsonObject(endpointIn)); - return request.send(this.requestCtx, "EndpointOut"); + return request.send(this.requestCtx, EndpointOutUtil._fromJsonObject); } /** Get an endpoint. */ @@ -107,7 +122,7 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); - return request.send(this.requestCtx, "EndpointOut"); + return request.send(this.requestCtx, EndpointOutUtil._fromJsonObject); } /** Update an endpoint. */ @@ -123,9 +138,9 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); - request.setBody(endpointUpdate, "EndpointUpdate"); + request.setBody(EndpointUpdateUtil._toJsonObject(endpointUpdate)); - return request.send(this.requestCtx, "EndpointOut"); + return request.send(this.requestCtx, EndpointOutUtil._fromJsonObject); } /** Delete an endpoint. */ @@ -154,9 +169,9 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); - request.setBody(endpointPatch, "EndpointPatch"); + request.setBody(EndpointPatchUtil._toJsonObject(endpointPatch)); - return request.send(this.requestCtx, "EndpointOut"); + return request.send(this.requestCtx, EndpointOutUtil._fromJsonObject); } /** Get the additional headers to be sent with the webhook. */ @@ -169,7 +184,7 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); - return request.send(this.requestCtx, "EndpointHeadersOut"); + return request.send(this.requestCtx, EndpointHeadersOutUtil._fromJsonObject); } /** Set the additional headers to be sent with the webhook. */ @@ -185,7 +200,7 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); - request.setBody(endpointHeadersIn, "EndpointHeadersIn"); + request.setBody(EndpointHeadersInUtil._toJsonObject(endpointHeadersIn)); return request.sendNoResponseBody(this.requestCtx); } @@ -211,7 +226,7 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); - request.setBody(endpointHeadersPatchIn, "EndpointHeadersPatchIn"); + request.setBody(EndpointHeadersPatchInUtil._toJsonObject(endpointHeadersPatchIn)); return request.sendNoResponseBody(this.requestCtx); } @@ -243,9 +258,9 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(recoverIn, "RecoverIn"); + request.setBody(RecoverInUtil._toJsonObject(recoverIn)); - return request.send(this.requestCtx, "RecoverOut"); + return request.send(this.requestCtx, RecoverOutUtil._fromJsonObject); } /** @@ -268,9 +283,9 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(replayIn, "ReplayIn"); + request.setBody(ReplayInUtil._toJsonObject(replayIn)); - return request.send(this.requestCtx, "ReplayOut"); + return request.send(this.requestCtx, ReplayOutUtil._fromJsonObject); } /** @@ -288,7 +303,7 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); - return request.send(this.requestCtx, "EndpointSecretOut"); + return request.send(this.requestCtx, EndpointSecretOutUtil._fromJsonObject); } /** @@ -310,7 +325,7 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(endpointSecretRotateIn, "EndpointSecretRotateIn"); + request.setBody(EndpointSecretRotateInUtil._toJsonObject(endpointSecretRotateIn)); return request.sendNoResponseBody(this.requestCtx); } @@ -330,9 +345,9 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(eventExampleIn, "EventExampleIn"); + request.setBody(EventExampleInUtil._toJsonObject(eventExampleIn)); - return request.send(this.requestCtx, "MessageOut"); + return request.send(this.requestCtx, MessageOutUtil._fromJsonObject); } /** Get basic statistics for the endpoint. */ @@ -351,7 +366,7 @@ export class Endpoint { request.setQueryParam("since", options?.since); request.setQueryParam("until", options?.until); - return request.send(this.requestCtx, "EndpointStats"); + return request.send(this.requestCtx, EndpointStatsUtil._fromJsonObject); } /** Get the transformation code associated with this endpoint. */ @@ -367,7 +382,7 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); - return request.send(this.requestCtx, "EndpointTransformationOut"); + return request.send(this.requestCtx, EndpointTransformationOutUtil._fromJsonObject); } /** Set or unset the transformation code associated with this endpoint. */ @@ -383,36 +398,7 @@ export class Endpoint { request.setPathParam("app_id", appId); request.setPathParam("endpoint_id", endpointId); - request.setBody(endpointTransformationIn, "EndpointTransformationIn"); - - return request.sendNoResponseBody(this.requestCtx); - } - - public oauthUpdate( - appId: string, - endpointId: string, - endpointOauthConfigIn: EndpointOauthConfigIn - ): Promise { - const request = new SvixRequest( - HttpMethod.PUT, - "/app/{app_id}/endpoint/{endpoint_id}/oauth" - ); - - request.setPathParam("app_id", appId); - request.setPathParam("endpoint_id", endpointId); - request.setBody(endpointOauthConfigIn, "EndpointOauthConfigIn"); - - return request.sendNoResponseBody(this.requestCtx); - } - - public oauthDelete(appId: string, endpointId: string): Promise { - const request = new SvixRequest( - HttpMethod.DELETE, - "/app/{app_id}/endpoint/{endpoint_id}/oauth" - ); - - request.setPathParam("app_id", appId); - request.setPathParam("endpoint_id", endpointId); + request.setBody(EndpointTransformationInUtil._toJsonObject(endpointTransformationIn)); return request.sendNoResponseBody(this.requestCtx); } diff --git a/javascript/src/api/event_type.ts b/javascript/src/api/event_type.ts index 382ec5df3a..0e9c112283 100644 --- a/javascript/src/api/event_type.ts +++ b/javascript/src/api/event_type.ts @@ -1,14 +1,21 @@ // this file is @generated import { EventTypeImportOpenApiIn, + EventTypeImportOpenApiInUtil, +} from "../models/event_type_import_open_api_in"; +import { EventTypeImportOpenApiOut, - EventTypeIn, - EventTypeOut, - EventTypePatch, - EventTypeUpdate, + EventTypeImportOpenApiOutUtil, +} from "../models/event_type_import_open_api_out"; +import { EventTypeIn, EventTypeInUtil } from "../models/event_type_in"; +import { EventTypeOut, EventTypeOutUtil } from "../models/event_type_out"; +import { EventTypePatch, EventTypePatchUtil } from "../models/event_type_patch"; +import { EventTypeUpdate, EventTypeUpdateUtil } from "../models/event_type_update"; +import { ListResponseEventTypeOut, - Ordering, -} from "../openapi"; + ListResponseEventTypeOutUtil, +} from "../models/list_response_event_type_out"; +import { Ordering, OrderingUtil } from "../models/ordering"; import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; export interface EventTypeListOptions { @@ -50,7 +57,7 @@ export class EventType { request.setQueryParam("include_archived", options?.includeArchived); request.setQueryParam("with_content", options?.withContent); - return request.send(this.requestCtx, "ListResponseEventTypeOut"); + return request.send(this.requestCtx, ListResponseEventTypeOutUtil._fromJsonObject); } /** @@ -67,9 +74,9 @@ export class EventType { const request = new SvixRequest(HttpMethod.POST, "/api/v1/event-type"); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(eventTypeIn, "EventTypeIn"); + request.setBody(EventTypeInUtil._toJsonObject(eventTypeIn)); - return request.send(this.requestCtx, "EventTypeOut"); + return request.send(this.requestCtx, EventTypeOutUtil._fromJsonObject); } /** @@ -86,9 +93,9 @@ export class EventType { const request = new SvixRequest(HttpMethod.POST, "/api/v1/event-type/import/openapi"); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(eventTypeImportOpenApiIn, "EventTypeImportOpenApiIn"); + request.setBody(EventTypeImportOpenApiInUtil._toJsonObject(eventTypeImportOpenApiIn)); - return request.send(this.requestCtx, "EventTypeImportOpenApiOut"); + return request.send(this.requestCtx, EventTypeImportOpenApiOutUtil._fromJsonObject); } /** Get an event type. */ @@ -100,7 +107,7 @@ export class EventType { request.setPathParam("event_type_name", eventTypeName); - return request.send(this.requestCtx, "EventTypeOut"); + return request.send(this.requestCtx, EventTypeOutUtil._fromJsonObject); } /** Update an event type. */ @@ -114,9 +121,9 @@ export class EventType { ); request.setPathParam("event_type_name", eventTypeName); - request.setBody(eventTypeUpdate, "EventTypeUpdate"); + request.setBody(EventTypeUpdateUtil._toJsonObject(eventTypeUpdate)); - return request.send(this.requestCtx, "EventTypeOut"); + return request.send(this.requestCtx, EventTypeOutUtil._fromJsonObject); } /** @@ -150,8 +157,8 @@ export class EventType { ); request.setPathParam("event_type_name", eventTypeName); - request.setBody(eventTypePatch, "EventTypePatch"); + request.setBody(EventTypePatchUtil._toJsonObject(eventTypePatch)); - return request.send(this.requestCtx, "EventTypeOut"); + return request.send(this.requestCtx, EventTypeOutUtil._fromJsonObject); } } diff --git a/javascript/src/api/integration.ts b/javascript/src/api/integration.ts index a008e2f377..5eb23efb03 100644 --- a/javascript/src/api/integration.ts +++ b/javascript/src/api/integration.ts @@ -1,12 +1,13 @@ // this file is @generated +import { IntegrationIn, IntegrationInUtil } from "../models/integration_in"; +import { IntegrationKeyOut, IntegrationKeyOutUtil } from "../models/integration_key_out"; +import { IntegrationOut, IntegrationOutUtil } from "../models/integration_out"; +import { IntegrationUpdate, IntegrationUpdateUtil } from "../models/integration_update"; import { - IntegrationIn, - IntegrationKeyOut, - IntegrationOut, - IntegrationUpdate, ListResponseIntegrationOut, - Ordering, -} from "../openapi"; + ListResponseIntegrationOutUtil, +} from "../models/list_response_integration_out"; +import { Ordering, OrderingUtil } from "../models/ordering"; import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; export interface IntegrationListOptions { @@ -41,7 +42,7 @@ export class Integration { request.setQueryParam("iterator", options?.iterator); request.setQueryParam("order", options?.order); - return request.send(this.requestCtx, "ListResponseIntegrationOut"); + return request.send(this.requestCtx, ListResponseIntegrationOutUtil._fromJsonObject); } /** Create an integration. */ @@ -54,9 +55,9 @@ export class Integration { request.setPathParam("app_id", appId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(integrationIn, "IntegrationIn"); + request.setBody(IntegrationInUtil._toJsonObject(integrationIn)); - return request.send(this.requestCtx, "IntegrationOut"); + return request.send(this.requestCtx, IntegrationOutUtil._fromJsonObject); } /** Get an integration. */ @@ -69,7 +70,7 @@ export class Integration { request.setPathParam("app_id", appId); request.setPathParam("integ_id", integId); - return request.send(this.requestCtx, "IntegrationOut"); + return request.send(this.requestCtx, IntegrationOutUtil._fromJsonObject); } /** Update an integration. */ @@ -85,9 +86,9 @@ export class Integration { request.setPathParam("app_id", appId); request.setPathParam("integ_id", integId); - request.setBody(integrationUpdate, "IntegrationUpdate"); + request.setBody(IntegrationUpdateUtil._toJsonObject(integrationUpdate)); - return request.send(this.requestCtx, "IntegrationOut"); + return request.send(this.requestCtx, IntegrationOutUtil._fromJsonObject); } /** Delete an integration. */ @@ -117,7 +118,7 @@ export class Integration { request.setPathParam("app_id", appId); request.setPathParam("integ_id", integId); - return request.send(this.requestCtx, "IntegrationKeyOut"); + return request.send(this.requestCtx, IntegrationKeyOutUtil._fromJsonObject); } /** Rotate the integration's key. The previous key will be immediately revoked. */ @@ -135,6 +136,6 @@ export class Integration { request.setPathParam("integ_id", integId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - return request.send(this.requestCtx, "IntegrationKeyOut"); + return request.send(this.requestCtx, IntegrationKeyOutUtil._fromJsonObject); } } diff --git a/javascript/src/api/message.ts b/javascript/src/api/message.ts index 5798443243..f02a864464 100644 --- a/javascript/src/api/message.ts +++ b/javascript/src/api/message.ts @@ -1,5 +1,10 @@ // this file is @generated -import { ListResponseMessageOut, MessageIn, MessageOut } from "../openapi"; +import { + ListResponseMessageOut, + ListResponseMessageOutUtil, +} from "../models/list_response_message_out"; +import { MessageIn, MessageInUtil } from "../models/message_in"; +import { MessageOut, MessageOutUtil } from "../models/message_out"; import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; export interface MessageListOptions { @@ -62,7 +67,7 @@ export class Message { request.setQueryParam("tag", options?.tag); request.setQueryParam("event_types", options?.eventTypes); - return request.send(this.requestCtx, "ListResponseMessageOut"); + return request.send(this.requestCtx, ListResponseMessageOutUtil._fromJsonObject); } /** @@ -86,9 +91,9 @@ export class Message { request.setPathParam("app_id", appId); request.setQueryParam("with_content", options?.withContent); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(messageIn, "MessageIn"); + request.setBody(MessageInUtil._toJsonObject(messageIn)); - return request.send(this.requestCtx, "MessageOut"); + return request.send(this.requestCtx, MessageOutUtil._fromJsonObject); } /** Get a message by its ID or eventID. */ @@ -103,7 +108,7 @@ export class Message { request.setPathParam("msg_id", msgId); request.setQueryParam("with_content", options?.withContent); - return request.send(this.requestCtx, "MessageOut"); + return request.send(this.requestCtx, MessageOutUtil._fromJsonObject); } /** diff --git a/javascript/src/api/message_attempt.ts b/javascript/src/api/message_attempt.ts index 4d3be787f4..692f252ea1 100644 --- a/javascript/src/api/message_attempt.ts +++ b/javascript/src/api/message_attempt.ts @@ -1,12 +1,19 @@ // this file is @generated import { ListResponseEndpointMessageOut, + ListResponseEndpointMessageOutUtil, +} from "../models/list_response_endpoint_message_out"; +import { ListResponseMessageAttemptOut, + ListResponseMessageAttemptOutUtil, +} from "../models/list_response_message_attempt_out"; +import { ListResponseMessageEndpointOut, - MessageAttemptOut, - MessageStatus, - StatusCodeClass, -} from "../openapi"; + ListResponseMessageEndpointOutUtil, +} from "../models/list_response_message_endpoint_out"; +import { MessageAttemptOut, MessageAttemptOutUtil } from "../models/message_attempt_out"; +import { MessageStatus, MessageStatusUtil } from "../models/message_status"; +import { StatusCodeClass, StatusCodeClassUtil } from "../models/status_code_class"; import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; export interface MessageAttemptListOptions { @@ -149,7 +156,10 @@ export class MessageAttempt { request.setQueryParam("with_msg", options?.withMsg); request.setQueryParam("event_types", options?.eventTypes); - return request.send(this.requestCtx, "ListResponseMessageAttemptOut"); + return request.send( + this.requestCtx, + ListResponseMessageAttemptOutUtil._fromJsonObject + ); } /** @@ -184,7 +194,10 @@ export class MessageAttempt { request.setQueryParam("with_content", options?.withContent); request.setQueryParam("event_types", options?.eventTypes); - return request.send(this.requestCtx, "ListResponseMessageAttemptOut"); + return request.send( + this.requestCtx, + ListResponseMessageAttemptOutUtil._fromJsonObject + ); } /** @@ -219,7 +232,10 @@ export class MessageAttempt { request.setQueryParam("with_content", options?.withContent); request.setQueryParam("event_types", options?.eventTypes); - return request.send(this.requestCtx, "ListResponseEndpointMessageOut"); + return request.send( + this.requestCtx, + ListResponseEndpointMessageOutUtil._fromJsonObject + ); } /** `msg_id`: Use a message id or a message `eventId` */ @@ -237,7 +253,7 @@ export class MessageAttempt { request.setPathParam("msg_id", msgId); request.setPathParam("attempt_id", attemptId); - return request.send(this.requestCtx, "MessageAttemptOut"); + return request.send(this.requestCtx, MessageAttemptOutUtil._fromJsonObject); } /** @@ -280,7 +296,10 @@ export class MessageAttempt { request.setQueryParam("limit", options?.limit); request.setQueryParam("iterator", options?.iterator); - return request.send(this.requestCtx, "ListResponseMessageEndpointOut"); + return request.send( + this.requestCtx, + ListResponseMessageEndpointOutUtil._fromJsonObject + ); } /** Resend a message to the specified endpoint. */ diff --git a/javascript/src/api/operational_webhook_endpoint.ts b/javascript/src/api/operational_webhook_endpoint.ts index a0d57287ee..a51b9b4f48 100644 --- a/javascript/src/api/operational_webhook_endpoint.ts +++ b/javascript/src/api/operational_webhook_endpoint.ts @@ -1,15 +1,37 @@ // this file is @generated import { ListResponseOperationalWebhookEndpointOut, + ListResponseOperationalWebhookEndpointOutUtil, +} from "../models/list_response_operational_webhook_endpoint_out"; +import { OperationalWebhookEndpointHeadersIn, + OperationalWebhookEndpointHeadersInUtil, +} from "../models/operational_webhook_endpoint_headers_in"; +import { OperationalWebhookEndpointHeadersOut, + OperationalWebhookEndpointHeadersOutUtil, +} from "../models/operational_webhook_endpoint_headers_out"; +import { OperationalWebhookEndpointIn, + OperationalWebhookEndpointInUtil, +} from "../models/operational_webhook_endpoint_in"; +import { OperationalWebhookEndpointOut, + OperationalWebhookEndpointOutUtil, +} from "../models/operational_webhook_endpoint_out"; +import { OperationalWebhookEndpointSecretIn, + OperationalWebhookEndpointSecretInUtil, +} from "../models/operational_webhook_endpoint_secret_in"; +import { OperationalWebhookEndpointSecretOut, + OperationalWebhookEndpointSecretOutUtil, +} from "../models/operational_webhook_endpoint_secret_out"; +import { OperationalWebhookEndpointUpdate, - Ordering, -} from "../openapi"; + OperationalWebhookEndpointUpdateUtil, +} from "../models/operational_webhook_endpoint_update"; +import { Ordering, OrderingUtil } from "../models/ordering"; import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; export interface OperationalWebhookEndpointListOptions { @@ -45,7 +67,10 @@ export class OperationalWebhookEndpoint { request.setQueryParam("iterator", options?.iterator); request.setQueryParam("order", options?.order); - return request.send(this.requestCtx, "ListResponseOperationalWebhookEndpointOut"); + return request.send( + this.requestCtx, + ListResponseOperationalWebhookEndpointOutUtil._fromJsonObject + ); } /** Create an operational webhook endpoint. */ @@ -59,9 +84,14 @@ export class OperationalWebhookEndpoint { ); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(operationalWebhookEndpointIn, "OperationalWebhookEndpointIn"); + request.setBody( + OperationalWebhookEndpointInUtil._toJsonObject(operationalWebhookEndpointIn) + ); - return request.send(this.requestCtx, "OperationalWebhookEndpointOut"); + return request.send( + this.requestCtx, + OperationalWebhookEndpointOutUtil._fromJsonObject + ); } /** Get an operational webhook endpoint. */ @@ -73,7 +103,10 @@ export class OperationalWebhookEndpoint { request.setPathParam("endpoint_id", endpointId); - return request.send(this.requestCtx, "OperationalWebhookEndpointOut"); + return request.send( + this.requestCtx, + OperationalWebhookEndpointOutUtil._fromJsonObject + ); } /** Update an operational webhook endpoint. */ @@ -87,9 +120,14 @@ export class OperationalWebhookEndpoint { ); request.setPathParam("endpoint_id", endpointId); - request.setBody(operationalWebhookEndpointUpdate, "OperationalWebhookEndpointUpdate"); + request.setBody( + OperationalWebhookEndpointUpdateUtil._toJsonObject(operationalWebhookEndpointUpdate) + ); - return request.send(this.requestCtx, "OperationalWebhookEndpointOut"); + return request.send( + this.requestCtx, + OperationalWebhookEndpointOutUtil._fromJsonObject + ); } /** Delete an operational webhook endpoint. */ @@ -113,7 +151,10 @@ export class OperationalWebhookEndpoint { request.setPathParam("endpoint_id", endpointId); - return request.send(this.requestCtx, "OperationalWebhookEndpointHeadersOut"); + return request.send( + this.requestCtx, + OperationalWebhookEndpointHeadersOutUtil._fromJsonObject + ); } /** Set the additional headers to be sent with the operational webhook. */ @@ -128,8 +169,9 @@ export class OperationalWebhookEndpoint { request.setPathParam("endpoint_id", endpointId); request.setBody( - operationalWebhookEndpointHeadersIn, - "OperationalWebhookEndpointHeadersIn" + OperationalWebhookEndpointHeadersInUtil._toJsonObject( + operationalWebhookEndpointHeadersIn + ) ); return request.sendNoResponseBody(this.requestCtx); @@ -149,7 +191,10 @@ export class OperationalWebhookEndpoint { request.setPathParam("endpoint_id", endpointId); - return request.send(this.requestCtx, "OperationalWebhookEndpointSecretOut"); + return request.send( + this.requestCtx, + OperationalWebhookEndpointSecretOutUtil._fromJsonObject + ); } /** @@ -170,8 +215,9 @@ export class OperationalWebhookEndpoint { request.setPathParam("endpoint_id", endpointId); request.setHeaderParam("idempotency-key", options?.idempotencyKey); request.setBody( - operationalWebhookEndpointSecretIn, - "OperationalWebhookEndpointSecretIn" + OperationalWebhookEndpointSecretInUtil._toJsonObject( + operationalWebhookEndpointSecretIn + ) ); return request.sendNoResponseBody(this.requestCtx); diff --git a/javascript/src/api/statistics.ts b/javascript/src/api/statistics.ts index 1751271432..3b1116c011 100644 --- a/javascript/src/api/statistics.ts +++ b/javascript/src/api/statistics.ts @@ -1,5 +1,10 @@ // this file is @generated -import { AggregateEventTypesOut, AppUsageStatsIn, AppUsageStatsOut } from "../openapi"; +import { + AggregateEventTypesOut, + AggregateEventTypesOutUtil, +} from "../models/aggregate_event_types_out"; +import { AppUsageStatsIn, AppUsageStatsInUtil } from "../models/app_usage_stats_in"; +import { AppUsageStatsOut, AppUsageStatsOutUtil } from "../models/app_usage_stats_out"; import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; export interface StatisticsAggregateAppStatsOptions { @@ -22,9 +27,9 @@ export class Statistics { const request = new SvixRequest(HttpMethod.POST, "/api/v1/stats/usage/app"); request.setHeaderParam("idempotency-key", options?.idempotencyKey); - request.setBody(appUsageStatsIn, "AppUsageStatsIn"); + request.setBody(AppUsageStatsInUtil._toJsonObject(appUsageStatsIn)); - return request.send(this.requestCtx, "AppUsageStatsOut"); + return request.send(this.requestCtx, AppUsageStatsOutUtil._fromJsonObject); } /** @@ -36,6 +41,6 @@ export class Statistics { public aggregateEventTypes(): Promise { const request = new SvixRequest(HttpMethod.PUT, "/api/v1/stats/usage/event-types"); - return request.send(this.requestCtx, "AggregateEventTypesOut"); + return request.send(this.requestCtx, AggregateEventTypesOutUtil._fromJsonObject); } } diff --git a/javascript/src/models/aggregate_event_types_out.ts b/javascript/src/models/aggregate_event_types_out.ts new file mode 100644 index 0000000000..41ba5d17ce --- /dev/null +++ b/javascript/src/models/aggregate_event_types_out.ts @@ -0,0 +1,33 @@ +// this file is @generated +import { + BackgroundTaskStatus, + BackgroundTaskStatusUtil, +} from "../models/background_task_status"; +import { + BackgroundTaskType, + BackgroundTaskTypeUtil, +} from "../models/background_task_type"; + +export interface AggregateEventTypesOut { + id: string; + status: BackgroundTaskStatus; + task: BackgroundTaskType; +} + +export namespace AggregateEventTypesOutUtil { + export function _fromJsonObject(object: any): AggregateEventTypesOut { + return { + id: object["id"], + status: BackgroundTaskStatusUtil._fromJsonObject(object["status"]), + task: BackgroundTaskTypeUtil._fromJsonObject(object["task"]), + }; + } + + export function _toJsonObject(self: AggregateEventTypesOut): any { + return { + id: self.id, + status: BackgroundTaskStatusUtil._toJsonObject(self.status), + task: BackgroundTaskTypeUtil._toJsonObject(self.task), + }; + } +} diff --git a/javascript/src/models/app_portal_access_in.ts b/javascript/src/models/app_portal_access_in.ts new file mode 100644 index 0000000000..e4213ef7a8 --- /dev/null +++ b/javascript/src/models/app_portal_access_in.ts @@ -0,0 +1,41 @@ +// this file is @generated +import { ApplicationIn, ApplicationInUtil } from "../models/application_in"; + +export interface AppPortalAccessIn { + /** + * Optionally creates a new application while generating the access link. + * + * If the application id or uid that is used in the path already exists, this argument is ignored. + */ + application?: ApplicationIn | null; + /** + * 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 namespace AppPortalAccessInUtil { + export function _fromJsonObject(object: any): AppPortalAccessIn { + return { + application: ApplicationInUtil._fromJsonObject(object["application"]), + expiry: object["expiry"], + featureFlags: object["featureFlags"], + readOnly: object["readOnly"], + }; + } + + export function _toJsonObject(self: AppPortalAccessIn): any { + return { + application: ApplicationInUtil._toJsonObject(self.application), + expiry: self.expiry, + featureFlags: self.featureFlags, + readOnly: self.readOnly, + }; + } +} diff --git a/javascript/src/models/app_portal_access_out.ts b/javascript/src/models/app_portal_access_out.ts new file mode 100644 index 0000000000..1d987ac197 --- /dev/null +++ b/javascript/src/models/app_portal_access_out.ts @@ -0,0 +1,22 @@ +// this file is @generated + +export interface AppPortalAccessOut { + token: string; + url: string; +} + +export namespace AppPortalAccessOutUtil { + export function _fromJsonObject(object: any): AppPortalAccessOut { + return { + token: object["token"], + url: object["url"], + }; + } + + export function _toJsonObject(self: AppPortalAccessOut): any { + return { + token: self.token, + url: self.url, + }; + } +} diff --git a/javascript/src/models/app_usage_stats_in.ts b/javascript/src/models/app_usage_stats_in.ts new file mode 100644 index 0000000000..915383db3f --- /dev/null +++ b/javascript/src/models/app_usage_stats_in.ts @@ -0,0 +1,30 @@ +// this file is @generated + +export interface AppUsageStatsIn { + /** + * Specific app IDs or UIDs to aggregate stats for. + * + * Note that if none of the given IDs or UIDs are resolved, a 422 response will be given. + */ + appIds?: string[] | null; + since: Date | null; + until: Date | null; +} + +export namespace AppUsageStatsInUtil { + export function _fromJsonObject(object: any): AppUsageStatsIn { + return { + appIds: object["appIds"], + since: new Date(object["since"]), + until: new Date(object["until"]), + }; + } + + export function _toJsonObject(self: AppUsageStatsIn): any { + return { + appIds: self.appIds, + since: self.since, + until: self.until, + }; + } +} diff --git a/javascript/src/models/app_usage_stats_out.ts b/javascript/src/models/app_usage_stats_out.ts new file mode 100644 index 0000000000..f556662be5 --- /dev/null +++ b/javascript/src/models/app_usage_stats_out.ts @@ -0,0 +1,41 @@ +// this file is @generated +import { + BackgroundTaskStatus, + BackgroundTaskStatusUtil, +} from "../models/background_task_status"; +import { + BackgroundTaskType, + BackgroundTaskTypeUtil, +} from "../models/background_task_type"; + +export interface AppUsageStatsOut { + id: string; + status: BackgroundTaskStatus; + task: BackgroundTaskType; + /** + * Any app IDs or UIDs received in the request that weren't found. + * + * Stats will be produced for all the others. + */ + unresolvedAppIds: string[]; +} + +export namespace AppUsageStatsOutUtil { + export function _fromJsonObject(object: any): AppUsageStatsOut { + return { + id: object["id"], + status: BackgroundTaskStatusUtil._fromJsonObject(object["status"]), + task: BackgroundTaskTypeUtil._fromJsonObject(object["task"]), + unresolvedAppIds: object["unresolvedAppIds"], + }; + } + + export function _toJsonObject(self: AppUsageStatsOut): any { + return { + id: self.id, + status: BackgroundTaskStatusUtil._toJsonObject(self.status), + task: BackgroundTaskTypeUtil._toJsonObject(self.task), + unresolvedAppIds: self.unresolvedAppIds, + }; + } +} diff --git a/javascript/src/models/application_in.ts b/javascript/src/models/application_in.ts new file mode 100644 index 0000000000..08a6750a07 --- /dev/null +++ b/javascript/src/models/application_in.ts @@ -0,0 +1,29 @@ +// this file is @generated + +export interface ApplicationIn { + metadata?: { [key: string]: string }; + name: string; + rateLimit?: number | null; + /** Optional unique identifier for the application. */ + uid?: string | null; +} + +export namespace ApplicationInUtil { + export function _fromJsonObject(object: any): ApplicationIn { + return { + metadata: object["metadata"], + name: object["name"], + rateLimit: object["rateLimit"], + uid: object["uid"], + }; + } + + export function _toJsonObject(self: ApplicationIn): any { + return { + metadata: self.metadata, + name: self.name, + rateLimit: self.rateLimit, + uid: self.uid, + }; + } +} diff --git a/javascript/src/models/application_out.ts b/javascript/src/models/application_out.ts new file mode 100644 index 0000000000..2080b2163c --- /dev/null +++ b/javascript/src/models/application_out.ts @@ -0,0 +1,39 @@ +// this file is @generated + +export interface ApplicationOut { + createdAt: Date | null; + /** The app's ID */ + id: string; + metadata: { [key: string]: string }; + name: string; + rateLimit?: number | null; + /** The app's UID */ + uid?: string | null; + updatedAt: Date | null; +} + +export namespace ApplicationOutUtil { + export function _fromJsonObject(object: any): ApplicationOut { + return { + createdAt: new Date(object["createdAt"]), + id: object["id"], + metadata: object["metadata"], + name: object["name"], + rateLimit: object["rateLimit"], + uid: object["uid"], + updatedAt: new Date(object["updatedAt"]), + }; + } + + export function _toJsonObject(self: ApplicationOut): any { + return { + createdAt: self.createdAt, + id: self.id, + metadata: self.metadata, + name: self.name, + rateLimit: self.rateLimit, + uid: self.uid, + updatedAt: self.updatedAt, + }; + } +} diff --git a/javascript/src/models/application_patch.ts b/javascript/src/models/application_patch.ts new file mode 100644 index 0000000000..0652ac79c7 --- /dev/null +++ b/javascript/src/models/application_patch.ts @@ -0,0 +1,29 @@ +// this file is @generated + +export interface ApplicationPatch { + metadata?: { [key: string]: string }; + name?: string; + rateLimit?: number | null; + /** The app's UID */ + uid?: string | null; +} + +export namespace ApplicationPatchUtil { + export function _fromJsonObject(object: any): ApplicationPatch { + return { + metadata: object["metadata"], + name: object["name"], + rateLimit: object["rateLimit"], + uid: object["uid"], + }; + } + + export function _toJsonObject(self: ApplicationPatch): any { + return { + metadata: self.metadata, + name: self.name, + rateLimit: self.rateLimit, + uid: self.uid, + }; + } +} diff --git a/javascript/src/models/application_token_expire_in.ts b/javascript/src/models/application_token_expire_in.ts new file mode 100644 index 0000000000..56eacdce80 --- /dev/null +++ b/javascript/src/models/application_token_expire_in.ts @@ -0,0 +1,20 @@ +// this file is @generated + +export interface ApplicationTokenExpireIn { + /** How many seconds until the old key is expired. */ + expiry?: number | null; +} + +export namespace ApplicationTokenExpireInUtil { + export function _fromJsonObject(object: any): ApplicationTokenExpireIn { + return { + expiry: object["expiry"], + }; + } + + export function _toJsonObject(self: ApplicationTokenExpireIn): any { + return { + expiry: self.expiry, + }; + } +} diff --git a/javascript/src/models/background_task_out.ts b/javascript/src/models/background_task_out.ts new file mode 100644 index 0000000000..fc25f588e3 --- /dev/null +++ b/javascript/src/models/background_task_out.ts @@ -0,0 +1,36 @@ +// this file is @generated +import { + BackgroundTaskStatus, + BackgroundTaskStatusUtil, +} from "../models/background_task_status"; +import { + BackgroundTaskType, + BackgroundTaskTypeUtil, +} from "../models/background_task_type"; + +export interface BackgroundTaskOut { + data: any; + id: string; + status: BackgroundTaskStatus; + task: BackgroundTaskType; +} + +export namespace BackgroundTaskOutUtil { + export function _fromJsonObject(object: any): BackgroundTaskOut { + return { + data: object["data"], + id: object["id"], + status: BackgroundTaskStatusUtil._fromJsonObject(object["status"]), + task: BackgroundTaskTypeUtil._fromJsonObject(object["task"]), + }; + } + + export function _toJsonObject(self: BackgroundTaskOut): any { + return { + data: self.data, + id: self.id, + status: BackgroundTaskStatusUtil._toJsonObject(self.status), + task: BackgroundTaskTypeUtil._toJsonObject(self.task), + }; + } +} diff --git a/javascript/src/models/background_task_status.ts b/javascript/src/models/background_task_status.ts new file mode 100644 index 0000000000..0b7f25ee4d --- /dev/null +++ b/javascript/src/models/background_task_status.ts @@ -0,0 +1,17 @@ +// this file is @generated + +export enum BackgroundTaskStatus { + Running = "running", + Finished = "finished", + Failed = "failed", +} + +export namespace BackgroundTaskStatusUtil { + export function _fromJsonObject(object: any): BackgroundTaskStatus { + return object; + } + + export function _toJsonObject(self: BackgroundTaskStatus): any { + return self; + } +} diff --git a/javascript/src/models/background_task_type.ts b/javascript/src/models/background_task_type.ts new file mode 100644 index 0000000000..605ce07ed5 --- /dev/null +++ b/javascript/src/models/background_task_type.ts @@ -0,0 +1,20 @@ +// this file is @generated + +export enum BackgroundTaskType { + EndpointReplay = "endpoint.replay", + EndpointRecover = "endpoint.recover", + ApplicationStats = "application.stats", + MessageBroadcast = "message.broadcast", + SdkGenerate = "sdk.generate", + EventTypeAggregate = "event-type.aggregate", +} + +export namespace BackgroundTaskTypeUtil { + export function _fromJsonObject(object: any): BackgroundTaskType { + return object; + } + + export function _toJsonObject(self: BackgroundTaskType): any { + return self; + } +} diff --git a/javascript/src/models/connector_in.ts b/javascript/src/models/connector_in.ts new file mode 100644 index 0000000000..46a714a6cc --- /dev/null +++ b/javascript/src/models/connector_in.ts @@ -0,0 +1,44 @@ +// this file is @generated +import { ConnectorKind, ConnectorKindUtil } from "../models/connector_kind"; + +export interface ConnectorIn { + description?: string; + featureFlag?: string | null; + filterTypes?: string[] | null; + instructions?: string; + instructionsLink?: string | null; + kind?: ConnectorKind; + logo: string; + name: string; + transformation: string; +} + +export namespace ConnectorInUtil { + export function _fromJsonObject(object: any): ConnectorIn { + return { + description: object["description"], + featureFlag: object["featureFlag"], + filterTypes: object["filterTypes"], + instructions: object["instructions"], + instructionsLink: object["instructionsLink"], + kind: ConnectorKindUtil._fromJsonObject(object["kind"]), + logo: object["logo"], + name: object["name"], + transformation: object["transformation"], + }; + } + + export function _toJsonObject(self: ConnectorIn): any { + return { + description: self.description, + featureFlag: self.featureFlag, + filterTypes: self.filterTypes, + instructions: self.instructions, + instructionsLink: self.instructionsLink, + kind: ConnectorKindUtil._toJsonObject(self.kind), + logo: self.logo, + name: self.name, + transformation: self.transformation, + }; + } +} diff --git a/javascript/src/models/connector_kind.ts b/javascript/src/models/connector_kind.ts new file mode 100644 index 0000000000..446cfb6be9 --- /dev/null +++ b/javascript/src/models/connector_kind.ts @@ -0,0 +1,26 @@ +// this file is @generated + +export enum ConnectorKind { + Custom = "Custom", + CustomerIo = "CustomerIO", + Discord = "Discord", + Hubspot = "Hubspot", + Inngest = "Inngest", + Salesforce = "Salesforce", + Segment = "Segment", + Slack = "Slack", + Teams = "Teams", + TriggerDev = "TriggerDev", + Windmill = "Windmill", + Zapier = "Zapier", +} + +export namespace ConnectorKindUtil { + export function _fromJsonObject(object: any): ConnectorKind { + return object; + } + + export function _toJsonObject(self: ConnectorKind): any { + return self; + } +} diff --git a/javascript/src/models/dashboard_access_out.ts b/javascript/src/models/dashboard_access_out.ts new file mode 100644 index 0000000000..67b0bcb07d --- /dev/null +++ b/javascript/src/models/dashboard_access_out.ts @@ -0,0 +1,22 @@ +// this file is @generated + +export interface DashboardAccessOut { + token: string; + url: string; +} + +export namespace DashboardAccessOutUtil { + export function _fromJsonObject(object: any): DashboardAccessOut { + return { + token: object["token"], + url: object["url"], + }; + } + + export function _toJsonObject(self: DashboardAccessOut): any { + return { + token: self.token, + url: self.url, + }; + } +} diff --git a/javascript/src/models/endpoint_headers_in.ts b/javascript/src/models/endpoint_headers_in.ts new file mode 100644 index 0000000000..5d295eb00c --- /dev/null +++ b/javascript/src/models/endpoint_headers_in.ts @@ -0,0 +1,19 @@ +// this file is @generated + +export interface EndpointHeadersIn { + headers: { [key: string]: string }; +} + +export namespace EndpointHeadersInUtil { + export function _fromJsonObject(object: any): EndpointHeadersIn { + return { + headers: object["headers"], + }; + } + + export function _toJsonObject(self: EndpointHeadersIn): any { + return { + headers: self.headers, + }; + } +} diff --git a/javascript/src/models/endpoint_headers_out.ts b/javascript/src/models/endpoint_headers_out.ts new file mode 100644 index 0000000000..463ed6a357 --- /dev/null +++ b/javascript/src/models/endpoint_headers_out.ts @@ -0,0 +1,26 @@ +// this file is @generated +/** + * The value of the headers is returned in the `headers` field. + * + * Sensitive headers that have been redacted are returned in the sensitive field. + */ +export interface EndpointHeadersOut { + headers: { [key: string]: string }; + sensitive: string[]; +} + +export namespace EndpointHeadersOutUtil { + export function _fromJsonObject(object: any): EndpointHeadersOut { + return { + headers: object["headers"], + sensitive: object["sensitive"], + }; + } + + export function _toJsonObject(self: EndpointHeadersOut): any { + return { + headers: self.headers, + sensitive: self.sensitive, + }; + } +} diff --git a/javascript/src/models/endpoint_headers_patch_in.ts b/javascript/src/models/endpoint_headers_patch_in.ts new file mode 100644 index 0000000000..ae5e6d2b52 --- /dev/null +++ b/javascript/src/models/endpoint_headers_patch_in.ts @@ -0,0 +1,19 @@ +// this file is @generated + +export interface EndpointHeadersPatchIn { + headers: { [key: string]: string }; +} + +export namespace EndpointHeadersPatchInUtil { + export function _fromJsonObject(object: any): EndpointHeadersPatchIn { + return { + headers: object["headers"], + }; + } + + export function _toJsonObject(self: EndpointHeadersPatchIn): any { + return { + headers: self.headers, + }; + } +} diff --git a/javascript/src/models/endpoint_in.ts b/javascript/src/models/endpoint_in.ts new file mode 100644 index 0000000000..becde3278e --- /dev/null +++ b/javascript/src/models/endpoint_in.ts @@ -0,0 +1,54 @@ +// this file is @generated + +export interface EndpointIn { + /** List of message channels this endpoint 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 endpoint. */ + uid?: string | null; + url: string; + version?: number | null; +} + +export namespace EndpointInUtil { + export function _fromJsonObject(object: any): EndpointIn { + 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"], + url: object["url"], + version: object["version"], + }; + } + + export function _toJsonObject(self: EndpointIn): 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, + url: self.url, + version: self.version, + }; + } +} diff --git a/javascript/src/models/endpoint_message_out.ts b/javascript/src/models/endpoint_message_out.ts new file mode 100644 index 0000000000..f26ff2d481 --- /dev/null +++ b/javascript/src/models/endpoint_message_out.ts @@ -0,0 +1,48 @@ +// this file is @generated +import { MessageStatus, MessageStatusUtil } from "../models/message_status"; +/** A model containing information on a given message plus additional fields on the last attempt for that message. */ +export interface EndpointMessageOut { + /** List of free-form identifiers that endpoints can filter by */ + channels?: string[] | null; + /** Optional unique identifier for the message */ + eventId?: string | null; + /** The event type's name */ + eventType: string; + /** The msg's ID */ + id: string; + nextAttempt?: Date | null | null; + payload: any; + status: MessageStatus; + tags?: string[] | null; + timestamp: Date | null; +} + +export namespace EndpointMessageOutUtil { + export function _fromJsonObject(object: any): EndpointMessageOut { + return { + channels: object["channels"], + eventId: object["eventId"], + eventType: object["eventType"], + id: object["id"], + nextAttempt: new Date(object["nextAttempt"]), + payload: object["payload"], + status: MessageStatusUtil._fromJsonObject(object["status"]), + tags: object["tags"], + timestamp: new Date(object["timestamp"]), + }; + } + + export function _toJsonObject(self: EndpointMessageOut): any { + return { + channels: self.channels, + eventId: self.eventId, + eventType: self.eventType, + id: self.id, + nextAttempt: self.nextAttempt, + payload: self.payload, + status: MessageStatusUtil._toJsonObject(self.status), + tags: self.tags, + timestamp: self.timestamp, + }; + } +} diff --git a/javascript/src/models/endpoint_out.ts b/javascript/src/models/endpoint_out.ts new file mode 100644 index 0000000000..f349bbeca9 --- /dev/null +++ b/javascript/src/models/endpoint_out.ts @@ -0,0 +1,56 @@ +// this file is @generated + +export interface EndpointOut { + /** 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 ep's ID */ + id: string; + metadata: { [key: string]: string }; + rateLimit?: number | null; + /** Optional unique identifier for the endpoint. */ + uid?: string | null; + updatedAt: Date | null; + url: string; + version: number; +} + +export namespace EndpointOutUtil { + export function _fromJsonObject(object: any): EndpointOut { + 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"]), + url: object["url"], + version: object["version"], + }; + } + + export function _toJsonObject(self: EndpointOut): 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, + url: self.url, + version: self.version, + }; + } +} diff --git a/javascript/src/models/endpoint_patch.ts b/javascript/src/models/endpoint_patch.ts new file mode 100644 index 0000000000..305f525b64 --- /dev/null +++ b/javascript/src/models/endpoint_patch.ts @@ -0,0 +1,53 @@ +// this file is @generated + +export interface EndpointPatch { + 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; + /** The ep's UID */ + uid?: string | null; + url?: string; + version?: number; +} + +export namespace EndpointPatchUtil { + export function _fromJsonObject(object: any): EndpointPatch { + 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"], + url: object["url"], + version: object["version"], + }; + } + + export function _toJsonObject(self: EndpointPatch): 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, + url: self.url, + version: self.version, + }; + } +} diff --git a/javascript/src/models/endpoint_secret_out.ts b/javascript/src/models/endpoint_secret_out.ts new file mode 100644 index 0000000000..3cb414f84d --- /dev/null +++ b/javascript/src/models/endpoint_secret_out.ts @@ -0,0 +1,25 @@ +// this file is @generated + +export interface EndpointSecretOut { + /** + * 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. + */ + key: string; +} + +export namespace EndpointSecretOutUtil { + export function _fromJsonObject(object: any): EndpointSecretOut { + return { + key: object["key"], + }; + } + + export function _toJsonObject(self: EndpointSecretOut): any { + return { + key: self.key, + }; + } +} diff --git a/javascript/src/models/endpoint_secret_rotate_in.ts b/javascript/src/models/endpoint_secret_rotate_in.ts new file mode 100644 index 0000000000..24973aecb8 --- /dev/null +++ b/javascript/src/models/endpoint_secret_rotate_in.ts @@ -0,0 +1,25 @@ +// this file is @generated + +export interface EndpointSecretRotateIn { + /** + * 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. + */ + key?: string | null; +} + +export namespace EndpointSecretRotateInUtil { + export function _fromJsonObject(object: any): EndpointSecretRotateIn { + return { + key: object["key"], + }; + } + + export function _toJsonObject(self: EndpointSecretRotateIn): any { + return { + key: self.key, + }; + } +} diff --git a/javascript/src/models/endpoint_stats.ts b/javascript/src/models/endpoint_stats.ts new file mode 100644 index 0000000000..bcb8e2ae38 --- /dev/null +++ b/javascript/src/models/endpoint_stats.ts @@ -0,0 +1,28 @@ +// this file is @generated + +export interface EndpointStats { + fail: number; + pending: number; + sending: number; + success: number; +} + +export namespace EndpointStatsUtil { + export function _fromJsonObject(object: any): EndpointStats { + return { + fail: object["fail"], + pending: object["pending"], + sending: object["sending"], + success: object["success"], + }; + } + + export function _toJsonObject(self: EndpointStats): any { + return { + fail: self.fail, + pending: self.pending, + sending: self.sending, + success: self.success, + }; + } +} diff --git a/javascript/src/models/endpoint_transformation_in.ts b/javascript/src/models/endpoint_transformation_in.ts new file mode 100644 index 0000000000..3c9e10f135 --- /dev/null +++ b/javascript/src/models/endpoint_transformation_in.ts @@ -0,0 +1,22 @@ +// this file is @generated + +export interface EndpointTransformationIn { + code?: string | null; + enabled?: boolean; +} + +export namespace EndpointTransformationInUtil { + export function _fromJsonObject(object: any): EndpointTransformationIn { + return { + code: object["code"], + enabled: object["enabled"], + }; + } + + export function _toJsonObject(self: EndpointTransformationIn): any { + return { + code: self.code, + enabled: self.enabled, + }; + } +} diff --git a/javascript/src/models/endpoint_transformation_out.ts b/javascript/src/models/endpoint_transformation_out.ts new file mode 100644 index 0000000000..871a497c66 --- /dev/null +++ b/javascript/src/models/endpoint_transformation_out.ts @@ -0,0 +1,22 @@ +// this file is @generated + +export interface EndpointTransformationOut { + code?: string | null; + enabled?: boolean; +} + +export namespace EndpointTransformationOutUtil { + export function _fromJsonObject(object: any): EndpointTransformationOut { + return { + code: object["code"], + enabled: object["enabled"], + }; + } + + export function _toJsonObject(self: EndpointTransformationOut): any { + return { + code: self.code, + enabled: self.enabled, + }; + } +} diff --git a/javascript/src/models/endpoint_update.ts b/javascript/src/models/endpoint_update.ts new file mode 100644 index 0000000000..e12ddfc263 --- /dev/null +++ b/javascript/src/models/endpoint_update.ts @@ -0,0 +1,45 @@ +// this file is @generated + +export interface EndpointUpdate { + /** List of message channels this endpoint listens to (omit for all). */ + channels?: string[] | null; + description?: string; + disabled?: boolean; + filterTypes?: string[] | null; + metadata?: { [key: string]: string }; + rateLimit?: number | null; + /** Optional unique identifier for the endpoint. */ + uid?: string | null; + url: string; + version?: number | null; +} + +export namespace EndpointUpdateUtil { + export function _fromJsonObject(object: any): EndpointUpdate { + return { + channels: object["channels"], + description: object["description"], + disabled: object["disabled"], + filterTypes: object["filterTypes"], + metadata: object["metadata"], + rateLimit: object["rateLimit"], + uid: object["uid"], + url: object["url"], + version: object["version"], + }; + } + + export function _toJsonObject(self: EndpointUpdate): any { + return { + channels: self.channels, + description: self.description, + disabled: self.disabled, + filterTypes: self.filterTypes, + metadata: self.metadata, + rateLimit: self.rateLimit, + uid: self.uid, + url: self.url, + version: self.version, + }; + } +} diff --git a/javascript/src/models/environment_in.ts b/javascript/src/models/environment_in.ts new file mode 100644 index 0000000000..9b2ec8a1d6 --- /dev/null +++ b/javascript/src/models/environment_in.ts @@ -0,0 +1,31 @@ +// this file is @generated +import { ConnectorIn, ConnectorInUtil } from "../models/connector_in"; +import { EventTypeIn, EventTypeInUtil } from "../models/event_type_in"; + +export interface EnvironmentIn { + connectors?: ConnectorIn[] | null; + eventTypes?: EventTypeIn[] | null; + settings?: any | null; +} + +export namespace EnvironmentInUtil { + export function _fromJsonObject(object: any): EnvironmentIn { + return { + connectors: object["connectors"].map((item) => + ConnectorInUtil._fromJsonObject(item) + ), + eventTypes: object["eventTypes"].map((item) => + EventTypeInUtil._fromJsonObject(item) + ), + settings: object["settings"], + }; + } + + export function _toJsonObject(self: EnvironmentIn): any { + return { + connectors: self.connectors.map((item) => ConnectorInUtil._toJsonObject(item)), + eventTypes: self.eventTypes.map((item) => EventTypeInUtil._toJsonObject(item)), + settings: self.settings, + }; + } +} diff --git a/javascript/src/models/environment_out.ts b/javascript/src/models/environment_out.ts new file mode 100644 index 0000000000..cd5ba26058 --- /dev/null +++ b/javascript/src/models/environment_out.ts @@ -0,0 +1,39 @@ +// this file is @generated +import { EventTypeOut, EventTypeOutUtil } from "../models/event_type_out"; +import { TemplateOut, TemplateOutUtil } from "../models/template_out"; + +export interface EnvironmentOut { + createdAt: Date | null; + eventTypes: EventTypeOut[]; + settings: any | null; + transformationTemplates: TemplateOut[]; + version?: number; +} + +export namespace EnvironmentOutUtil { + export function _fromJsonObject(object: any): EnvironmentOut { + return { + createdAt: new Date(object["createdAt"]), + eventTypes: object["eventTypes"].map((item) => + EventTypeOutUtil._fromJsonObject(item) + ), + settings: object["settings"], + transformationTemplates: object["transformationTemplates"].map((item) => + TemplateOutUtil._fromJsonObject(item) + ), + version: object["version"], + }; + } + + export function _toJsonObject(self: EnvironmentOut): any { + return { + createdAt: self.createdAt, + eventTypes: self.eventTypes.map((item) => EventTypeOutUtil._toJsonObject(item)), + settings: self.settings, + transformationTemplates: self.transformationTemplates.map((item) => + TemplateOutUtil._toJsonObject(item) + ), + version: self.version, + }; + } +} diff --git a/javascript/src/models/event_example_in.ts b/javascript/src/models/event_example_in.ts new file mode 100644 index 0000000000..530f95e3a0 --- /dev/null +++ b/javascript/src/models/event_example_in.ts @@ -0,0 +1,28 @@ +// this file is @generated + +export interface EventExampleIn { + /** The event type's name */ + eventType: string; + /** + * If the event type schema contains an array of examples, chooses which one to send. + * + * Defaults to the first example. Ignored if the schema doesn't contain an array of examples. + */ + exampleIndex?: number; +} + +export namespace EventExampleInUtil { + export function _fromJsonObject(object: any): EventExampleIn { + return { + eventType: object["eventType"], + exampleIndex: object["exampleIndex"], + }; + } + + export function _toJsonObject(self: EventExampleIn): any { + return { + eventType: self.eventType, + exampleIndex: self.exampleIndex, + }; + } +} diff --git a/javascript/src/models/event_type_from_open_api.ts b/javascript/src/models/event_type_from_open_api.ts new file mode 100644 index 0000000000..1e6b0d9a3f --- /dev/null +++ b/javascript/src/models/event_type_from_open_api.ts @@ -0,0 +1,36 @@ +// this file is @generated + +export interface EventTypeFromOpenApi { + deprecated: boolean; + description: string; + featureFlag?: string | null; + /** The event type group's name */ + groupName?: string | null; + /** The event type's name */ + name: string; + schemas?: any | null; +} + +export namespace EventTypeFromOpenApiUtil { + export function _fromJsonObject(object: any): EventTypeFromOpenApi { + return { + deprecated: object["deprecated"], + description: object["description"], + featureFlag: object["featureFlag"], + groupName: object["groupName"], + name: object["name"], + schemas: object["schemas"], + }; + } + + export function _toJsonObject(self: EventTypeFromOpenApi): any { + return { + deprecated: self.deprecated, + description: self.description, + featureFlag: self.featureFlag, + groupName: self.groupName, + name: self.name, + schemas: self.schemas, + }; + } +} diff --git a/javascript/src/models/event_type_import_open_api_in.ts b/javascript/src/models/event_type_import_open_api_in.ts new file mode 100644 index 0000000000..1fca6a9f8d --- /dev/null +++ b/javascript/src/models/event_type_import_open_api_in.ts @@ -0,0 +1,36 @@ +// this file is @generated +/** + * Import a list of event types from webhooks defined in an OpenAPI spec. + * + * The OpenAPI spec can be specified as either `spec` given the spec as a JSON object, or as `specRaw` (a `string`) which will be parsed as YAML or JSON by the server. Sending neither or both is invalid, resulting in a `400` **Bad Request**. + */ +export interface EventTypeImportOpenApiIn { + /** If `true`, return the event types that would be modified without actually modifying them. */ + dryRun?: boolean; + /** If `true`, all existing event types that are not in the spec will be archived. */ + replaceAll?: boolean; + /** A pre-parsed JSON spec. */ + spec?: any | null; + /** A string, parsed by the server as YAML or JSON. */ + specRaw?: string | null; +} + +export namespace EventTypeImportOpenApiInUtil { + export function _fromJsonObject(object: any): EventTypeImportOpenApiIn { + return { + dryRun: object["dryRun"], + replaceAll: object["replaceAll"], + spec: object["spec"], + specRaw: object["specRaw"], + }; + } + + export function _toJsonObject(self: EventTypeImportOpenApiIn): any { + return { + dryRun: self.dryRun, + replaceAll: self.replaceAll, + spec: self.spec, + specRaw: self.specRaw, + }; + } +} diff --git a/javascript/src/models/event_type_import_open_api_out.ts b/javascript/src/models/event_type_import_open_api_out.ts new file mode 100644 index 0000000000..8d50779b80 --- /dev/null +++ b/javascript/src/models/event_type_import_open_api_out.ts @@ -0,0 +1,23 @@ +// this file is @generated +import { + EventTypeImportOpenApiOutData, + EventTypeImportOpenApiOutDataUtil, +} from "../models/event_type_import_open_api_out_data"; + +export interface EventTypeImportOpenApiOut { + data: EventTypeImportOpenApiOutData; +} + +export namespace EventTypeImportOpenApiOutUtil { + export function _fromJsonObject(object: any): EventTypeImportOpenApiOut { + return { + data: EventTypeImportOpenApiOutDataUtil._fromJsonObject(object["data"]), + }; + } + + export function _toJsonObject(self: EventTypeImportOpenApiOut): any { + return { + data: EventTypeImportOpenApiOutDataUtil._toJsonObject(self.data), + }; + } +} diff --git a/javascript/src/models/event_type_import_open_api_out_data.ts b/javascript/src/models/event_type_import_open_api_out_data.ts new file mode 100644 index 0000000000..96f48a4db1 --- /dev/null +++ b/javascript/src/models/event_type_import_open_api_out_data.ts @@ -0,0 +1,30 @@ +// this file is @generated +import { + EventTypeFromOpenApi, + EventTypeFromOpenApiUtil, +} from "../models/event_type_from_open_api"; + +export interface EventTypeImportOpenApiOutData { + modified: string[]; + toModify?: EventTypeFromOpenApi[] | null; +} + +export namespace EventTypeImportOpenApiOutDataUtil { + export function _fromJsonObject(object: any): EventTypeImportOpenApiOutData { + return { + modified: object["modified"], + toModify: object["to_modify"].map((item) => + EventTypeFromOpenApiUtil._fromJsonObject(item) + ), + }; + } + + export function _toJsonObject(self: EventTypeImportOpenApiOutData): any { + return { + modified: self.modified, + to_modify: self.toModify.map((item) => + EventTypeFromOpenApiUtil._toJsonObject(item) + ), + }; + } +} diff --git a/javascript/src/models/event_type_in.ts b/javascript/src/models/event_type_in.ts new file mode 100644 index 0000000000..efb1122ee2 --- /dev/null +++ b/javascript/src/models/event_type_in.ts @@ -0,0 +1,40 @@ +// this file is @generated + +export interface EventTypeIn { + archived?: boolean; + deprecated?: boolean; + description: string; + featureFlag?: string | null; + /** The event type group's name */ + groupName?: string | null; + /** The event type's name */ + name: string; + /** The schema for the event type for a specific version as a JSON schema. */ + schemas?: any | null; +} + +export namespace EventTypeInUtil { + export function _fromJsonObject(object: any): EventTypeIn { + return { + archived: object["archived"], + deprecated: object["deprecated"], + description: object["description"], + featureFlag: object["featureFlag"], + groupName: object["groupName"], + name: object["name"], + schemas: object["schemas"], + }; + } + + export function _toJsonObject(self: EventTypeIn): any { + return { + archived: self.archived, + deprecated: self.deprecated, + description: self.description, + featureFlag: self.featureFlag, + groupName: self.groupName, + name: self.name, + schemas: self.schemas, + }; + } +} diff --git a/javascript/src/models/event_type_out.ts b/javascript/src/models/event_type_out.ts new file mode 100644 index 0000000000..825e70f4d5 --- /dev/null +++ b/javascript/src/models/event_type_out.ts @@ -0,0 +1,46 @@ +// this file is @generated + +export interface EventTypeOut { + archived?: boolean; + createdAt: Date | null; + deprecated: boolean; + description: string; + featureFlag?: string | null; + /** The event type group's name */ + groupName?: string | null; + /** The event type's name */ + name: string; + /** The schema for the event type for a specific version as a JSON schema. */ + schemas?: any | null; + updatedAt: Date | null; +} + +export namespace EventTypeOutUtil { + export function _fromJsonObject(object: any): EventTypeOut { + return { + archived: object["archived"], + createdAt: new Date(object["createdAt"]), + deprecated: object["deprecated"], + description: object["description"], + featureFlag: object["featureFlag"], + groupName: object["groupName"], + name: object["name"], + schemas: object["schemas"], + updatedAt: new Date(object["updatedAt"]), + }; + } + + export function _toJsonObject(self: EventTypeOut): any { + return { + archived: self.archived, + createdAt: self.createdAt, + deprecated: self.deprecated, + description: self.description, + featureFlag: self.featureFlag, + groupName: self.groupName, + name: self.name, + schemas: self.schemas, + updatedAt: self.updatedAt, + }; + } +} diff --git a/javascript/src/models/event_type_patch.ts b/javascript/src/models/event_type_patch.ts new file mode 100644 index 0000000000..df3d09f601 --- /dev/null +++ b/javascript/src/models/event_type_patch.ts @@ -0,0 +1,35 @@ +// this file is @generated + +export interface EventTypePatch { + archived?: boolean; + deprecated?: boolean; + description?: string; + featureFlag?: string | null; + /** The event type group's name */ + groupName?: string | null; + schemas?: any | null; +} + +export namespace EventTypePatchUtil { + export function _fromJsonObject(object: any): EventTypePatch { + return { + archived: object["archived"], + deprecated: object["deprecated"], + description: object["description"], + featureFlag: object["featureFlag"], + groupName: object["groupName"], + schemas: object["schemas"], + }; + } + + export function _toJsonObject(self: EventTypePatch): any { + return { + archived: self.archived, + deprecated: self.deprecated, + description: self.description, + featureFlag: self.featureFlag, + groupName: self.groupName, + schemas: self.schemas, + }; + } +} diff --git a/javascript/src/models/event_type_update.ts b/javascript/src/models/event_type_update.ts new file mode 100644 index 0000000000..a213073734 --- /dev/null +++ b/javascript/src/models/event_type_update.ts @@ -0,0 +1,36 @@ +// this file is @generated + +export interface EventTypeUpdate { + archived?: boolean; + deprecated?: boolean; + description: string; + featureFlag?: string | null; + /** The event type group's name */ + groupName?: string | null; + /** The schema for the event type for a specific version as a JSON schema. */ + schemas?: any | null; +} + +export namespace EventTypeUpdateUtil { + export function _fromJsonObject(object: any): EventTypeUpdate { + return { + archived: object["archived"], + deprecated: object["deprecated"], + description: object["description"], + featureFlag: object["featureFlag"], + groupName: object["groupName"], + schemas: object["schemas"], + }; + } + + export function _toJsonObject(self: EventTypeUpdate): any { + return { + archived: self.archived, + deprecated: self.deprecated, + description: self.description, + featureFlag: self.featureFlag, + groupName: self.groupName, + schemas: self.schemas, + }; + } +} diff --git a/javascript/src/models/integration_in.ts b/javascript/src/models/integration_in.ts new file mode 100644 index 0000000000..95516e3d1c --- /dev/null +++ b/javascript/src/models/integration_in.ts @@ -0,0 +1,23 @@ +// this file is @generated + +export interface IntegrationIn { + /** The set of feature flags the integration will have access to. */ + featureFlags?: string[]; + name: string; +} + +export namespace IntegrationInUtil { + export function _fromJsonObject(object: any): IntegrationIn { + return { + featureFlags: object["featureFlags"], + name: object["name"], + }; + } + + export function _toJsonObject(self: IntegrationIn): any { + return { + featureFlags: self.featureFlags, + name: self.name, + }; + } +} diff --git a/javascript/src/models/integration_key_out.ts b/javascript/src/models/integration_key_out.ts new file mode 100644 index 0000000000..13f611812c --- /dev/null +++ b/javascript/src/models/integration_key_out.ts @@ -0,0 +1,19 @@ +// this file is @generated + +export interface IntegrationKeyOut { + key: string; +} + +export namespace IntegrationKeyOutUtil { + export function _fromJsonObject(object: any): IntegrationKeyOut { + return { + key: object["key"], + }; + } + + export function _toJsonObject(self: IntegrationKeyOut): any { + return { + key: self.key, + }; + } +} diff --git a/javascript/src/models/integration_out.ts b/javascript/src/models/integration_out.ts new file mode 100644 index 0000000000..bef5694a15 --- /dev/null +++ b/javascript/src/models/integration_out.ts @@ -0,0 +1,33 @@ +// this file is @generated + +export interface IntegrationOut { + createdAt: Date | null; + /** The set of feature flags the integration has access to. */ + featureFlags?: string[]; + /** The integ's ID */ + id: string; + name: string; + updatedAt: Date | null; +} + +export namespace IntegrationOutUtil { + export function _fromJsonObject(object: any): IntegrationOut { + return { + createdAt: new Date(object["createdAt"]), + featureFlags: object["featureFlags"], + id: object["id"], + name: object["name"], + updatedAt: new Date(object["updatedAt"]), + }; + } + + export function _toJsonObject(self: IntegrationOut): any { + return { + createdAt: self.createdAt, + featureFlags: self.featureFlags, + id: self.id, + name: self.name, + updatedAt: self.updatedAt, + }; + } +} diff --git a/javascript/src/models/integration_update.ts b/javascript/src/models/integration_update.ts new file mode 100644 index 0000000000..31affa2d6b --- /dev/null +++ b/javascript/src/models/integration_update.ts @@ -0,0 +1,23 @@ +// this file is @generated + +export interface IntegrationUpdate { + /** The set of feature flags the integration will have access to. */ + featureFlags?: string[]; + name: string; +} + +export namespace IntegrationUpdateUtil { + export function _fromJsonObject(object: any): IntegrationUpdate { + return { + featureFlags: object["featureFlags"], + name: object["name"], + }; + } + + export function _toJsonObject(self: IntegrationUpdate): any { + return { + featureFlags: self.featureFlags, + name: self.name, + }; + } +} diff --git a/javascript/src/models/list_response_application_out.ts b/javascript/src/models/list_response_application_out.ts new file mode 100644 index 0000000000..74699faf47 --- /dev/null +++ b/javascript/src/models/list_response_application_out.ts @@ -0,0 +1,29 @@ +// this file is @generated +import { ApplicationOut, ApplicationOutUtil } from "../models/application_out"; + +export interface ListResponseApplicationOut { + data: ApplicationOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export namespace ListResponseApplicationOutUtil { + export function _fromJsonObject(object: any): ListResponseApplicationOut { + return { + data: object["data"].map((item) => ApplicationOutUtil._fromJsonObject(item)), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + } + + export function _toJsonObject(self: ListResponseApplicationOut): any { + return { + data: self.data.map((item) => ApplicationOutUtil._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + } +} diff --git a/javascript/src/models/list_response_background_task_out.ts b/javascript/src/models/list_response_background_task_out.ts new file mode 100644 index 0000000000..7974557570 --- /dev/null +++ b/javascript/src/models/list_response_background_task_out.ts @@ -0,0 +1,29 @@ +// this file is @generated +import { BackgroundTaskOut, BackgroundTaskOutUtil } from "../models/background_task_out"; + +export interface ListResponseBackgroundTaskOut { + data: BackgroundTaskOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export namespace ListResponseBackgroundTaskOutUtil { + export function _fromJsonObject(object: any): ListResponseBackgroundTaskOut { + return { + data: object["data"].map((item) => BackgroundTaskOutUtil._fromJsonObject(item)), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + } + + export function _toJsonObject(self: ListResponseBackgroundTaskOut): any { + return { + data: self.data.map((item) => BackgroundTaskOutUtil._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + } +} diff --git a/javascript/src/models/list_response_endpoint_message_out.ts b/javascript/src/models/list_response_endpoint_message_out.ts new file mode 100644 index 0000000000..3d5d618aa1 --- /dev/null +++ b/javascript/src/models/list_response_endpoint_message_out.ts @@ -0,0 +1,32 @@ +// this file is @generated +import { + EndpointMessageOut, + EndpointMessageOutUtil, +} from "../models/endpoint_message_out"; + +export interface ListResponseEndpointMessageOut { + data: EndpointMessageOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export namespace ListResponseEndpointMessageOutUtil { + export function _fromJsonObject(object: any): ListResponseEndpointMessageOut { + return { + data: object["data"].map((item) => EndpointMessageOutUtil._fromJsonObject(item)), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + } + + export function _toJsonObject(self: ListResponseEndpointMessageOut): any { + return { + data: self.data.map((item) => EndpointMessageOutUtil._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + } +} diff --git a/javascript/src/models/list_response_endpoint_out.ts b/javascript/src/models/list_response_endpoint_out.ts new file mode 100644 index 0000000000..ac805a91f4 --- /dev/null +++ b/javascript/src/models/list_response_endpoint_out.ts @@ -0,0 +1,29 @@ +// this file is @generated +import { EndpointOut, EndpointOutUtil } from "../models/endpoint_out"; + +export interface ListResponseEndpointOut { + data: EndpointOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export namespace ListResponseEndpointOutUtil { + export function _fromJsonObject(object: any): ListResponseEndpointOut { + return { + data: object["data"].map((item) => EndpointOutUtil._fromJsonObject(item)), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + } + + export function _toJsonObject(self: ListResponseEndpointOut): any { + return { + data: self.data.map((item) => EndpointOutUtil._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + } +} diff --git a/javascript/src/models/list_response_event_type_out.ts b/javascript/src/models/list_response_event_type_out.ts new file mode 100644 index 0000000000..778ad2b439 --- /dev/null +++ b/javascript/src/models/list_response_event_type_out.ts @@ -0,0 +1,29 @@ +// this file is @generated +import { EventTypeOut, EventTypeOutUtil } from "../models/event_type_out"; + +export interface ListResponseEventTypeOut { + data: EventTypeOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export namespace ListResponseEventTypeOutUtil { + export function _fromJsonObject(object: any): ListResponseEventTypeOut { + return { + data: object["data"].map((item) => EventTypeOutUtil._fromJsonObject(item)), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + } + + export function _toJsonObject(self: ListResponseEventTypeOut): any { + return { + data: self.data.map((item) => EventTypeOutUtil._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + } +} diff --git a/javascript/src/models/list_response_integration_out.ts b/javascript/src/models/list_response_integration_out.ts new file mode 100644 index 0000000000..50a0a8b4cb --- /dev/null +++ b/javascript/src/models/list_response_integration_out.ts @@ -0,0 +1,29 @@ +// this file is @generated +import { IntegrationOut, IntegrationOutUtil } from "../models/integration_out"; + +export interface ListResponseIntegrationOut { + data: IntegrationOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export namespace ListResponseIntegrationOutUtil { + export function _fromJsonObject(object: any): ListResponseIntegrationOut { + return { + data: object["data"].map((item) => IntegrationOutUtil._fromJsonObject(item)), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + } + + export function _toJsonObject(self: ListResponseIntegrationOut): any { + return { + data: self.data.map((item) => IntegrationOutUtil._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + } +} diff --git a/javascript/src/models/list_response_message_attempt_out.ts b/javascript/src/models/list_response_message_attempt_out.ts new file mode 100644 index 0000000000..e59c9a1e04 --- /dev/null +++ b/javascript/src/models/list_response_message_attempt_out.ts @@ -0,0 +1,29 @@ +// this file is @generated +import { MessageAttemptOut, MessageAttemptOutUtil } from "../models/message_attempt_out"; + +export interface ListResponseMessageAttemptOut { + data: MessageAttemptOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export namespace ListResponseMessageAttemptOutUtil { + export function _fromJsonObject(object: any): ListResponseMessageAttemptOut { + return { + data: object["data"].map((item) => MessageAttemptOutUtil._fromJsonObject(item)), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + } + + export function _toJsonObject(self: ListResponseMessageAttemptOut): any { + return { + data: self.data.map((item) => MessageAttemptOutUtil._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + } +} diff --git a/javascript/src/models/list_response_message_endpoint_out.ts b/javascript/src/models/list_response_message_endpoint_out.ts new file mode 100644 index 0000000000..1588a8ee9a --- /dev/null +++ b/javascript/src/models/list_response_message_endpoint_out.ts @@ -0,0 +1,32 @@ +// this file is @generated +import { + MessageEndpointOut, + MessageEndpointOutUtil, +} from "../models/message_endpoint_out"; + +export interface ListResponseMessageEndpointOut { + data: MessageEndpointOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export namespace ListResponseMessageEndpointOutUtil { + export function _fromJsonObject(object: any): ListResponseMessageEndpointOut { + return { + data: object["data"].map((item) => MessageEndpointOutUtil._fromJsonObject(item)), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + } + + export function _toJsonObject(self: ListResponseMessageEndpointOut): any { + return { + data: self.data.map((item) => MessageEndpointOutUtil._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + } +} diff --git a/javascript/src/models/list_response_message_out.ts b/javascript/src/models/list_response_message_out.ts new file mode 100644 index 0000000000..d92551b646 --- /dev/null +++ b/javascript/src/models/list_response_message_out.ts @@ -0,0 +1,29 @@ +// this file is @generated +import { MessageOut, MessageOutUtil } from "../models/message_out"; + +export interface ListResponseMessageOut { + data: MessageOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export namespace ListResponseMessageOutUtil { + export function _fromJsonObject(object: any): ListResponseMessageOut { + return { + data: object["data"].map((item) => MessageOutUtil._fromJsonObject(item)), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + } + + export function _toJsonObject(self: ListResponseMessageOut): any { + return { + data: self.data.map((item) => MessageOutUtil._toJsonObject(item)), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + } +} diff --git a/javascript/src/models/list_response_operational_webhook_endpoint_out.ts b/javascript/src/models/list_response_operational_webhook_endpoint_out.ts new file mode 100644 index 0000000000..dc43d46f98 --- /dev/null +++ b/javascript/src/models/list_response_operational_webhook_endpoint_out.ts @@ -0,0 +1,38 @@ +// this file is @generated +import { + OperationalWebhookEndpointOut, + OperationalWebhookEndpointOutUtil, +} from "../models/operational_webhook_endpoint_out"; + +export interface ListResponseOperationalWebhookEndpointOut { + data: OperationalWebhookEndpointOut[]; + done: boolean; + iterator: string | null; + prevIterator?: string | null; +} + +export namespace ListResponseOperationalWebhookEndpointOutUtil { + export function _fromJsonObject( + object: any + ): ListResponseOperationalWebhookEndpointOut { + return { + data: object["data"].map((item) => + OperationalWebhookEndpointOutUtil._fromJsonObject(item) + ), + done: object["done"], + iterator: object["iterator"], + prevIterator: object["prevIterator"], + }; + } + + export function _toJsonObject(self: ListResponseOperationalWebhookEndpointOut): any { + return { + data: self.data.map((item) => + OperationalWebhookEndpointOutUtil._toJsonObject(item) + ), + done: self.done, + iterator: self.iterator, + prevIterator: self.prevIterator, + }; + } +} diff --git a/javascript/src/models/message_attempt_out.ts b/javascript/src/models/message_attempt_out.ts new file mode 100644 index 0000000000..52e74c7b27 --- /dev/null +++ b/javascript/src/models/message_attempt_out.ts @@ -0,0 +1,59 @@ +// this file is @generated +import { + MessageAttemptTriggerType, + MessageAttemptTriggerTypeUtil, +} from "../models/message_attempt_trigger_type"; +import { MessageOut, MessageOutUtil } from "../models/message_out"; +import { MessageStatus, MessageStatusUtil } from "../models/message_status"; + +export interface MessageAttemptOut { + /** The ep's ID */ + endpointId: string; + /** The attempt's ID */ + id: string; + msg?: MessageOut | null; + /** The msg's ID */ + msgId: string; + response: string; + /** Response duration in milliseconds. */ + responseDurationMs: number; + responseStatusCode: number; + status: MessageStatus; + timestamp: Date | null; + triggerType: MessageAttemptTriggerType; + url: string; +} + +export namespace MessageAttemptOutUtil { + export function _fromJsonObject(object: any): MessageAttemptOut { + return { + endpointId: object["endpointId"], + id: object["id"], + msg: MessageOutUtil._fromJsonObject(object["msg"]), + msgId: object["msgId"], + response: object["response"], + responseDurationMs: object["responseDurationMs"], + responseStatusCode: object["responseStatusCode"], + status: MessageStatusUtil._fromJsonObject(object["status"]), + timestamp: new Date(object["timestamp"]), + triggerType: MessageAttemptTriggerTypeUtil._fromJsonObject(object["triggerType"]), + url: object["url"], + }; + } + + export function _toJsonObject(self: MessageAttemptOut): any { + return { + endpointId: self.endpointId, + id: self.id, + msg: MessageOutUtil._toJsonObject(self.msg), + msgId: self.msgId, + response: self.response, + responseDurationMs: self.responseDurationMs, + responseStatusCode: self.responseStatusCode, + status: MessageStatusUtil._toJsonObject(self.status), + timestamp: self.timestamp, + triggerType: MessageAttemptTriggerTypeUtil._toJsonObject(self.triggerType), + url: self.url, + }; + } +} diff --git a/javascript/src/models/message_attempt_trigger_type.ts b/javascript/src/models/message_attempt_trigger_type.ts new file mode 100644 index 0000000000..9bfb739def --- /dev/null +++ b/javascript/src/models/message_attempt_trigger_type.ts @@ -0,0 +1,20 @@ +// this file is @generated +/** + * The reason an attempt was made: + * - Scheduled = 0 + * - Manual = 1 + */ +export enum MessageAttemptTriggerType { + Scheduled = 0, + Manual = 1, +} + +export namespace MessageAttemptTriggerTypeUtil { + export function _fromJsonObject(object: any): MessageAttemptTriggerType { + return object; + } + + export function _toJsonObject(self: MessageAttemptTriggerType): any { + return self; + } +} diff --git a/javascript/src/models/message_endpoint_out.ts b/javascript/src/models/message_endpoint_out.ts new file mode 100644 index 0000000000..55218d4348 --- /dev/null +++ b/javascript/src/models/message_endpoint_out.ts @@ -0,0 +1,60 @@ +// this file is @generated +import { MessageStatus, MessageStatusUtil } from "../models/message_status"; + +export interface MessageEndpointOut { + /** 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 ep's ID */ + id: string; + nextAttempt?: Date | null | null; + rateLimit?: number | null; + status: MessageStatus; + /** Optional unique identifier for the endpoint. */ + uid?: string | null; + updatedAt: Date | null; + url: string; + version: number; +} + +export namespace MessageEndpointOutUtil { + export function _fromJsonObject(object: any): MessageEndpointOut { + return { + channels: object["channels"], + createdAt: new Date(object["createdAt"]), + description: object["description"], + disabled: object["disabled"], + filterTypes: object["filterTypes"], + id: object["id"], + nextAttempt: new Date(object["nextAttempt"]), + rateLimit: object["rateLimit"], + status: MessageStatusUtil._fromJsonObject(object["status"]), + uid: object["uid"], + updatedAt: new Date(object["updatedAt"]), + url: object["url"], + version: object["version"], + }; + } + + export function _toJsonObject(self: MessageEndpointOut): any { + return { + channels: self.channels, + createdAt: self.createdAt, + description: self.description, + disabled: self.disabled, + filterTypes: self.filterTypes, + id: self.id, + nextAttempt: self.nextAttempt, + rateLimit: self.rateLimit, + status: MessageStatusUtil._toJsonObject(self.status), + uid: self.uid, + updatedAt: self.updatedAt, + url: self.url, + version: self.version, + }; + } +} diff --git a/javascript/src/models/message_in.ts b/javascript/src/models/message_in.ts new file mode 100644 index 0000000000..52f477dbb0 --- /dev/null +++ b/javascript/src/models/message_in.ts @@ -0,0 +1,61 @@ +// this file is @generated +import { ApplicationIn, ApplicationInUtil } from "../models/application_in"; + +export interface MessageIn { + /** + * Optionally creates a new application alongside the message. + * + * If the application id or uid that is used in the path already exists, this argument is ignored. + */ + application?: ApplicationIn | null; + /** List of free-form identifiers that endpoints can filter by */ + channels?: string[] | null; + /** Optional unique identifier for the message */ + eventId?: string | null; + /** The event type's name */ + eventType: string; + /** + * JSON payload to send as the request body of the webhook. + * + * We also support sending non-JSON payloads. Please contact us for more information. + */ + payload: any; + /** Optional number of hours to retain the message payload. Note that this is mutually exclusive with `payloadRetentionPeriod`. */ + payloadRetentionHours?: number | null; + /** Optional number of days to retain the message payload. Defaults to 90. Note that this is mutually exclusive with `payloadRetentionHours`. */ + payloadRetentionPeriod?: number | null; + /** List of free-form tags that can be filtered by when listing messages */ + tags?: string[] | null; + /** Extra parameters to pass to Transformations (for future use) */ + transformationsParams?: any | null; +} + +export namespace MessageInUtil { + export function _fromJsonObject(object: any): MessageIn { + return { + application: ApplicationInUtil._fromJsonObject(object["application"]), + channels: object["channels"], + eventId: object["eventId"], + eventType: object["eventType"], + payload: object["payload"], + payloadRetentionHours: object["payloadRetentionHours"], + payloadRetentionPeriod: object["payloadRetentionPeriod"], + tags: object["tags"], + transformationsParams: object["transformationsParams"], + }; + } + + export function _toJsonObject(self: MessageIn): any { + return { + application: ApplicationInUtil._toJsonObject(self.application), + channels: self.channels, + eventId: self.eventId, + eventType: self.eventType, + payload: self.payload, + payloadRetentionHours: self.payloadRetentionHours, + payloadRetentionPeriod: self.payloadRetentionPeriod, + tags: self.tags, + transformationsParams: self.transformationsParams, + }; + } +} diff --git a/javascript/src/models/message_out.ts b/javascript/src/models/message_out.ts new file mode 100644 index 0000000000..2b7fe58421 --- /dev/null +++ b/javascript/src/models/message_out.ts @@ -0,0 +1,41 @@ +// this file is @generated + +export interface MessageOut { + /** List of free-form identifiers that endpoints can filter by */ + channels?: string[] | null; + /** Optional unique identifier for the message */ + eventId?: string | null; + /** The event type's name */ + eventType: string; + /** The msg's ID */ + id: string; + payload: any; + tags?: string[] | null; + timestamp: Date | null; +} + +export namespace MessageOutUtil { + export function _fromJsonObject(object: any): MessageOut { + return { + channels: object["channels"], + eventId: object["eventId"], + eventType: object["eventType"], + id: object["id"], + payload: object["payload"], + tags: object["tags"], + timestamp: new Date(object["timestamp"]), + }; + } + + export function _toJsonObject(self: MessageOut): any { + return { + channels: self.channels, + eventId: self.eventId, + eventType: self.eventType, + id: self.id, + payload: self.payload, + tags: self.tags, + timestamp: self.timestamp, + }; + } +} diff --git a/javascript/src/models/message_status.ts b/javascript/src/models/message_status.ts new file mode 100644 index 0000000000..dc0d48f557 --- /dev/null +++ b/javascript/src/models/message_status.ts @@ -0,0 +1,24 @@ +// this file is @generated +/** + * The sending status of the message: + * - Success = 0 + * - Pending = 1 + * - Fail = 2 + * - Sending = 3 + */ +export enum MessageStatus { + Success = 0, + Pending = 1, + Fail = 2, + Sending = 3, +} + +export namespace MessageStatusUtil { + export function _fromJsonObject(object: any): MessageStatus { + return object; + } + + export function _toJsonObject(self: MessageStatus): any { + return self; + } +} diff --git a/javascript/src/models/operational_webhook_endpoint_headers_in.ts b/javascript/src/models/operational_webhook_endpoint_headers_in.ts new file mode 100644 index 0000000000..e55bdcc402 --- /dev/null +++ b/javascript/src/models/operational_webhook_endpoint_headers_in.ts @@ -0,0 +1,19 @@ +// this file is @generated + +export interface OperationalWebhookEndpointHeadersIn { + headers: { [key: string]: string }; +} + +export namespace OperationalWebhookEndpointHeadersInUtil { + export function _fromJsonObject(object: any): OperationalWebhookEndpointHeadersIn { + return { + headers: object["headers"], + }; + } + + export function _toJsonObject(self: OperationalWebhookEndpointHeadersIn): any { + return { + headers: self.headers, + }; + } +} diff --git a/javascript/src/models/operational_webhook_endpoint_headers_out.ts b/javascript/src/models/operational_webhook_endpoint_headers_out.ts new file mode 100644 index 0000000000..0702ba4631 --- /dev/null +++ b/javascript/src/models/operational_webhook_endpoint_headers_out.ts @@ -0,0 +1,22 @@ +// this file is @generated + +export interface OperationalWebhookEndpointHeadersOut { + headers: { [key: string]: string }; + sensitive: string[]; +} + +export namespace OperationalWebhookEndpointHeadersOutUtil { + export function _fromJsonObject(object: any): OperationalWebhookEndpointHeadersOut { + return { + headers: object["headers"], + sensitive: object["sensitive"], + }; + } + + export function _toJsonObject(self: OperationalWebhookEndpointHeadersOut): any { + return { + headers: self.headers, + sensitive: self.sensitive, + }; + } +} diff --git a/javascript/src/models/operational_webhook_endpoint_in.ts b/javascript/src/models/operational_webhook_endpoint_in.ts new file mode 100644 index 0000000000..9219cfde73 --- /dev/null +++ b/javascript/src/models/operational_webhook_endpoint_in.ts @@ -0,0 +1,47 @@ +// this file is @generated + +export interface OperationalWebhookEndpointIn { + 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 endpoint. */ + uid?: string | null; + url: string; +} + +export namespace OperationalWebhookEndpointInUtil { + export function _fromJsonObject(object: any): OperationalWebhookEndpointIn { + return { + description: object["description"], + disabled: object["disabled"], + filterTypes: object["filterTypes"], + metadata: object["metadata"], + rateLimit: object["rateLimit"], + secret: object["secret"], + uid: object["uid"], + url: object["url"], + }; + } + + export function _toJsonObject(self: OperationalWebhookEndpointIn): any { + return { + description: self.description, + disabled: self.disabled, + filterTypes: self.filterTypes, + metadata: self.metadata, + rateLimit: self.rateLimit, + secret: self.secret, + uid: self.uid, + url: self.url, + }; + } +} diff --git a/javascript/src/models/operational_webhook_endpoint_out.ts b/javascript/src/models/operational_webhook_endpoint_out.ts new file mode 100644 index 0000000000..44ed77bff9 --- /dev/null +++ b/javascript/src/models/operational_webhook_endpoint_out.ts @@ -0,0 +1,49 @@ +// this file is @generated + +export interface OperationalWebhookEndpointOut { + createdAt: Date | null; + /** An example endpoint name. */ + description: string; + disabled?: boolean; + filterTypes?: string[] | null; + /** The ep's ID */ + id: string; + metadata: { [key: string]: string }; + rateLimit?: number | null; + /** Optional unique identifier for the endpoint. */ + uid?: string | null; + updatedAt: Date | null; + url: string; +} + +export namespace OperationalWebhookEndpointOutUtil { + export function _fromJsonObject(object: any): OperationalWebhookEndpointOut { + return { + 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"]), + url: object["url"], + }; + } + + export function _toJsonObject(self: OperationalWebhookEndpointOut): any { + return { + 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, + url: self.url, + }; + } +} diff --git a/javascript/src/models/operational_webhook_endpoint_secret_in.ts b/javascript/src/models/operational_webhook_endpoint_secret_in.ts new file mode 100644 index 0000000000..fe512deea5 --- /dev/null +++ b/javascript/src/models/operational_webhook_endpoint_secret_in.ts @@ -0,0 +1,25 @@ +// this file is @generated + +export interface OperationalWebhookEndpointSecretIn { + /** + * 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. + */ + key?: string | null; +} + +export namespace OperationalWebhookEndpointSecretInUtil { + export function _fromJsonObject(object: any): OperationalWebhookEndpointSecretIn { + return { + key: object["key"], + }; + } + + export function _toJsonObject(self: OperationalWebhookEndpointSecretIn): any { + return { + key: self.key, + }; + } +} diff --git a/javascript/src/models/operational_webhook_endpoint_secret_out.ts b/javascript/src/models/operational_webhook_endpoint_secret_out.ts new file mode 100644 index 0000000000..4e05bb1163 --- /dev/null +++ b/javascript/src/models/operational_webhook_endpoint_secret_out.ts @@ -0,0 +1,25 @@ +// this file is @generated + +export interface OperationalWebhookEndpointSecretOut { + /** + * 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. + */ + key: string; +} + +export namespace OperationalWebhookEndpointSecretOutUtil { + export function _fromJsonObject(object: any): OperationalWebhookEndpointSecretOut { + return { + key: object["key"], + }; + } + + export function _toJsonObject(self: OperationalWebhookEndpointSecretOut): any { + return { + key: self.key, + }; + } +} diff --git a/javascript/src/models/operational_webhook_endpoint_update.ts b/javascript/src/models/operational_webhook_endpoint_update.ts new file mode 100644 index 0000000000..e255d6a23e --- /dev/null +++ b/javascript/src/models/operational_webhook_endpoint_update.ts @@ -0,0 +1,38 @@ +// this file is @generated + +export interface OperationalWebhookEndpointUpdate { + description?: string; + disabled?: boolean; + filterTypes?: string[] | null; + metadata?: { [key: string]: string }; + rateLimit?: number | null; + /** Optional unique identifier for the endpoint. */ + uid?: string | null; + url: string; +} + +export namespace OperationalWebhookEndpointUpdateUtil { + export function _fromJsonObject(object: any): OperationalWebhookEndpointUpdate { + return { + description: object["description"], + disabled: object["disabled"], + filterTypes: object["filterTypes"], + metadata: object["metadata"], + rateLimit: object["rateLimit"], + uid: object["uid"], + url: object["url"], + }; + } + + export function _toJsonObject(self: OperationalWebhookEndpointUpdate): any { + return { + description: self.description, + disabled: self.disabled, + filterTypes: self.filterTypes, + metadata: self.metadata, + rateLimit: self.rateLimit, + uid: self.uid, + url: self.url, + }; + } +} diff --git a/javascript/src/models/ordering.ts b/javascript/src/models/ordering.ts new file mode 100644 index 0000000000..e579da6c2d --- /dev/null +++ b/javascript/src/models/ordering.ts @@ -0,0 +1,16 @@ +// this file is @generated +/** Defines the ordering in a listing of results. */ +export enum Ordering { + Ascending = "ascending", + Descending = "descending", +} + +export namespace OrderingUtil { + export function _fromJsonObject(object: any): Ordering { + return object; + } + + export function _toJsonObject(self: Ordering): any { + return self; + } +} diff --git a/javascript/src/models/recover_in.ts b/javascript/src/models/recover_in.ts new file mode 100644 index 0000000000..ff2a2a6757 --- /dev/null +++ b/javascript/src/models/recover_in.ts @@ -0,0 +1,22 @@ +// this file is @generated + +export interface RecoverIn { + since: Date | null; + until?: Date | null | null; +} + +export namespace RecoverInUtil { + export function _fromJsonObject(object: any): RecoverIn { + return { + since: new Date(object["since"]), + until: new Date(object["until"]), + }; + } + + export function _toJsonObject(self: RecoverIn): any { + return { + since: self.since, + until: self.until, + }; + } +} diff --git a/javascript/src/models/recover_out.ts b/javascript/src/models/recover_out.ts new file mode 100644 index 0000000000..0d52f6ce6c --- /dev/null +++ b/javascript/src/models/recover_out.ts @@ -0,0 +1,33 @@ +// this file is @generated +import { + BackgroundTaskStatus, + BackgroundTaskStatusUtil, +} from "../models/background_task_status"; +import { + BackgroundTaskType, + BackgroundTaskTypeUtil, +} from "../models/background_task_type"; + +export interface RecoverOut { + id: string; + status: BackgroundTaskStatus; + task: BackgroundTaskType; +} + +export namespace RecoverOutUtil { + export function _fromJsonObject(object: any): RecoverOut { + return { + id: object["id"], + status: BackgroundTaskStatusUtil._fromJsonObject(object["status"]), + task: BackgroundTaskTypeUtil._fromJsonObject(object["task"]), + }; + } + + export function _toJsonObject(self: RecoverOut): any { + return { + id: self.id, + status: BackgroundTaskStatusUtil._toJsonObject(self.status), + task: BackgroundTaskTypeUtil._toJsonObject(self.task), + }; + } +} diff --git a/javascript/src/models/replay_in.ts b/javascript/src/models/replay_in.ts new file mode 100644 index 0000000000..2140a0a295 --- /dev/null +++ b/javascript/src/models/replay_in.ts @@ -0,0 +1,22 @@ +// this file is @generated + +export interface ReplayIn { + since: Date | null; + until?: Date | null | null; +} + +export namespace ReplayInUtil { + export function _fromJsonObject(object: any): ReplayIn { + return { + since: new Date(object["since"]), + until: new Date(object["until"]), + }; + } + + export function _toJsonObject(self: ReplayIn): any { + return { + since: self.since, + until: self.until, + }; + } +} diff --git a/javascript/src/models/replay_out.ts b/javascript/src/models/replay_out.ts new file mode 100644 index 0000000000..c3c318c250 --- /dev/null +++ b/javascript/src/models/replay_out.ts @@ -0,0 +1,33 @@ +// this file is @generated +import { + BackgroundTaskStatus, + BackgroundTaskStatusUtil, +} from "../models/background_task_status"; +import { + BackgroundTaskType, + BackgroundTaskTypeUtil, +} from "../models/background_task_type"; + +export interface ReplayOut { + id: string; + status: BackgroundTaskStatus; + task: BackgroundTaskType; +} + +export namespace ReplayOutUtil { + export function _fromJsonObject(object: any): ReplayOut { + return { + id: object["id"], + status: BackgroundTaskStatusUtil._fromJsonObject(object["status"]), + task: BackgroundTaskTypeUtil._fromJsonObject(object["task"]), + }; + } + + export function _toJsonObject(self: ReplayOut): any { + return { + id: self.id, + status: BackgroundTaskStatusUtil._toJsonObject(self.status), + task: BackgroundTaskTypeUtil._toJsonObject(self.task), + }; + } +} diff --git a/javascript/src/models/status_code_class.ts b/javascript/src/models/status_code_class.ts new file mode 100644 index 0000000000..a536de47a4 --- /dev/null +++ b/javascript/src/models/status_code_class.ts @@ -0,0 +1,28 @@ +// this file is @generated +/** + * The different classes of HTTP status codes: + * - CodeNone = 0 + * - Code1xx = 100 + * - Code2xx = 200 + * - Code3xx = 300 + * - Code4xx = 400 + * - Code5xx = 500 + */ +export enum StatusCodeClass { + CodeNone = 0, + Code1xx = 100, + Code2xx = 200, + Code3xx = 300, + Code4xx = 400, + Code5xx = 500, +} + +export namespace StatusCodeClassUtil { + export function _fromJsonObject(object: any): StatusCodeClass { + return object; + } + + export function _toJsonObject(self: StatusCodeClass): any { + return self; + } +} diff --git a/javascript/src/models/template_out.ts b/javascript/src/models/template_out.ts new file mode 100644 index 0000000000..09c2fc11e9 --- /dev/null +++ b/javascript/src/models/template_out.ts @@ -0,0 +1,56 @@ +// this file is @generated +import { ConnectorKind, ConnectorKindUtil } from "../models/connector_kind"; + +export interface TemplateOut { + createdAt: Date | null; + description: string; + featureFlag?: string | null; + filterTypes?: string[] | null; + id: string; + instructions: string; + instructionsLink?: string | null; + kind: ConnectorKind; + logo: string; + name: string; + orgId: string; + transformation: string; + updatedAt: Date | null; +} + +export namespace TemplateOutUtil { + export function _fromJsonObject(object: any): TemplateOut { + return { + createdAt: new Date(object["createdAt"]), + description: object["description"], + featureFlag: object["featureFlag"], + filterTypes: object["filterTypes"], + id: object["id"], + instructions: object["instructions"], + instructionsLink: object["instructionsLink"], + kind: ConnectorKindUtil._fromJsonObject(object["kind"]), + logo: object["logo"], + name: object["name"], + orgId: object["orgId"], + transformation: object["transformation"], + updatedAt: new Date(object["updatedAt"]), + }; + } + + export function _toJsonObject(self: TemplateOut): any { + return { + createdAt: self.createdAt, + description: self.description, + featureFlag: self.featureFlag, + filterTypes: self.filterTypes, + id: self.id, + instructions: self.instructions, + instructionsLink: self.instructionsLink, + kind: ConnectorKindUtil._toJsonObject(self.kind), + logo: self.logo, + name: self.name, + orgId: self.orgId, + transformation: self.transformation, + updatedAt: self.updatedAt, + }; + } +} diff --git a/javascript/src/request.ts b/javascript/src/request.ts index 8fcab139a5..a3628df584 100644 --- a/javascript/src/request.ts +++ b/javascript/src/request.ts @@ -77,8 +77,8 @@ export class SvixRequest { this.headerParams[name] = value; } - public setBody(value: any, type: string) { - this.body = JSON.stringify(ObjectSerializer.serialize(value, type, "")); + public setBody(value: any) { + this.body = JSON.stringify(value); } /** @@ -90,9 +90,12 @@ export class SvixRequest { * If the server returns a 5xx error, the request is retried up to two times with exponential backoff. * If retries are exhausted, an `ApiException` is thrown. */ - public async send(ctx: SvixRequestContext, responseType: string): Promise { + public async send( + ctx: SvixRequestContext, + parseResponseBody: (jsonObject: any) => R + ): Promise { const responseBody = await this.sendInner(ctx); - return ObjectSerializer.deserialize(JSON.parse(responseBody), responseType, ""); + return parseResponseBody(JSON.parse(responseBody)); } /** Same as `send`, but the response body is discarded, not parsed. */