diff --git a/apps/api/src/app/events/events.controller.ts b/apps/api/src/app/events/events.controller.ts index 3437769e161..fb5fa77fe72 100644 --- a/apps/api/src/app/events/events.controller.ts +++ b/apps/api/src/app/events/events.controller.ts @@ -32,7 +32,6 @@ import { ApiOkResponse, ApiResponse, } from '../shared/framework/response.decorator'; -import { DataBooleanDto } from '../shared/dtos/data-wrapper-dto'; import { ThrottlerCategory, ThrottlerCost } from '../rate-limiting/guards'; import { UserAuthentication } from '../shared/framework/swagger/api.key.security'; import { SdkGroupName, SdkMethodName, SdkUsageExample } from '../shared/framework/swagger/sdk.decorators'; @@ -190,7 +189,7 @@ export class EventsController { @UserAuthentication() @Delete('/trigger/:transactionId') @ApiOkResponse({ - type: DataBooleanDto, + type: Boolean, }) @ApiOperation({ summary: 'Cancel triggered event', diff --git a/libs/internal-sdk/src/models/components/channelsettingsdto.ts b/libs/internal-sdk/src/models/components/channelsettingsdto.ts index 24b2d460ca9..646f8f696e2 100644 --- a/libs/internal-sdk/src/models/components/channelsettingsdto.ts +++ b/libs/internal-sdk/src/models/components/channelsettingsdto.ts @@ -18,7 +18,7 @@ import { /** * The provider identifier for the credentials */ -export const ChannelSettingsDtoProviderId = { +export const ProviderId = { Slack: "slack", Discord: "discord", Msteams: "msteams", @@ -40,15 +40,13 @@ export const ChannelSettingsDtoProviderId = { /** * The provider identifier for the credentials */ -export type ChannelSettingsDtoProviderId = ClosedEnum< - typeof ChannelSettingsDtoProviderId ->; +export type ProviderId = ClosedEnum; export type ChannelSettingsDto = { /** * The provider identifier for the credentials */ - providerId: ChannelSettingsDtoProviderId; + providerId: ProviderId; /** * The integration identifier */ @@ -64,24 +62,22 @@ export type ChannelSettingsDto = { }; /** @internal */ -export const ChannelSettingsDtoProviderId$inboundSchema: z.ZodNativeEnum< - typeof ChannelSettingsDtoProviderId -> = z.nativeEnum(ChannelSettingsDtoProviderId); +export const ProviderId$inboundSchema: z.ZodNativeEnum = z + .nativeEnum(ProviderId); /** @internal */ -export const ChannelSettingsDtoProviderId$outboundSchema: z.ZodNativeEnum< - typeof ChannelSettingsDtoProviderId -> = ChannelSettingsDtoProviderId$inboundSchema; +export const ProviderId$outboundSchema: z.ZodNativeEnum = + ProviderId$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace ChannelSettingsDtoProviderId$ { - /** @deprecated use `ChannelSettingsDtoProviderId$inboundSchema` instead. */ - export const inboundSchema = ChannelSettingsDtoProviderId$inboundSchema; - /** @deprecated use `ChannelSettingsDtoProviderId$outboundSchema` instead. */ - export const outboundSchema = ChannelSettingsDtoProviderId$outboundSchema; +export namespace ProviderId$ { + /** @deprecated use `ProviderId$inboundSchema` instead. */ + export const inboundSchema = ProviderId$inboundSchema; + /** @deprecated use `ProviderId$outboundSchema` instead. */ + export const outboundSchema = ProviderId$outboundSchema; } /** @internal */ @@ -90,7 +86,7 @@ export const ChannelSettingsDto$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - providerId: ChannelSettingsDtoProviderId$inboundSchema, + providerId: ProviderId$inboundSchema, integrationIdentifier: z.string().optional(), credentials: ChannelCredentials$inboundSchema, _integrationId: z.string(), @@ -114,7 +110,7 @@ export const ChannelSettingsDto$outboundSchema: z.ZodType< z.ZodTypeDef, ChannelSettingsDto > = z.object({ - providerId: ChannelSettingsDtoProviderId$outboundSchema, + providerId: ProviderId$outboundSchema, integrationIdentifier: z.string().optional(), credentials: ChannelCredentials$outboundSchema, integrationId: z.string(), diff --git a/libs/internal-sdk/src/models/components/databooleandto.ts b/libs/internal-sdk/src/models/components/databooleandto.ts deleted file mode 100644 index 200fb5b0262..00000000000 --- a/libs/internal-sdk/src/models/components/databooleandto.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type DataBooleanDto = { - data: boolean; -}; - -/** @internal */ -export const DataBooleanDto$inboundSchema: z.ZodType< - DataBooleanDto, - z.ZodTypeDef, - unknown -> = z.object({ - data: z.boolean(), -}); - -/** @internal */ -export type DataBooleanDto$Outbound = { - data: boolean; -}; - -/** @internal */ -export const DataBooleanDto$outboundSchema: z.ZodType< - DataBooleanDto$Outbound, - z.ZodTypeDef, - DataBooleanDto -> = z.object({ - data: z.boolean(), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace DataBooleanDto$ { - /** @deprecated use `DataBooleanDto$inboundSchema` instead. */ - export const inboundSchema = DataBooleanDto$inboundSchema; - /** @deprecated use `DataBooleanDto$outboundSchema` instead. */ - export const outboundSchema = DataBooleanDto$outboundSchema; - /** @deprecated use `DataBooleanDto$Outbound` instead. */ - export type Outbound = DataBooleanDto$Outbound; -} - -export function dataBooleanDtoToJSON(dataBooleanDto: DataBooleanDto): string { - return JSON.stringify(DataBooleanDto$outboundSchema.parse(dataBooleanDto)); -} - -export function dataBooleanDtoFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataBooleanDto$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataBooleanDto' from JSON`, - ); -} diff --git a/libs/internal-sdk/src/models/components/iapikeydto.ts b/libs/internal-sdk/src/models/components/iapikeydto.ts deleted file mode 100644 index 29fd046e0c9..00000000000 --- a/libs/internal-sdk/src/models/components/iapikeydto.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type IApiKeyDto = { - /** - * API key - */ - key: string; - /** - * User ID associated with the API key - */ - userId: string; - /** - * Hashed representation of the API key - */ - hash?: string | undefined; -}; - -/** @internal */ -export const IApiKeyDto$inboundSchema: z.ZodType< - IApiKeyDto, - z.ZodTypeDef, - unknown -> = z.object({ - key: z.string(), - _userId: z.string(), - hash: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "_userId": "userId", - }); -}); - -/** @internal */ -export type IApiKeyDto$Outbound = { - key: string; - _userId: string; - hash?: string | undefined; -}; - -/** @internal */ -export const IApiKeyDto$outboundSchema: z.ZodType< - IApiKeyDto$Outbound, - z.ZodTypeDef, - IApiKeyDto -> = z.object({ - key: z.string(), - userId: z.string(), - hash: z.string().optional(), -}).transform((v) => { - return remap$(v, { - userId: "_userId", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace IApiKeyDto$ { - /** @deprecated use `IApiKeyDto$inboundSchema` instead. */ - export const inboundSchema = IApiKeyDto$inboundSchema; - /** @deprecated use `IApiKeyDto$outboundSchema` instead. */ - export const outboundSchema = IApiKeyDto$outboundSchema; - /** @deprecated use `IApiKeyDto$Outbound` instead. */ - export type Outbound = IApiKeyDto$Outbound; -} - -export function iApiKeyDtoToJSON(iApiKeyDto: IApiKeyDto): string { - return JSON.stringify(IApiKeyDto$outboundSchema.parse(iApiKeyDto)); -} - -export function iApiKeyDtoFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => IApiKeyDto$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'IApiKeyDto' from JSON`, - ); -} diff --git a/libs/internal-sdk/src/models/components/index.ts b/libs/internal-sdk/src/models/components/index.ts index ede1c3f6436..79b74656965 100644 --- a/libs/internal-sdk/src/models/components/index.ts +++ b/libs/internal-sdk/src/models/components/index.ts @@ -33,7 +33,6 @@ export * from "./createsubscriberrequestdto.js"; export * from "./createtopicrequestdto.js"; export * from "./createtopicresponsedto.js"; export * from "./credentialsdto.js"; -export * from "./databooleandto.js"; export * from "./delayregularmetadata.js"; export * from "./delayscheduledmetadata.js"; export * from "./deletemessageresponsedto.js"; diff --git a/libs/internal-sdk/src/models/components/integrationresponsedto.ts b/libs/internal-sdk/src/models/components/integrationresponsedto.ts index a142448552a..e5b93191bce 100644 --- a/libs/internal-sdk/src/models/components/integrationresponsedto.ts +++ b/libs/internal-sdk/src/models/components/integrationresponsedto.ts @@ -24,7 +24,7 @@ import { /** * The channel type for the integration, which defines how the integration communicates (e.g., email, SMS). */ -export const Channel = { +export const IntegrationResponseDtoChannel = { InApp: "in_app", Email: "email", Sms: "sms", @@ -34,7 +34,9 @@ export const Channel = { /** * The channel type for the integration, which defines how the integration communicates (e.g., email, SMS). */ -export type Channel = ClosedEnum; +export type IntegrationResponseDtoChannel = ClosedEnum< + typeof IntegrationResponseDtoChannel +>; export type IntegrationResponseDto = { /** @@ -64,7 +66,7 @@ export type IntegrationResponseDto = { /** * The channel type for the integration, which defines how the integration communicates (e.g., email, SMS). */ - channel: Channel; + channel: IntegrationResponseDtoChannel; /** * The credentials required for the integration to function, including API keys and other sensitive information. */ @@ -96,22 +98,24 @@ export type IntegrationResponseDto = { }; /** @internal */ -export const Channel$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(Channel); +export const IntegrationResponseDtoChannel$inboundSchema: z.ZodNativeEnum< + typeof IntegrationResponseDtoChannel +> = z.nativeEnum(IntegrationResponseDtoChannel); /** @internal */ -export const Channel$outboundSchema: z.ZodNativeEnum = - Channel$inboundSchema; +export const IntegrationResponseDtoChannel$outboundSchema: z.ZodNativeEnum< + typeof IntegrationResponseDtoChannel +> = IntegrationResponseDtoChannel$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Channel$ { - /** @deprecated use `Channel$inboundSchema` instead. */ - export const inboundSchema = Channel$inboundSchema; - /** @deprecated use `Channel$outboundSchema` instead. */ - export const outboundSchema = Channel$outboundSchema; +export namespace IntegrationResponseDtoChannel$ { + /** @deprecated use `IntegrationResponseDtoChannel$inboundSchema` instead. */ + export const inboundSchema = IntegrationResponseDtoChannel$inboundSchema; + /** @deprecated use `IntegrationResponseDtoChannel$outboundSchema` instead. */ + export const outboundSchema = IntegrationResponseDtoChannel$outboundSchema; } /** @internal */ @@ -126,7 +130,7 @@ export const IntegrationResponseDto$inboundSchema: z.ZodType< name: z.string(), identifier: z.string(), providerId: z.string(), - channel: Channel$inboundSchema, + channel: IntegrationResponseDtoChannel$inboundSchema, credentials: CredentialsDto$inboundSchema, active: z.boolean(), deleted: z.boolean(), @@ -172,7 +176,7 @@ export const IntegrationResponseDto$outboundSchema: z.ZodType< name: z.string(), identifier: z.string(), providerId: z.string(), - channel: Channel$outboundSchema, + channel: IntegrationResponseDtoChannel$outboundSchema, credentials: CredentialsDto$outboundSchema, active: z.boolean(), deleted: z.boolean(), diff --git a/libs/internal-sdk/src/models/components/markallmessageasrequestdto.ts b/libs/internal-sdk/src/models/components/markallmessageasrequestdto.ts index 1258d034192..c36d9a9329f 100644 --- a/libs/internal-sdk/src/models/components/markallmessageasrequestdto.ts +++ b/libs/internal-sdk/src/models/components/markallmessageasrequestdto.ts @@ -16,7 +16,7 @@ export type FeedIdentifier = string | Array; /** * Mark all subscriber messages as read, unread, seen or unseen */ -export const MarkAllMessageAsRequestDtoMarkAs = { +export const MarkAs = { Read: "read", Seen: "seen", Unread: "unread", @@ -25,9 +25,7 @@ export const MarkAllMessageAsRequestDtoMarkAs = { /** * Mark all subscriber messages as read, unread, seen or unseen */ -export type MarkAllMessageAsRequestDtoMarkAs = ClosedEnum< - typeof MarkAllMessageAsRequestDtoMarkAs ->; +export type MarkAs = ClosedEnum; export type MarkAllMessageAsRequestDto = { /** @@ -37,7 +35,7 @@ export type MarkAllMessageAsRequestDto = { /** * Mark all subscriber messages as read, unread, seen or unseen */ - markAs: MarkAllMessageAsRequestDtoMarkAs; + markAs: MarkAs; }; /** @internal */ @@ -85,24 +83,22 @@ export function feedIdentifierFromJSON( } /** @internal */ -export const MarkAllMessageAsRequestDtoMarkAs$inboundSchema: z.ZodNativeEnum< - typeof MarkAllMessageAsRequestDtoMarkAs -> = z.nativeEnum(MarkAllMessageAsRequestDtoMarkAs); +export const MarkAs$inboundSchema: z.ZodNativeEnum = z + .nativeEnum(MarkAs); /** @internal */ -export const MarkAllMessageAsRequestDtoMarkAs$outboundSchema: z.ZodNativeEnum< - typeof MarkAllMessageAsRequestDtoMarkAs -> = MarkAllMessageAsRequestDtoMarkAs$inboundSchema; +export const MarkAs$outboundSchema: z.ZodNativeEnum = + MarkAs$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace MarkAllMessageAsRequestDtoMarkAs$ { - /** @deprecated use `MarkAllMessageAsRequestDtoMarkAs$inboundSchema` instead. */ - export const inboundSchema = MarkAllMessageAsRequestDtoMarkAs$inboundSchema; - /** @deprecated use `MarkAllMessageAsRequestDtoMarkAs$outboundSchema` instead. */ - export const outboundSchema = MarkAllMessageAsRequestDtoMarkAs$outboundSchema; +export namespace MarkAs$ { + /** @deprecated use `MarkAs$inboundSchema` instead. */ + export const inboundSchema = MarkAs$inboundSchema; + /** @deprecated use `MarkAs$outboundSchema` instead. */ + export const outboundSchema = MarkAs$outboundSchema; } /** @internal */ @@ -112,7 +108,7 @@ export const MarkAllMessageAsRequestDto$inboundSchema: z.ZodType< unknown > = z.object({ feedIdentifier: z.union([z.string(), z.array(z.string())]).optional(), - markAs: MarkAllMessageAsRequestDtoMarkAs$inboundSchema, + markAs: MarkAs$inboundSchema, }); /** @internal */ @@ -128,7 +124,7 @@ export const MarkAllMessageAsRequestDto$outboundSchema: z.ZodType< MarkAllMessageAsRequestDto > = z.object({ feedIdentifier: z.union([z.string(), z.array(z.string())]).optional(), - markAs: MarkAllMessageAsRequestDtoMarkAs$outboundSchema, + markAs: MarkAs$outboundSchema, }); /** diff --git a/libs/internal-sdk/src/models/components/messagemarkasrequestdto.ts b/libs/internal-sdk/src/models/components/messagemarkasrequestdto.ts index 22b8a38a126..8436290b68f 100644 --- a/libs/internal-sdk/src/models/components/messagemarkasrequestdto.ts +++ b/libs/internal-sdk/src/models/components/messagemarkasrequestdto.ts @@ -10,17 +10,19 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type MessageId = string | Array; -export const MarkAs = { +export const MessageMarkAsRequestDtoMarkAs = { Read: "read", Seen: "seen", Unread: "unread", Unseen: "unseen", } as const; -export type MarkAs = ClosedEnum; +export type MessageMarkAsRequestDtoMarkAs = ClosedEnum< + typeof MessageMarkAsRequestDtoMarkAs +>; export type MessageMarkAsRequestDto = { messageId: string | Array; - markAs: MarkAs; + markAs: MessageMarkAsRequestDtoMarkAs; }; /** @internal */ @@ -68,22 +70,24 @@ export function messageIdFromJSON( } /** @internal */ -export const MarkAs$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(MarkAs); +export const MessageMarkAsRequestDtoMarkAs$inboundSchema: z.ZodNativeEnum< + typeof MessageMarkAsRequestDtoMarkAs +> = z.nativeEnum(MessageMarkAsRequestDtoMarkAs); /** @internal */ -export const MarkAs$outboundSchema: z.ZodNativeEnum = - MarkAs$inboundSchema; +export const MessageMarkAsRequestDtoMarkAs$outboundSchema: z.ZodNativeEnum< + typeof MessageMarkAsRequestDtoMarkAs +> = MessageMarkAsRequestDtoMarkAs$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace MarkAs$ { - /** @deprecated use `MarkAs$inboundSchema` instead. */ - export const inboundSchema = MarkAs$inboundSchema; - /** @deprecated use `MarkAs$outboundSchema` instead. */ - export const outboundSchema = MarkAs$outboundSchema; +export namespace MessageMarkAsRequestDtoMarkAs$ { + /** @deprecated use `MessageMarkAsRequestDtoMarkAs$inboundSchema` instead. */ + export const inboundSchema = MessageMarkAsRequestDtoMarkAs$inboundSchema; + /** @deprecated use `MessageMarkAsRequestDtoMarkAs$outboundSchema` instead. */ + export const outboundSchema = MessageMarkAsRequestDtoMarkAs$outboundSchema; } /** @internal */ @@ -93,7 +97,7 @@ export const MessageMarkAsRequestDto$inboundSchema: z.ZodType< unknown > = z.object({ messageId: z.union([z.string(), z.array(z.string())]), - markAs: MarkAs$inboundSchema, + markAs: MessageMarkAsRequestDtoMarkAs$inboundSchema, }); /** @internal */ @@ -109,7 +113,7 @@ export const MessageMarkAsRequestDto$outboundSchema: z.ZodType< MessageMarkAsRequestDto > = z.object({ messageId: z.union([z.string(), z.array(z.string())]), - markAs: MarkAs$outboundSchema, + markAs: MessageMarkAsRequestDtoMarkAs$outboundSchema, }); /** diff --git a/libs/internal-sdk/src/models/components/overrides.ts b/libs/internal-sdk/src/models/components/overrides.ts index 0965f9bb062..feab360b54e 100644 --- a/libs/internal-sdk/src/models/components/overrides.ts +++ b/libs/internal-sdk/src/models/components/overrides.ts @@ -11,7 +11,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The channel type which is overridden */ -export const OverridesChannel = { +export const Channel = { InApp: "in_app", Email: "email", Sms: "sms", @@ -21,7 +21,7 @@ export const OverridesChannel = { /** * The channel type which is overridden */ -export type OverridesChannel = ClosedEnum; +export type Channel = ClosedEnum; /** * The source of overrides @@ -40,7 +40,7 @@ export type Overrides = { /** * The channel type which is overridden */ - channel: OverridesChannel; + channel: Channel; /** * The source of overrides */ @@ -48,24 +48,22 @@ export type Overrides = { }; /** @internal */ -export const OverridesChannel$inboundSchema: z.ZodNativeEnum< - typeof OverridesChannel -> = z.nativeEnum(OverridesChannel); +export const Channel$inboundSchema: z.ZodNativeEnum = z + .nativeEnum(Channel); /** @internal */ -export const OverridesChannel$outboundSchema: z.ZodNativeEnum< - typeof OverridesChannel -> = OverridesChannel$inboundSchema; +export const Channel$outboundSchema: z.ZodNativeEnum = + Channel$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace OverridesChannel$ { - /** @deprecated use `OverridesChannel$inboundSchema` instead. */ - export const inboundSchema = OverridesChannel$inboundSchema; - /** @deprecated use `OverridesChannel$outboundSchema` instead. */ - export const outboundSchema = OverridesChannel$outboundSchema; +export namespace Channel$ { + /** @deprecated use `Channel$inboundSchema` instead. */ + export const inboundSchema = Channel$inboundSchema; + /** @deprecated use `Channel$outboundSchema` instead. */ + export const outboundSchema = Channel$outboundSchema; } /** @internal */ @@ -93,7 +91,7 @@ export const Overrides$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - channel: OverridesChannel$inboundSchema, + channel: Channel$inboundSchema, source: Source$inboundSchema, }); @@ -109,7 +107,7 @@ export const Overrides$outboundSchema: z.ZodType< z.ZodTypeDef, Overrides > = z.object({ - channel: OverridesChannel$outboundSchema, + channel: Channel$outboundSchema, source: Source$outboundSchema, }); diff --git a/libs/internal-sdk/src/models/components/patchsubscriberrequestdto.ts b/libs/internal-sdk/src/models/components/patchsubscriberrequestdto.ts index be79a664206..1c73006320f 100644 --- a/libs/internal-sdk/src/models/components/patchsubscriberrequestdto.ts +++ b/libs/internal-sdk/src/models/components/patchsubscriberrequestdto.ts @@ -10,7 +10,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Additional custom data for the subscriber */ -export type PatchSubscriberRequestDtoData = {}; +export type Data = {}; export type PatchSubscriberRequestDto = { /** @@ -44,56 +44,44 @@ export type PatchSubscriberRequestDto = { /** * Additional custom data for the subscriber */ - data?: PatchSubscriberRequestDtoData | null | undefined; + data?: Data | null | undefined; }; /** @internal */ -export const PatchSubscriberRequestDtoData$inboundSchema: z.ZodType< - PatchSubscriberRequestDtoData, - z.ZodTypeDef, - unknown -> = z.object({}); +export const Data$inboundSchema: z.ZodType = z + .object({}); /** @internal */ -export type PatchSubscriberRequestDtoData$Outbound = {}; +export type Data$Outbound = {}; /** @internal */ -export const PatchSubscriberRequestDtoData$outboundSchema: z.ZodType< - PatchSubscriberRequestDtoData$Outbound, - z.ZodTypeDef, - PatchSubscriberRequestDtoData -> = z.object({}); +export const Data$outboundSchema: z.ZodType = + z.object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace PatchSubscriberRequestDtoData$ { - /** @deprecated use `PatchSubscriberRequestDtoData$inboundSchema` instead. */ - export const inboundSchema = PatchSubscriberRequestDtoData$inboundSchema; - /** @deprecated use `PatchSubscriberRequestDtoData$outboundSchema` instead. */ - export const outboundSchema = PatchSubscriberRequestDtoData$outboundSchema; - /** @deprecated use `PatchSubscriberRequestDtoData$Outbound` instead. */ - export type Outbound = PatchSubscriberRequestDtoData$Outbound; +export namespace Data$ { + /** @deprecated use `Data$inboundSchema` instead. */ + export const inboundSchema = Data$inboundSchema; + /** @deprecated use `Data$outboundSchema` instead. */ + export const outboundSchema = Data$outboundSchema; + /** @deprecated use `Data$Outbound` instead. */ + export type Outbound = Data$Outbound; } -export function patchSubscriberRequestDtoDataToJSON( - patchSubscriberRequestDtoData: PatchSubscriberRequestDtoData, -): string { - return JSON.stringify( - PatchSubscriberRequestDtoData$outboundSchema.parse( - patchSubscriberRequestDtoData, - ), - ); +export function dataToJSON(data: Data): string { + return JSON.stringify(Data$outboundSchema.parse(data)); } -export function patchSubscriberRequestDtoDataFromJSON( +export function dataFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => PatchSubscriberRequestDtoData$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PatchSubscriberRequestDtoData' from JSON`, + (x) => Data$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Data' from JSON`, ); } @@ -110,8 +98,7 @@ export const PatchSubscriberRequestDto$inboundSchema: z.ZodType< avatar: z.nullable(z.string()).optional(), timezone: z.nullable(z.string()).optional(), locale: z.nullable(z.string()).optional(), - data: z.nullable(z.lazy(() => PatchSubscriberRequestDtoData$inboundSchema)) - .optional(), + data: z.nullable(z.lazy(() => Data$inboundSchema)).optional(), }); /** @internal */ @@ -123,7 +110,7 @@ export type PatchSubscriberRequestDto$Outbound = { avatar?: string | null | undefined; timezone?: string | null | undefined; locale?: string | null | undefined; - data?: PatchSubscriberRequestDtoData$Outbound | null | undefined; + data?: Data$Outbound | null | undefined; }; /** @internal */ @@ -139,8 +126,7 @@ export const PatchSubscriberRequestDto$outboundSchema: z.ZodType< avatar: z.nullable(z.string()).optional(), timezone: z.nullable(z.string()).optional(), locale: z.nullable(z.string()).optional(), - data: z.nullable(z.lazy(() => PatchSubscriberRequestDtoData$outboundSchema)) - .optional(), + data: z.nullable(z.lazy(() => Data$outboundSchema)).optional(), }); /** diff --git a/libs/internal-sdk/src/models/components/subscriberchanneldto.ts b/libs/internal-sdk/src/models/components/subscriberchanneldto.ts index 1746ca6f816..98e5316f99b 100644 --- a/libs/internal-sdk/src/models/components/subscriberchanneldto.ts +++ b/libs/internal-sdk/src/models/components/subscriberchanneldto.ts @@ -17,7 +17,7 @@ import { /** * The ID of the chat or push provider. */ -export const ProviderId = { +export const SubscriberChannelDtoProviderId = { Slack: "slack", Discord: "discord", Msteams: "msteams", @@ -39,13 +39,15 @@ export const ProviderId = { /** * The ID of the chat or push provider. */ -export type ProviderId = ClosedEnum; +export type SubscriberChannelDtoProviderId = ClosedEnum< + typeof SubscriberChannelDtoProviderId +>; export type SubscriberChannelDto = { /** * The ID of the chat or push provider. */ - providerId: ProviderId; + providerId: SubscriberChannelDtoProviderId; /** * An optional identifier for the integration. */ @@ -57,22 +59,24 @@ export type SubscriberChannelDto = { }; /** @internal */ -export const ProviderId$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(ProviderId); +export const SubscriberChannelDtoProviderId$inboundSchema: z.ZodNativeEnum< + typeof SubscriberChannelDtoProviderId +> = z.nativeEnum(SubscriberChannelDtoProviderId); /** @internal */ -export const ProviderId$outboundSchema: z.ZodNativeEnum = - ProviderId$inboundSchema; +export const SubscriberChannelDtoProviderId$outboundSchema: z.ZodNativeEnum< + typeof SubscriberChannelDtoProviderId +> = SubscriberChannelDtoProviderId$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace ProviderId$ { - /** @deprecated use `ProviderId$inboundSchema` instead. */ - export const inboundSchema = ProviderId$inboundSchema; - /** @deprecated use `ProviderId$outboundSchema` instead. */ - export const outboundSchema = ProviderId$outboundSchema; +export namespace SubscriberChannelDtoProviderId$ { + /** @deprecated use `SubscriberChannelDtoProviderId$inboundSchema` instead. */ + export const inboundSchema = SubscriberChannelDtoProviderId$inboundSchema; + /** @deprecated use `SubscriberChannelDtoProviderId$outboundSchema` instead. */ + export const outboundSchema = SubscriberChannelDtoProviderId$outboundSchema; } /** @internal */ @@ -81,7 +85,7 @@ export const SubscriberChannelDto$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - providerId: ProviderId$inboundSchema, + providerId: SubscriberChannelDtoProviderId$inboundSchema, integrationIdentifier: z.string().optional(), credentials: ChannelCredentialsDto$inboundSchema, }); @@ -99,7 +103,7 @@ export const SubscriberChannelDto$outboundSchema: z.ZodType< z.ZodTypeDef, SubscriberChannelDto > = z.object({ - providerId: ProviderId$outboundSchema, + providerId: SubscriberChannelDtoProviderId$outboundSchema, integrationIdentifier: z.string().optional(), credentials: ChannelCredentialsDto$outboundSchema, }); diff --git a/libs/internal-sdk/src/models/components/subscriberpayloaddto.ts b/libs/internal-sdk/src/models/components/subscriberpayloaddto.ts index d93133c6494..300f6fcb380 100644 --- a/libs/internal-sdk/src/models/components/subscriberpayloaddto.ts +++ b/libs/internal-sdk/src/models/components/subscriberpayloaddto.ts @@ -13,7 +13,11 @@ import { SubscriberChannelDto$outboundSchema, } from "./subscriberchanneldto.js"; -export type Data = string | Array | boolean | number; +export type SubscriberPayloadDtoData = + | string + | Array + | boolean + | number; export type SubscriberPayloadDto = { /** @@ -59,40 +63,54 @@ export type SubscriberPayloadDto = { }; /** @internal */ -export const Data$inboundSchema: z.ZodType = z - .union([z.string(), z.array(z.string()), z.boolean(), z.number()]); +export const SubscriberPayloadDtoData$inboundSchema: z.ZodType< + SubscriberPayloadDtoData, + z.ZodTypeDef, + unknown +> = z.union([z.string(), z.array(z.string()), z.boolean(), z.number()]); /** @internal */ -export type Data$Outbound = string | Array | boolean | number; +export type SubscriberPayloadDtoData$Outbound = + | string + | Array + | boolean + | number; /** @internal */ -export const Data$outboundSchema: z.ZodType = - z.union([z.string(), z.array(z.string()), z.boolean(), z.number()]); +export const SubscriberPayloadDtoData$outboundSchema: z.ZodType< + SubscriberPayloadDtoData$Outbound, + z.ZodTypeDef, + SubscriberPayloadDtoData +> = z.union([z.string(), z.array(z.string()), z.boolean(), z.number()]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Data$ { - /** @deprecated use `Data$inboundSchema` instead. */ - export const inboundSchema = Data$inboundSchema; - /** @deprecated use `Data$outboundSchema` instead. */ - export const outboundSchema = Data$outboundSchema; - /** @deprecated use `Data$Outbound` instead. */ - export type Outbound = Data$Outbound; +export namespace SubscriberPayloadDtoData$ { + /** @deprecated use `SubscriberPayloadDtoData$inboundSchema` instead. */ + export const inboundSchema = SubscriberPayloadDtoData$inboundSchema; + /** @deprecated use `SubscriberPayloadDtoData$outboundSchema` instead. */ + export const outboundSchema = SubscriberPayloadDtoData$outboundSchema; + /** @deprecated use `SubscriberPayloadDtoData$Outbound` instead. */ + export type Outbound = SubscriberPayloadDtoData$Outbound; } -export function dataToJSON(data: Data): string { - return JSON.stringify(Data$outboundSchema.parse(data)); +export function subscriberPayloadDtoDataToJSON( + subscriberPayloadDtoData: SubscriberPayloadDtoData, +): string { + return JSON.stringify( + SubscriberPayloadDtoData$outboundSchema.parse(subscriberPayloadDtoData), + ); } -export function dataFromJSON( +export function subscriberPayloadDtoDataFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => Data$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Data' from JSON`, + (x) => SubscriberPayloadDtoData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SubscriberPayloadDtoData' from JSON`, ); } diff --git a/libs/internal-sdk/src/models/components/triggereventrequestdto.ts b/libs/internal-sdk/src/models/components/triggereventrequestdto.ts index 5737051eb25..5b93bd59b1e 100644 --- a/libs/internal-sdk/src/models/components/triggereventrequestdto.ts +++ b/libs/internal-sdk/src/models/components/triggereventrequestdto.ts @@ -43,7 +43,7 @@ export type To = * @remarks * If a new actor object is provided, we will create a new subscriber in our system */ -export type Actor = SubscriberPayloadDto | string; +export type TriggerEventRequestDtoActor = SubscriberPayloadDto | string; /** * It is used to specify a tenant context during trigger event. @@ -51,7 +51,7 @@ export type Actor = SubscriberPayloadDto | string; * @remarks * Existing tenants will be updated with the provided details. */ -export type Tenant = TenantPayloadDto | string; +export type TriggerEventRequestDtoTenant = TenantPayloadDto | string; export type TriggerEventRequestDto = { /** @@ -212,84 +212,106 @@ export function toFromJSON( } /** @internal */ -export const Actor$inboundSchema: z.ZodType = z - .union([SubscriberPayloadDto$inboundSchema, z.string()]); +export const TriggerEventRequestDtoActor$inboundSchema: z.ZodType< + TriggerEventRequestDtoActor, + z.ZodTypeDef, + unknown +> = z.union([SubscriberPayloadDto$inboundSchema, z.string()]); /** @internal */ -export type Actor$Outbound = SubscriberPayloadDto$Outbound | string; +export type TriggerEventRequestDtoActor$Outbound = + | SubscriberPayloadDto$Outbound + | string; /** @internal */ -export const Actor$outboundSchema: z.ZodType< - Actor$Outbound, +export const TriggerEventRequestDtoActor$outboundSchema: z.ZodType< + TriggerEventRequestDtoActor$Outbound, z.ZodTypeDef, - Actor + TriggerEventRequestDtoActor > = z.union([SubscriberPayloadDto$outboundSchema, z.string()]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Actor$ { - /** @deprecated use `Actor$inboundSchema` instead. */ - export const inboundSchema = Actor$inboundSchema; - /** @deprecated use `Actor$outboundSchema` instead. */ - export const outboundSchema = Actor$outboundSchema; - /** @deprecated use `Actor$Outbound` instead. */ - export type Outbound = Actor$Outbound; +export namespace TriggerEventRequestDtoActor$ { + /** @deprecated use `TriggerEventRequestDtoActor$inboundSchema` instead. */ + export const inboundSchema = TriggerEventRequestDtoActor$inboundSchema; + /** @deprecated use `TriggerEventRequestDtoActor$outboundSchema` instead. */ + export const outboundSchema = TriggerEventRequestDtoActor$outboundSchema; + /** @deprecated use `TriggerEventRequestDtoActor$Outbound` instead. */ + export type Outbound = TriggerEventRequestDtoActor$Outbound; } -export function actorToJSON(actor: Actor): string { - return JSON.stringify(Actor$outboundSchema.parse(actor)); +export function triggerEventRequestDtoActorToJSON( + triggerEventRequestDtoActor: TriggerEventRequestDtoActor, +): string { + return JSON.stringify( + TriggerEventRequestDtoActor$outboundSchema.parse( + triggerEventRequestDtoActor, + ), + ); } -export function actorFromJSON( +export function triggerEventRequestDtoActorFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => Actor$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Actor' from JSON`, + (x) => TriggerEventRequestDtoActor$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'TriggerEventRequestDtoActor' from JSON`, ); } /** @internal */ -export const Tenant$inboundSchema: z.ZodType = z - .union([TenantPayloadDto$inboundSchema, z.string()]); +export const TriggerEventRequestDtoTenant$inboundSchema: z.ZodType< + TriggerEventRequestDtoTenant, + z.ZodTypeDef, + unknown +> = z.union([TenantPayloadDto$inboundSchema, z.string()]); /** @internal */ -export type Tenant$Outbound = TenantPayloadDto$Outbound | string; +export type TriggerEventRequestDtoTenant$Outbound = + | TenantPayloadDto$Outbound + | string; /** @internal */ -export const Tenant$outboundSchema: z.ZodType< - Tenant$Outbound, +export const TriggerEventRequestDtoTenant$outboundSchema: z.ZodType< + TriggerEventRequestDtoTenant$Outbound, z.ZodTypeDef, - Tenant + TriggerEventRequestDtoTenant > = z.union([TenantPayloadDto$outboundSchema, z.string()]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Tenant$ { - /** @deprecated use `Tenant$inboundSchema` instead. */ - export const inboundSchema = Tenant$inboundSchema; - /** @deprecated use `Tenant$outboundSchema` instead. */ - export const outboundSchema = Tenant$outboundSchema; - /** @deprecated use `Tenant$Outbound` instead. */ - export type Outbound = Tenant$Outbound; +export namespace TriggerEventRequestDtoTenant$ { + /** @deprecated use `TriggerEventRequestDtoTenant$inboundSchema` instead. */ + export const inboundSchema = TriggerEventRequestDtoTenant$inboundSchema; + /** @deprecated use `TriggerEventRequestDtoTenant$outboundSchema` instead. */ + export const outboundSchema = TriggerEventRequestDtoTenant$outboundSchema; + /** @deprecated use `TriggerEventRequestDtoTenant$Outbound` instead. */ + export type Outbound = TriggerEventRequestDtoTenant$Outbound; } -export function tenantToJSON(tenant: Tenant): string { - return JSON.stringify(Tenant$outboundSchema.parse(tenant)); +export function triggerEventRequestDtoTenantToJSON( + triggerEventRequestDtoTenant: TriggerEventRequestDtoTenant, +): string { + return JSON.stringify( + TriggerEventRequestDtoTenant$outboundSchema.parse( + triggerEventRequestDtoTenant, + ), + ); } -export function tenantFromJSON( +export function triggerEventRequestDtoTenantFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => Tenant$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Tenant' from JSON`, + (x) => TriggerEventRequestDtoTenant$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'TriggerEventRequestDtoTenant' from JSON`, ); } diff --git a/libs/internal-sdk/src/models/components/triggereventtoallrequestdto.ts b/libs/internal-sdk/src/models/components/triggereventtoallrequestdto.ts index 3c51b37b947..2296c13deeb 100644 --- a/libs/internal-sdk/src/models/components/triggereventtoallrequestdto.ts +++ b/libs/internal-sdk/src/models/components/triggereventtoallrequestdto.ts @@ -30,7 +30,7 @@ export type TriggerEventToAllRequestDtoOverrides = {}; * @remarks * If a new actor object is provided, we will create a new subscriber in our system */ -export type TriggerEventToAllRequestDtoActor = SubscriberPayloadDto | string; +export type Actor = SubscriberPayloadDto | string; /** * It is used to specify a tenant context during trigger event. @@ -38,7 +38,7 @@ export type TriggerEventToAllRequestDtoActor = SubscriberPayloadDto | string; * @remarks * If a new tenant object is provided, we will create a new tenant. */ -export type TriggerEventToAllRequestDtoTenant = TenantPayloadDto | string; +export type Tenant = TenantPayloadDto | string; export type TriggerEventToAllRequestDto = { /** @@ -131,107 +131,84 @@ export function triggerEventToAllRequestDtoOverridesFromJSON( } /** @internal */ -export const TriggerEventToAllRequestDtoActor$inboundSchema: z.ZodType< - TriggerEventToAllRequestDtoActor, - z.ZodTypeDef, - unknown -> = z.union([SubscriberPayloadDto$inboundSchema, z.string()]); +export const Actor$inboundSchema: z.ZodType = z + .union([SubscriberPayloadDto$inboundSchema, z.string()]); /** @internal */ -export type TriggerEventToAllRequestDtoActor$Outbound = - | SubscriberPayloadDto$Outbound - | string; +export type Actor$Outbound = SubscriberPayloadDto$Outbound | string; /** @internal */ -export const TriggerEventToAllRequestDtoActor$outboundSchema: z.ZodType< - TriggerEventToAllRequestDtoActor$Outbound, +export const Actor$outboundSchema: z.ZodType< + Actor$Outbound, z.ZodTypeDef, - TriggerEventToAllRequestDtoActor + Actor > = z.union([SubscriberPayloadDto$outboundSchema, z.string()]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace TriggerEventToAllRequestDtoActor$ { - /** @deprecated use `TriggerEventToAllRequestDtoActor$inboundSchema` instead. */ - export const inboundSchema = TriggerEventToAllRequestDtoActor$inboundSchema; - /** @deprecated use `TriggerEventToAllRequestDtoActor$outboundSchema` instead. */ - export const outboundSchema = TriggerEventToAllRequestDtoActor$outboundSchema; - /** @deprecated use `TriggerEventToAllRequestDtoActor$Outbound` instead. */ - export type Outbound = TriggerEventToAllRequestDtoActor$Outbound; +export namespace Actor$ { + /** @deprecated use `Actor$inboundSchema` instead. */ + export const inboundSchema = Actor$inboundSchema; + /** @deprecated use `Actor$outboundSchema` instead. */ + export const outboundSchema = Actor$outboundSchema; + /** @deprecated use `Actor$Outbound` instead. */ + export type Outbound = Actor$Outbound; } -export function triggerEventToAllRequestDtoActorToJSON( - triggerEventToAllRequestDtoActor: TriggerEventToAllRequestDtoActor, -): string { - return JSON.stringify( - TriggerEventToAllRequestDtoActor$outboundSchema.parse( - triggerEventToAllRequestDtoActor, - ), - ); +export function actorToJSON(actor: Actor): string { + return JSON.stringify(Actor$outboundSchema.parse(actor)); } -export function triggerEventToAllRequestDtoActorFromJSON( +export function actorFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => TriggerEventToAllRequestDtoActor$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TriggerEventToAllRequestDtoActor' from JSON`, + (x) => Actor$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Actor' from JSON`, ); } /** @internal */ -export const TriggerEventToAllRequestDtoTenant$inboundSchema: z.ZodType< - TriggerEventToAllRequestDtoTenant, - z.ZodTypeDef, - unknown -> = z.union([TenantPayloadDto$inboundSchema, z.string()]); +export const Tenant$inboundSchema: z.ZodType = z + .union([TenantPayloadDto$inboundSchema, z.string()]); /** @internal */ -export type TriggerEventToAllRequestDtoTenant$Outbound = - | TenantPayloadDto$Outbound - | string; +export type Tenant$Outbound = TenantPayloadDto$Outbound | string; /** @internal */ -export const TriggerEventToAllRequestDtoTenant$outboundSchema: z.ZodType< - TriggerEventToAllRequestDtoTenant$Outbound, +export const Tenant$outboundSchema: z.ZodType< + Tenant$Outbound, z.ZodTypeDef, - TriggerEventToAllRequestDtoTenant + Tenant > = z.union([TenantPayloadDto$outboundSchema, z.string()]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace TriggerEventToAllRequestDtoTenant$ { - /** @deprecated use `TriggerEventToAllRequestDtoTenant$inboundSchema` instead. */ - export const inboundSchema = TriggerEventToAllRequestDtoTenant$inboundSchema; - /** @deprecated use `TriggerEventToAllRequestDtoTenant$outboundSchema` instead. */ - export const outboundSchema = - TriggerEventToAllRequestDtoTenant$outboundSchema; - /** @deprecated use `TriggerEventToAllRequestDtoTenant$Outbound` instead. */ - export type Outbound = TriggerEventToAllRequestDtoTenant$Outbound; +export namespace Tenant$ { + /** @deprecated use `Tenant$inboundSchema` instead. */ + export const inboundSchema = Tenant$inboundSchema; + /** @deprecated use `Tenant$outboundSchema` instead. */ + export const outboundSchema = Tenant$outboundSchema; + /** @deprecated use `Tenant$Outbound` instead. */ + export type Outbound = Tenant$Outbound; } -export function triggerEventToAllRequestDtoTenantToJSON( - triggerEventToAllRequestDtoTenant: TriggerEventToAllRequestDtoTenant, -): string { - return JSON.stringify( - TriggerEventToAllRequestDtoTenant$outboundSchema.parse( - triggerEventToAllRequestDtoTenant, - ), - ); +export function tenantToJSON(tenant: Tenant): string { + return JSON.stringify(Tenant$outboundSchema.parse(tenant)); } -export function triggerEventToAllRequestDtoTenantFromJSON( +export function tenantFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => TriggerEventToAllRequestDtoTenant$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TriggerEventToAllRequestDtoTenant' from JSON`, + (x) => Tenant$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Tenant' from JSON`, ); } diff --git a/libs/internal-sdk/src/models/operations/eventscontrollercancel.ts b/libs/internal-sdk/src/models/operations/eventscontrollercancel.ts index 86544d82a76..d6ead948083 100644 --- a/libs/internal-sdk/src/models/operations/eventscontrollercancel.ts +++ b/libs/internal-sdk/src/models/operations/eventscontrollercancel.ts @@ -6,7 +6,6 @@ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type EventsControllerCancelRequest = { @@ -19,7 +18,7 @@ export type EventsControllerCancelRequest = { export type EventsControllerCancelResponse = { headers: { [k: string]: Array }; - result: components.DataBooleanDto; + result: boolean; }; /** @internal */ @@ -96,7 +95,7 @@ export const EventsControllerCancelResponse$inboundSchema: z.ZodType< unknown > = z.object({ Headers: z.record(z.array(z.string())), - Result: components.DataBooleanDto$inboundSchema, + Result: z.boolean(), }).transform((v) => { return remap$(v, { "Headers": "headers", @@ -107,7 +106,7 @@ export const EventsControllerCancelResponse$inboundSchema: z.ZodType< /** @internal */ export type EventsControllerCancelResponse$Outbound = { Headers: { [k: string]: Array }; - Result: components.DataBooleanDto$Outbound; + Result: boolean; }; /** @internal */ @@ -117,7 +116,7 @@ export const EventsControllerCancelResponse$outboundSchema: z.ZodType< EventsControllerCancelResponse > = z.object({ headers: z.record(z.array(z.string())), - result: components.DataBooleanDto$outboundSchema, + result: z.boolean(), }).transform((v) => { return remap$(v, { headers: "Headers", diff --git a/libs/internal-sdk/src/sdk/authentication.ts b/libs/internal-sdk/src/sdk/authentication.ts index 27627c04a67..138b0229349 100644 --- a/libs/internal-sdk/src/sdk/authentication.ts +++ b/libs/internal-sdk/src/sdk/authentication.ts @@ -14,22 +14,6 @@ import { unwrapAsync } from "../types/fp.js"; export { ChatAccessOauthCallBackAcceptEnum } from "../funcs/subscribersAuthenticationChatAccessOauthCallBack.js"; export class Authentication extends ClientSDK { - /** - * Handle providers oauth redirect - */ - async chatAccessOauthCallBack( - request: operations.SubscribersV1ControllerChatOauthCallbackRequest, - options?: RequestOptions & { - acceptHeaderOverride?: ChatAccessOauthCallBackAcceptEnum; - }, - ): Promise { - return unwrapAsync(subscribersAuthenticationChatAccessOauthCallBack( - this, - request, - options, - )); - } - /** * Handle chat oauth */ @@ -45,4 +29,20 @@ export class Authentication extends ClientSDK { options, )); } + + /** + * Handle providers oauth redirect + */ + async chatAccessOauthCallBack( + request: operations.SubscribersV1ControllerChatOauthCallbackRequest, + options?: RequestOptions & { + acceptHeaderOverride?: ChatAccessOauthCallBackAcceptEnum; + }, + ): Promise { + return unwrapAsync(subscribersAuthenticationChatAccessOauthCallBack( + this, + request, + options, + )); + } } diff --git a/libs/internal-sdk/src/sdk/integrations.ts b/libs/internal-sdk/src/sdk/integrations.ts index 62f6a65a0b4..0d77ae92f7f 100644 --- a/libs/internal-sdk/src/sdk/integrations.ts +++ b/libs/internal-sdk/src/sdk/integrations.ts @@ -56,23 +56,6 @@ export class Integrations extends ClientSDK { )); } - /** - * Get active integrations - * - * @remarks - * Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change - */ - async listActive( - idempotencyKey?: string | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(integrationsListActive( - this, - idempotencyKey, - options, - )); - } - /** * Update integration */ @@ -122,4 +105,21 @@ export class Integrations extends ClientSDK { options, )); } + + /** + * Get active integrations + * + * @remarks + * Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change + */ + async listActive( + idempotencyKey?: string | undefined, + options?: RequestOptions, + ): Promise { + return unwrapAsync(integrationsListActive( + this, + idempotencyKey, + options, + )); + } } diff --git a/libs/internal-sdk/src/sdk/novumessages.ts b/libs/internal-sdk/src/sdk/novumessages.ts index 61016e86a3f..06c64504dc5 100644 --- a/libs/internal-sdk/src/sdk/novumessages.ts +++ b/libs/internal-sdk/src/sdk/novumessages.ts @@ -12,19 +12,15 @@ import { unwrapAsync } from "../types/fp.js"; export class NovuMessages extends ClientSDK { /** - * Mark a subscriber messages as seen, read, unseen or unread + * Mark message action as seen */ - async markAllAs( - messageMarkAsRequestDto: components.MessageMarkAsRequestDto, - subscriberId: string, - idempotencyKey?: string | undefined, + async updateAsSeen( + request: operations.SubscribersV1ControllerMarkActionAsSeenRequest, options?: RequestOptions, - ): Promise { - return unwrapAsync(subscribersMessagesMarkAllAs( + ): Promise { + return unwrapAsync(subscribersMessagesUpdateAsSeen( this, - messageMarkAsRequestDto, - subscriberId, - idempotencyKey, + request, options, )); } @@ -48,15 +44,19 @@ export class NovuMessages extends ClientSDK { } /** - * Mark message action as seen + * Mark a subscriber messages as seen, read, unseen or unread */ - async updateAsSeen( - request: operations.SubscribersV1ControllerMarkActionAsSeenRequest, + async markAllAs( + messageMarkAsRequestDto: components.MessageMarkAsRequestDto, + subscriberId: string, + idempotencyKey?: string | undefined, options?: RequestOptions, - ): Promise { - return unwrapAsync(subscribersMessagesUpdateAsSeen( + ): Promise { + return unwrapAsync(subscribersMessagesMarkAllAs( this, - request, + messageMarkAsRequestDto, + subscriberId, + idempotencyKey, options, )); } diff --git a/libs/internal-sdk/src/sdk/sdk.ts b/libs/internal-sdk/src/sdk/sdk.ts index 256fbf9a81f..f5b132523a2 100644 --- a/libs/internal-sdk/src/sdk/sdk.ts +++ b/libs/internal-sdk/src/sdk/sdk.ts @@ -19,41 +19,41 @@ import { Topics } from "./topics.js"; import { Workflows } from "./workflows.js"; export class Novu extends ClientSDK { + private _subscribers?: Subscribers; + get subscribers(): Subscribers { + return (this._subscribers ??= new Subscribers(this._options)); + } + + private _workflows?: Workflows; + get workflows(): Workflows { + return (this._workflows ??= new Workflows(this._options)); + } + private _environments?: Environments; get environments(): Environments { return (this._environments ??= new Environments(this._options)); } - private _notifications?: Notifications; - get notifications(): Notifications { - return (this._notifications ??= new Notifications(this._options)); - } - private _integrations?: Integrations; get integrations(): Integrations { return (this._integrations ??= new Integrations(this._options)); } - private _subscribers?: Subscribers; - get subscribers(): Subscribers { - return (this._subscribers ??= new Subscribers(this._options)); - } - private _messages?: Messages; get messages(): Messages { return (this._messages ??= new Messages(this._options)); } + private _notifications?: Notifications; + get notifications(): Notifications { + return (this._notifications ??= new Notifications(this._options)); + } + private _topics?: Topics; get topics(): Topics { return (this._topics ??= new Topics(this._options)); } - private _workflows?: Workflows; - get workflows(): Workflows { - return (this._workflows ??= new Workflows(this._options)); - } - /** * Trigger event * @@ -77,21 +77,21 @@ export class Novu extends ClientSDK { } /** - * Bulk trigger event + * Cancel triggered event * * @remarks * - * Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API. - * The bulk API is limited to 100 events per request. + * Using a previously generated transactionId during the event trigger, + * will cancel any active or pending workflows. This is useful to cancel active digests, delays etc... */ - async triggerBulk( - bulkTriggerEventDto: components.BulkTriggerEventDto, + async cancel( + transactionId: string, idempotencyKey?: string | undefined, options?: RequestOptions, - ): Promise { - return unwrapAsync(triggerBulk( + ): Promise { + return unwrapAsync(cancel( this, - bulkTriggerEventDto, + transactionId, idempotencyKey, options, )); @@ -118,21 +118,21 @@ export class Novu extends ClientSDK { } /** - * Cancel triggered event + * Bulk trigger event * * @remarks * - * Using a previously generated transactionId during the event trigger, - * will cancel any active or pending workflows. This is useful to cancel active digests, delays etc... + * Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API. + * The bulk API is limited to 100 events per request. */ - async cancel( - transactionId: string, + async triggerBulk( + bulkTriggerEventDto: components.BulkTriggerEventDto, idempotencyKey?: string | undefined, options?: RequestOptions, - ): Promise { - return unwrapAsync(cancel( + ): Promise { + return unwrapAsync(triggerBulk( this, - transactionId, + bulkTriggerEventDto, idempotencyKey, options, )); diff --git a/libs/internal-sdk/src/sdk/stats.ts b/libs/internal-sdk/src/sdk/stats.ts index 03295a1278b..328b8d2e3df 100644 --- a/libs/internal-sdk/src/sdk/stats.ts +++ b/libs/internal-sdk/src/sdk/stats.ts @@ -10,30 +10,30 @@ import { unwrapAsync } from "../types/fp.js"; export class Stats extends ClientSDK { /** - * Get notification statistics + * Get notification graph statistics */ - async retrieve( + async graph( + days?: number | undefined, idempotencyKey?: string | undefined, options?: RequestOptions, - ): Promise { - return unwrapAsync(notificationsStatsRetrieve( + ): Promise { + return unwrapAsync(notificationsStatsGraph( this, + days, idempotencyKey, options, )); } /** - * Get notification graph statistics + * Get notification statistics */ - async graph( - days?: number | undefined, + async retrieve( idempotencyKey?: string | undefined, options?: RequestOptions, - ): Promise { - return unwrapAsync(notificationsStatsGraph( + ): Promise { + return unwrapAsync(notificationsStatsRetrieve( this, - days, idempotencyKey, options, )); diff --git a/libs/internal-sdk/src/sdk/subscribers.ts b/libs/internal-sdk/src/sdk/subscribers.ts index 60741b13de3..352a846de55 100644 --- a/libs/internal-sdk/src/sdk/subscribers.ts +++ b/libs/internal-sdk/src/sdk/subscribers.ts @@ -22,81 +22,34 @@ import { Preferences } from "./preferences.js"; import { Properties } from "./properties.js"; export class Subscribers extends ClientSDK { + private _preferences?: Preferences; + get preferences(): Preferences { + return (this._preferences ??= new Preferences(this._options)); + } + private _credentials?: Credentials; get credentials(): Credentials { return (this._credentials ??= new Credentials(this._options)); } - private _properties?: Properties; - get properties(): Properties { - return (this._properties ??= new Properties(this._options)); - } - - private _notifications?: NovuNotifications; - get notifications(): NovuNotifications { - return (this._notifications ??= new NovuNotifications(this._options)); - } - - private _messages?: NovuMessages; - get messages(): NovuMessages { - return (this._messages ??= new NovuMessages(this._options)); - } - private _authentication?: Authentication; get authentication(): Authentication { return (this._authentication ??= new Authentication(this._options)); } - private _preferences?: Preferences; - get preferences(): Preferences { - return (this._preferences ??= new Preferences(this._options)); + private _messages?: NovuMessages; + get messages(): NovuMessages { + return (this._messages ??= new NovuMessages(this._options)); } - /** - * Get subscribers - * - * @remarks - * Returns a list of subscribers, could paginated using the `page` and `limit` query parameter - */ - async list( - page?: number | undefined, - limit?: number | undefined, - idempotencyKey?: string | undefined, - options?: RequestOptions, - ): Promise< - PageIterator< - operations.SubscribersV1ControllerListSubscribersResponse, - { page: number } - > - > { - return unwrapResultIterator(subscribersList( - this, - page, - limit, - idempotencyKey, - options, - )); + private _notifications?: NovuNotifications; + get notifications(): NovuNotifications { + return (this._notifications ??= new NovuNotifications(this._options)); } - /** - * Bulk create subscribers - * - * @remarks - * - * Using this endpoint you can create multiple subscribers at once, to avoid multiple calls to the API. - * The bulk API is limited to 500 subscribers per request. - */ - async createBulk( - bulkSubscriberCreateDto: components.BulkSubscriberCreateDto, - idempotencyKey?: string | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(subscribersCreateBulk( - this, - bulkSubscriberCreateDto, - idempotencyKey, - options, - )); + private _properties?: Properties; + get properties(): Properties { + return (this._properties ??= new Properties(this._options)); } /** @@ -190,4 +143,51 @@ export class Subscribers extends ClientSDK { options, )); } + + /** + * Get subscribers + * + * @remarks + * Returns a list of subscribers, could paginated using the `page` and `limit` query parameter + */ + async list( + page?: number | undefined, + limit?: number | undefined, + idempotencyKey?: string | undefined, + options?: RequestOptions, + ): Promise< + PageIterator< + operations.SubscribersV1ControllerListSubscribersResponse, + { page: number } + > + > { + return unwrapResultIterator(subscribersList( + this, + page, + limit, + idempotencyKey, + options, + )); + } + + /** + * Bulk create subscribers + * + * @remarks + * + * Using this endpoint you can create multiple subscribers at once, to avoid multiple calls to the API. + * The bulk API is limited to 500 subscribers per request. + */ + async createBulk( + bulkSubscriberCreateDto: components.BulkSubscriberCreateDto, + idempotencyKey?: string | undefined, + options?: RequestOptions, + ): Promise { + return unwrapAsync(subscribersCreateBulk( + this, + bulkSubscriberCreateDto, + idempotencyKey, + options, + )); + } } diff --git a/libs/internal-sdk/src/sdk/workflows.ts b/libs/internal-sdk/src/sdk/workflows.ts index 656800b9ac9..48cf6f341fe 100644 --- a/libs/internal-sdk/src/sdk/workflows.ts +++ b/libs/internal-sdk/src/sdk/workflows.ts @@ -19,10 +19,10 @@ import { unwrapAsync } from "../types/fp.js"; export class Workflows extends ClientSDK { /** - * Topic creation + * Create subscriber * * @remarks - * Create a topic + * Create subscriber with the given data */ async create( idempotencyKey?: string | undefined, @@ -46,24 +46,11 @@ export class Workflows extends ClientSDK { )); } - async workflowControllerSync( - workflowId: string, - idempotencyKey?: string | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(workflowsWorkflowControllerSync( - this, - workflowId, - idempotencyKey, - options, - )); - } - /** - * Update subscriber global or workflow specific preferences + * Update subscriber credentials * * @remarks - * Update subscriber global or workflow specific preferences + * Subscriber credentials associated to the delivery methods such as slack and push tokens. */ async update( workflowId: string, @@ -79,10 +66,10 @@ export class Workflows extends ClientSDK { } /** - * Get topic + * Get subscriber * * @remarks - * Get a topic by its topic key + * Get subscriber by your internal id used to identify the subscriber */ async retrieve( workflowId: string, @@ -100,10 +87,10 @@ export class Workflows extends ClientSDK { } /** - * Delete topic + * Delete subscriber * * @remarks - * Delete a topic by its topic key if it has no subscribers + * Deletes a subscriber entity from the Novu platform */ async delete( workflowId: string, @@ -176,6 +163,19 @@ export class Workflows extends ClientSDK { )); } + async workflowControllerSync( + workflowId: string, + idempotencyKey?: string | undefined, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workflowsWorkflowControllerSync( + this, + workflowId, + idempotencyKey, + options, + )); + } + async getWorkflowTestData( workflowId: string, idempotencyKey?: string | undefined,