diff --git a/package.json b/package.json index d258c3d..09e6a6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ravenapp/raven", - "version": "0.0.40", + "version": "0.0.41", "repository": "https://github.com/ravenappdev/raven-node", "files": [ "dist", diff --git a/src/Client.ts b/src/Client.ts index 3e50648..11da6be 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,53 +1,131 @@ /** - * This file auto-generated by Fern from our API Definition. + * This file was auto-generated by Fern from our API Definition. */ import * as environments from "./environments"; import * as core from "./core"; -import { Client as DeviceClient } from "./resources/device/client/Client"; -import { Client as EventClient } from "./resources/event/client/Client"; -import { Client as UserClient } from "./resources/user/client/Client"; -import { RavenApi } from "."; +import { RavenApi } from "@ravenapp/raven"; +import urlJoin from "url-join"; +import * as serializers from "./serialization"; +import * as errors from "./errors"; +import { Client as DeviceClient } from "./api/resources/device/client/Client"; +import { Client as UserClient } from "./api/resources/user/client/Client"; export declare namespace RavenApiClient { - interface Options { - environment?: environments.Environment | string; - auth?: { - authorization?: core.Supplier; - }; - } + interface Options { + environment?: environments.RavenApiEnvironment | string; + authorization?: core.Supplier; + } } export class RavenApiClient { - constructor(private readonly options: RavenApiClient.Options) {} + constructor(private readonly options: RavenApiClient.Options) {} - #device: DeviceClient | undefined; + /** + * This endpoint allows you to send messages + * @throws {RavenApi.EventNotFoundError} + */ + public async send(appId: RavenApi.AppId, request: RavenApi.SendEventRequest): Promise { + const { idempotencyKey, ..._body } = request; + const _response = await core.fetcher({ + url: urlJoin( + this.options.environment ?? environments.RavenApiEnvironment.Prod, + `/v1/apps/${appId}/events/send` + ), + method: "POST", + headers: { + "Idempotency-Key": idempotencyKey, + Authorization: await core.Supplier.get(this.options.authorization), + }, + body: await serializers.SendEventRequest.json(_body), + }); + if (_response.ok) { + return await serializers.SendEventResponse.parse(_response.body as serializers.SendEventResponse.Raw); + } - public get device(): DeviceClient { - return (this.#device ??= new DeviceClient(this.options)); - } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 404: + throw new RavenApi.EventNotFoundError( + await serializers.EventNotFoundErrorBody.parse( + _response.error.body as serializers.EventNotFoundErrorBody.Raw + ) + ); + default: + throw new errors.RavenApiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } - #event: EventClient | undefined; + switch (_response.error.reason) { + case "non-json": + throw new errors.RavenApiError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.RavenApiTimeoutError(); + case "unknown": + throw new errors.RavenApiError({ + message: _response.error.errorMessage, + }); + } + } - public get event(): EventClient { - return (this.#event ??= new EventClient(this.options)); - } + public async sendBulk( + appId: RavenApi.AppId, + request: RavenApi.BulkSendEventRequest + ): Promise { + const { idempotencyKey, ..._body } = request; + const _response = await core.fetcher({ + url: urlJoin( + this.options.environment ?? environments.RavenApiEnvironment.Prod, + `/v1/apps/${appId}/events/bulk_send` + ), + method: "POST", + headers: { + "Idempotency-Key": idempotencyKey, + Authorization: await core.Supplier.get(this.options.authorization), + }, + body: await serializers.BulkSendEventRequest.json(_body), + }); + if (_response.ok) { + return await serializers.SendEventResponse.parse(_response.body as serializers.SendEventResponse.Raw); + } - public async send( - request: RavenApi.event.send.Request - ): Promise { - return this.event.send(request); - } + if (_response.error.reason === "status-code") { + throw new errors.RavenApiError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } - public async sendBulk( - request: RavenApi.event.sendBulk.Request - ): Promise { - return this.event.sendBulk(request); - } + switch (_response.error.reason) { + case "non-json": + throw new errors.RavenApiError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.RavenApiTimeoutError(); + case "unknown": + throw new errors.RavenApiError({ + message: _response.error.errorMessage, + }); + } + } - #user: UserClient | undefined; + #device: DeviceClient | undefined; - public get user(): UserClient { - return (this.#user ??= new UserClient(this.options)); - } + public get device(): DeviceClient { + return (this.#device ??= new DeviceClient(this.options)); + } + + #user: UserClient | undefined; + + public get user(): UserClient { + return (this.#user ??= new UserClient(this.options)); + } } diff --git a/src/api/resources/event/client/index.ts b/src/api/client/index.ts similarity index 100% rename from src/api/resources/event/client/index.ts rename to src/api/client/index.ts diff --git a/src/api/resources/event/client/requests/BulkSendEventRequest.ts b/src/api/client/requests/BulkSendEventRequest.ts similarity index 100% rename from src/api/resources/event/client/requests/BulkSendEventRequest.ts rename to src/api/client/requests/BulkSendEventRequest.ts diff --git a/src/api/resources/event/client/requests/SendEventRequest.ts b/src/api/client/requests/SendEventRequest.ts similarity index 100% rename from src/api/resources/event/client/requests/SendEventRequest.ts rename to src/api/client/requests/SendEventRequest.ts diff --git a/src/api/resources/event/client/requests/index.ts b/src/api/client/requests/index.ts similarity index 100% rename from src/api/resources/event/client/requests/index.ts rename to src/api/client/requests/index.ts diff --git a/src/api/resources/event/errors/EventNotFoundError.ts b/src/api/errors/EventNotFoundError.ts similarity index 90% rename from src/api/resources/event/errors/EventNotFoundError.ts rename to src/api/errors/EventNotFoundError.ts index 5c8bc47..15ff8d0 100644 --- a/src/api/resources/event/errors/EventNotFoundError.ts +++ b/src/api/errors/EventNotFoundError.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as errors from "../../../../errors"; +import * as errors from "../../errors"; import { RavenApi } from "@ravenapp/raven"; export class EventNotFoundError extends errors.RavenApiError { diff --git a/src/api/resources/event/errors/index.ts b/src/api/errors/index.ts similarity index 100% rename from src/api/resources/event/errors/index.ts rename to src/api/errors/index.ts diff --git a/src/api/index.ts b/src/api/index.ts index 3e5335f..d5c609c 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1 +1,4 @@ export * from "./resources"; +export * from "./types"; +export * from "./errors"; +export * from "./client"; diff --git a/src/api/resources/event/client/Client.ts b/src/api/resources/event/client/Client.ts deleted file mode 100644 index dc24d6b..0000000 --- a/src/api/resources/event/client/Client.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as environments from "../../../../environments"; -import * as core from "../../../../core"; -import { RavenApi } from "@ravenapp/raven"; -import urlJoin from "url-join"; -import * as serializers from "../../../../serialization"; -import * as errors from "../../../../errors"; - -export declare namespace Client { - interface Options { - environment?: environments.RavenApiEnvironment | string; - authorization?: core.Supplier; - } -} - -export class Client { - constructor(private readonly options: Client.Options) {} - - /** - * This endpoint allows you to send messages - * @throws {RavenApi.EventNotFoundError} - */ - public async send(appId: RavenApi.AppId, request: RavenApi.SendEventRequest): Promise { - const { idempotencyKey, ..._body } = request; - const _response = await core.fetcher({ - url: urlJoin( - this.options.environment ?? environments.RavenApiEnvironment.Prod, - `/v1/apps/${appId}/events/send` - ), - method: "POST", - headers: { - "Idempotency-Key": idempotencyKey, - Authorization: await core.Supplier.get(this.options.authorization), - }, - body: await serializers.SendEventRequest.json(_body), - }); - if (_response.ok) { - return await serializers.SendEventResponse.parse(_response.body as serializers.SendEventResponse.Raw); - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 404: - throw new RavenApi.EventNotFoundError( - await serializers.EventNotFoundErrorBody.parse( - _response.error.body as serializers.EventNotFoundErrorBody.Raw - ) - ); - default: - throw new errors.RavenApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - }); - } - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.RavenApiError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - }); - case "timeout": - throw new errors.RavenApiTimeoutError(); - case "unknown": - throw new errors.RavenApiError({ - message: _response.error.errorMessage, - }); - } - } - - public async sendBulk( - appId: RavenApi.AppId, - request: RavenApi.BulkSendEventRequest - ): Promise { - const { idempotencyKey, ..._body } = request; - const _response = await core.fetcher({ - url: urlJoin( - this.options.environment ?? environments.RavenApiEnvironment.Prod, - `/v1/apps/${appId}/events/bulk_send` - ), - method: "POST", - headers: { - "Idempotency-Key": idempotencyKey, - Authorization: await core.Supplier.get(this.options.authorization), - }, - body: await serializers.BulkSendEventRequest.json(_body), - }); - if (_response.ok) { - return await serializers.SendEventResponse.parse(_response.body as serializers.SendEventResponse.Raw); - } - - if (_response.error.reason === "status-code") { - throw new errors.RavenApiError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.RavenApiError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - }); - case "timeout": - throw new errors.RavenApiTimeoutError(); - case "unknown": - throw new errors.RavenApiError({ - message: _response.error.errorMessage, - }); - } - } -} diff --git a/src/api/resources/event/index.ts b/src/api/resources/event/index.ts deleted file mode 100644 index 9dc8224..0000000 --- a/src/api/resources/event/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./types"; -export * from "./errors"; -export * from "./client"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 9ee504c..eba2913 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,11 +1,7 @@ export * as device from "./device"; export * from "./device/types"; -export * as event from "./event"; -export * from "./event/types"; export * as ids from "./ids"; export * from "./ids/types"; export * as user from "./user"; export * from "./user/types"; -export * from "./event/errors"; -export * from "./event/client/requests"; export * from "./user/client/requests"; diff --git a/src/api/resources/event/types/Attachment.ts b/src/api/types/Attachment.ts similarity index 100% rename from src/api/resources/event/types/Attachment.ts rename to src/api/types/Attachment.ts diff --git a/src/api/resources/event/types/BatchEvent.ts b/src/api/types/BatchEvent.ts similarity index 100% rename from src/api/resources/event/types/BatchEvent.ts rename to src/api/types/BatchEvent.ts diff --git a/src/api/resources/event/types/ChannelOverride.ts b/src/api/types/ChannelOverride.ts similarity index 100% rename from src/api/resources/event/types/ChannelOverride.ts rename to src/api/types/ChannelOverride.ts diff --git a/src/api/resources/event/types/EmailMessage.ts b/src/api/types/EmailMessage.ts similarity index 100% rename from src/api/resources/event/types/EmailMessage.ts rename to src/api/types/EmailMessage.ts diff --git a/src/api/resources/event/types/EmailOverride.ts b/src/api/types/EmailOverride.ts similarity index 100% rename from src/api/resources/event/types/EmailOverride.ts rename to src/api/types/EmailOverride.ts diff --git a/src/api/resources/event/types/EmailRecipient.ts b/src/api/types/EmailRecipient.ts similarity index 100% rename from src/api/resources/event/types/EmailRecipient.ts rename to src/api/types/EmailRecipient.ts diff --git a/src/api/resources/event/types/EventNotFoundErrorBody.ts b/src/api/types/EventNotFoundErrorBody.ts similarity index 100% rename from src/api/resources/event/types/EventNotFoundErrorBody.ts rename to src/api/types/EventNotFoundErrorBody.ts diff --git a/src/api/resources/event/types/EventOverride.ts b/src/api/types/EventOverride.ts similarity index 100% rename from src/api/resources/event/types/EventOverride.ts rename to src/api/types/EventOverride.ts diff --git a/src/api/resources/event/types/InAppOverride.ts b/src/api/types/InAppOverride.ts similarity index 100% rename from src/api/resources/event/types/InAppOverride.ts rename to src/api/types/InAppOverride.ts diff --git a/src/api/resources/event/types/Param.ts b/src/api/types/Param.ts similarity index 100% rename from src/api/resources/event/types/Param.ts rename to src/api/types/Param.ts diff --git a/src/api/resources/event/types/ProviderOverride.ts b/src/api/types/ProviderOverride.ts similarity index 100% rename from src/api/resources/event/types/ProviderOverride.ts rename to src/api/types/ProviderOverride.ts diff --git a/src/api/resources/event/types/PushOverride.ts b/src/api/types/PushOverride.ts similarity index 100% rename from src/api/resources/event/types/PushOverride.ts rename to src/api/types/PushOverride.ts diff --git a/src/api/resources/event/types/SendEventResponse.ts b/src/api/types/SendEventResponse.ts similarity index 100% rename from src/api/resources/event/types/SendEventResponse.ts rename to src/api/types/SendEventResponse.ts diff --git a/src/api/resources/event/types/SlackMessage.ts b/src/api/types/SlackMessage.ts similarity index 100% rename from src/api/resources/event/types/SlackMessage.ts rename to src/api/types/SlackMessage.ts diff --git a/src/api/resources/event/types/SlackOverride.ts b/src/api/types/SlackOverride.ts similarity index 100% rename from src/api/resources/event/types/SlackOverride.ts rename to src/api/types/SlackOverride.ts diff --git a/src/api/resources/event/types/SmsMessage.ts b/src/api/types/SmsMessage.ts similarity index 100% rename from src/api/resources/event/types/SmsMessage.ts rename to src/api/types/SmsMessage.ts diff --git a/src/api/resources/event/types/SmsOverride.ts b/src/api/types/SmsOverride.ts similarity index 100% rename from src/api/resources/event/types/SmsOverride.ts rename to src/api/types/SmsOverride.ts diff --git a/src/api/resources/event/types/TelegramOverride.ts b/src/api/types/TelegramOverride.ts similarity index 100% rename from src/api/resources/event/types/TelegramOverride.ts rename to src/api/types/TelegramOverride.ts diff --git a/src/api/resources/event/types/User.ts b/src/api/types/User.ts similarity index 100% rename from src/api/resources/event/types/User.ts rename to src/api/types/User.ts diff --git a/src/api/resources/event/types/VoiceOverride.ts b/src/api/types/VoiceOverride.ts similarity index 100% rename from src/api/resources/event/types/VoiceOverride.ts rename to src/api/types/VoiceOverride.ts diff --git a/src/api/resources/event/types/WebhookOverride.ts b/src/api/types/WebhookOverride.ts similarity index 100% rename from src/api/resources/event/types/WebhookOverride.ts rename to src/api/types/WebhookOverride.ts diff --git a/src/api/resources/event/types/WhatsappOverride.ts b/src/api/types/WhatsappOverride.ts similarity index 100% rename from src/api/resources/event/types/WhatsappOverride.ts rename to src/api/types/WhatsappOverride.ts diff --git a/src/api/resources/event/types/index.ts b/src/api/types/index.ts similarity index 100% rename from src/api/resources/event/types/index.ts rename to src/api/types/index.ts diff --git a/src/serialization/resources/event/client/index.ts b/src/serialization/client/index.ts similarity index 100% rename from src/serialization/resources/event/client/index.ts rename to src/serialization/client/index.ts diff --git a/src/serialization/resources/event/client/requests/BulkSendEventRequest.ts b/src/serialization/client/requests/BulkSendEventRequest.ts similarity index 79% rename from src/serialization/resources/event/client/requests/BulkSendEventRequest.ts rename to src/serialization/client/requests/BulkSendEventRequest.ts index 7162695..ed58912 100644 --- a/src/serialization/resources/event/client/requests/BulkSendEventRequest.ts +++ b/src/serialization/client/requests/BulkSendEventRequest.ts @@ -2,16 +2,16 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../../.."; +import * as serializers from "../.."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../../core"; +import * as core from "../../../core"; export const BulkSendEventRequest: core.serialization.Schema< serializers.BulkSendEventRequest.Raw, Omit > = core.serialization.object({ event: core.serialization.string(), - batch: core.serialization.list(core.serialization.lazyObject(async () => (await import("../../../..")).BatchEvent)), + batch: core.serialization.list(core.serialization.lazyObject(async () => (await import("../..")).BatchEvent)), }); export declare namespace BulkSendEventRequest { diff --git a/src/serialization/resources/event/client/requests/SendEventRequest.ts b/src/serialization/client/requests/SendEventRequest.ts similarity index 83% rename from src/serialization/resources/event/client/requests/SendEventRequest.ts rename to src/serialization/client/requests/SendEventRequest.ts index dd9e0d1..45d7e0b 100644 --- a/src/serialization/resources/event/client/requests/SendEventRequest.ts +++ b/src/serialization/client/requests/SendEventRequest.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../../.."; +import * as serializers from "../.."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../../core"; +import * as core from "../../../core"; export const SendEventRequest: core.serialization.Schema< serializers.SendEventRequest.Raw, @@ -12,9 +12,9 @@ export const SendEventRequest: core.serialization.Schema< > = core.serialization.object({ event: core.serialization.string(), data: core.serialization.record(core.serialization.string(), core.serialization.unknown()), - user: core.serialization.lazyObject(async () => (await import("../../../..")).User).optional(), + user: core.serialization.lazyObject(async () => (await import("../..")).User).optional(), scheduleAt: core.serialization.number().optional(), - override: core.serialization.lazyObject(async () => (await import("../../../..")).EventOverride).optional(), + override: core.serialization.lazyObject(async () => (await import("../..")).EventOverride).optional(), }); export declare namespace SendEventRequest { diff --git a/src/serialization/resources/event/client/requests/index.ts b/src/serialization/client/requests/index.ts similarity index 100% rename from src/serialization/resources/event/client/requests/index.ts rename to src/serialization/client/requests/index.ts diff --git a/src/serialization/index.ts b/src/serialization/index.ts index 3e5335f..d3c5080 100644 --- a/src/serialization/index.ts +++ b/src/serialization/index.ts @@ -1 +1,3 @@ export * from "./resources"; +export * from "./types"; +export * from "./client"; diff --git a/src/serialization/resources/event/index.ts b/src/serialization/resources/event/index.ts deleted file mode 100644 index c9240f8..0000000 --- a/src/serialization/resources/event/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./types"; -export * from "./client"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index b65e776..eba2913 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,10 +1,7 @@ export * as device from "./device"; export * from "./device/types"; -export * as event from "./event"; -export * from "./event/types"; export * as ids from "./ids"; export * from "./ids/types"; export * as user from "./user"; export * from "./user/types"; -export * from "./event/client/requests"; export * from "./user/client/requests"; diff --git a/src/serialization/resources/event/types/Attachment.ts b/src/serialization/types/Attachment.ts similarity index 87% rename from src/serialization/resources/event/types/Attachment.ts rename to src/serialization/types/Attachment.ts index c046b68..0403878 100644 --- a/src/serialization/resources/event/types/Attachment.ts +++ b/src/serialization/types/Attachment.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const Attachment: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/resources/event/types/BatchEvent.ts b/src/serialization/types/BatchEvent.ts similarity index 80% rename from src/serialization/resources/event/types/BatchEvent.ts rename to src/serialization/types/BatchEvent.ts index 6e54ff1..35edc0b 100644 --- a/src/serialization/resources/event/types/BatchEvent.ts +++ b/src/serialization/types/BatchEvent.ts @@ -2,15 +2,15 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const BatchEvent: core.serialization.ObjectSchema = core.serialization.object({ data: core.serialization.record(core.serialization.string(), core.serialization.unknown()), - user: core.serialization.lazyObject(async () => (await import("../../..")).User).optional(), - override: core.serialization.lazyObject(async () => (await import("../../..")).EventOverride).optional(), + user: core.serialization.lazyObject(async () => (await import("..")).User).optional(), + override: core.serialization.lazyObject(async () => (await import("..")).EventOverride).optional(), }); export declare namespace BatchEvent { diff --git a/src/serialization/resources/event/types/ChannelOverride.ts b/src/serialization/types/ChannelOverride.ts similarity index 85% rename from src/serialization/resources/event/types/ChannelOverride.ts rename to src/serialization/types/ChannelOverride.ts index 730f36a..d712e8c 100644 --- a/src/serialization/resources/event/types/ChannelOverride.ts +++ b/src/serialization/types/ChannelOverride.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const ChannelOverride: core.serialization.ObjectSchema< serializers.ChannelOverride.Raw, diff --git a/src/serialization/resources/event/types/EmailMessage.ts b/src/serialization/types/EmailMessage.ts similarity index 87% rename from src/serialization/resources/event/types/EmailMessage.ts rename to src/serialization/types/EmailMessage.ts index 2345054..d2c1284 100644 --- a/src/serialization/resources/event/types/EmailMessage.ts +++ b/src/serialization/types/EmailMessage.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const EmailMessage: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/resources/event/types/EmailOverride.ts b/src/serialization/types/EmailOverride.ts similarity index 71% rename from src/serialization/resources/event/types/EmailOverride.ts rename to src/serialization/types/EmailOverride.ts index 5d54301..921c41c 100644 --- a/src/serialization/resources/event/types/EmailOverride.ts +++ b/src/serialization/types/EmailOverride.ts @@ -2,26 +2,24 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const EmailOverride: core.serialization.ObjectSchema = core.serialization .object({ - from: core.serialization.lazyObject(async () => (await import("../../..")).EmailRecipient), - cc: core.serialization.list( - core.serialization.lazyObject(async () => (await import("../../..")).EmailRecipient) - ), + from: core.serialization.lazyObject(async () => (await import("..")).EmailRecipient), + cc: core.serialization.list(core.serialization.lazyObject(async () => (await import("..")).EmailRecipient)), bcc: core.serialization.list( - core.serialization.lazyObject(async () => (await import("../../..")).EmailRecipient) + core.serialization.lazyObject(async () => (await import("..")).EmailRecipient) ), attachments: core.serialization.list( - core.serialization.lazyObject(async () => (await import("../../..")).Attachment) + core.serialization.lazyObject(async () => (await import("..")).Attachment) ), - message: core.serialization.lazyObject(async () => (await import("../../..")).EmailMessage), + message: core.serialization.lazyObject(async () => (await import("..")).EmailMessage), }) - .extend(core.serialization.lazyObject(async () => (await import("../../..")).ChannelOverride)); + .extend(core.serialization.lazyObject(async () => (await import("..")).ChannelOverride)); export declare namespace EmailOverride { interface Raw extends serializers.ChannelOverride.Raw { diff --git a/src/serialization/resources/event/types/EmailRecipient.ts b/src/serialization/types/EmailRecipient.ts similarity index 85% rename from src/serialization/resources/event/types/EmailRecipient.ts rename to src/serialization/types/EmailRecipient.ts index fa16068..78e09e8 100644 --- a/src/serialization/resources/event/types/EmailRecipient.ts +++ b/src/serialization/types/EmailRecipient.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const EmailRecipient: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/resources/event/types/EventNotFoundErrorBody.ts b/src/serialization/types/EventNotFoundErrorBody.ts similarity index 86% rename from src/serialization/resources/event/types/EventNotFoundErrorBody.ts rename to src/serialization/types/EventNotFoundErrorBody.ts index 2945dbc..76543b2 100644 --- a/src/serialization/resources/event/types/EventNotFoundErrorBody.ts +++ b/src/serialization/types/EventNotFoundErrorBody.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const EventNotFoundErrorBody: core.serialization.ObjectSchema< serializers.EventNotFoundErrorBody.Raw, diff --git a/src/serialization/resources/event/types/EventOverride.ts b/src/serialization/types/EventOverride.ts similarity index 75% rename from src/serialization/resources/event/types/EventOverride.ts rename to src/serialization/types/EventOverride.ts index fa89567..9d0b835 100644 --- a/src/serialization/resources/event/types/EventOverride.ts +++ b/src/serialization/types/EventOverride.ts @@ -2,27 +2,27 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const EventOverride: core.serialization.ObjectSchema = core.serialization.object({ - email: core.serialization.lazyObject(async () => (await import("../../..")).EmailOverride).optional(), - sms: core.serialization.lazyObject(async () => (await import("../../..")).SmsOverride).optional(), - whatsapp: core.serialization.lazyObject(async () => (await import("../../..")).WhatsappOverride).optional(), - push: core.serialization.lazyObject(async () => (await import("../../..")).PushOverride).optional(), - webhook: core.serialization.lazyObject(async () => (await import("../../..")).WebhookOverride).optional(), - voice: core.serialization.lazyObject(async () => (await import("../../..")).VoiceOverride).optional(), - slack: core.serialization.lazyObject(async () => (await import("../../..")).SlackOverride).optional(), + email: core.serialization.lazyObject(async () => (await import("..")).EmailOverride).optional(), + sms: core.serialization.lazyObject(async () => (await import("..")).SmsOverride).optional(), + whatsapp: core.serialization.lazyObject(async () => (await import("..")).WhatsappOverride).optional(), + push: core.serialization.lazyObject(async () => (await import("..")).PushOverride).optional(), + webhook: core.serialization.lazyObject(async () => (await import("..")).WebhookOverride).optional(), + voice: core.serialization.lazyObject(async () => (await import("..")).VoiceOverride).optional(), + slack: core.serialization.lazyObject(async () => (await import("..")).SlackOverride).optional(), inApp: core.serialization.property( "in_app", - core.serialization.lazyObject(async () => (await import("../../..")).InAppOverride).optional() + core.serialization.lazyObject(async () => (await import("..")).InAppOverride).optional() ), - telegram: core.serialization.lazyObject(async () => (await import("../../..")).TelegramOverride).optional(), + telegram: core.serialization.lazyObject(async () => (await import("..")).TelegramOverride).optional(), providers: core.serialization.record( core.serialization.string(), - core.serialization.lazyObject(async () => (await import("../../..")).ProviderOverride) + core.serialization.lazyObject(async () => (await import("..")).ProviderOverride) ), }); diff --git a/src/serialization/resources/event/types/InAppOverride.ts b/src/serialization/types/InAppOverride.ts similarity index 78% rename from src/serialization/resources/event/types/InAppOverride.ts rename to src/serialization/types/InAppOverride.ts index ba003df..3a1f81b 100644 --- a/src/serialization/resources/event/types/InAppOverride.ts +++ b/src/serialization/types/InAppOverride.ts @@ -2,14 +2,14 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const InAppOverride: core.serialization.ObjectSchema = core.serialization .object({}) - .extend(core.serialization.lazyObject(async () => (await import("../../..")).ChannelOverride)); + .extend(core.serialization.lazyObject(async () => (await import("..")).ChannelOverride)); export declare namespace InAppOverride { interface Raw extends serializers.ChannelOverride.Raw {} diff --git a/src/serialization/resources/event/types/Param.ts b/src/serialization/types/Param.ts similarity index 83% rename from src/serialization/resources/event/types/Param.ts rename to src/serialization/types/Param.ts index 1eb9572..55301f4 100644 --- a/src/serialization/resources/event/types/Param.ts +++ b/src/serialization/types/Param.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const Param: core.serialization.ObjectSchema = core.serialization.object({ name: core.serialization.string(), diff --git a/src/serialization/resources/event/types/ProviderOverride.ts b/src/serialization/types/ProviderOverride.ts similarity index 81% rename from src/serialization/resources/event/types/ProviderOverride.ts rename to src/serialization/types/ProviderOverride.ts index 0699c3d..c4801a5 100644 --- a/src/serialization/resources/event/types/ProviderOverride.ts +++ b/src/serialization/types/ProviderOverride.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const ProviderOverride: core.serialization.ObjectSchema< serializers.ProviderOverride.Raw, @@ -13,17 +13,17 @@ export const ProviderOverride: core.serialization.ObjectSchema< payload: core.serialization.record(core.serialization.string(), core.serialization.unknown()), formParams: core.serialization.property( "form_params", - core.serialization.list(core.serialization.lazyObject(async () => (await import("../../..")).Param)) + core.serialization.list(core.serialization.lazyObject(async () => (await import("..")).Param)) ), queryParams: core.serialization.property( "query_params", - core.serialization.list(core.serialization.lazyObject(async () => (await import("../../..")).Param)) + core.serialization.list(core.serialization.lazyObject(async () => (await import("..")).Param)) ), pathParams: core.serialization.property( "path_params", - core.serialization.list(core.serialization.lazyObject(async () => (await import("../../..")).Param)) + core.serialization.list(core.serialization.lazyObject(async () => (await import("..")).Param)) ), - headers: core.serialization.list(core.serialization.lazyObject(async () => (await import("../../..")).Param)), + headers: core.serialization.list(core.serialization.lazyObject(async () => (await import("..")).Param)), }); export declare namespace ProviderOverride { diff --git a/src/serialization/resources/event/types/PushOverride.ts b/src/serialization/types/PushOverride.ts similarity index 78% rename from src/serialization/resources/event/types/PushOverride.ts rename to src/serialization/types/PushOverride.ts index 2a188f7..6945d0f 100644 --- a/src/serialization/resources/event/types/PushOverride.ts +++ b/src/serialization/types/PushOverride.ts @@ -2,14 +2,14 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const PushOverride: core.serialization.ObjectSchema = core.serialization .object({}) - .extend(core.serialization.lazyObject(async () => (await import("../../..")).ChannelOverride)); + .extend(core.serialization.lazyObject(async () => (await import("..")).ChannelOverride)); export declare namespace PushOverride { interface Raw extends serializers.ChannelOverride.Raw {} diff --git a/src/serialization/resources/event/types/SendEventResponse.ts b/src/serialization/types/SendEventResponse.ts similarity index 73% rename from src/serialization/resources/event/types/SendEventResponse.ts rename to src/serialization/types/SendEventResponse.ts index 19bc140..6c2c035 100644 --- a/src/serialization/resources/event/types/SendEventResponse.ts +++ b/src/serialization/types/SendEventResponse.ts @@ -2,15 +2,15 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const SendEventResponse: core.serialization.ObjectSchema< serializers.SendEventResponse.Raw, RavenApi.SendEventResponse > = core.serialization.object({ - id: core.serialization.lazy(async () => (await import("../../..")).RequestId), + id: core.serialization.lazy(async () => (await import("..")).RequestId), success: core.serialization.boolean(), }); diff --git a/src/serialization/resources/event/types/SlackMessage.ts b/src/serialization/types/SlackMessage.ts similarity index 85% rename from src/serialization/resources/event/types/SlackMessage.ts rename to src/serialization/types/SlackMessage.ts index 727f2a7..cee2224 100644 --- a/src/serialization/resources/event/types/SlackMessage.ts +++ b/src/serialization/types/SlackMessage.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const SlackMessage: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/resources/event/types/SlackOverride.ts b/src/serialization/types/SlackOverride.ts similarity index 77% rename from src/serialization/resources/event/types/SlackOverride.ts rename to src/serialization/types/SlackOverride.ts index 73a6025..05dc320 100644 --- a/src/serialization/resources/event/types/SlackOverride.ts +++ b/src/serialization/types/SlackOverride.ts @@ -2,16 +2,16 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const SlackOverride: core.serialization.ObjectSchema = core.serialization .object({ - message: core.serialization.lazyObject(async () => (await import("../../..")).SlackMessage), + message: core.serialization.lazyObject(async () => (await import("..")).SlackMessage), }) - .extend(core.serialization.lazyObject(async () => (await import("../../..")).ChannelOverride)); + .extend(core.serialization.lazyObject(async () => (await import("..")).ChannelOverride)); export declare namespace SlackOverride { interface Raw extends serializers.ChannelOverride.Raw { diff --git a/src/serialization/resources/event/types/SmsMessage.ts b/src/serialization/types/SmsMessage.ts similarity index 82% rename from src/serialization/resources/event/types/SmsMessage.ts rename to src/serialization/types/SmsMessage.ts index 79a5b2b..37ed330 100644 --- a/src/serialization/resources/event/types/SmsMessage.ts +++ b/src/serialization/types/SmsMessage.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const SmsMessage: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/resources/event/types/SmsOverride.ts b/src/serialization/types/SmsOverride.ts similarity index 79% rename from src/serialization/resources/event/types/SmsOverride.ts rename to src/serialization/types/SmsOverride.ts index d4a290d..8a54403 100644 --- a/src/serialization/resources/event/types/SmsOverride.ts +++ b/src/serialization/types/SmsOverride.ts @@ -2,17 +2,17 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const SmsOverride: core.serialization.ObjectSchema = core.serialization .object({ sender: core.serialization.string(), - message: core.serialization.lazyObject(async () => (await import("../../..")).SmsMessage), + message: core.serialization.lazyObject(async () => (await import("..")).SmsMessage), }) - .extend(core.serialization.lazyObject(async () => (await import("../../..")).ChannelOverride)); + .extend(core.serialization.lazyObject(async () => (await import("..")).ChannelOverride)); export declare namespace SmsOverride { interface Raw extends serializers.ChannelOverride.Raw { diff --git a/src/serialization/resources/event/types/TelegramOverride.ts b/src/serialization/types/TelegramOverride.ts similarity index 79% rename from src/serialization/resources/event/types/TelegramOverride.ts rename to src/serialization/types/TelegramOverride.ts index 7092732..e6500f2 100644 --- a/src/serialization/resources/event/types/TelegramOverride.ts +++ b/src/serialization/types/TelegramOverride.ts @@ -2,16 +2,16 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const TelegramOverride: core.serialization.ObjectSchema< serializers.TelegramOverride.Raw, RavenApi.TelegramOverride > = core.serialization .object({}) - .extend(core.serialization.lazyObject(async () => (await import("../../..")).ChannelOverride)); + .extend(core.serialization.lazyObject(async () => (await import("..")).ChannelOverride)); export declare namespace TelegramOverride { interface Raw extends serializers.ChannelOverride.Raw {} diff --git a/src/serialization/resources/event/types/User.ts b/src/serialization/types/User.ts similarity index 88% rename from src/serialization/resources/event/types/User.ts rename to src/serialization/types/User.ts index 05799e1..7817131 100644 --- a/src/serialization/resources/event/types/User.ts +++ b/src/serialization/types/User.ts @@ -2,14 +2,14 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const User: core.serialization.ObjectSchema = core.serialization.object({ userId: core.serialization.property( "user_id", - core.serialization.lazy(async () => (await import("../../..")).UserId).optional() + core.serialization.lazy(async () => (await import("..")).UserId).optional() ), email: core.serialization.string().optional(), mobile: core.serialization.string().optional(), @@ -27,8 +27,8 @@ export const User: core.serialization.ObjectSchema (await import("../../..")).SlackProfile).optional(), - telegram: core.serialization.lazyObject(async () => (await import("../../..")).TelegramProfile).optional(), + slack: core.serialization.lazyObject(async () => (await import("..")).SlackProfile).optional(), + telegram: core.serialization.lazyObject(async () => (await import("..")).TelegramProfile).optional(), fcmTopic: core.serialization.property("fcm_topic", core.serialization.string().optional()), fcmDeviceGroup: core.serialization.property("fcm_device_group", core.serialization.string().optional()), }); diff --git a/src/serialization/resources/event/types/VoiceOverride.ts b/src/serialization/types/VoiceOverride.ts similarity index 78% rename from src/serialization/resources/event/types/VoiceOverride.ts rename to src/serialization/types/VoiceOverride.ts index d7d120e..6770c69 100644 --- a/src/serialization/resources/event/types/VoiceOverride.ts +++ b/src/serialization/types/VoiceOverride.ts @@ -2,14 +2,14 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const VoiceOverride: core.serialization.ObjectSchema = core.serialization .object({}) - .extend(core.serialization.lazyObject(async () => (await import("../../..")).ChannelOverride)); + .extend(core.serialization.lazyObject(async () => (await import("..")).ChannelOverride)); export declare namespace VoiceOverride { interface Raw extends serializers.ChannelOverride.Raw {} diff --git a/src/serialization/resources/event/types/WebhookOverride.ts b/src/serialization/types/WebhookOverride.ts similarity index 79% rename from src/serialization/resources/event/types/WebhookOverride.ts rename to src/serialization/types/WebhookOverride.ts index 922d6e7..07493f4 100644 --- a/src/serialization/resources/event/types/WebhookOverride.ts +++ b/src/serialization/types/WebhookOverride.ts @@ -2,16 +2,16 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const WebhookOverride: core.serialization.ObjectSchema< serializers.WebhookOverride.Raw, RavenApi.WebhookOverride > = core.serialization .object({}) - .extend(core.serialization.lazyObject(async () => (await import("../../..")).ChannelOverride)); + .extend(core.serialization.lazyObject(async () => (await import("..")).ChannelOverride)); export declare namespace WebhookOverride { interface Raw extends serializers.ChannelOverride.Raw {} diff --git a/src/serialization/resources/event/types/WhatsappOverride.ts b/src/serialization/types/WhatsappOverride.ts similarity index 79% rename from src/serialization/resources/event/types/WhatsappOverride.ts rename to src/serialization/types/WhatsappOverride.ts index 0d30f59..da15d05 100644 --- a/src/serialization/resources/event/types/WhatsappOverride.ts +++ b/src/serialization/types/WhatsappOverride.ts @@ -2,18 +2,18 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../../.."; +import * as serializers from ".."; import { RavenApi } from "@ravenapp/raven"; -import * as core from "../../../../core"; +import * as core from "../../core"; export const WhatsappOverride: core.serialization.ObjectSchema< serializers.WhatsappOverride.Raw, RavenApi.WhatsappOverride > = core.serialization .object({ - message: core.serialization.lazyObject(async () => (await import("../../..")).SmsMessage), + message: core.serialization.lazyObject(async () => (await import("..")).SmsMessage), }) - .extend(core.serialization.lazyObject(async () => (await import("../../..")).ChannelOverride)); + .extend(core.serialization.lazyObject(async () => (await import("..")).ChannelOverride)); export declare namespace WhatsappOverride { interface Raw extends serializers.ChannelOverride.Raw { diff --git a/src/serialization/resources/event/types/index.ts b/src/serialization/types/index.ts similarity index 100% rename from src/serialization/resources/event/types/index.ts rename to src/serialization/types/index.ts