Skip to content

Commit

Permalink
js: Fix Date types.
Browse files Browse the repository at this point in the history
For some reason Date was hard-coded to always be `Date | null`
And since I have tests for Date de/serialization, I am confident I can remove this
  • Loading branch information
svix-mman authored and svix-lucho committed Feb 20, 2025
1 parent b6d5083 commit 7f9f2cb
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions javascript/src/models/appUsageStatsIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export interface AppUsageStatsIn {
* 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;
since: Date;
until: Date;
}

export const AppUsageStatsInSerializer = {
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/models/applicationOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
/* eslint @typescript-eslint/no-explicit-any: 0 */

export interface ApplicationOut {
createdAt: Date | null;
createdAt: Date;
/** The Application's ID. */
id: string;
metadata: { [key: string]: string };
name: string;
rateLimit?: number | null;
/** The Application's UID. */
uid?: string | null;
updatedAt: Date | null;
updatedAt: Date;
}

export const ApplicationOutSerializer = {
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/models/endpointMessageOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export interface EndpointMessageOut {
eventType: string;
/** The Message's ID. */
id: string;
nextAttempt?: Date | null | null;
nextAttempt?: Date | null;
payload: any;
status: MessageStatus;
tags?: string[] | null;
timestamp: Date | null;
timestamp: Date;
}

export const EndpointMessageOutSerializer = {
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/models/endpointOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export interface EndpointOut {
/** List of message channels this endpoint listens to (omit for all). */
channels?: string[] | null;
createdAt: Date | null;
createdAt: Date;
/** An example endpoint name. */
description: string;
disabled?: boolean;
Expand All @@ -15,7 +15,7 @@ export interface EndpointOut {
rateLimit?: number | null;
/** Optional unique identifier for the endpoint. */
uid?: string | null;
updatedAt: Date | null;
updatedAt: Date;
url: string;
version: number;
}
Expand Down
2 changes: 1 addition & 1 deletion javascript/src/models/environmentOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { EventTypeOut, EventTypeOutSerializer } from "./eventTypeOut";
import { TemplateOut, TemplateOutSerializer } from "./templateOut";

export interface EnvironmentOut {
createdAt: Date | null;
createdAt: Date;
eventTypes: EventTypeOut[];
settings: any | null;
transformationTemplates: TemplateOut[];
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/models/eventTypeOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

export interface EventTypeOut {
archived?: boolean;
createdAt: Date | null;
createdAt: Date;
deprecated: boolean;
description: string;
featureFlag?: string | null;
Expand All @@ -13,7 +13,7 @@ export interface EventTypeOut {
name: string;
/** The schema for the event type for a specific version as a JSON schema. */
schemas?: any | null;
updatedAt: Date | null;
updatedAt: Date;
}

export const EventTypeOutSerializer = {
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/models/integrationOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
/* eslint @typescript-eslint/no-explicit-any: 0 */

export interface IntegrationOut {
createdAt: Date | null;
createdAt: Date;
/** The set of feature flags the integration has access to. */
featureFlags?: string[];
/** The Integration's ID. */
id: string;
name: string;
updatedAt: Date | null;
updatedAt: Date;
}

export const IntegrationOutSerializer = {
Expand Down
2 changes: 1 addition & 1 deletion javascript/src/models/messageAttemptOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface MessageAttemptOut {
responseDurationMs: number;
responseStatusCode: number;
status: MessageStatus;
timestamp: Date | null;
timestamp: Date;
triggerType: MessageAttemptTriggerType;
url: string;
}
Expand Down
6 changes: 3 additions & 3 deletions javascript/src/models/messageEndpointOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import { MessageStatus, MessageStatusSerializer } from "./messageStatus";
export interface MessageEndpointOut {
/** List of message channels this endpoint listens to (omit for all). */
channels?: string[] | null;
createdAt: Date | null;
createdAt: Date;
/** An example endpoint name. */
description: string;
disabled?: boolean;
filterTypes?: string[] | null;
/** The Endpoint's ID. */
id: string;
nextAttempt?: Date | null | null;
nextAttempt?: Date | null;
rateLimit?: number | null;
status: MessageStatus;
/** Optional unique identifier for the endpoint. */
uid?: string | null;
updatedAt: Date | null;
updatedAt: Date;
url: string;
version: number;
}
Expand Down
2 changes: 1 addition & 1 deletion javascript/src/models/messageOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface MessageOut {
id: string;
payload: any;
tags?: string[] | null;
timestamp: Date | null;
timestamp: Date;
}

export const MessageOutSerializer = {
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/models/operationalWebhookEndpointOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint @typescript-eslint/no-explicit-any: 0 */

export interface OperationalWebhookEndpointOut {
createdAt: Date | null;
createdAt: Date;
/** An example endpoint name. */
description: string;
disabled?: boolean;
Expand All @@ -13,7 +13,7 @@ export interface OperationalWebhookEndpointOut {
rateLimit?: number | null;
/** Optional unique identifier for the endpoint. */
uid?: string | null;
updatedAt: Date | null;
updatedAt: Date;
url: string;
}

Expand Down
4 changes: 2 additions & 2 deletions javascript/src/models/recoverIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/* eslint @typescript-eslint/no-explicit-any: 0 */

export interface RecoverIn {
since: Date | null;
until?: Date | null | null;
since: Date;
until?: Date | null;
}

export const RecoverInSerializer = {
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/models/replayIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/* eslint @typescript-eslint/no-explicit-any: 0 */

export interface ReplayIn {
since: Date | null;
until?: Date | null | null;
since: Date;
until?: Date | null;
}

export const ReplayInSerializer = {
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/models/templateOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { ConnectorKind, ConnectorKindSerializer } from "./connectorKind";

export interface TemplateOut {
createdAt: Date | null;
createdAt: Date;
description: string;
featureFlag?: string | null;
filterTypes?: string[] | null;
Expand All @@ -17,7 +17,7 @@ export interface TemplateOut {
/** The Organization's ID. */
orgId: string;
transformation: string;
updatedAt: Date | null;
updatedAt: Date;
}

export const TemplateOutSerializer = {
Expand Down

0 comments on commit 7f9f2cb

Please sign in to comment.