FRE-709: Document duplicate recovery wake - FRE-635 already recovered via FRE-708
This commit is contained in:
110
node_modules/svix/src/HttpErrors.ts
generated
vendored
Normal file
110
node_modules/svix/src/HttpErrors.ts
generated
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
export class HttpErrorOut {
|
||||
code!: string;
|
||||
detail!: string;
|
||||
|
||||
static readonly discriminator: string | undefined = undefined;
|
||||
|
||||
static readonly mapping: { [index: string]: string } | undefined = undefined;
|
||||
|
||||
static readonly attributeTypeMap: Array<{
|
||||
name: string;
|
||||
baseName: string;
|
||||
type: string;
|
||||
format: string;
|
||||
}> = [
|
||||
{
|
||||
name: "code",
|
||||
baseName: "code",
|
||||
type: "string",
|
||||
format: "",
|
||||
},
|
||||
{
|
||||
name: "detail",
|
||||
baseName: "detail",
|
||||
type: "string",
|
||||
format: "",
|
||||
},
|
||||
];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return HttpErrorOut.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validation errors have their own schema to provide context for invalid requests eg. mismatched types and out of bounds values. There may be any number of these per 422 UNPROCESSABLE ENTITY error.
|
||||
*/
|
||||
export class ValidationError {
|
||||
/**
|
||||
* The location as a [`Vec`] of [`String`]s -- often in the form `[\"body\", \"field_name\"]`, `[\"query\", \"field_name\"]`, etc. They may, however, be arbitrarily deep.
|
||||
*/
|
||||
loc!: Array<string>;
|
||||
/**
|
||||
* The message accompanying the validation error item.
|
||||
*/
|
||||
msg!: string;
|
||||
/**
|
||||
* The type of error, often \"type_error\" or \"value_error\", but sometimes with more context like as \"value_error.number.not_ge\"
|
||||
*/
|
||||
type!: string;
|
||||
|
||||
static readonly discriminator: string | undefined = undefined;
|
||||
|
||||
static readonly mapping: { [index: string]: string } | undefined = undefined;
|
||||
|
||||
static readonly attributeTypeMap: Array<{
|
||||
name: string;
|
||||
baseName: string;
|
||||
type: string;
|
||||
format: string;
|
||||
}> = [
|
||||
{
|
||||
name: "loc",
|
||||
baseName: "loc",
|
||||
type: "Array<string>",
|
||||
format: "",
|
||||
},
|
||||
{
|
||||
name: "msg",
|
||||
baseName: "msg",
|
||||
type: "string",
|
||||
format: "",
|
||||
},
|
||||
{
|
||||
name: "type",
|
||||
baseName: "type",
|
||||
type: "string",
|
||||
format: "",
|
||||
},
|
||||
];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return ValidationError.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
||||
export class HTTPValidationError {
|
||||
detail!: Array<ValidationError>;
|
||||
|
||||
static readonly discriminator: string | undefined = undefined;
|
||||
|
||||
static readonly mapping: { [index: string]: string } | undefined = undefined;
|
||||
|
||||
static readonly attributeTypeMap: Array<{
|
||||
name: string;
|
||||
baseName: string;
|
||||
type: string;
|
||||
format: string;
|
||||
}> = [
|
||||
{
|
||||
name: "detail",
|
||||
baseName: "detail",
|
||||
type: "Array<ValidationError>",
|
||||
format: "",
|
||||
},
|
||||
];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return HTTPValidationError.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
64
node_modules/svix/src/KitchenSink.test.ts
generated
vendored
Normal file
64
node_modules/svix/src/KitchenSink.test.ts
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
import { Svix } from ".";
|
||||
import type { HttpErrorOut } from "./HttpErrors";
|
||||
import type { ApiException } from "./util";
|
||||
import { test } from "node:test";
|
||||
import { strict as assert } from "node:assert/strict";
|
||||
|
||||
function getTestClient(): Svix | null {
|
||||
const token = process.env.SVIX_TOKEN;
|
||||
const serverUrl = process.env.SVIX_SERVER_URL;
|
||||
if (!token || !serverUrl) {
|
||||
console.warn(
|
||||
"Unable to construct test client: `SVIX_TOKEN` or `SVIX_SERVER_URL` unset."
|
||||
);
|
||||
return null;
|
||||
}
|
||||
return new Svix(token, { serverUrl });
|
||||
}
|
||||
const client = getTestClient();
|
||||
|
||||
// Auto-skip tests in this module if we don't have a test client to work with.
|
||||
test("e2e tests", { skip: client === null }, async (t) => {
|
||||
await t.test("endpoint crud", async () => {
|
||||
if (client === null || client === undefined) {
|
||||
throw new Error("unreachable");
|
||||
}
|
||||
|
||||
const appOut = await client.application.create({ name: "App" });
|
||||
try {
|
||||
await client.eventType.create({
|
||||
name: "event.started",
|
||||
description: "Something started",
|
||||
});
|
||||
} catch (e) {
|
||||
// Conflicts are expected from test run to test run, but other statuses are not.
|
||||
assert.deepEqual((e as ApiException<HttpErrorOut>).code, 409);
|
||||
}
|
||||
try {
|
||||
await client.eventType.create({
|
||||
name: "event.ended",
|
||||
description: "Something ended",
|
||||
});
|
||||
} catch (e) {
|
||||
// Conflicts are expected from test run to test run, but other statuses are not.
|
||||
assert.deepEqual((e as ApiException<HttpErrorOut>).code, 409);
|
||||
}
|
||||
|
||||
const epOut = await client.endpoint.create(appOut.id, {
|
||||
url: "https://example.svix.com/",
|
||||
channels: ["ch0", "ch1"],
|
||||
});
|
||||
assert.deepEqual(epOut.channels?.sort(), ["ch0", "ch1"]);
|
||||
assert.deepEqual(epOut.filterTypes || [], []);
|
||||
|
||||
const epPatched = await client.endpoint.patch(appOut.id, epOut.id, {
|
||||
filterTypes: ["event.started", "event.ended"],
|
||||
});
|
||||
|
||||
assert.deepEqual(epPatched.channels?.sort(), ["ch0", "ch1"]);
|
||||
assert.deepEqual(epPatched.filterTypes?.sort(), ["event.ended", "event.started"]);
|
||||
|
||||
// Should not throw an error while trying to deserialize the empty body.
|
||||
await client.endpoint.delete(appOut.id, epOut.id);
|
||||
});
|
||||
});
|
||||
123
node_modules/svix/src/api/application.ts
generated
vendored
Normal file
123
node_modules/svix/src/api/application.ts
generated
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
// this file is @generated
|
||||
|
||||
import { type ApplicationIn, ApplicationInSerializer } from "../models/applicationIn";
|
||||
import { type ApplicationOut, ApplicationOutSerializer } from "../models/applicationOut";
|
||||
import {
|
||||
type ApplicationPatch,
|
||||
ApplicationPatchSerializer,
|
||||
} from "../models/applicationPatch";
|
||||
import {
|
||||
type ListResponseApplicationOut,
|
||||
ListResponseApplicationOutSerializer,
|
||||
} from "../models/listResponseApplicationOut";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface ApplicationListOptions {
|
||||
/** Exclude applications that have no endpoints. Default is false. */
|
||||
excludeAppsWithNoEndpoints?: boolean;
|
||||
/** Exclude applications that have only disabled endpoints. Default is false. */
|
||||
excludeAppsWithDisabledEndpoints?: boolean;
|
||||
excludeAppsWithSvixPlayEndpoints?: boolean;
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
}
|
||||
|
||||
export interface ApplicationCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class Application {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** List of all the organization's applications. */
|
||||
public list(options?: ApplicationListOptions): Promise<ListResponseApplicationOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/app");
|
||||
|
||||
request.setQueryParams({
|
||||
exclude_apps_with_no_endpoints: options?.excludeAppsWithNoEndpoints,
|
||||
exclude_apps_with_disabled_endpoints: options?.excludeAppsWithDisabledEndpoints,
|
||||
exclude_apps_with_svix_play_endpoints: options?.excludeAppsWithSvixPlayEndpoints,
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseApplicationOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Create a new application. */
|
||||
public create(
|
||||
applicationIn: ApplicationIn,
|
||||
options?: ApplicationCreateOptions
|
||||
): Promise<ApplicationOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/app");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(ApplicationInSerializer._toJsonObject(applicationIn));
|
||||
|
||||
return request.send(this.requestCtx, ApplicationOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get the application with the UID from `applicationIn`, or create it if it doesn't exist yet. */
|
||||
public getOrCreate(
|
||||
applicationIn: ApplicationIn,
|
||||
options?: ApplicationCreateOptions
|
||||
): Promise<ApplicationOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/app");
|
||||
|
||||
request.setQueryParam("get_if_exists", true);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(ApplicationInSerializer._toJsonObject(applicationIn));
|
||||
|
||||
return request.send(this.requestCtx, ApplicationOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get an application. */
|
||||
public get(appId: string): Promise<ApplicationOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/app/{app_id}");
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
|
||||
return request.send(this.requestCtx, ApplicationOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Update an application. */
|
||||
public update(appId: string, applicationIn: ApplicationIn): Promise<ApplicationOut> {
|
||||
const request = new SvixRequest(HttpMethod.PUT, "/api/v1/app/{app_id}");
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setBody(ApplicationInSerializer._toJsonObject(applicationIn));
|
||||
|
||||
return request.send(this.requestCtx, ApplicationOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Delete an application. */
|
||||
public delete(appId: string): Promise<void> {
|
||||
const request = new SvixRequest(HttpMethod.DELETE, "/api/v1/app/{app_id}");
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Partially update an application. */
|
||||
public patch(
|
||||
appId: string,
|
||||
applicationPatch: ApplicationPatch
|
||||
): Promise<ApplicationOut> {
|
||||
const request = new SvixRequest(HttpMethod.PATCH, "/api/v1/app/{app_id}");
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setBody(ApplicationPatchSerializer._toJsonObject(applicationPatch));
|
||||
|
||||
return request.send(this.requestCtx, ApplicationOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
218
node_modules/svix/src/api/authentication.ts
generated
vendored
Normal file
218
node_modules/svix/src/api/authentication.ts
generated
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
// this file is @generated
|
||||
|
||||
import { type ApiTokenOut, ApiTokenOutSerializer } from "../models/apiTokenOut";
|
||||
import {
|
||||
type AppPortalAccessIn,
|
||||
AppPortalAccessInSerializer,
|
||||
} from "../models/appPortalAccessIn";
|
||||
import {
|
||||
type AppPortalAccessOut,
|
||||
AppPortalAccessOutSerializer,
|
||||
} from "../models/appPortalAccessOut";
|
||||
import {
|
||||
type ApplicationTokenExpireIn,
|
||||
ApplicationTokenExpireInSerializer,
|
||||
} from "../models/applicationTokenExpireIn";
|
||||
import {
|
||||
type RotatePollerTokenIn,
|
||||
RotatePollerTokenInSerializer,
|
||||
} from "../models/rotatePollerTokenIn";
|
||||
import {
|
||||
type StreamPortalAccessIn,
|
||||
StreamPortalAccessInSerializer,
|
||||
} from "../models/streamPortalAccessIn";
|
||||
import {
|
||||
type StreamTokenExpireIn,
|
||||
StreamTokenExpireInSerializer,
|
||||
} from "../models/streamTokenExpireIn";
|
||||
import {
|
||||
type DashboardAccessOut,
|
||||
DashboardAccessOutSerializer,
|
||||
} from "../models/dashboardAccessOut";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface AuthenticationAppPortalAccessOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface AuthenticationExpireAllOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface AuthenticationLogoutOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface AuthenticationStreamLogoutOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface AuthenticationStreamPortalAccessOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface AuthenticationStreamExpireAllOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface AuthenticationRotateStreamPollerTokenOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export interface AuthenticationDashboardAccessOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class Authentication {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** Use this function to get magic links (and authentication codes) for connecting your users to the Consumer Application Portal. */
|
||||
public appPortalAccess(
|
||||
appId: string,
|
||||
appPortalAccessIn: AppPortalAccessIn,
|
||||
options?: AuthenticationAppPortalAccessOptions
|
||||
): Promise<AppPortalAccessOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/auth/app-portal-access/{app_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(AppPortalAccessInSerializer._toJsonObject(appPortalAccessIn));
|
||||
|
||||
return request.send(this.requestCtx, AppPortalAccessOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Expire all of the tokens associated with a specific application. */
|
||||
public expireAll(
|
||||
appId: string,
|
||||
applicationTokenExpireIn: ApplicationTokenExpireIn,
|
||||
options?: AuthenticationExpireAllOptions
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/auth/app/{app_id}/expire-all"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(
|
||||
ApplicationTokenExpireInSerializer._toJsonObject(applicationTokenExpireIn)
|
||||
);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** @deprecated Please use `appPortalAccess` instead. */
|
||||
public dashboardAccess(
|
||||
appId: string,
|
||||
options?: AuthenticationDashboardAccessOptions
|
||||
): Promise<DashboardAccessOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/auth/dashboard-access/{app_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
|
||||
return request.send(this.requestCtx, DashboardAccessOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logout an app token.
|
||||
*
|
||||
* Trying to log out other tokens will fail.
|
||||
*/
|
||||
public logout(options?: AuthenticationLogoutOptions): Promise<void> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/auth/logout");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logout a stream token.
|
||||
*
|
||||
* Trying to log out other tokens will fail.
|
||||
*/
|
||||
public streamLogout(options?: AuthenticationStreamLogoutOptions): Promise<void> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/auth/stream-logout");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Use this function to get magic links (and authentication codes) for connecting your users to the Stream Consumer Portal. */
|
||||
public streamPortalAccess(
|
||||
streamId: string,
|
||||
streamPortalAccessIn: StreamPortalAccessIn,
|
||||
options?: AuthenticationStreamPortalAccessOptions
|
||||
): Promise<AppPortalAccessOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/auth/stream-portal-access/{stream_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(StreamPortalAccessInSerializer._toJsonObject(streamPortalAccessIn));
|
||||
|
||||
return request.send(this.requestCtx, AppPortalAccessOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Expire all of the tokens associated with a specific stream. */
|
||||
public streamExpireAll(
|
||||
streamId: string,
|
||||
streamTokenExpireIn: StreamTokenExpireIn,
|
||||
options?: AuthenticationStreamExpireAllOptions
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/auth/stream/{stream_id}/expire-all"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(StreamTokenExpireInSerializer._toJsonObject(streamTokenExpireIn));
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Get the current auth token for the stream poller. */
|
||||
public getStreamPollerToken(streamId: string, sinkId: string): Promise<ApiTokenOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
|
||||
return request.send(this.requestCtx, ApiTokenOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Create a new auth token for the stream poller API. */
|
||||
public rotateStreamPollerToken(
|
||||
streamId: string,
|
||||
sinkId: string,
|
||||
rotatePollerTokenIn: RotatePollerTokenIn,
|
||||
options?: AuthenticationRotateStreamPollerTokenOptions
|
||||
): Promise<ApiTokenOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(RotatePollerTokenInSerializer._toJsonObject(rotatePollerTokenIn));
|
||||
|
||||
return request.send(this.requestCtx, ApiTokenOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
71
node_modules/svix/src/api/backgroundTask.ts
generated
vendored
Normal file
71
node_modules/svix/src/api/backgroundTask.ts
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type BackgroundTaskOut,
|
||||
BackgroundTaskOutSerializer,
|
||||
} from "../models/backgroundTaskOut";
|
||||
import type { BackgroundTaskStatus } from "../models/backgroundTaskStatus";
|
||||
import type { BackgroundTaskType } from "../models/backgroundTaskType";
|
||||
import {
|
||||
type ListResponseBackgroundTaskOut,
|
||||
ListResponseBackgroundTaskOutSerializer,
|
||||
} from "../models/listResponseBackgroundTaskOut";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface BackgroundTaskListOptions {
|
||||
/** Filter the response based on the status. */
|
||||
status?: BackgroundTaskStatus;
|
||||
/** Filter the response based on the type. */
|
||||
task?: BackgroundTaskType;
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
}
|
||||
|
||||
export class BackgroundTask {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** List background tasks executed in the past 90 days. */
|
||||
public list(
|
||||
options?: BackgroundTaskListOptions
|
||||
): Promise<ListResponseBackgroundTaskOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/background-task");
|
||||
|
||||
request.setQueryParams({
|
||||
status: options?.status,
|
||||
task: options?.task,
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseBackgroundTaskOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* List background tasks executed in the past 90 days.
|
||||
*
|
||||
* @deprecated Use list instead.
|
||||
* */
|
||||
public listByEndpoint(
|
||||
options?: BackgroundTaskListOptions
|
||||
): Promise<ListResponseBackgroundTaskOut> {
|
||||
return this.list(options);
|
||||
}
|
||||
|
||||
/** Get a background task by ID. */
|
||||
public get(taskId: string): Promise<BackgroundTaskOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/background-task/{task_id}");
|
||||
|
||||
request.setPathParam("task_id", taskId);
|
||||
|
||||
return request.send(this.requestCtx, BackgroundTaskOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
111
node_modules/svix/src/api/connector.ts
generated
vendored
Normal file
111
node_modules/svix/src/api/connector.ts
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
// this file is @generated
|
||||
|
||||
import { type ConnectorIn, ConnectorInSerializer } from "../models/connectorIn";
|
||||
import { type ConnectorOut, ConnectorOutSerializer } from "../models/connectorOut";
|
||||
import { type ConnectorPatch, ConnectorPatchSerializer } from "../models/connectorPatch";
|
||||
import type { ConnectorProduct } from "../models/connectorProduct";
|
||||
import {
|
||||
type ConnectorUpdate,
|
||||
ConnectorUpdateSerializer,
|
||||
} from "../models/connectorUpdate";
|
||||
import {
|
||||
type ListResponseConnectorOut,
|
||||
ListResponseConnectorOutSerializer,
|
||||
} from "../models/listResponseConnectorOut";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface ConnectorListOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
productType?: ConnectorProduct;
|
||||
}
|
||||
|
||||
export interface ConnectorCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class Connector {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** List all connectors for an application. */
|
||||
public list(options?: ConnectorListOptions): Promise<ListResponseConnectorOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/connector");
|
||||
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
product_type: options?.productType,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseConnectorOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Create a new connector. */
|
||||
public create(
|
||||
connectorIn: ConnectorIn,
|
||||
options?: ConnectorCreateOptions
|
||||
): Promise<ConnectorOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/connector");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(ConnectorInSerializer._toJsonObject(connectorIn));
|
||||
|
||||
return request.send(this.requestCtx, ConnectorOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get a connector. */
|
||||
public get(connectorId: string): Promise<ConnectorOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/connector/{connector_id}");
|
||||
|
||||
request.setPathParam("connector_id", connectorId);
|
||||
|
||||
return request.send(this.requestCtx, ConnectorOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Update a connector. */
|
||||
public update(
|
||||
connectorId: string,
|
||||
connectorUpdate: ConnectorUpdate
|
||||
): Promise<ConnectorOut> {
|
||||
const request = new SvixRequest(HttpMethod.PUT, "/api/v1/connector/{connector_id}");
|
||||
|
||||
request.setPathParam("connector_id", connectorId);
|
||||
request.setBody(ConnectorUpdateSerializer._toJsonObject(connectorUpdate));
|
||||
|
||||
return request.send(this.requestCtx, ConnectorOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Delete a connector. */
|
||||
public delete(connectorId: string): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.DELETE,
|
||||
"/api/v1/connector/{connector_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("connector_id", connectorId);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Partially update a connector. */
|
||||
public patch(
|
||||
connectorId: string,
|
||||
connectorPatch: ConnectorPatch
|
||||
): Promise<ConnectorOut> {
|
||||
const request = new SvixRequest(HttpMethod.PATCH, "/api/v1/connector/{connector_id}");
|
||||
|
||||
request.setPathParam("connector_id", connectorId);
|
||||
request.setBody(ConnectorPatchSerializer._toJsonObject(connectorPatch));
|
||||
|
||||
return request.send(this.requestCtx, ConnectorOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
522
node_modules/svix/src/api/endpoint.ts
generated
vendored
Normal file
522
node_modules/svix/src/api/endpoint.ts
generated
vendored
Normal file
@@ -0,0 +1,522 @@
|
||||
// this file is @generated
|
||||
|
||||
import { type BulkReplayIn, BulkReplayInSerializer } from "../models/bulkReplayIn";
|
||||
import {
|
||||
type EndpointHeadersIn,
|
||||
EndpointHeadersInSerializer,
|
||||
} from "../models/endpointHeadersIn";
|
||||
import {
|
||||
type EndpointHeadersOut,
|
||||
EndpointHeadersOutSerializer,
|
||||
} from "../models/endpointHeadersOut";
|
||||
import {
|
||||
type EndpointHeadersPatchIn,
|
||||
EndpointHeadersPatchInSerializer,
|
||||
} from "../models/endpointHeadersPatchIn";
|
||||
import { type EndpointIn, EndpointInSerializer } from "../models/endpointIn";
|
||||
import { type EndpointOut, EndpointOutSerializer } from "../models/endpointOut";
|
||||
import { type EndpointPatch, EndpointPatchSerializer } from "../models/endpointPatch";
|
||||
import {
|
||||
type EndpointSecretOut,
|
||||
EndpointSecretOutSerializer,
|
||||
} from "../models/endpointSecretOut";
|
||||
import {
|
||||
type EndpointSecretRotateIn,
|
||||
EndpointSecretRotateInSerializer,
|
||||
} from "../models/endpointSecretRotateIn";
|
||||
import { type EndpointStats, EndpointStatsSerializer } from "../models/endpointStats";
|
||||
import {
|
||||
type EndpointTransformationIn,
|
||||
EndpointTransformationInSerializer,
|
||||
} from "../models/endpointTransformationIn";
|
||||
import {
|
||||
type EndpointTransformationOut,
|
||||
EndpointTransformationOutSerializer,
|
||||
} from "../models/endpointTransformationOut";
|
||||
import {
|
||||
type EndpointTransformationPatch,
|
||||
EndpointTransformationPatchSerializer,
|
||||
} from "../models/endpointTransformationPatch";
|
||||
import { type EndpointUpdate, EndpointUpdateSerializer } from "../models/endpointUpdate";
|
||||
import { type EventExampleIn, EventExampleInSerializer } from "../models/eventExampleIn";
|
||||
import {
|
||||
type ListResponseEndpointOut,
|
||||
ListResponseEndpointOutSerializer,
|
||||
} from "../models/listResponseEndpointOut";
|
||||
import { type MessageOut, MessageOutSerializer } from "../models/messageOut";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import { type RecoverIn, RecoverInSerializer } from "../models/recoverIn";
|
||||
import { type RecoverOut, RecoverOutSerializer } from "../models/recoverOut";
|
||||
import { type ReplayIn, ReplayInSerializer } from "../models/replayIn";
|
||||
import { type ReplayOut, ReplayOutSerializer } from "../models/replayOut";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface EndpointListOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
}
|
||||
|
||||
export interface EndpointCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface EndpointBulkReplayOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface EndpointRecoverOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface EndpointReplayMissingOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface EndpointRotateSecretOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface EndpointSendExampleOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface EndpointGetStatsOptions {
|
||||
/** Filter the range to data starting from this date. */
|
||||
since?: Date | null;
|
||||
/** Filter the range to data ending by this date. */
|
||||
until?: Date | null;
|
||||
}
|
||||
|
||||
export class Endpoint {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** List the application's endpoints. */
|
||||
public list(
|
||||
appId: string,
|
||||
options?: EndpointListOptions
|
||||
): Promise<ListResponseEndpointOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/app/{app_id}/endpoint");
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseEndpointOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new endpoint for the application.
|
||||
*
|
||||
* When `secret` is `null` the secret is automatically generated (recommended).
|
||||
*/
|
||||
public create(
|
||||
appId: string,
|
||||
endpointIn: EndpointIn,
|
||||
options?: EndpointCreateOptions
|
||||
): Promise<EndpointOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/app/{app_id}/endpoint");
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(EndpointInSerializer._toJsonObject(endpointIn));
|
||||
|
||||
return request.send(this.requestCtx, EndpointOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get an endpoint. */
|
||||
public get(appId: string, endpointId: string): Promise<EndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.send(this.requestCtx, EndpointOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Update an endpoint. */
|
||||
public update(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
endpointUpdate: EndpointUpdate
|
||||
): Promise<EndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PUT,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setBody(EndpointUpdateSerializer._toJsonObject(endpointUpdate));
|
||||
|
||||
return request.send(this.requestCtx, EndpointOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Delete an endpoint. */
|
||||
public delete(appId: string, endpointId: string): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.DELETE,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Partially update an endpoint. */
|
||||
public patch(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
endpointPatch: EndpointPatch
|
||||
): Promise<EndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PATCH,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setBody(EndpointPatchSerializer._toJsonObject(endpointPatch));
|
||||
|
||||
return request.send(this.requestCtx, EndpointOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk replay messages sent to the endpoint.
|
||||
*
|
||||
* Only messages that were created after `since` will be sent.
|
||||
* This will replay both successful, and failed messages
|
||||
*
|
||||
* A completed task will return a payload like the following:
|
||||
* ```json
|
||||
* {
|
||||
* "id": "qtask_33qen93MNuelBAq1T9G7eHLJRsF",
|
||||
* "status": "finished",
|
||||
* "task": "endpoint.bulk-replay",
|
||||
* "data": {
|
||||
* "messagesSent": 2
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
public bulkReplay(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
bulkReplayIn: BulkReplayIn,
|
||||
options?: EndpointBulkReplayOptions
|
||||
): Promise<ReplayOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/bulk-replay"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(BulkReplayInSerializer._toJsonObject(bulkReplayIn));
|
||||
|
||||
return request.send(this.requestCtx, ReplayOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get the additional headers to be sent with the webhook. */
|
||||
public getHeaders(appId: string, endpointId: string): Promise<EndpointHeadersOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.send(this.requestCtx, EndpointHeadersOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Set the additional headers to be sent with the webhook. */
|
||||
public updateHeaders(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
endpointHeadersIn: EndpointHeadersIn
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PUT,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setBody(EndpointHeadersInSerializer._toJsonObject(endpointHeadersIn));
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
public headersUpdate(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
endpointHeadersIn: EndpointHeadersIn
|
||||
): Promise<void> {
|
||||
return this.updateHeaders(appId, endpointId, endpointHeadersIn);
|
||||
}
|
||||
|
||||
/** Partially set the additional headers to be sent with the webhook. */
|
||||
public patchHeaders(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
endpointHeadersPatchIn: EndpointHeadersPatchIn
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PATCH,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setBody(
|
||||
EndpointHeadersPatchInSerializer._toJsonObject(endpointHeadersPatchIn)
|
||||
);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
public headersPatch(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
endpointHeadersPatchIn: EndpointHeadersPatchIn
|
||||
): Promise<void> {
|
||||
return this.patchHeaders(appId, endpointId, endpointHeadersPatchIn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resend all failed messages since a given time.
|
||||
*
|
||||
* Messages that were sent successfully, even if failed initially, are not resent.
|
||||
*
|
||||
* A completed task will return a payload like the following:
|
||||
* ```json
|
||||
* {
|
||||
* "id": "qtask_33qen93MNuelBAq1T9G7eHLJRsF",
|
||||
* "status": "finished",
|
||||
* "task": "endpoint.recover",
|
||||
* "data": {
|
||||
* "messagesSent": 2
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
public recover(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
recoverIn: RecoverIn,
|
||||
options?: EndpointRecoverOptions
|
||||
): Promise<RecoverOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(RecoverInSerializer._toJsonObject(recoverIn));
|
||||
|
||||
return request.send(this.requestCtx, RecoverOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replays messages to the endpoint.
|
||||
*
|
||||
* Only messages that were created after `since` will be sent.
|
||||
* Messages that were previously sent to the endpoint are not resent.
|
||||
*
|
||||
* A completed task will return a payload like the following:
|
||||
* ```json
|
||||
* {
|
||||
* "id": "qtask_33qen93MNuelBAq1T9G7eHLJRsF",
|
||||
* "status": "finished",
|
||||
* "task": "endpoint.replay",
|
||||
* "data": {
|
||||
* "messagesSent": 2
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
public replayMissing(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
replayIn: ReplayIn,
|
||||
options?: EndpointReplayMissingOptions
|
||||
): Promise<ReplayOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(ReplayInSerializer._toJsonObject(replayIn));
|
||||
|
||||
return request.send(this.requestCtx, ReplayOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the endpoint's signing secret.
|
||||
*
|
||||
* This is used to verify the authenticity of the webhook.
|
||||
* For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
|
||||
*/
|
||||
public getSecret(appId: string, endpointId: string): Promise<EndpointSecretOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.send(this.requestCtx, EndpointSecretOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotates the endpoint's signing secret.
|
||||
*
|
||||
* The previous secret will remain valid for the next 24 hours.
|
||||
*/
|
||||
public rotateSecret(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
endpointSecretRotateIn: EndpointSecretRotateIn,
|
||||
options?: EndpointRotateSecretOptions
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(
|
||||
EndpointSecretRotateInSerializer._toJsonObject(endpointSecretRotateIn)
|
||||
);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Send an example message for an event. */
|
||||
public sendExample(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
eventExampleIn: EventExampleIn,
|
||||
options?: EndpointSendExampleOptions
|
||||
): Promise<MessageOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(EventExampleInSerializer._toJsonObject(eventExampleIn));
|
||||
|
||||
return request.send(this.requestCtx, MessageOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get basic statistics for the endpoint. */
|
||||
public getStats(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
options?: EndpointGetStatsOptions
|
||||
): Promise<EndpointStats> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setQueryParams({
|
||||
since: options?.since,
|
||||
until: options?.until,
|
||||
});
|
||||
|
||||
return request.send(this.requestCtx, EndpointStatsSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get the transformation code associated with this endpoint. */
|
||||
public transformationGet(
|
||||
appId: string,
|
||||
endpointId: string
|
||||
): Promise<EndpointTransformationOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
EndpointTransformationOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Set or unset the transformation code associated with this endpoint. */
|
||||
public patchTransformation(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
endpointTransformationPatch: EndpointTransformationPatch
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PATCH,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setBody(
|
||||
EndpointTransformationPatchSerializer._toJsonObject(endpointTransformationPatch)
|
||||
);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/**
|
||||
* This operation was renamed to `set-transformation`.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public transformationPartialUpdate(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
endpointTransformationIn: EndpointTransformationIn
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PATCH,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setBody(
|
||||
EndpointTransformationInSerializer._toJsonObject(endpointTransformationIn)
|
||||
);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
}
|
||||
51
node_modules/svix/src/api/environment.ts
generated
vendored
Normal file
51
node_modules/svix/src/api/environment.ts
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
// this file is @generated
|
||||
|
||||
import { type EnvironmentIn, EnvironmentInSerializer } from "../models/environmentIn";
|
||||
import { type EnvironmentOut, EnvironmentOutSerializer } from "../models/environmentOut";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface EnvironmentExportOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface EnvironmentImportOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class Environment {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/**
|
||||
* Download a JSON file containing all org-settings and event types.
|
||||
*
|
||||
* Note that the schema for [`EnvironmentOut`] is subject to change. The fields
|
||||
* herein are provided for convenience but should be treated as JSON blobs.
|
||||
*/
|
||||
public export(options?: EnvironmentExportOptions): Promise<EnvironmentOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/environment/export");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
|
||||
return request.send(this.requestCtx, EnvironmentOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Import a configuration into the active organization.
|
||||
*
|
||||
* It doesn't delete anything, only adds / updates what was passed to it.
|
||||
*
|
||||
* Note that the schema for [`EnvironmentIn`] is subject to change. The fields
|
||||
* herein are provided for convenience but should be treated as JSON blobs.
|
||||
*/
|
||||
public import(
|
||||
environmentIn: EnvironmentIn,
|
||||
options?: EnvironmentImportOptions
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/environment/import");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(EnvironmentInSerializer._toJsonObject(environmentIn));
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
}
|
||||
180
node_modules/svix/src/api/eventType.ts
generated
vendored
Normal file
180
node_modules/svix/src/api/eventType.ts
generated
vendored
Normal file
@@ -0,0 +1,180 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type EventTypeImportOpenApiIn,
|
||||
EventTypeImportOpenApiInSerializer,
|
||||
} from "../models/eventTypeImportOpenApiIn";
|
||||
import {
|
||||
type EventTypeImportOpenApiOut,
|
||||
EventTypeImportOpenApiOutSerializer,
|
||||
} from "../models/eventTypeImportOpenApiOut";
|
||||
import { type EventTypeIn, EventTypeInSerializer } from "../models/eventTypeIn";
|
||||
import { type EventTypeOut, EventTypeOutSerializer } from "../models/eventTypeOut";
|
||||
import { type EventTypePatch, EventTypePatchSerializer } from "../models/eventTypePatch";
|
||||
import {
|
||||
type EventTypeUpdate,
|
||||
EventTypeUpdateSerializer,
|
||||
} from "../models/eventTypeUpdate";
|
||||
import {
|
||||
type ListResponseEventTypeOut,
|
||||
ListResponseEventTypeOutSerializer,
|
||||
} from "../models/listResponseEventTypeOut";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface EventTypeListOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
/** When `true` archived (deleted but not expunged) items are included in the response. */
|
||||
includeArchived?: boolean;
|
||||
/** When `true` the full item (including the schema) is included in the response. */
|
||||
withContent?: boolean;
|
||||
}
|
||||
|
||||
export interface EventTypeCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface EventTypeImportOpenapiOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface EventTypeDeleteOptions {
|
||||
/** By default event types are archived when "deleted". Passing this to `true` deletes them entirely. */
|
||||
expunge?: boolean;
|
||||
}
|
||||
|
||||
export class EventType {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** Return the list of event types. */
|
||||
public list(options?: EventTypeListOptions): Promise<ListResponseEventTypeOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/event-type");
|
||||
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
include_archived: options?.includeArchived,
|
||||
with_content: options?.withContent,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseEventTypeOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new or unarchive existing event type.
|
||||
*
|
||||
* Unarchiving an event type will allow endpoints to filter on it and messages to be sent with it.
|
||||
* Endpoints filtering on the event type before archival will continue to filter on it.
|
||||
* This operation does not preserve the description and schemas.
|
||||
*/
|
||||
public create(
|
||||
eventTypeIn: EventTypeIn,
|
||||
options?: EventTypeCreateOptions
|
||||
): Promise<EventTypeOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/event-type");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(EventTypeInSerializer._toJsonObject(eventTypeIn));
|
||||
|
||||
return request.send(this.requestCtx, EventTypeOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Given an OpenAPI spec, create new or update existing event types.
|
||||
*
|
||||
* If an existing `archived` event type is updated, it will be unarchived.
|
||||
* The importer will convert all webhooks found in the either the `webhooks` or `x-webhooks`
|
||||
* top-level.
|
||||
*/
|
||||
public importOpenapi(
|
||||
eventTypeImportOpenApiIn: EventTypeImportOpenApiIn,
|
||||
options?: EventTypeImportOpenapiOptions
|
||||
): Promise<EventTypeImportOpenApiOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/event-type/import/openapi");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(
|
||||
EventTypeImportOpenApiInSerializer._toJsonObject(eventTypeImportOpenApiIn)
|
||||
);
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
EventTypeImportOpenApiOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Get an event type. */
|
||||
public get(eventTypeName: string): Promise<EventTypeOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/event-type/{event_type_name}"
|
||||
);
|
||||
|
||||
request.setPathParam("event_type_name", eventTypeName);
|
||||
|
||||
return request.send(this.requestCtx, EventTypeOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Update an event type. */
|
||||
public update(
|
||||
eventTypeName: string,
|
||||
eventTypeUpdate: EventTypeUpdate
|
||||
): Promise<EventTypeOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PUT,
|
||||
"/api/v1/event-type/{event_type_name}"
|
||||
);
|
||||
|
||||
request.setPathParam("event_type_name", eventTypeName);
|
||||
request.setBody(EventTypeUpdateSerializer._toJsonObject(eventTypeUpdate));
|
||||
|
||||
return request.send(this.requestCtx, EventTypeOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive an event type.
|
||||
*
|
||||
* Endpoints already configured to filter on an event type will continue to do so after archival.
|
||||
* However, new messages can not be sent with it and endpoints can not filter on it.
|
||||
* An event type can be unarchived with the
|
||||
* [create operation](#operation/create_event_type_api_v1_event_type__post).
|
||||
*/
|
||||
public delete(eventTypeName: string, options?: EventTypeDeleteOptions): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.DELETE,
|
||||
"/api/v1/event-type/{event_type_name}"
|
||||
);
|
||||
|
||||
request.setPathParam("event_type_name", eventTypeName);
|
||||
request.setQueryParams({
|
||||
expunge: options?.expunge,
|
||||
});
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Partially update an event type. */
|
||||
public patch(
|
||||
eventTypeName: string,
|
||||
eventTypePatch: EventTypePatch
|
||||
): Promise<EventTypeOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PATCH,
|
||||
"/api/v1/event-type/{event_type_name}"
|
||||
);
|
||||
|
||||
request.setPathParam("event_type_name", eventTypeName);
|
||||
request.setBody(EventTypePatchSerializer._toJsonObject(eventTypePatch));
|
||||
|
||||
return request.send(this.requestCtx, EventTypeOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
14
node_modules/svix/src/api/health.ts
generated
vendored
Normal file
14
node_modules/svix/src/api/health.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// this file is @generated
|
||||
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export class Health {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** Verify the API server is up and running. */
|
||||
public get(): Promise<void> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/health");
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
}
|
||||
51
node_modules/svix/src/api/ingest.ts
generated
vendored
Normal file
51
node_modules/svix/src/api/ingest.ts
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type DashboardAccessOut,
|
||||
DashboardAccessOutSerializer,
|
||||
} from "../models/dashboardAccessOut";
|
||||
import {
|
||||
type IngestSourceConsumerPortalAccessIn,
|
||||
IngestSourceConsumerPortalAccessInSerializer,
|
||||
} from "../models/ingestSourceConsumerPortalAccessIn";
|
||||
import { IngestEndpoint } from "./ingestEndpoint";
|
||||
import { IngestSource } from "./ingestSource";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface IngestDashboardOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class Ingest {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
public get endpoint() {
|
||||
return new IngestEndpoint(this.requestCtx);
|
||||
}
|
||||
|
||||
public get source() {
|
||||
return new IngestSource(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Get access to the Ingest Source Consumer Portal. */
|
||||
public dashboard(
|
||||
sourceId: string,
|
||||
ingestSourceConsumerPortalAccessIn: IngestSourceConsumerPortalAccessIn,
|
||||
options?: IngestDashboardOptions
|
||||
): Promise<DashboardAccessOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/ingest/api/v1/source/{source_id}/dashboard"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(
|
||||
IngestSourceConsumerPortalAccessInSerializer._toJsonObject(
|
||||
ingestSourceConsumerPortalAccessIn
|
||||
)
|
||||
);
|
||||
|
||||
return request.send(this.requestCtx, DashboardAccessOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
280
node_modules/svix/src/api/ingestEndpoint.ts
generated
vendored
Normal file
280
node_modules/svix/src/api/ingestEndpoint.ts
generated
vendored
Normal file
@@ -0,0 +1,280 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type IngestEndpointHeadersIn,
|
||||
IngestEndpointHeadersInSerializer,
|
||||
} from "../models/ingestEndpointHeadersIn";
|
||||
import {
|
||||
type IngestEndpointHeadersOut,
|
||||
IngestEndpointHeadersOutSerializer,
|
||||
} from "../models/ingestEndpointHeadersOut";
|
||||
import {
|
||||
type IngestEndpointIn,
|
||||
IngestEndpointInSerializer,
|
||||
} from "../models/ingestEndpointIn";
|
||||
import {
|
||||
type IngestEndpointOut,
|
||||
IngestEndpointOutSerializer,
|
||||
} from "../models/ingestEndpointOut";
|
||||
import {
|
||||
type IngestEndpointSecretIn,
|
||||
IngestEndpointSecretInSerializer,
|
||||
} from "../models/ingestEndpointSecretIn";
|
||||
import {
|
||||
type IngestEndpointSecretOut,
|
||||
IngestEndpointSecretOutSerializer,
|
||||
} from "../models/ingestEndpointSecretOut";
|
||||
import {
|
||||
type IngestEndpointTransformationOut,
|
||||
IngestEndpointTransformationOutSerializer,
|
||||
} from "../models/ingestEndpointTransformationOut";
|
||||
import {
|
||||
type IngestEndpointTransformationPatch,
|
||||
IngestEndpointTransformationPatchSerializer,
|
||||
} from "../models/ingestEndpointTransformationPatch";
|
||||
import {
|
||||
type IngestEndpointUpdate,
|
||||
IngestEndpointUpdateSerializer,
|
||||
} from "../models/ingestEndpointUpdate";
|
||||
import {
|
||||
type ListResponseIngestEndpointOut,
|
||||
ListResponseIngestEndpointOutSerializer,
|
||||
} from "../models/listResponseIngestEndpointOut";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface IngestEndpointListOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
}
|
||||
|
||||
export interface IngestEndpointCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface IngestEndpointRotateSecretOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class IngestEndpoint {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** List ingest endpoints. */
|
||||
public list(
|
||||
sourceId: string,
|
||||
options?: IngestEndpointListOptions
|
||||
): Promise<ListResponseIngestEndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/ingest/api/v1/source/{source_id}/endpoint"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseIngestEndpointOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Create an ingest endpoint. */
|
||||
public create(
|
||||
sourceId: string,
|
||||
ingestEndpointIn: IngestEndpointIn,
|
||||
options?: IngestEndpointCreateOptions
|
||||
): Promise<IngestEndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/ingest/api/v1/source/{source_id}/endpoint"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(IngestEndpointInSerializer._toJsonObject(ingestEndpointIn));
|
||||
|
||||
return request.send(this.requestCtx, IngestEndpointOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get an ingest endpoint. */
|
||||
public get(sourceId: string, endpointId: string): Promise<IngestEndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.send(this.requestCtx, IngestEndpointOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Update an ingest endpoint. */
|
||||
public update(
|
||||
sourceId: string,
|
||||
endpointId: string,
|
||||
ingestEndpointUpdate: IngestEndpointUpdate
|
||||
): Promise<IngestEndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PUT,
|
||||
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setBody(IngestEndpointUpdateSerializer._toJsonObject(ingestEndpointUpdate));
|
||||
|
||||
return request.send(this.requestCtx, IngestEndpointOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Delete an ingest endpoint. */
|
||||
public delete(sourceId: string, endpointId: string): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.DELETE,
|
||||
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Get the additional headers to be sent with the ingest. */
|
||||
public getHeaders(
|
||||
sourceId: string,
|
||||
endpointId: string
|
||||
): Promise<IngestEndpointHeadersOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
IngestEndpointHeadersOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Set the additional headers to be sent to the endpoint. */
|
||||
public updateHeaders(
|
||||
sourceId: string,
|
||||
endpointId: string,
|
||||
ingestEndpointHeadersIn: IngestEndpointHeadersIn
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PUT,
|
||||
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setBody(
|
||||
IngestEndpointHeadersInSerializer._toJsonObject(ingestEndpointHeadersIn)
|
||||
);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an ingest endpoint's signing secret.
|
||||
*
|
||||
* This is used to verify the authenticity of the webhook.
|
||||
* For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
|
||||
*/
|
||||
public getSecret(
|
||||
sourceId: string,
|
||||
endpointId: string
|
||||
): Promise<IngestEndpointSecretOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
IngestEndpointSecretOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotates an ingest endpoint's signing secret.
|
||||
*
|
||||
* The previous secret will remain valid for the next 24 hours.
|
||||
*/
|
||||
public rotateSecret(
|
||||
sourceId: string,
|
||||
endpointId: string,
|
||||
ingestEndpointSecretIn: IngestEndpointSecretIn,
|
||||
options?: IngestEndpointRotateSecretOptions
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(
|
||||
IngestEndpointSecretInSerializer._toJsonObject(ingestEndpointSecretIn)
|
||||
);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Get the transformation code associated with this ingest endpoint. */
|
||||
public getTransformation(
|
||||
sourceId: string,
|
||||
endpointId: string
|
||||
): Promise<IngestEndpointTransformationOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
IngestEndpointTransformationOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Set or unset the transformation code associated with this ingest endpoint. */
|
||||
public setTransformation(
|
||||
sourceId: string,
|
||||
endpointId: string,
|
||||
ingestEndpointTransformationPatch: IngestEndpointTransformationPatch
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PATCH,
|
||||
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setBody(
|
||||
IngestEndpointTransformationPatchSerializer._toJsonObject(
|
||||
ingestEndpointTransformationPatch
|
||||
)
|
||||
);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
}
|
||||
121
node_modules/svix/src/api/ingestSource.ts
generated
vendored
Normal file
121
node_modules/svix/src/api/ingestSource.ts
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
// this file is @generated
|
||||
|
||||
import { type IngestSourceIn, IngestSourceInSerializer } from "../models/ingestSourceIn";
|
||||
import {
|
||||
type IngestSourceOut,
|
||||
IngestSourceOutSerializer,
|
||||
} from "../models/ingestSourceOut";
|
||||
import {
|
||||
type ListResponseIngestSourceOut,
|
||||
ListResponseIngestSourceOutSerializer,
|
||||
} from "../models/listResponseIngestSourceOut";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import { type RotateTokenOut, RotateTokenOutSerializer } from "../models/rotateTokenOut";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface IngestSourceListOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
}
|
||||
|
||||
export interface IngestSourceCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface IngestSourceRotateTokenOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class IngestSource {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** List of all the organization's Ingest Sources. */
|
||||
public list(options?: IngestSourceListOptions): Promise<ListResponseIngestSourceOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/ingest/api/v1/source");
|
||||
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseIngestSourceOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Create Ingest Source. */
|
||||
public create(
|
||||
ingestSourceIn: IngestSourceIn,
|
||||
options?: IngestSourceCreateOptions
|
||||
): Promise<IngestSourceOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/ingest/api/v1/source");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(IngestSourceInSerializer._toJsonObject(ingestSourceIn));
|
||||
|
||||
return request.send(this.requestCtx, IngestSourceOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get an Ingest Source by id or uid. */
|
||||
public get(sourceId: string): Promise<IngestSourceOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/ingest/api/v1/source/{source_id}");
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
|
||||
return request.send(this.requestCtx, IngestSourceOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Update an Ingest Source. */
|
||||
public update(
|
||||
sourceId: string,
|
||||
ingestSourceIn: IngestSourceIn
|
||||
): Promise<IngestSourceOut> {
|
||||
const request = new SvixRequest(HttpMethod.PUT, "/ingest/api/v1/source/{source_id}");
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setBody(IngestSourceInSerializer._toJsonObject(ingestSourceIn));
|
||||
|
||||
return request.send(this.requestCtx, IngestSourceOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Delete an Ingest Source. */
|
||||
public delete(sourceId: string): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.DELETE,
|
||||
"/ingest/api/v1/source/{source_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate the Ingest Source's Url Token.
|
||||
*
|
||||
* This will rotate the ingest source's token, which is used to
|
||||
* construct the unique `ingestUrl` for the source. Previous tokens
|
||||
* will remain valid for 48 hours after rotation. The token can be
|
||||
* rotated a maximum of three times within the 48-hour period.
|
||||
*/
|
||||
public rotateToken(
|
||||
sourceId: string,
|
||||
options?: IngestSourceRotateTokenOptions
|
||||
): Promise<RotateTokenOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/ingest/api/v1/source/{source_id}/token/rotate"
|
||||
);
|
||||
|
||||
request.setPathParam("source_id", sourceId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
|
||||
return request.send(this.requestCtx, RotateTokenOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
153
node_modules/svix/src/api/integration.ts
generated
vendored
Normal file
153
node_modules/svix/src/api/integration.ts
generated
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
// this file is @generated
|
||||
|
||||
import { type IntegrationIn, IntegrationInSerializer } from "../models/integrationIn";
|
||||
import {
|
||||
type IntegrationKeyOut,
|
||||
IntegrationKeyOutSerializer,
|
||||
} from "../models/integrationKeyOut";
|
||||
import { type IntegrationOut, IntegrationOutSerializer } from "../models/integrationOut";
|
||||
import {
|
||||
type IntegrationUpdate,
|
||||
IntegrationUpdateSerializer,
|
||||
} from "../models/integrationUpdate";
|
||||
import {
|
||||
type ListResponseIntegrationOut,
|
||||
ListResponseIntegrationOutSerializer,
|
||||
} from "../models/listResponseIntegrationOut";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface IntegrationListOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
}
|
||||
|
||||
export interface IntegrationCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface IntegrationRotateKeyOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class Integration {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** List the application's integrations. */
|
||||
public list(
|
||||
appId: string,
|
||||
options?: IntegrationListOptions
|
||||
): Promise<ListResponseIntegrationOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/app/{app_id}/integration");
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseIntegrationOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Create an integration. */
|
||||
public create(
|
||||
appId: string,
|
||||
integrationIn: IntegrationIn,
|
||||
options?: IntegrationCreateOptions
|
||||
): Promise<IntegrationOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/app/{app_id}/integration");
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(IntegrationInSerializer._toJsonObject(integrationIn));
|
||||
|
||||
return request.send(this.requestCtx, IntegrationOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get an integration. */
|
||||
public get(appId: string, integId: string): Promise<IntegrationOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/integration/{integ_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("integ_id", integId);
|
||||
|
||||
return request.send(this.requestCtx, IntegrationOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Update an integration. */
|
||||
public update(
|
||||
appId: string,
|
||||
integId: string,
|
||||
integrationUpdate: IntegrationUpdate
|
||||
): Promise<IntegrationOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PUT,
|
||||
"/api/v1/app/{app_id}/integration/{integ_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("integ_id", integId);
|
||||
request.setBody(IntegrationUpdateSerializer._toJsonObject(integrationUpdate));
|
||||
|
||||
return request.send(this.requestCtx, IntegrationOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Delete an integration. */
|
||||
public delete(appId: string, integId: string): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.DELETE,
|
||||
"/api/v1/app/{app_id}/integration/{integ_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("integ_id", integId);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an integration's key.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
public getKey(appId: string, integId: string): Promise<IntegrationKeyOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/integration/{integ_id}/key"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("integ_id", integId);
|
||||
|
||||
return request.send(this.requestCtx, IntegrationKeyOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Rotate the integration's key. The previous key will be immediately revoked. */
|
||||
public rotateKey(
|
||||
appId: string,
|
||||
integId: string,
|
||||
options?: IntegrationRotateKeyOptions
|
||||
): Promise<IntegrationKeyOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/app/{app_id}/integration/{integ_id}/key/rotate"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("integ_id", integId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
|
||||
return request.send(this.requestCtx, IntegrationKeyOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
254
node_modules/svix/src/api/message.ts
generated
vendored
Normal file
254
node_modules/svix/src/api/message.ts
generated
vendored
Normal file
@@ -0,0 +1,254 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type ExpungeAllContentsOut,
|
||||
ExpungeAllContentsOutSerializer,
|
||||
} from "../models/expungeAllContentsOut";
|
||||
import {
|
||||
type ListResponseMessageOut,
|
||||
ListResponseMessageOutSerializer,
|
||||
} from "../models/listResponseMessageOut";
|
||||
import { type MessageOut, MessageOutSerializer } from "../models/messageOut";
|
||||
import {
|
||||
type MessagePrecheckIn,
|
||||
MessagePrecheckInSerializer,
|
||||
} from "../models/messagePrecheckIn";
|
||||
import {
|
||||
type MessagePrecheckOut,
|
||||
MessagePrecheckOutSerializer,
|
||||
} from "../models/messagePrecheckOut";
|
||||
import { MessagePoller } from "./messagePoller";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
import { type MessageIn, MessageInSerializer } from "../models/messageIn";
|
||||
|
||||
export interface MessageListOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** Filter response based on the channel. */
|
||||
channel?: string;
|
||||
/** Only include items created before a certain date. */
|
||||
before?: Date | null;
|
||||
/** Only include items created after a certain date. */
|
||||
after?: Date | null;
|
||||
/** When `true` message payloads are included in the response. */
|
||||
withContent?: boolean;
|
||||
/** Filter messages matching the provided tag. */
|
||||
tag?: string;
|
||||
/** Filter response based on the event type */
|
||||
eventTypes?: string[];
|
||||
}
|
||||
|
||||
export interface MessageCreateOptions {
|
||||
/** When `true`, message payloads are included in the response. */
|
||||
withContent?: boolean;
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface MessageExpungeAllContentsOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface MessagePrecheckOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface MessageGetOptions {
|
||||
/** When `true` message payloads are included in the response. */
|
||||
withContent?: boolean;
|
||||
}
|
||||
|
||||
export class Message {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
public get poller() {
|
||||
return new MessagePoller(this.requestCtx);
|
||||
}
|
||||
|
||||
/**
|
||||
* List all of the application's messages.
|
||||
*
|
||||
* The `before` and `after` parameters let you filter all items created before or after a certain date. These can be
|
||||
* used alongside an iterator to paginate over results within a certain window.
|
||||
*
|
||||
* Note that by default this endpoint is limited to retrieving 90 days' worth of data
|
||||
* relative to now or, if an iterator is provided, 90 days before/after the time indicated
|
||||
* by the iterator ID. If you require data beyond those time ranges, you will need to explicitly
|
||||
* set the `before` or `after` parameter as appropriate.
|
||||
*/
|
||||
public list(
|
||||
appId: string,
|
||||
options?: MessageListOptions
|
||||
): Promise<ListResponseMessageOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/app/{app_id}/msg");
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
channel: options?.channel,
|
||||
before: options?.before,
|
||||
after: options?.after,
|
||||
with_content: options?.withContent,
|
||||
tag: options?.tag,
|
||||
event_types: options?.eventTypes,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseMessageOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new message and dispatches it to all of the application's endpoints.
|
||||
*
|
||||
* The `eventId` is an optional custom unique ID. It's verified to be unique only up to a day, after that no verification will be made.
|
||||
* If a message with the same `eventId` already exists for the application, a 409 conflict error will be returned.
|
||||
*
|
||||
* The `eventType` indicates the type and schema of the event. All messages of a certain `eventType` are expected to have the same schema. Endpoints can choose to only listen to specific event types.
|
||||
* Messages can also have `channels`, which similar to event types let endpoints filter by them. Unlike event types, messages can have multiple channels, and channels don't imply a specific message content or schema.
|
||||
*
|
||||
* The `payload` property is the webhook's body (the actual webhook message). Svix supports payload sizes of up to 1MiB, though it's generally a good idea to keep webhook payloads small, probably no larger than 40kb.
|
||||
*/
|
||||
public create(
|
||||
appId: string,
|
||||
messageIn: MessageIn,
|
||||
options?: MessageCreateOptions
|
||||
): Promise<MessageOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/app/{app_id}/msg");
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setQueryParams({
|
||||
with_content: options?.withContent,
|
||||
});
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(MessageInSerializer._toJsonObject(messageIn));
|
||||
|
||||
return request.send(this.requestCtx, MessageOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all message payloads for the application.
|
||||
*
|
||||
* This operation is only available in the <a href="https://svix.com/pricing" target="_blank">Enterprise</a> plan.
|
||||
*
|
||||
* A completed task will return a payload like the following:
|
||||
* ```json
|
||||
* {
|
||||
* "id": "qtask_33qen93MNuelBAq1T9G7eHLJRsF",
|
||||
* "status": "finished",
|
||||
* "task": "application.purge_content",
|
||||
* "data": {
|
||||
* "messagesPurged": 150
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
public expungeAllContents(
|
||||
appId: string,
|
||||
options?: MessageExpungeAllContentsOptions
|
||||
): Promise<ExpungeAllContentsOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/app/{app_id}/msg/expunge-all-contents"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
|
||||
return request.send(this.requestCtx, ExpungeAllContentsOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* A pre-check call for `message.create` that checks whether any active endpoints are
|
||||
* listening to this message.
|
||||
*
|
||||
* Note: most people shouldn't be using this API. Svix doesn't bill you for
|
||||
* messages not actually sent, so using this API doesn't save money.
|
||||
* If unsure, please ask Svix support before using this API.
|
||||
*/
|
||||
public precheck(
|
||||
appId: string,
|
||||
messagePrecheckIn: MessagePrecheckIn,
|
||||
options?: MessagePrecheckOptions
|
||||
): Promise<MessagePrecheckOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/app/{app_id}/msg/precheck/active"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(MessagePrecheckInSerializer._toJsonObject(messagePrecheckIn));
|
||||
|
||||
return request.send(this.requestCtx, MessagePrecheckOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get a message by its ID or eventID. */
|
||||
public get(
|
||||
appId: string,
|
||||
msgId: string,
|
||||
options?: MessageGetOptions
|
||||
): Promise<MessageOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/app/{app_id}/msg/{msg_id}");
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("msg_id", msgId);
|
||||
request.setQueryParams({
|
||||
with_content: options?.withContent,
|
||||
});
|
||||
|
||||
return request.send(this.requestCtx, MessageOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the given message's payload.
|
||||
*
|
||||
* Useful in cases when a message was accidentally sent with sensitive content.
|
||||
* The message can't be replayed or resent once its payload has been deleted or expired.
|
||||
*/
|
||||
public expungeContent(appId: string, msgId: string): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.DELETE,
|
||||
"/api/v1/app/{app_id}/msg/{msg_id}/content"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("msg_id", msgId);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a `MessageIn` with a raw string payload.
|
||||
*
|
||||
* The payload is not normalized on the server. Normally, payloads are
|
||||
* required to be JSON, and Svix will minify the payload before sending the
|
||||
* webhooks (for example, by removing extraneous whitespace or unnecessarily
|
||||
* escaped characters in strings). With this function, the payload will be
|
||||
* sent "as is", without any minification or other processing.
|
||||
*
|
||||
* @param payload Serialized message payload
|
||||
* @param contentType The value to use for the Content-Type header of the webhook sent by Svix, overwriting the default of `application/json` if specified
|
||||
*
|
||||
* See the class documentation for details about the other parameters.
|
||||
*/
|
||||
export function messageInRaw(
|
||||
eventType: string,
|
||||
payload: string,
|
||||
contentType?: string
|
||||
): MessageIn {
|
||||
const headers = contentType ? { "content-type": contentType } : undefined;
|
||||
|
||||
return {
|
||||
eventType,
|
||||
payload: {},
|
||||
transformationsParams: {
|
||||
rawPayload: payload,
|
||||
headers,
|
||||
},
|
||||
};
|
||||
}
|
||||
314
node_modules/svix/src/api/messageAttempt.ts
generated
vendored
Normal file
314
node_modules/svix/src/api/messageAttempt.ts
generated
vendored
Normal file
@@ -0,0 +1,314 @@
|
||||
// this file is @generated
|
||||
|
||||
import { type EmptyResponse, EmptyResponseSerializer } from "../models/emptyResponse";
|
||||
import {
|
||||
type ListResponseEndpointMessageOut,
|
||||
ListResponseEndpointMessageOutSerializer,
|
||||
} from "../models/listResponseEndpointMessageOut";
|
||||
import {
|
||||
type ListResponseMessageAttemptOut,
|
||||
ListResponseMessageAttemptOutSerializer,
|
||||
} from "../models/listResponseMessageAttemptOut";
|
||||
import {
|
||||
type ListResponseMessageEndpointOut,
|
||||
ListResponseMessageEndpointOutSerializer,
|
||||
} from "../models/listResponseMessageEndpointOut";
|
||||
import {
|
||||
type MessageAttemptOut,
|
||||
MessageAttemptOutSerializer,
|
||||
} from "../models/messageAttemptOut";
|
||||
import type { MessageStatus } from "../models/messageStatus";
|
||||
import type { StatusCodeClass } from "../models/statusCodeClass";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface MessageAttemptListByEndpointOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) */
|
||||
status?: MessageStatus;
|
||||
/** Filter response based on the HTTP status code */
|
||||
statusCodeClass?: StatusCodeClass;
|
||||
/** Filter response based on the channel */
|
||||
channel?: string;
|
||||
/** Filter response based on the tag */
|
||||
tag?: string;
|
||||
/** Only include items created before a certain date */
|
||||
before?: Date | null;
|
||||
/** Only include items created after a certain date */
|
||||
after?: Date | null;
|
||||
/** When `true` attempt content is included in the response */
|
||||
withContent?: boolean;
|
||||
/** When `true`, the message information is included in the response */
|
||||
withMsg?: boolean;
|
||||
/** Filter response based on the event type */
|
||||
eventTypes?: string[];
|
||||
}
|
||||
|
||||
export interface MessageAttemptListByMsgOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) */
|
||||
status?: MessageStatus;
|
||||
/** Filter response based on the HTTP status code */
|
||||
statusCodeClass?: StatusCodeClass;
|
||||
/** Filter response based on the channel */
|
||||
channel?: string;
|
||||
/** Filter response based on the tag */
|
||||
tag?: string;
|
||||
/** Filter the attempts based on the attempted endpoint */
|
||||
endpointId?: string;
|
||||
/** Only include items created before a certain date */
|
||||
before?: Date | null;
|
||||
/** Only include items created after a certain date */
|
||||
after?: Date | null;
|
||||
/** When `true` attempt content is included in the response */
|
||||
withContent?: boolean;
|
||||
/** Filter response based on the event type */
|
||||
eventTypes?: string[];
|
||||
}
|
||||
|
||||
export interface MessageAttemptListAttemptedMessagesOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** Filter response based on the channel */
|
||||
channel?: string;
|
||||
/** Filter response based on the message tags */
|
||||
tag?: string;
|
||||
/** Filter response based on the status of the attempt: Success (0), Pending (1), Failed (2), or Sending (3) */
|
||||
status?: MessageStatus;
|
||||
/** Only include items created before a certain date */
|
||||
before?: Date | null;
|
||||
/** Only include items created after a certain date */
|
||||
after?: Date | null;
|
||||
/** When `true` message payloads are included in the response */
|
||||
withContent?: boolean;
|
||||
/** Filter response based on the event type */
|
||||
eventTypes?: string[];
|
||||
}
|
||||
|
||||
export interface MessageAttemptListAttemptedDestinationsOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
}
|
||||
|
||||
export interface MessageAttemptResendOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class MessageAttempt {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/**
|
||||
* List attempts by endpoint id
|
||||
*
|
||||
* Note that by default this endpoint is limited to retrieving 90 days' worth of data
|
||||
* relative to now or, if an iterator is provided, 90 days before/after the time indicated
|
||||
* by the iterator ID. If you require data beyond those time ranges, you will need to explicitly
|
||||
* set the `before` or `after` parameter as appropriate.
|
||||
*/
|
||||
public listByEndpoint(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
options?: MessageAttemptListByEndpointOptions
|
||||
): Promise<ListResponseMessageAttemptOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
status: options?.status,
|
||||
status_code_class: options?.statusCodeClass,
|
||||
channel: options?.channel,
|
||||
tag: options?.tag,
|
||||
before: options?.before,
|
||||
after: options?.after,
|
||||
with_content: options?.withContent,
|
||||
with_msg: options?.withMsg,
|
||||
event_types: options?.eventTypes,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseMessageAttemptOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* List attempts by message ID.
|
||||
*
|
||||
* Note that by default this endpoint is limited to retrieving 90 days' worth of data
|
||||
* relative to now or, if an iterator is provided, 90 days before/after the time indicated
|
||||
* by the iterator ID. If you require data beyond those time ranges, you will need to explicitly
|
||||
* set the `before` or `after` parameter as appropriate.
|
||||
*/
|
||||
public listByMsg(
|
||||
appId: string,
|
||||
msgId: string,
|
||||
options?: MessageAttemptListByMsgOptions
|
||||
): Promise<ListResponseMessageAttemptOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/attempt/msg/{msg_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("msg_id", msgId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
status: options?.status,
|
||||
status_code_class: options?.statusCodeClass,
|
||||
channel: options?.channel,
|
||||
tag: options?.tag,
|
||||
endpoint_id: options?.endpointId,
|
||||
before: options?.before,
|
||||
after: options?.after,
|
||||
with_content: options?.withContent,
|
||||
event_types: options?.eventTypes,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseMessageAttemptOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* List messages for a particular endpoint. Additionally includes metadata about the latest message attempt.
|
||||
*
|
||||
* The `before` parameter lets you filter all items created before a certain date and is ignored if an iterator is passed.
|
||||
*
|
||||
* Note that by default this endpoint is limited to retrieving 90 days' worth of data
|
||||
* relative to now or, if an iterator is provided, 90 days before/after the time indicated
|
||||
* by the iterator ID. If you require data beyond those time ranges, you will need to explicitly
|
||||
* set the `before` or `after` parameter as appropriate.
|
||||
*/
|
||||
public listAttemptedMessages(
|
||||
appId: string,
|
||||
endpointId: string,
|
||||
options?: MessageAttemptListAttemptedMessagesOptions
|
||||
): Promise<ListResponseEndpointMessageOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
channel: options?.channel,
|
||||
tag: options?.tag,
|
||||
status: options?.status,
|
||||
before: options?.before,
|
||||
after: options?.after,
|
||||
with_content: options?.withContent,
|
||||
event_types: options?.eventTypes,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseEndpointMessageOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** `msg_id`: Use a message id or a message `eventId` */
|
||||
public get(
|
||||
appId: string,
|
||||
msgId: string,
|
||||
attemptId: string
|
||||
): Promise<MessageAttemptOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("msg_id", msgId);
|
||||
request.setPathParam("attempt_id", attemptId);
|
||||
|
||||
return request.send(this.requestCtx, MessageAttemptOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the given attempt's response body.
|
||||
*
|
||||
* Useful when an endpoint accidentally returned sensitive content.
|
||||
* The message can't be replayed or resent once its payload has been deleted or expired.
|
||||
*/
|
||||
public expungeContent(appId: string, msgId: string, attemptId: string): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.DELETE,
|
||||
"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("msg_id", msgId);
|
||||
request.setPathParam("attempt_id", attemptId);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/**
|
||||
* List endpoints attempted by a given message.
|
||||
*
|
||||
* Additionally includes metadata about the latest message attempt.
|
||||
* By default, endpoints are listed in ascending order by ID.
|
||||
*/
|
||||
public listAttemptedDestinations(
|
||||
appId: string,
|
||||
msgId: string,
|
||||
options?: MessageAttemptListAttemptedDestinationsOptions
|
||||
): Promise<ListResponseMessageEndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/msg/{msg_id}/endpoint"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("msg_id", msgId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseMessageEndpointOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Resend a message to the specified endpoint. */
|
||||
public resend(
|
||||
appId: string,
|
||||
msgId: string,
|
||||
endpointId: string,
|
||||
options?: MessageAttemptResendOptions
|
||||
): Promise<EmptyResponse> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("msg_id", msgId);
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
|
||||
return request.send(this.requestCtx, EmptyResponseSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
119
node_modules/svix/src/api/messagePoller.ts
generated
vendored
Normal file
119
node_modules/svix/src/api/messagePoller.ts
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type PollingEndpointConsumerSeekIn,
|
||||
PollingEndpointConsumerSeekInSerializer,
|
||||
} from "../models/pollingEndpointConsumerSeekIn";
|
||||
import {
|
||||
type PollingEndpointConsumerSeekOut,
|
||||
PollingEndpointConsumerSeekOutSerializer,
|
||||
} from "../models/pollingEndpointConsumerSeekOut";
|
||||
import {
|
||||
type PollingEndpointOut,
|
||||
PollingEndpointOutSerializer,
|
||||
} from "../models/pollingEndpointOut";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface MessagePollerPollOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** Filters messages sent with this event type (optional). */
|
||||
eventType?: string;
|
||||
/** Filters messages sent with this channel (optional). */
|
||||
channel?: string;
|
||||
after?: Date | null;
|
||||
}
|
||||
|
||||
export interface MessagePollerConsumerPollOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
}
|
||||
|
||||
export interface MessagePollerConsumerSeekOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class MessagePoller {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** Reads the stream of created messages for an application, filtered on the Sink's event types and Channels. */
|
||||
public poll(
|
||||
appId: string,
|
||||
sinkId: string,
|
||||
options?: MessagePollerPollOptions
|
||||
): Promise<PollingEndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/poller/{sink_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
event_type: options?.eventType,
|
||||
channel: options?.channel,
|
||||
after: options?.after,
|
||||
});
|
||||
|
||||
return request.send(this.requestCtx, PollingEndpointOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the stream of created messages for an application, filtered on the Sink's event types and
|
||||
* Channels, using server-managed iterator tracking.
|
||||
*/
|
||||
public consumerPoll(
|
||||
appId: string,
|
||||
sinkId: string,
|
||||
consumerId: string,
|
||||
options?: MessagePollerConsumerPollOptions
|
||||
): Promise<PollingEndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
request.setPathParam("consumer_id", consumerId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
});
|
||||
|
||||
return request.send(this.requestCtx, PollingEndpointOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Sets the starting offset for the consumer of a polling endpoint. */
|
||||
public consumerSeek(
|
||||
appId: string,
|
||||
sinkId: string,
|
||||
consumerId: string,
|
||||
pollingEndpointConsumerSeekIn: PollingEndpointConsumerSeekIn,
|
||||
options?: MessagePollerConsumerSeekOptions
|
||||
): Promise<PollingEndpointConsumerSeekOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek"
|
||||
);
|
||||
|
||||
request.setPathParam("app_id", appId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
request.setPathParam("consumer_id", consumerId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(
|
||||
PollingEndpointConsumerSeekInSerializer._toJsonObject(pollingEndpointConsumerSeekIn)
|
||||
);
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
PollingEndpointConsumerSeekOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
}
|
||||
12
node_modules/svix/src/api/operationalWebhook.ts
generated
vendored
Normal file
12
node_modules/svix/src/api/operationalWebhook.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// this file is @generated
|
||||
|
||||
import { OperationalWebhookEndpoint } from "./operationalWebhookEndpoint";
|
||||
import type { SvixRequestContext } from "../request";
|
||||
|
||||
export class OperationalWebhook {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
public get endpoint() {
|
||||
return new OperationalWebhookEndpoint(this.requestCtx);
|
||||
}
|
||||
}
|
||||
230
node_modules/svix/src/api/operationalWebhookEndpoint.ts
generated
vendored
Normal file
230
node_modules/svix/src/api/operationalWebhookEndpoint.ts
generated
vendored
Normal file
@@ -0,0 +1,230 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type ListResponseOperationalWebhookEndpointOut,
|
||||
ListResponseOperationalWebhookEndpointOutSerializer,
|
||||
} from "../models/listResponseOperationalWebhookEndpointOut";
|
||||
import {
|
||||
type OperationalWebhookEndpointHeadersIn,
|
||||
OperationalWebhookEndpointHeadersInSerializer,
|
||||
} from "../models/operationalWebhookEndpointHeadersIn";
|
||||
import {
|
||||
type OperationalWebhookEndpointHeadersOut,
|
||||
OperationalWebhookEndpointHeadersOutSerializer,
|
||||
} from "../models/operationalWebhookEndpointHeadersOut";
|
||||
import {
|
||||
type OperationalWebhookEndpointIn,
|
||||
OperationalWebhookEndpointInSerializer,
|
||||
} from "../models/operationalWebhookEndpointIn";
|
||||
import {
|
||||
type OperationalWebhookEndpointOut,
|
||||
OperationalWebhookEndpointOutSerializer,
|
||||
} from "../models/operationalWebhookEndpointOut";
|
||||
import {
|
||||
type OperationalWebhookEndpointSecretIn,
|
||||
OperationalWebhookEndpointSecretInSerializer,
|
||||
} from "../models/operationalWebhookEndpointSecretIn";
|
||||
import {
|
||||
type OperationalWebhookEndpointSecretOut,
|
||||
OperationalWebhookEndpointSecretOutSerializer,
|
||||
} from "../models/operationalWebhookEndpointSecretOut";
|
||||
import {
|
||||
type OperationalWebhookEndpointUpdate,
|
||||
OperationalWebhookEndpointUpdateSerializer,
|
||||
} from "../models/operationalWebhookEndpointUpdate";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface OperationalWebhookEndpointListOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
}
|
||||
|
||||
export interface OperationalWebhookEndpointCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface OperationalWebhookEndpointRotateSecretOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class OperationalWebhookEndpoint {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** List operational webhook endpoints. */
|
||||
public list(
|
||||
options?: OperationalWebhookEndpointListOptions
|
||||
): Promise<ListResponseOperationalWebhookEndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/operational-webhook/endpoint"
|
||||
);
|
||||
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseOperationalWebhookEndpointOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Create an operational webhook endpoint. */
|
||||
public create(
|
||||
operationalWebhookEndpointIn: OperationalWebhookEndpointIn,
|
||||
options?: OperationalWebhookEndpointCreateOptions
|
||||
): Promise<OperationalWebhookEndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/operational-webhook/endpoint"
|
||||
);
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(
|
||||
OperationalWebhookEndpointInSerializer._toJsonObject(operationalWebhookEndpointIn)
|
||||
);
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
OperationalWebhookEndpointOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Get an operational webhook endpoint. */
|
||||
public get(endpointId: string): Promise<OperationalWebhookEndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/operational-webhook/endpoint/{endpoint_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
OperationalWebhookEndpointOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Update an operational webhook endpoint. */
|
||||
public update(
|
||||
endpointId: string,
|
||||
operationalWebhookEndpointUpdate: OperationalWebhookEndpointUpdate
|
||||
): Promise<OperationalWebhookEndpointOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PUT,
|
||||
"/api/v1/operational-webhook/endpoint/{endpoint_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setBody(
|
||||
OperationalWebhookEndpointUpdateSerializer._toJsonObject(
|
||||
operationalWebhookEndpointUpdate
|
||||
)
|
||||
);
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
OperationalWebhookEndpointOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Delete an operational webhook endpoint. */
|
||||
public delete(endpointId: string): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.DELETE,
|
||||
"/api/v1/operational-webhook/endpoint/{endpoint_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Get the additional headers to be sent with the operational webhook. */
|
||||
public getHeaders(endpointId: string): Promise<OperationalWebhookEndpointHeadersOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers"
|
||||
);
|
||||
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
OperationalWebhookEndpointHeadersOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Set the additional headers to be sent with the operational webhook. */
|
||||
public updateHeaders(
|
||||
endpointId: string,
|
||||
operationalWebhookEndpointHeadersIn: OperationalWebhookEndpointHeadersIn
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PUT,
|
||||
"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers"
|
||||
);
|
||||
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setBody(
|
||||
OperationalWebhookEndpointHeadersInSerializer._toJsonObject(
|
||||
operationalWebhookEndpointHeadersIn
|
||||
)
|
||||
);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an operational webhook endpoint's signing secret.
|
||||
*
|
||||
* This is used to verify the authenticity of the webhook.
|
||||
* For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
|
||||
*/
|
||||
public getSecret(endpointId: string): Promise<OperationalWebhookEndpointSecretOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret"
|
||||
);
|
||||
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
OperationalWebhookEndpointSecretOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotates an operational webhook endpoint's signing secret.
|
||||
*
|
||||
* The previous secret will remain valid for the next 24 hours.
|
||||
*/
|
||||
public rotateSecret(
|
||||
endpointId: string,
|
||||
operationalWebhookEndpointSecretIn: OperationalWebhookEndpointSecretIn,
|
||||
options?: OperationalWebhookEndpointRotateSecretOptions
|
||||
): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate"
|
||||
);
|
||||
|
||||
request.setPathParam("endpoint_id", endpointId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(
|
||||
OperationalWebhookEndpointSecretInSerializer._toJsonObject(
|
||||
operationalWebhookEndpointSecretIn
|
||||
)
|
||||
);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
}
|
||||
92
node_modules/svix/src/api/statistics.ts
generated
vendored
Normal file
92
node_modules/svix/src/api/statistics.ts
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type AggregateEventTypesOut,
|
||||
AggregateEventTypesOutSerializer,
|
||||
} from "../models/aggregateEventTypesOut";
|
||||
import {
|
||||
type AppUsageStatsIn,
|
||||
AppUsageStatsInSerializer,
|
||||
} from "../models/appUsageStatsIn";
|
||||
import {
|
||||
type AppUsageStatsOut,
|
||||
AppUsageStatsOutSerializer,
|
||||
} from "../models/appUsageStatsOut";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface StatisticsAggregateAppStatsOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class Statistics {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/**
|
||||
* Creates a background task to calculate the number of message attempts (`messageDestinations`) made for all applications in the environment.
|
||||
*
|
||||
* Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to
|
||||
* retrieve the results of the operation.
|
||||
*
|
||||
* The completed background task will return a payload like the following:
|
||||
* ```json
|
||||
* {
|
||||
* "id": "qtask_33qe39Stble9Rn3ZxFrqL5ZSsjT",
|
||||
* "status": "finished",
|
||||
* "task": "application.stats",
|
||||
* "data": {
|
||||
* "appStats": [
|
||||
* {
|
||||
* "messageDestinations": 2,
|
||||
* "appId": "app_33W1An2Zz5cO9SWbhHsYyDmVC6m",
|
||||
* "appUid": null
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
public aggregateAppStats(
|
||||
appUsageStatsIn: AppUsageStatsIn,
|
||||
options?: StatisticsAggregateAppStatsOptions
|
||||
): Promise<AppUsageStatsOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/stats/usage/app");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(AppUsageStatsInSerializer._toJsonObject(appUsageStatsIn));
|
||||
|
||||
return request.send(this.requestCtx, AppUsageStatsOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a background task to calculate the listed event types for all apps in the organization.
|
||||
*
|
||||
* Note that this endpoint is asynchronous. You will need to poll the `Get Background Task` endpoint to
|
||||
* retrieve the results of the operation.
|
||||
*
|
||||
* The completed background task will return a payload like the following:
|
||||
* ```json
|
||||
* {
|
||||
* "id": "qtask_33qe39Stble9Rn3ZxFrqL5ZSsjT",
|
||||
* "status": "finished",
|
||||
* "task": "event-type.aggregate",
|
||||
* "data": {
|
||||
* "event_types": [
|
||||
* {
|
||||
* "appId": "app_33W1An2Zz5cO9SWbhHsYyDmVC6m",
|
||||
* "explicitlySubscribedEventTypes": ["user.signup", "user.deleted"],
|
||||
* "hasCatchAllEndpoint": false
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
public aggregateEventTypes(): Promise<AggregateEventTypesOut> {
|
||||
const request = new SvixRequest(HttpMethod.PUT, "/api/v1/stats/usage/event-types");
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
AggregateEventTypesOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
}
|
||||
88
node_modules/svix/src/api/streaming.ts
generated
vendored
Normal file
88
node_modules/svix/src/api/streaming.ts
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type EndpointHeadersOut,
|
||||
EndpointHeadersOutSerializer,
|
||||
} from "../models/endpointHeadersOut";
|
||||
import {
|
||||
type HttpSinkHeadersPatchIn,
|
||||
HttpSinkHeadersPatchInSerializer,
|
||||
} from "../models/httpSinkHeadersPatchIn";
|
||||
import {
|
||||
type SinkTransformationOut,
|
||||
SinkTransformationOutSerializer,
|
||||
} from "../models/sinkTransformationOut";
|
||||
import { StreamingEventType } from "./streamingEventType";
|
||||
import { StreamingEvents } from "./streamingEvents";
|
||||
import { StreamingSink } from "./streamingSink";
|
||||
import { StreamingStream } from "./streamingStream";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export class Streaming {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
public get event_type() {
|
||||
return new StreamingEventType(this.requestCtx);
|
||||
}
|
||||
|
||||
public get events() {
|
||||
return new StreamingEvents(this.requestCtx);
|
||||
}
|
||||
|
||||
public get sink() {
|
||||
return new StreamingSink(this.requestCtx);
|
||||
}
|
||||
|
||||
public get stream() {
|
||||
return new StreamingStream(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Get the HTTP sink headers. Only valid for `http` or `otelTracing` sinks. */
|
||||
public sinkHeadersGet(streamId: string, sinkId: string): Promise<EndpointHeadersOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/stream/{stream_id}/sink/{sink_id}/headers"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
|
||||
return request.send(this.requestCtx, EndpointHeadersOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Updates the Sink's headers. Only valid for `http` or `otelTracing` sinks. */
|
||||
public sinkHeadersPatch(
|
||||
streamId: string,
|
||||
sinkId: string,
|
||||
httpSinkHeadersPatchIn: HttpSinkHeadersPatchIn
|
||||
): Promise<EndpointHeadersOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PATCH,
|
||||
"/api/v1/stream/{stream_id}/sink/{sink_id}/headers"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
request.setBody(
|
||||
HttpSinkHeadersPatchInSerializer._toJsonObject(httpSinkHeadersPatchIn)
|
||||
);
|
||||
|
||||
return request.send(this.requestCtx, EndpointHeadersOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get the transformation code associated with this sink. */
|
||||
public sinkTransformationGet(
|
||||
streamId: string,
|
||||
sinkId: string
|
||||
): Promise<SinkTransformationOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
|
||||
return request.send(this.requestCtx, SinkTransformationOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
126
node_modules/svix/src/api/streamingEventType.ts
generated
vendored
Normal file
126
node_modules/svix/src/api/streamingEventType.ts
generated
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type ListResponseStreamEventTypeOut,
|
||||
ListResponseStreamEventTypeOutSerializer,
|
||||
} from "../models/listResponseStreamEventTypeOut";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import {
|
||||
type StreamEventTypeIn,
|
||||
StreamEventTypeInSerializer,
|
||||
} from "../models/streamEventTypeIn";
|
||||
import {
|
||||
type StreamEventTypeOut,
|
||||
StreamEventTypeOutSerializer,
|
||||
} from "../models/streamEventTypeOut";
|
||||
import {
|
||||
type StreamEventTypePatch,
|
||||
StreamEventTypePatchSerializer,
|
||||
} from "../models/streamEventTypePatch";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface StreamingEventTypeListOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
/** Include archived (deleted but not expunged) items in the response. */
|
||||
includeArchived?: boolean;
|
||||
}
|
||||
|
||||
export interface StreamingEventTypeCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface StreamingEventTypeDeleteOptions {
|
||||
/** By default, event types are archived when "deleted". With this flag, they are deleted entirely. */
|
||||
expunge?: boolean;
|
||||
}
|
||||
|
||||
export class StreamingEventType {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** List of all the organization's event types for streaming. */
|
||||
public list(
|
||||
options?: StreamingEventTypeListOptions
|
||||
): Promise<ListResponseStreamEventTypeOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/stream/event-type");
|
||||
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
include_archived: options?.includeArchived,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseStreamEventTypeOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Create an event type for Streams. */
|
||||
public create(
|
||||
streamEventTypeIn: StreamEventTypeIn,
|
||||
options?: StreamingEventTypeCreateOptions
|
||||
): Promise<StreamEventTypeOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/stream/event-type");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(StreamEventTypeInSerializer._toJsonObject(streamEventTypeIn));
|
||||
|
||||
return request.send(this.requestCtx, StreamEventTypeOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get an event type. */
|
||||
public get(name: string): Promise<StreamEventTypeOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/stream/event-type/{name}");
|
||||
|
||||
request.setPathParam("name", name);
|
||||
|
||||
return request.send(this.requestCtx, StreamEventTypeOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Update or create a event type for Streams. */
|
||||
public update(
|
||||
name: string,
|
||||
streamEventTypeIn: StreamEventTypeIn
|
||||
): Promise<StreamEventTypeOut> {
|
||||
const request = new SvixRequest(HttpMethod.PUT, "/api/v1/stream/event-type/{name}");
|
||||
|
||||
request.setPathParam("name", name);
|
||||
request.setBody(StreamEventTypeInSerializer._toJsonObject(streamEventTypeIn));
|
||||
|
||||
return request.send(this.requestCtx, StreamEventTypeOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Delete an event type. */
|
||||
public delete(name: string, options?: StreamingEventTypeDeleteOptions): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.DELETE,
|
||||
"/api/v1/stream/event-type/{name}"
|
||||
);
|
||||
|
||||
request.setPathParam("name", name);
|
||||
request.setQueryParams({
|
||||
expunge: options?.expunge,
|
||||
});
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Patch an event type for Streams. */
|
||||
public patch(
|
||||
name: string,
|
||||
streamEventTypePatch: StreamEventTypePatch
|
||||
): Promise<StreamEventTypeOut> {
|
||||
const request = new SvixRequest(HttpMethod.PATCH, "/api/v1/stream/event-type/{name}");
|
||||
|
||||
request.setPathParam("name", name);
|
||||
request.setBody(StreamEventTypePatchSerializer._toJsonObject(streamEventTypePatch));
|
||||
|
||||
return request.send(this.requestCtx, StreamEventTypeOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
69
node_modules/svix/src/api/streamingEvents.ts
generated
vendored
Normal file
69
node_modules/svix/src/api/streamingEvents.ts
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type CreateStreamEventsIn,
|
||||
CreateStreamEventsInSerializer,
|
||||
} from "../models/createStreamEventsIn";
|
||||
import {
|
||||
type CreateStreamEventsOut,
|
||||
CreateStreamEventsOutSerializer,
|
||||
} from "../models/createStreamEventsOut";
|
||||
import { type EventStreamOut, EventStreamOutSerializer } from "../models/eventStreamOut";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface StreamingEventsCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface StreamingEventsGetOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
after?: Date | null;
|
||||
}
|
||||
|
||||
export class StreamingEvents {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** Creates events on the Stream. */
|
||||
public create(
|
||||
streamId: string,
|
||||
createStreamEventsIn: CreateStreamEventsIn,
|
||||
options?: StreamingEventsCreateOptions
|
||||
): Promise<CreateStreamEventsOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/stream/{stream_id}/events");
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(CreateStreamEventsInSerializer._toJsonObject(createStreamEventsIn));
|
||||
|
||||
return request.send(this.requestCtx, CreateStreamEventsOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate over a stream of events.
|
||||
*
|
||||
* The sink must be of type `poller` to use the poller endpoint.
|
||||
*/
|
||||
public get(
|
||||
streamId: string,
|
||||
sinkId: string,
|
||||
options?: StreamingEventsGetOptions
|
||||
): Promise<EventStreamOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/stream/{stream_id}/sink/{sink_id}/events"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
after: options?.after,
|
||||
});
|
||||
|
||||
return request.send(this.requestCtx, EventStreamOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
201
node_modules/svix/src/api/streamingSink.ts
generated
vendored
Normal file
201
node_modules/svix/src/api/streamingSink.ts
generated
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
// this file is @generated
|
||||
|
||||
import { type EmptyResponse, EmptyResponseSerializer } from "../models/emptyResponse";
|
||||
import {
|
||||
type EndpointSecretRotateIn,
|
||||
EndpointSecretRotateInSerializer,
|
||||
} from "../models/endpointSecretRotateIn";
|
||||
import {
|
||||
type ListResponseStreamSinkOut,
|
||||
ListResponseStreamSinkOutSerializer,
|
||||
} from "../models/listResponseStreamSinkOut";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import { type SinkSecretOut, SinkSecretOutSerializer } from "../models/sinkSecretOut";
|
||||
import {
|
||||
type SinkTransformIn,
|
||||
SinkTransformInSerializer,
|
||||
} from "../models/sinkTransformIn";
|
||||
import { type StreamSinkIn, StreamSinkInSerializer } from "../models/streamSinkIn";
|
||||
import { type StreamSinkOut, StreamSinkOutSerializer } from "../models/streamSinkOut";
|
||||
import {
|
||||
type StreamSinkPatch,
|
||||
StreamSinkPatchSerializer,
|
||||
} from "../models/streamSinkPatch";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface StreamingSinkListOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
}
|
||||
|
||||
export interface StreamingSinkCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export interface StreamingSinkRotateSecretOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class StreamingSink {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** List of all the stream's sinks. */
|
||||
public list(
|
||||
streamId: string,
|
||||
options?: StreamingSinkListOptions
|
||||
): Promise<ListResponseStreamSinkOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/stream/{stream_id}/sink");
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
});
|
||||
|
||||
return request.send(
|
||||
this.requestCtx,
|
||||
ListResponseStreamSinkOutSerializer._fromJsonObject
|
||||
);
|
||||
}
|
||||
|
||||
/** Creates a new sink. */
|
||||
public create(
|
||||
streamId: string,
|
||||
streamSinkIn: StreamSinkIn,
|
||||
options?: StreamingSinkCreateOptions
|
||||
): Promise<StreamSinkOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/stream/{stream_id}/sink");
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(StreamSinkInSerializer._toJsonObject(streamSinkIn));
|
||||
|
||||
return request.send(this.requestCtx, StreamSinkOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get a sink by id or uid. */
|
||||
public get(streamId: string, sinkId: string): Promise<StreamSinkOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/stream/{stream_id}/sink/{sink_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
|
||||
return request.send(this.requestCtx, StreamSinkOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Update a sink. */
|
||||
public update(
|
||||
streamId: string,
|
||||
sinkId: string,
|
||||
streamSinkIn: StreamSinkIn
|
||||
): Promise<StreamSinkOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PUT,
|
||||
"/api/v1/stream/{stream_id}/sink/{sink_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
request.setBody(StreamSinkInSerializer._toJsonObject(streamSinkIn));
|
||||
|
||||
return request.send(this.requestCtx, StreamSinkOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Delete a sink. */
|
||||
public delete(streamId: string, sinkId: string): Promise<void> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.DELETE,
|
||||
"/api/v1/stream/{stream_id}/sink/{sink_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Partially update a sink. */
|
||||
public patch(
|
||||
streamId: string,
|
||||
sinkId: string,
|
||||
streamSinkPatch: StreamSinkPatch
|
||||
): Promise<StreamSinkOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PATCH,
|
||||
"/api/v1/stream/{stream_id}/sink/{sink_id}"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
request.setBody(StreamSinkPatchSerializer._toJsonObject(streamSinkPatch));
|
||||
|
||||
return request.send(this.requestCtx, StreamSinkOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sink's signing secret (only supported for http sinks)
|
||||
*
|
||||
* This is used to verify the authenticity of the delivery.
|
||||
*
|
||||
* For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
|
||||
*/
|
||||
public getSecret(streamId: string, sinkId: string): Promise<SinkSecretOut> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.GET,
|
||||
"/api/v1/stream/{stream_id}/sink/{sink_id}/secret"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
|
||||
return request.send(this.requestCtx, SinkSecretOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Rotates the signing secret (only supported for http sinks). */
|
||||
public rotateSecret(
|
||||
streamId: string,
|
||||
sinkId: string,
|
||||
endpointSecretRotateIn: EndpointSecretRotateIn,
|
||||
options?: StreamingSinkRotateSecretOptions
|
||||
): Promise<EmptyResponse> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.POST,
|
||||
"/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(
|
||||
EndpointSecretRotateInSerializer._toJsonObject(endpointSecretRotateIn)
|
||||
);
|
||||
|
||||
return request.send(this.requestCtx, EmptyResponseSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Set or unset the transformation code associated with this sink. */
|
||||
public transformationPartialUpdate(
|
||||
streamId: string,
|
||||
sinkId: string,
|
||||
sinkTransformIn: SinkTransformIn
|
||||
): Promise<EmptyResponse> {
|
||||
const request = new SvixRequest(
|
||||
HttpMethod.PATCH,
|
||||
"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation"
|
||||
);
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setPathParam("sink_id", sinkId);
|
||||
request.setBody(SinkTransformInSerializer._toJsonObject(sinkTransformIn));
|
||||
|
||||
return request.send(this.requestCtx, EmptyResponseSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
92
node_modules/svix/src/api/streamingStream.ts
generated
vendored
Normal file
92
node_modules/svix/src/api/streamingStream.ts
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
// this file is @generated
|
||||
|
||||
import {
|
||||
type ListResponseStreamOut,
|
||||
ListResponseStreamOutSerializer,
|
||||
} from "../models/listResponseStreamOut";
|
||||
import type { Ordering } from "../models/ordering";
|
||||
import { type StreamIn, StreamInSerializer } from "../models/streamIn";
|
||||
import { type StreamOut, StreamOutSerializer } from "../models/streamOut";
|
||||
import { type StreamPatch, StreamPatchSerializer } from "../models/streamPatch";
|
||||
import { HttpMethod, SvixRequest, type SvixRequestContext } from "../request";
|
||||
|
||||
export interface StreamingStreamListOptions {
|
||||
/** Limit the number of returned items */
|
||||
limit?: number;
|
||||
/** The iterator returned from a prior invocation */
|
||||
iterator?: string | null;
|
||||
/** The sorting order of the returned items */
|
||||
order?: Ordering;
|
||||
}
|
||||
|
||||
export interface StreamingStreamCreateOptions {
|
||||
idempotencyKey?: string;
|
||||
}
|
||||
|
||||
export class StreamingStream {
|
||||
public constructor(private readonly requestCtx: SvixRequestContext) {}
|
||||
|
||||
/** List of all the organization's streams. */
|
||||
public list(options?: StreamingStreamListOptions): Promise<ListResponseStreamOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/stream");
|
||||
|
||||
request.setQueryParams({
|
||||
limit: options?.limit,
|
||||
iterator: options?.iterator,
|
||||
order: options?.order,
|
||||
});
|
||||
|
||||
return request.send(this.requestCtx, ListResponseStreamOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Creates a new stream. */
|
||||
public create(
|
||||
streamIn: StreamIn,
|
||||
options?: StreamingStreamCreateOptions
|
||||
): Promise<StreamOut> {
|
||||
const request = new SvixRequest(HttpMethod.POST, "/api/v1/stream");
|
||||
|
||||
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
|
||||
request.setBody(StreamInSerializer._toJsonObject(streamIn));
|
||||
|
||||
return request.send(this.requestCtx, StreamOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Get a stream by id or uid. */
|
||||
public get(streamId: string): Promise<StreamOut> {
|
||||
const request = new SvixRequest(HttpMethod.GET, "/api/v1/stream/{stream_id}");
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
|
||||
return request.send(this.requestCtx, StreamOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Update a stream. */
|
||||
public update(streamId: string, streamIn: StreamIn): Promise<StreamOut> {
|
||||
const request = new SvixRequest(HttpMethod.PUT, "/api/v1/stream/{stream_id}");
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setBody(StreamInSerializer._toJsonObject(streamIn));
|
||||
|
||||
return request.send(this.requestCtx, StreamOutSerializer._fromJsonObject);
|
||||
}
|
||||
|
||||
/** Delete a stream. */
|
||||
public delete(streamId: string): Promise<void> {
|
||||
const request = new SvixRequest(HttpMethod.DELETE, "/api/v1/stream/{stream_id}");
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
|
||||
return request.sendNoResponseBody(this.requestCtx);
|
||||
}
|
||||
|
||||
/** Partially update a stream. */
|
||||
public patch(streamId: string, streamPatch: StreamPatch): Promise<StreamOut> {
|
||||
const request = new SvixRequest(HttpMethod.PATCH, "/api/v1/stream/{stream_id}");
|
||||
|
||||
request.setPathParam("stream_id", streamId);
|
||||
request.setBody(StreamPatchSerializer._toJsonObject(streamPatch));
|
||||
|
||||
return request.send(this.requestCtx, StreamOutSerializer._fromJsonObject);
|
||||
}
|
||||
}
|
||||
3
node_modules/svix/src/index.test.ts
generated
vendored
Normal file
3
node_modules/svix/src/index.test.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import "./mockttp.test";
|
||||
import "./KitchenSink.test";
|
||||
import "./webhook.test";
|
||||
165
node_modules/svix/src/index.ts
generated
vendored
Normal file
165
node_modules/svix/src/index.ts
generated
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
// this file is @generated
|
||||
import { Application } from "./api/application";
|
||||
import { Authentication } from "./api/authentication";
|
||||
import { BackgroundTask } from "./api/backgroundTask";
|
||||
import { Connector } from "./api/connector";
|
||||
import { Endpoint } from "./api/endpoint";
|
||||
import { Environment } from "./api/environment";
|
||||
import { EventType } from "./api/eventType";
|
||||
import { Health } from "./api/health";
|
||||
import { Ingest } from "./api/ingest";
|
||||
import { Integration } from "./api/integration";
|
||||
import { Message } from "./api/message";
|
||||
import { MessageAttempt } from "./api/messageAttempt";
|
||||
import { OperationalWebhook } from "./api/operationalWebhook";
|
||||
import { Statistics } from "./api/statistics";
|
||||
import { Streaming } from "./api/streaming";
|
||||
import { OperationalWebhookEndpoint } from "./api/operationalWebhookEndpoint";
|
||||
import type { SvixRequestContext } from "./request";
|
||||
|
||||
export { PostOptions, ApiException } from "./util";
|
||||
export { HTTPValidationError, HttpErrorOut, ValidationError } from "./HttpErrors";
|
||||
export * from "./webhook";
|
||||
export * from "./models/index";
|
||||
import type { XOR } from "./util";
|
||||
|
||||
export { ApplicationListOptions } from "./api/application";
|
||||
export { BackgroundTaskListOptions } from "./api/backgroundTask";
|
||||
export { EndpointListOptions, EndpointGetStatsOptions } from "./api/endpoint";
|
||||
export { EventTypeListOptions } from "./api/eventType";
|
||||
export { IntegrationListOptions } from "./api/integration";
|
||||
export { MessageListOptions, messageInRaw } from "./api/message";
|
||||
export { MessageAttemptListByEndpointOptions } from "./api/messageAttempt";
|
||||
export { OperationalWebhookEndpointListOptions } from "./api/operationalWebhookEndpoint";
|
||||
|
||||
export type SvixOptions = {
|
||||
debug?: boolean;
|
||||
serverUrl?: string;
|
||||
/** Time in milliseconds to wait for requests to get a response. */
|
||||
requestTimeout?: number;
|
||||
/**
|
||||
* Custom fetch implementation to use for HTTP requests.
|
||||
* Useful for testing, adding custom middleware, or running in non-standard environments.
|
||||
*/
|
||||
fetch?: typeof fetch;
|
||||
} & XOR<
|
||||
{
|
||||
/** List of delays (in milliseconds) to wait before each retry attempt.*/
|
||||
retryScheduleInMs?: number[];
|
||||
},
|
||||
{
|
||||
/** The number of times the client will retry if a server-side error
|
||||
* or timeout is received.
|
||||
* Default: 2
|
||||
*/
|
||||
numRetries?: number;
|
||||
}
|
||||
>;
|
||||
|
||||
const REGIONS = [
|
||||
{ region: "us", url: "https://api.us.svix.com" },
|
||||
{ region: "eu", url: "https://api.eu.svix.com" },
|
||||
{ region: "in", url: "https://api.in.svix.com" },
|
||||
{ region: "ca", url: "https://api.ca.svix.com" },
|
||||
{ region: "au", url: "https://api.au.svix.com" },
|
||||
];
|
||||
|
||||
export class Svix {
|
||||
private readonly requestCtx: SvixRequestContext;
|
||||
|
||||
public constructor(token: string, options: SvixOptions = {}) {
|
||||
const regionalUrl = REGIONS.find((x) => x.region === token.split(".")[1])?.url;
|
||||
const baseUrl: string = options.serverUrl ?? regionalUrl ?? "https://api.svix.com";
|
||||
|
||||
if (options.retryScheduleInMs) {
|
||||
this.requestCtx = {
|
||||
baseUrl,
|
||||
token,
|
||||
timeout: options.requestTimeout,
|
||||
retryScheduleInMs: options.retryScheduleInMs,
|
||||
fetch: options.fetch,
|
||||
};
|
||||
return;
|
||||
}
|
||||
if (options.numRetries) {
|
||||
this.requestCtx = {
|
||||
baseUrl,
|
||||
token,
|
||||
timeout: options.requestTimeout,
|
||||
numRetries: options.numRetries,
|
||||
fetch: options.fetch,
|
||||
};
|
||||
return;
|
||||
}
|
||||
this.requestCtx = {
|
||||
baseUrl,
|
||||
token,
|
||||
timeout: options.requestTimeout,
|
||||
fetch: options.fetch,
|
||||
};
|
||||
}
|
||||
|
||||
public get application() {
|
||||
return new Application(this.requestCtx);
|
||||
}
|
||||
|
||||
public get authentication() {
|
||||
return new Authentication(this.requestCtx);
|
||||
}
|
||||
|
||||
public get backgroundTask() {
|
||||
return new BackgroundTask(this.requestCtx);
|
||||
}
|
||||
|
||||
public get connector() {
|
||||
return new Connector(this.requestCtx);
|
||||
}
|
||||
|
||||
public get endpoint() {
|
||||
return new Endpoint(this.requestCtx);
|
||||
}
|
||||
|
||||
public get environment() {
|
||||
return new Environment(this.requestCtx);
|
||||
}
|
||||
|
||||
public get eventType() {
|
||||
return new EventType(this.requestCtx);
|
||||
}
|
||||
|
||||
public get health() {
|
||||
return new Health(this.requestCtx);
|
||||
}
|
||||
|
||||
public get ingest() {
|
||||
return new Ingest(this.requestCtx);
|
||||
}
|
||||
|
||||
public get integration() {
|
||||
return new Integration(this.requestCtx);
|
||||
}
|
||||
|
||||
public get message() {
|
||||
return new Message(this.requestCtx);
|
||||
}
|
||||
|
||||
public get messageAttempt() {
|
||||
return new MessageAttempt(this.requestCtx);
|
||||
}
|
||||
|
||||
public get operationalWebhook() {
|
||||
return new OperationalWebhook(this.requestCtx);
|
||||
}
|
||||
|
||||
public get statistics() {
|
||||
return new Statistics(this.requestCtx);
|
||||
}
|
||||
|
||||
public get streaming() {
|
||||
return new Streaming(this.requestCtx);
|
||||
}
|
||||
|
||||
public get operationalWebhookEndpoint() {
|
||||
return new OperationalWebhookEndpoint(this.requestCtx);
|
||||
}
|
||||
}
|
||||
521
node_modules/svix/src/mockttp.test.ts
generated
vendored
Normal file
521
node_modules/svix/src/mockttp.test.ts
generated
vendored
Normal file
@@ -0,0 +1,521 @@
|
||||
import { BackgroundTaskType, MessageAttemptTriggerType, Svix } from ".";
|
||||
import { test } from "node:test";
|
||||
import { strict as assert } from "node:assert/strict";
|
||||
import * as mockttp from "mockttp";
|
||||
import { ApiException } from "./util";
|
||||
import { Ordering } from "./models/ordering";
|
||||
import type { ValidationError, HttpErrorOut } from "./HttpErrors";
|
||||
import { LIB_VERSION } from "./request";
|
||||
|
||||
const ApplicationOut = `{"uid":"unique-identifier","name":"My first application","rateLimit":0,"id":"app_1srOrx2ZWZBpBUvZwXKQmoEYga2","createdAt":"2019-08-24T14:15:22Z","updatedAt":"2019-08-24T14:15:22Z","metadata":{"property1":"string","property2":"string"}}`;
|
||||
const ListResponseMessageOut = `{"data":[{"eventId":"unique-identifier","eventType":"user.signup","payload":{"email":"test@example.com","type":"user.created","username":"test_user"},"channels":["project_123","group_2"],"id":"msg_1srOrx2ZWZBpBUvZwXKQmoEYga2","timestamp":"2019-08-24T14:15:22Z","tags":["project_1337"]}],"iterator":"iterator","prevIterator":"-iterator","done":true}`;
|
||||
const ListResponseApplicationOut = `{"data":[{"uid":"unique-identifier","name":"My first application","rateLimit":0,"id":"app_1srOrx2ZWZBpBUvZwXKQmoEYga2","createdAt":"2019-08-24T14:15:22Z","updatedAt":"2019-08-24T14:15:22Z","metadata":{"property1":"string","property2":"string"}}],"iterator":"iterator","prevIterator":"-iterator","done":true}`;
|
||||
const ListResponseMessageAttemptOut = `{"data":[{"url":"https://example.com/webhook/","response":"{}","responseStatusCode":200,"responseDurationMs":0,"status":0,"triggerType":0,"msgId":"msg_1srOrx2ZWZBpBUvZwXKQmoEYga2","endpointId":"ep_1srOrx2ZWZBpBUvZwXKQmoEYga2","id":"atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2","timestamp":"2025-02-16T21:38:21.977Z","msg":{"eventId":"unique-identifier","eventType":"user.signup","payload":{"email":"test@example.com","type":"user.created","username":"test_user"},"channels":["project_123","group_2"],"id":"msg_1srOrx2ZWZBpBUvZwXKQmoEYga2","timestamp":"2025-02-16T21:38:21.977Z","tags":["project_1337"]}}],"iterator":"iterator","prevIterator":"-iterator","done":true}`;
|
||||
const ListResponseOperationalWebhookEndpointOut = `{"data":[{"id":"ep_1srOrx2ZWZBpBUvZwXKQmoEYga2","description":"string","rateLimit":0,"uid":"unique-identifier","url":"https://example.com/webhook/","disabled":false,"filterTypes":["message.attempt.failing"],"createdAt":"2019-08-24T14:15:22Z","updatedAt":"2019-08-24T14:15:22Z","metadata":{"property1":"string","property2":"string"}}],"iterator":"iterator","prevIterator":"-iterator","done":true}`;
|
||||
const ListResponseBackgroundTaskOut = `{"data":[{"data":{},"id":"qtask_1srOrx2ZWZBpBUvZwXKQmoEYga2","status":"running","task":"endpoint.replay","updatedAt":"2025-03-03T03:03:03.000000Z"}],"iterator":"iterator","prevIterator":"-iterator","done":true}`;
|
||||
const EventTypeImportOpenApiOut = `{"data":{"modified":["user.signup"],"to_modify":[{"name":"user.signup","description":"string","schemas":{},"deprecated":true,"featureFlag":"cool-new-feature","groupName":"user"}]}}`;
|
||||
const ReplayOut = `{"id":"qtask_1srOrx2ZWZBpBUvZwXKQmoEYga2","status":"running","task":"endpoint.replay","updatedAt":"2025-03-03T03:03:03.000000Z"}`;
|
||||
const EndpointOut = `{"description":"string","rateLimit":0,"uid":"unique-identifier","url":"http://example.com","version":1,"disabled":true,"filterTypes":["user.signup"],"channels":["project_1337"],"secret":"whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD","metadata":{"property1":"string","property2":"string"}}`;
|
||||
const ValidationErrorOut = `{"detail":[{"loc":["string"],"msg":"string","type":"string"}]}`;
|
||||
const IngestSourceOutCron = `{"type":"cron","config":{"schedule":"hello","payload":"world"},"id":"src_2yZwUhtgs5Ai8T9yRQJXA","uid":"unique-identifier","name":"string","ingestUrl":"http://example.com","createdAt":"2019-08-24T14:15:22Z","updatedAt":"2019-08-24T14:15:22Z"}`;
|
||||
const IngestSourceOutGeneric = `{"type":"generic-webhook","config":{},"id":"src_2yZwUhtgs5Ai8T9yRQJXA","uid":"unique-identifier","name":"string","ingestUrl":"http://example.com","createdAt":"2019-08-24T14:15:22Z","updatedAt":"2019-08-24T14:15:22Z"}`;
|
||||
const mockServer = mockttp.getLocal();
|
||||
|
||||
test("mockttp tests", async (t) => {
|
||||
t.beforeEach(async () => await mockServer.start(0));
|
||||
t.afterEach(async () => await mockServer.stop());
|
||||
|
||||
await t.test("test Date in query param", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet(/\/api\/v1\/app\/app1\/attempt\/endpoint\/ep1.*/)
|
||||
.thenReply(200, ListResponseMessageAttemptOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.messageAttempt.listByEndpoint("app1", "ep1", {
|
||||
before: new Date(1739741901977),
|
||||
});
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert(requests[0].url.endsWith("before=2025-02-16T21%3A38%3A21.977Z"));
|
||||
});
|
||||
|
||||
await t.test("test Date request body", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forPost("/api/v1/app/app1/endpoint/ep1/replay-missing")
|
||||
.thenReply(200, ReplayOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.endpoint.replayMissing("app1", "ep1", { since: new Date(1739741901977) });
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert.equal(
|
||||
await requests[0].body.getText(),
|
||||
`{"since":"2025-02-16T21:38:21.977Z"}`
|
||||
);
|
||||
});
|
||||
|
||||
await t.test("test Date response body", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/app/app1/attempt/endpoint/ep1")
|
||||
.thenReply(200, ListResponseMessageAttemptOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
const res = await svx.messageAttempt.listByEndpoint("app1", "ep1");
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert.equal(res.data[0].timestamp?.getTime(), 1739741901977);
|
||||
});
|
||||
|
||||
await t.test("test listResponseOut deserializes correctly", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/app/app1/attempt/endpoint/ep1")
|
||||
.thenReply(200, `{"data":[],"iterator":null,"prevIterator":null,"done":true}`);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
const res = await svx.messageAttempt.listByEndpoint("app1", "ep1");
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert.equal(res.iterator, null);
|
||||
assert.equal(res.prevIterator, null);
|
||||
});
|
||||
|
||||
await t.test("test enum as query param", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet(/\/api\/v1\/app.*/)
|
||||
.thenReply(200, ListResponseApplicationOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.application.list({ order: Ordering.Ascending });
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert(requests[0].url.endsWith("order=ascending"));
|
||||
});
|
||||
|
||||
await t.test("test list as query param", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet(/\/api\/v1\/app\/app1\/msg.*/)
|
||||
.thenReply(200, ListResponseMessageOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.message.list("app1", { eventTypes: ["val8", "val1", "val5"] });
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert(
|
||||
requests[0].url.endsWith("/api/v1/app/app1/msg?event_types=val8%2Cval1%2Cval5")
|
||||
);
|
||||
});
|
||||
|
||||
await t.test("test header param sent", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forPost(/\/api\/v1\/app.*/)
|
||||
.thenReply(200, ApplicationOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.application.create({ name: "test" }, { idempotencyKey: "random-key" });
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert.equal(requests[0].headers["idempotency-key"], "random-key");
|
||||
});
|
||||
|
||||
await t.test("test retry for status => 500", async () => {
|
||||
const numRetries = 5;
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/app")
|
||||
.thenReply(500, `{"code":"500","detail":"asd"}`);
|
||||
const svx = new Svix("token", {
|
||||
serverUrl: mockServer.url,
|
||||
numRetries,
|
||||
});
|
||||
|
||||
await assert.rejects(svx.application.list(), ApiException);
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, numRetries + 1);
|
||||
|
||||
// same svix-req-id for each retry
|
||||
const req_id = requests[0].headers["svix-req-id"];
|
||||
assert(req_id);
|
||||
assert.equal(typeof req_id, "string");
|
||||
for (let i = 0; i < requests.length; i++) {
|
||||
assert.equal(requests[i].headers["svix-req-id"], req_id);
|
||||
if (i === 0) {
|
||||
// first request does not set svix-retry-count
|
||||
assert.equal(requests[i].headers["svix-retry-count"], undefined);
|
||||
} else {
|
||||
assert.equal(requests[i].headers["svix-retry-count"], i.toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
await t.test("test retry schedule for status => 500", async () => {
|
||||
const retryScheduleInMs = [60, 120, 240];
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/app")
|
||||
.thenReply(500, `{"code":"500","detail":"asd"}`);
|
||||
const before = Date.now();
|
||||
const svx = new Svix("token", {
|
||||
serverUrl: mockServer.url,
|
||||
retryScheduleInMs,
|
||||
});
|
||||
|
||||
await assert.rejects(svx.application.list(), ApiException);
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, retryScheduleInMs.length + 1);
|
||||
|
||||
const after = Date.now();
|
||||
|
||||
assert(after - before >= retryScheduleInMs.reduce((prev, curr) => prev + curr, 0));
|
||||
});
|
||||
|
||||
await t.test("no body in response does not return anything", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forDelete("/api/v1/app/app1")
|
||||
.thenReply(204, "");
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.application.delete("app1");
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
});
|
||||
|
||||
await t.test("422 returns validation error", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/app")
|
||||
.thenReply(422, ValidationErrorOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await assert.rejects(svx.application.list(), ApiException<ValidationError>);
|
||||
try {
|
||||
await svx.application.list();
|
||||
} catch (e) {
|
||||
const error = e as ApiException<ValidationError>;
|
||||
assert.equal(error.code, 422);
|
||||
assert.deepEqual(error.body, {
|
||||
detail: [{ loc: ["string"], msg: "string", type: "string" }],
|
||||
});
|
||||
}
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 2);
|
||||
});
|
||||
|
||||
await t.test("400 returns ApiException", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/app")
|
||||
.thenReply(400, `{"code":"400","detail":"text"}`);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await assert.rejects(svx.application.list(), ApiException<HttpErrorOut>);
|
||||
try {
|
||||
await svx.application.list();
|
||||
} catch (e) {
|
||||
const error = e as ApiException<HttpErrorOut>;
|
||||
assert.equal(error.code, 400);
|
||||
assert.deepEqual(error.body, { code: "400", detail: "text" });
|
||||
}
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 2);
|
||||
});
|
||||
|
||||
await t.test("sub-resource works", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/operational-webhook/endpoint")
|
||||
.thenReply(200, ListResponseOperationalWebhookEndpointOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.operationalWebhookEndpoint.list();
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
});
|
||||
|
||||
await t.test("integer enum serialization", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/app/app1/attempt/endpoint/endp1")
|
||||
.thenReply(200, ListResponseMessageAttemptOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
const res = await svx.messageAttempt.listByEndpoint("app1", "endp1");
|
||||
assert.equal(res.data[0].triggerType, MessageAttemptTriggerType.Scheduled);
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
});
|
||||
|
||||
await t.test("string enum de/serialization", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/background-task")
|
||||
.thenReply(200, ListResponseBackgroundTaskOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
const res = await svx.backgroundTask.list({
|
||||
task: BackgroundTaskType.EndpointReplay,
|
||||
});
|
||||
assert.equal(res.data[0].task, BackgroundTaskType.EndpointReplay);
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert(requests[0].url.endsWith("api/v1/background-task?task=endpoint.replay"));
|
||||
});
|
||||
|
||||
await t.test("non-camelCase field name", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forPost("/api/v1/event-type/import/openapi")
|
||||
.thenReply(200, EventTypeImportOpenApiOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
const res = await svx.eventType.importOpenapi({ dryRun: true });
|
||||
assert.deepEqual(res.data.toModify, [
|
||||
{
|
||||
name: "user.signup",
|
||||
description: "string",
|
||||
schemas: {},
|
||||
deprecated: true,
|
||||
featureFlag: "cool-new-feature",
|
||||
featureFlags: undefined,
|
||||
groupName: "user",
|
||||
},
|
||||
]);
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
});
|
||||
|
||||
await t.test("patch request body", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forPatch("/api/v1/app/app1/endpoint/endp1")
|
||||
.thenReply(200, EndpointOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.endpoint.patch("app1", "endp1", { filterTypes: ["ty1"] });
|
||||
await svx.endpoint.patch("app1", "endp1", { filterTypes: null });
|
||||
await svx.endpoint.patch("app1", "endp1", { description: "text" });
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 3);
|
||||
|
||||
// nullable field is sent
|
||||
assert.equal(await requests[0].body.getText(), `{"filterTypes":["ty1"]}`);
|
||||
// nullable field is null
|
||||
assert.equal(await requests[1].body.getText(), `{"filterTypes":null}`);
|
||||
// undefined field is omitted
|
||||
assert.equal(await requests[2].body.getText(), `{"description":"text"}`);
|
||||
});
|
||||
|
||||
await t.test("arbitrary json object body", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forPost("/api/v1/app/app1/msg")
|
||||
.thenReply(200, EndpointOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.message.create("app1", {
|
||||
eventType: "asd",
|
||||
payload: { key1: "val", list: ["val1"], obj: { key: "val2" } },
|
||||
});
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert.equal(
|
||||
await requests[0].body.getText(),
|
||||
`{"eventType":"asd","payload":{"key1":"val","list":["val1"],"obj":{"key":"val2"}}}`
|
||||
);
|
||||
});
|
||||
|
||||
await t.test("token/user-agent is sent", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forDelete("/api/v1/app/app1")
|
||||
.thenReply(200, EndpointOut);
|
||||
const svx = new Svix("token.eu", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.application.delete("app1");
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert.equal(requests[0].headers["authorization"], "Bearer token.eu");
|
||||
assert.equal(
|
||||
requests[0].headers["user-agent"],
|
||||
`svix-libs/${LIB_VERSION}/javascript`
|
||||
);
|
||||
});
|
||||
|
||||
await t.test("MessageAttemptOut without msg", async () => {
|
||||
const RES = `{
|
||||
"data": [
|
||||
{
|
||||
"url": "https://example.com/webhook/",
|
||||
"response": "{}",
|
||||
"responseStatusCode": 200,
|
||||
"responseDurationMs": 0,
|
||||
"status": 0,
|
||||
"triggerType": 0,
|
||||
"msgId": "msg_1srOrx2ZWZBpBUvZwXKQmoEYga2",
|
||||
"endpointId": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2",
|
||||
"id": "atmpt_1srOrx2ZWZBpBUvZwXKQmoEYga2",
|
||||
"timestamp": "2019-08-24T14:15:22Z"
|
||||
}
|
||||
],
|
||||
"iterator": "iterator",
|
||||
"prevIterator": "-iterator",
|
||||
"done": true
|
||||
}`;
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/app/app/attempt/endpoint/edp")
|
||||
.thenReply(200, RES);
|
||||
|
||||
const svx = new Svix("token.eu", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.messageAttempt.listByEndpoint("app", "edp");
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
});
|
||||
|
||||
await t.test("octothorpe in url query", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/app/app1/msg")
|
||||
.thenReply(200, ListResponseMessageOut);
|
||||
const svx = new Svix("token.eu", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.message.list("app1", { tag: "test#test" });
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert(requests[0].url.endsWith("api/v1/app/app1/msg?tag=test%23test"));
|
||||
});
|
||||
|
||||
await t.test("content-type application/json is sent on request with body", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forPost(/\/api\/v1\/app.*/)
|
||||
.thenReply(200, ApplicationOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.application.create({ name: "test" });
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert.equal(requests[0].headers["content-type"], "application/json");
|
||||
});
|
||||
|
||||
await t.test("content type not sent on request without body", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/app")
|
||||
.thenReply(200, ListResponseApplicationOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.application.list();
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert.equal(requests[0].headers["content-type"], undefined);
|
||||
});
|
||||
|
||||
await t.test("struct enum with extra fields", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forPost("/ingest/api/v1/source")
|
||||
.thenReply(200, IngestSourceOutCron);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
const res = await svx.ingest.source.create({
|
||||
name: "crontab -r",
|
||||
type: "cron",
|
||||
config: { schedule: "hello", payload: "world" },
|
||||
});
|
||||
|
||||
assert.equal(res.type, "cron");
|
||||
// this will smart cast res.config
|
||||
if (res.type === "cron") {
|
||||
assert.equal(res.config.schedule, "hello");
|
||||
assert.equal(res.config.payload, "world");
|
||||
}
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(
|
||||
await requests[0].body.getText(),
|
||||
'{"type":"cron","config":{"payload":"world","schedule":"hello"},"name":"crontab -r"}'
|
||||
);
|
||||
});
|
||||
|
||||
await t.test("struct enum with no extra fields", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forPost("/ingest/api/v1/source")
|
||||
.thenReply(200, IngestSourceOutGeneric);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
const res = await svx.ingest.source.create({
|
||||
name: "generic over <T>",
|
||||
type: "generic-webhook",
|
||||
});
|
||||
|
||||
assert.equal(res.type, "generic-webhook");
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
// empty config object should be sent
|
||||
assert.equal(
|
||||
await requests[0].body.getText(),
|
||||
'{"type":"generic-webhook","config":{},"name":"generic over <T>"}'
|
||||
);
|
||||
});
|
||||
|
||||
await t.test("test idempotency key is sent for create request", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forPost("/api/v1/app")
|
||||
.thenReply(200, ApplicationOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.application.create({ name: "test app" });
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
const idempotencyKey = requests[0].headers["idempotency-key"] as string;
|
||||
assert(idempotencyKey.startsWith("auto_"));
|
||||
});
|
||||
|
||||
await t.test("test client provided idempotency key is not overridden", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forPost("/api/v1/app")
|
||||
.thenReply(200, ApplicationOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
const clientProvidedKey = "test-key-123";
|
||||
await svx.application.create(
|
||||
{ name: "test app" },
|
||||
{ idempotencyKey: clientProvidedKey }
|
||||
);
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
assert.equal(requests[0].headers["idempotency-key"], clientProvidedKey);
|
||||
});
|
||||
|
||||
await t.test("test unknown keys are ignored", async () => {
|
||||
const endpointMock = await mockServer
|
||||
.forGet("/api/v1/app")
|
||||
.thenReply(
|
||||
200,
|
||||
`{"data":[],"done":true,"iterator":null,"prevIterator":null,"extra-key":"ignored"}`
|
||||
);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url });
|
||||
|
||||
await svx.application.list();
|
||||
|
||||
const requests = await endpointMock.getSeenRequests();
|
||||
assert.equal(requests.length, 1);
|
||||
});
|
||||
|
||||
await t.test("should use custom fetch implementation", async () => {
|
||||
let customFetchCalled = false;
|
||||
const mockFetch: typeof fetch = async (_input, _init) => {
|
||||
customFetchCalled = true;
|
||||
return new Response(ListResponseApplicationOut, {
|
||||
status: 200,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
};
|
||||
|
||||
await mockServer
|
||||
.forGet(/\/api\/v1\/app.*/)
|
||||
.thenReply(200, ListResponseApplicationOut);
|
||||
const svx = new Svix("token", { serverUrl: mockServer.url, fetch: mockFetch });
|
||||
await svx.application.list({ order: Ordering.Ascending });
|
||||
assert(customFetchCalled);
|
||||
});
|
||||
});
|
||||
19
node_modules/svix/src/models/adobeSignConfig.ts
generated
vendored
Normal file
19
node_modules/svix/src/models/adobeSignConfig.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface AdobeSignConfig {
|
||||
clientId: string;
|
||||
}
|
||||
|
||||
export const AdobeSignConfigSerializer = {
|
||||
_fromJsonObject(object: any): AdobeSignConfig {
|
||||
return {
|
||||
clientId: object["clientId"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: AdobeSignConfig): any {
|
||||
return {
|
||||
clientId: self.clientId,
|
||||
};
|
||||
},
|
||||
};
|
||||
15
node_modules/svix/src/models/adobeSignConfigOut.ts
generated
vendored
Normal file
15
node_modules/svix/src/models/adobeSignConfigOut.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// this file is @generated
|
||||
|
||||
// biome-ignore-all lint/suspicious/noEmptyInterface: backwards compat
|
||||
|
||||
export interface AdobeSignConfigOut {}
|
||||
|
||||
export const AdobeSignConfigOutSerializer = {
|
||||
_fromJsonObject(_object: any): AdobeSignConfigOut {
|
||||
return {};
|
||||
},
|
||||
|
||||
_toJsonObject(_self: AdobeSignConfigOut): any {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
37
node_modules/svix/src/models/aggregateEventTypesOut.ts
generated
vendored
Normal file
37
node_modules/svix/src/models/aggregateEventTypesOut.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type BackgroundTaskStatus,
|
||||
BackgroundTaskStatusSerializer,
|
||||
} from "./backgroundTaskStatus";
|
||||
import {
|
||||
type BackgroundTaskType,
|
||||
BackgroundTaskTypeSerializer,
|
||||
} from "./backgroundTaskType";
|
||||
|
||||
export interface AggregateEventTypesOut {
|
||||
/** The QueueBackgroundTask's ID. */
|
||||
id: string;
|
||||
status: BackgroundTaskStatus;
|
||||
task: BackgroundTaskType;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export const AggregateEventTypesOutSerializer = {
|
||||
_fromJsonObject(object: any): AggregateEventTypesOut {
|
||||
return {
|
||||
id: object["id"],
|
||||
status: BackgroundTaskStatusSerializer._fromJsonObject(object["status"]),
|
||||
task: BackgroundTaskTypeSerializer._fromJsonObject(object["task"]),
|
||||
updatedAt: new Date(object["updatedAt"]),
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: AggregateEventTypesOut): any {
|
||||
return {
|
||||
id: self.id,
|
||||
status: BackgroundTaskStatusSerializer._toJsonObject(self.status),
|
||||
task: BackgroundTaskTypeSerializer._toJsonObject(self.task),
|
||||
updatedAt: self.updatedAt,
|
||||
};
|
||||
},
|
||||
};
|
||||
19
node_modules/svix/src/models/airwallexConfig.ts
generated
vendored
Normal file
19
node_modules/svix/src/models/airwallexConfig.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface AirwallexConfig {
|
||||
secret: string;
|
||||
}
|
||||
|
||||
export const AirwallexConfigSerializer = {
|
||||
_fromJsonObject(object: any): AirwallexConfig {
|
||||
return {
|
||||
secret: object["secret"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: AirwallexConfig): any {
|
||||
return {
|
||||
secret: self.secret,
|
||||
};
|
||||
},
|
||||
};
|
||||
15
node_modules/svix/src/models/airwallexConfigOut.ts
generated
vendored
Normal file
15
node_modules/svix/src/models/airwallexConfigOut.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// this file is @generated
|
||||
|
||||
// biome-ignore-all lint/suspicious/noEmptyInterface: backwards compat
|
||||
|
||||
export interface AirwallexConfigOut {}
|
||||
|
||||
export const AirwallexConfigOutSerializer = {
|
||||
_fromJsonObject(_object: any): AirwallexConfigOut {
|
||||
return {};
|
||||
},
|
||||
|
||||
_toJsonObject(_self: AirwallexConfigOut): any {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
31
node_modules/svix/src/models/amazonS3PatchConfig.ts
generated
vendored
Normal file
31
node_modules/svix/src/models/amazonS3PatchConfig.ts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface AmazonS3PatchConfig {
|
||||
accessKeyId?: string;
|
||||
bucket?: string;
|
||||
endpointUrl?: string;
|
||||
region?: string;
|
||||
secretAccessKey?: string;
|
||||
}
|
||||
|
||||
export const AmazonS3PatchConfigSerializer = {
|
||||
_fromJsonObject(object: any): AmazonS3PatchConfig {
|
||||
return {
|
||||
accessKeyId: object["accessKeyId"],
|
||||
bucket: object["bucket"],
|
||||
endpointUrl: object["endpointUrl"],
|
||||
region: object["region"],
|
||||
secretAccessKey: object["secretAccessKey"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: AmazonS3PatchConfig): any {
|
||||
return {
|
||||
accessKeyId: self.accessKeyId,
|
||||
bucket: self.bucket,
|
||||
endpointUrl: self.endpointUrl,
|
||||
region: self.region,
|
||||
secretAccessKey: self.secretAccessKey,
|
||||
};
|
||||
},
|
||||
};
|
||||
34
node_modules/svix/src/models/apiTokenOut.ts
generated
vendored
Normal file
34
node_modules/svix/src/models/apiTokenOut.ts
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface ApiTokenOut {
|
||||
createdAt: Date;
|
||||
expiresAt?: Date | null;
|
||||
id: string;
|
||||
name?: string | null;
|
||||
scopes?: string[] | null;
|
||||
token: string;
|
||||
}
|
||||
|
||||
export const ApiTokenOutSerializer = {
|
||||
_fromJsonObject(object: any): ApiTokenOut {
|
||||
return {
|
||||
createdAt: new Date(object["createdAt"]),
|
||||
expiresAt: object["expiresAt"] ? new Date(object["expiresAt"]) : null,
|
||||
id: object["id"],
|
||||
name: object["name"],
|
||||
scopes: object["scopes"],
|
||||
token: object["token"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: ApiTokenOut): any {
|
||||
return {
|
||||
createdAt: self.createdAt,
|
||||
expiresAt: self.expiresAt,
|
||||
id: self.id,
|
||||
name: self.name,
|
||||
scopes: self.scopes,
|
||||
token: self.token,
|
||||
};
|
||||
},
|
||||
};
|
||||
89
node_modules/svix/src/models/appPortalAccessIn.ts
generated
vendored
Normal file
89
node_modules/svix/src/models/appPortalAccessIn.ts
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type AppPortalCapability,
|
||||
AppPortalCapabilitySerializer,
|
||||
} from "./appPortalCapability";
|
||||
import { type ApplicationIn, ApplicationInSerializer } from "./applicationIn";
|
||||
|
||||
export interface AppPortalAccessIn {
|
||||
/**
|
||||
* Optionally creates a new application while generating the access link.
|
||||
*
|
||||
* If the application id or uid that is used in the path already exists, this argument is ignored.
|
||||
*/
|
||||
application?: ApplicationIn | null;
|
||||
/**
|
||||
* Custom capabilities attached to the token, You can combine as many capabilities as necessary.
|
||||
*
|
||||
* The `ViewBase` capability is always required
|
||||
*
|
||||
* - `ViewBase`: Basic read only permissions, does not allow the user to see the endpoint secret.
|
||||
*
|
||||
* - `ViewEndpointSecret`: Allows user to view the endpoint secret.
|
||||
*
|
||||
* - `ManageEndpointSecret`: Allows user to rotate and view the endpoint secret.
|
||||
*
|
||||
* - `ManageTransformations`: Allows user to modify the endpoint transformations.
|
||||
*
|
||||
* - `CreateAttempts`: Allows user to replay missing messages and send example messages.
|
||||
*
|
||||
* - `ManageEndpoint`: Allows user to read/modify any field or configuration of an endpoint (including secrets)
|
||||
*
|
||||
* By default, the token will get all capabilities if the capabilities are not explicitly specified.
|
||||
*/
|
||||
capabilities?: AppPortalCapability[] | null;
|
||||
/**
|
||||
* How long the token will be valid for, in seconds.
|
||||
*
|
||||
* Valid values are between 1 hour and 7 days. The default is 7 days.
|
||||
*/
|
||||
expiry?: number | null;
|
||||
/** The set of feature flags the created token will have access to. */
|
||||
featureFlags?: string[];
|
||||
/**
|
||||
* Whether the app portal should be in read-only mode.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
readOnly?: boolean | null;
|
||||
/**
|
||||
* An optional session ID to attach to the token.
|
||||
*
|
||||
* When expiring tokens with "Expire All", you can include the session ID to only expire tokens that were created with that session ID.
|
||||
*/
|
||||
sessionId?: string | null;
|
||||
}
|
||||
|
||||
export const AppPortalAccessInSerializer = {
|
||||
_fromJsonObject(object: any): AppPortalAccessIn {
|
||||
return {
|
||||
application:
|
||||
object["application"] != null
|
||||
? ApplicationInSerializer._fromJsonObject(object["application"])
|
||||
: undefined,
|
||||
capabilities: object["capabilities"]?.map((item: AppPortalCapability) =>
|
||||
AppPortalCapabilitySerializer._fromJsonObject(item)
|
||||
),
|
||||
expiry: object["expiry"],
|
||||
featureFlags: object["featureFlags"],
|
||||
readOnly: object["readOnly"],
|
||||
sessionId: object["sessionId"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: AppPortalAccessIn): any {
|
||||
return {
|
||||
application:
|
||||
self.application != null
|
||||
? ApplicationInSerializer._toJsonObject(self.application)
|
||||
: undefined,
|
||||
capabilities: self.capabilities?.map((item) =>
|
||||
AppPortalCapabilitySerializer._toJsonObject(item)
|
||||
),
|
||||
expiry: self.expiry,
|
||||
featureFlags: self.featureFlags,
|
||||
readOnly: self.readOnly,
|
||||
sessionId: self.sessionId,
|
||||
};
|
||||
},
|
||||
};
|
||||
22
node_modules/svix/src/models/appPortalAccessOut.ts
generated
vendored
Normal file
22
node_modules/svix/src/models/appPortalAccessOut.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface AppPortalAccessOut {
|
||||
token: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export const AppPortalAccessOutSerializer = {
|
||||
_fromJsonObject(object: any): AppPortalAccessOut {
|
||||
return {
|
||||
token: object["token"],
|
||||
url: object["url"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: AppPortalAccessOut): any {
|
||||
return {
|
||||
token: self.token,
|
||||
url: self.url,
|
||||
};
|
||||
},
|
||||
};
|
||||
20
node_modules/svix/src/models/appPortalCapability.ts
generated
vendored
Normal file
20
node_modules/svix/src/models/appPortalCapability.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// this file is @generated
|
||||
|
||||
export enum AppPortalCapability {
|
||||
ViewBase = "ViewBase",
|
||||
ViewEndpointSecret = "ViewEndpointSecret",
|
||||
ManageEndpointSecret = "ManageEndpointSecret",
|
||||
ManageTransformations = "ManageTransformations",
|
||||
CreateAttempts = "CreateAttempts",
|
||||
ManageEndpoint = "ManageEndpoint",
|
||||
}
|
||||
|
||||
export const AppPortalCapabilitySerializer = {
|
||||
_fromJsonObject(object: any): AppPortalCapability {
|
||||
return object;
|
||||
},
|
||||
|
||||
_toJsonObject(self: AppPortalCapability): any {
|
||||
return self;
|
||||
},
|
||||
};
|
||||
30
node_modules/svix/src/models/appUsageStatsIn.ts
generated
vendored
Normal file
30
node_modules/svix/src/models/appUsageStatsIn.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface AppUsageStatsIn {
|
||||
/**
|
||||
* Specific app IDs or UIDs to aggregate stats for.
|
||||
*
|
||||
* Note that if none of the given IDs or UIDs are resolved, a 422 response will be given.
|
||||
*/
|
||||
appIds?: string[] | null;
|
||||
since: Date;
|
||||
until: Date;
|
||||
}
|
||||
|
||||
export const AppUsageStatsInSerializer = {
|
||||
_fromJsonObject(object: any): AppUsageStatsIn {
|
||||
return {
|
||||
appIds: object["appIds"],
|
||||
since: new Date(object["since"]),
|
||||
until: new Date(object["until"]),
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: AppUsageStatsIn): any {
|
||||
return {
|
||||
appIds: self.appIds,
|
||||
since: self.since,
|
||||
until: self.until,
|
||||
};
|
||||
},
|
||||
};
|
||||
45
node_modules/svix/src/models/appUsageStatsOut.ts
generated
vendored
Normal file
45
node_modules/svix/src/models/appUsageStatsOut.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type BackgroundTaskStatus,
|
||||
BackgroundTaskStatusSerializer,
|
||||
} from "./backgroundTaskStatus";
|
||||
import {
|
||||
type BackgroundTaskType,
|
||||
BackgroundTaskTypeSerializer,
|
||||
} from "./backgroundTaskType";
|
||||
|
||||
export interface AppUsageStatsOut {
|
||||
/** The QueueBackgroundTask's ID. */
|
||||
id: string;
|
||||
status: BackgroundTaskStatus;
|
||||
task: BackgroundTaskType;
|
||||
/**
|
||||
* Any app IDs or UIDs received in the request that weren't found.
|
||||
*
|
||||
* Stats will be produced for all the others.
|
||||
*/
|
||||
unresolvedAppIds: string[];
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export const AppUsageStatsOutSerializer = {
|
||||
_fromJsonObject(object: any): AppUsageStatsOut {
|
||||
return {
|
||||
id: object["id"],
|
||||
status: BackgroundTaskStatusSerializer._fromJsonObject(object["status"]),
|
||||
task: BackgroundTaskTypeSerializer._fromJsonObject(object["task"]),
|
||||
unresolvedAppIds: object["unresolvedAppIds"],
|
||||
updatedAt: new Date(object["updatedAt"]),
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: AppUsageStatsOut): any {
|
||||
return {
|
||||
id: self.id,
|
||||
status: BackgroundTaskStatusSerializer._toJsonObject(self.status),
|
||||
task: BackgroundTaskTypeSerializer._toJsonObject(self.task),
|
||||
unresolvedAppIds: self.unresolvedAppIds,
|
||||
updatedAt: self.updatedAt,
|
||||
};
|
||||
},
|
||||
};
|
||||
43
node_modules/svix/src/models/applicationIn.ts
generated
vendored
Normal file
43
node_modules/svix/src/models/applicationIn.ts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface ApplicationIn {
|
||||
metadata?: { [key: string]: string };
|
||||
/** Application name for human consumption. */
|
||||
name: string;
|
||||
/**
|
||||
* Deprecated, use `throttleRate` instead.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
rateLimit?: number | null;
|
||||
/**
|
||||
* Maximum messages per second to send to this application.
|
||||
*
|
||||
* Outgoing messages will be throttled to this rate.
|
||||
*/
|
||||
throttleRate?: number | null;
|
||||
/** Optional unique identifier for the application. */
|
||||
uid?: string | null;
|
||||
}
|
||||
|
||||
export const ApplicationInSerializer = {
|
||||
_fromJsonObject(object: any): ApplicationIn {
|
||||
return {
|
||||
metadata: object["metadata"],
|
||||
name: object["name"],
|
||||
rateLimit: object["rateLimit"],
|
||||
throttleRate: object["throttleRate"],
|
||||
uid: object["uid"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: ApplicationIn): any {
|
||||
return {
|
||||
metadata: self.metadata,
|
||||
name: self.name,
|
||||
rateLimit: self.rateLimit,
|
||||
throttleRate: self.throttleRate,
|
||||
uid: self.uid,
|
||||
};
|
||||
},
|
||||
};
|
||||
53
node_modules/svix/src/models/applicationOut.ts
generated
vendored
Normal file
53
node_modules/svix/src/models/applicationOut.ts
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface ApplicationOut {
|
||||
createdAt: Date;
|
||||
/** The Application's ID. */
|
||||
id: string;
|
||||
metadata: { [key: string]: string };
|
||||
/** Application name for human consumption. */
|
||||
name: string;
|
||||
/**
|
||||
* Deprecated, use `throttleRate` instead.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
rateLimit?: number | null;
|
||||
/**
|
||||
* Maximum messages per second to send to this application.
|
||||
*
|
||||
* Outgoing messages will be throttled to this rate.
|
||||
*/
|
||||
throttleRate?: number | null;
|
||||
/** Optional unique identifier for the application. */
|
||||
uid?: string | null;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export const ApplicationOutSerializer = {
|
||||
_fromJsonObject(object: any): ApplicationOut {
|
||||
return {
|
||||
createdAt: new Date(object["createdAt"]),
|
||||
id: object["id"],
|
||||
metadata: object["metadata"],
|
||||
name: object["name"],
|
||||
rateLimit: object["rateLimit"],
|
||||
throttleRate: object["throttleRate"],
|
||||
uid: object["uid"],
|
||||
updatedAt: new Date(object["updatedAt"]),
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: ApplicationOut): any {
|
||||
return {
|
||||
createdAt: self.createdAt,
|
||||
id: self.id,
|
||||
metadata: self.metadata,
|
||||
name: self.name,
|
||||
rateLimit: self.rateLimit,
|
||||
throttleRate: self.throttleRate,
|
||||
uid: self.uid,
|
||||
updatedAt: self.updatedAt,
|
||||
};
|
||||
},
|
||||
};
|
||||
29
node_modules/svix/src/models/applicationPatch.ts
generated
vendored
Normal file
29
node_modules/svix/src/models/applicationPatch.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface ApplicationPatch {
|
||||
metadata?: { [key: string]: string };
|
||||
name?: string;
|
||||
rateLimit?: number | null;
|
||||
/** The Application's UID. */
|
||||
uid?: string | null;
|
||||
}
|
||||
|
||||
export const ApplicationPatchSerializer = {
|
||||
_fromJsonObject(object: any): ApplicationPatch {
|
||||
return {
|
||||
metadata: object["metadata"],
|
||||
name: object["name"],
|
||||
rateLimit: object["rateLimit"],
|
||||
uid: object["uid"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: ApplicationPatch): any {
|
||||
return {
|
||||
metadata: self.metadata,
|
||||
name: self.name,
|
||||
rateLimit: self.rateLimit,
|
||||
uid: self.uid,
|
||||
};
|
||||
},
|
||||
};
|
||||
28
node_modules/svix/src/models/applicationTokenExpireIn.ts
generated
vendored
Normal file
28
node_modules/svix/src/models/applicationTokenExpireIn.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface ApplicationTokenExpireIn {
|
||||
/** How many seconds until the old key is expired. */
|
||||
expiry?: number | null;
|
||||
/**
|
||||
* An optional list of session ids.
|
||||
*
|
||||
* If any session ids are specified, only Application tokens created with that session id will be expired.
|
||||
*/
|
||||
sessionIds?: string[];
|
||||
}
|
||||
|
||||
export const ApplicationTokenExpireInSerializer = {
|
||||
_fromJsonObject(object: any): ApplicationTokenExpireIn {
|
||||
return {
|
||||
expiry: object["expiry"],
|
||||
sessionIds: object["sessionIds"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: ApplicationTokenExpireIn): any {
|
||||
return {
|
||||
expiry: self.expiry,
|
||||
sessionIds: self.sessionIds,
|
||||
};
|
||||
},
|
||||
};
|
||||
25
node_modules/svix/src/models/azureBlobStorageConfig.ts
generated
vendored
Normal file
25
node_modules/svix/src/models/azureBlobStorageConfig.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface AzureBlobStorageConfig {
|
||||
accessKey: string;
|
||||
account: string;
|
||||
container: string;
|
||||
}
|
||||
|
||||
export const AzureBlobStorageConfigSerializer = {
|
||||
_fromJsonObject(object: any): AzureBlobStorageConfig {
|
||||
return {
|
||||
accessKey: object["accessKey"],
|
||||
account: object["account"],
|
||||
container: object["container"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: AzureBlobStorageConfig): any {
|
||||
return {
|
||||
accessKey: self.accessKey,
|
||||
account: self.account,
|
||||
container: self.container,
|
||||
};
|
||||
},
|
||||
};
|
||||
25
node_modules/svix/src/models/azureBlobStoragePatchConfig.ts
generated
vendored
Normal file
25
node_modules/svix/src/models/azureBlobStoragePatchConfig.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface AzureBlobStoragePatchConfig {
|
||||
accessKey?: string;
|
||||
account?: string;
|
||||
container?: string;
|
||||
}
|
||||
|
||||
export const AzureBlobStoragePatchConfigSerializer = {
|
||||
_fromJsonObject(object: any): AzureBlobStoragePatchConfig {
|
||||
return {
|
||||
accessKey: object["accessKey"],
|
||||
account: object["account"],
|
||||
container: object["container"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: AzureBlobStoragePatchConfig): any {
|
||||
return {
|
||||
accessKey: self.accessKey,
|
||||
account: self.account,
|
||||
container: self.container,
|
||||
};
|
||||
},
|
||||
};
|
||||
27
node_modules/svix/src/models/backgroundTaskFinishedEvent.ts
generated
vendored
Normal file
27
node_modules/svix/src/models/backgroundTaskFinishedEvent.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type BackgroundTaskFinishedEvent2,
|
||||
BackgroundTaskFinishedEvent2Serializer,
|
||||
} from "./backgroundTaskFinishedEvent2";
|
||||
|
||||
/** Sent when a background task is finished. */
|
||||
export interface BackgroundTaskFinishedEvent {
|
||||
data: BackgroundTaskFinishedEvent2;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export const BackgroundTaskFinishedEventSerializer = {
|
||||
_fromJsonObject(object: any): BackgroundTaskFinishedEvent {
|
||||
return {
|
||||
data: BackgroundTaskFinishedEvent2Serializer._fromJsonObject(object["data"]),
|
||||
type: object["type"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: BackgroundTaskFinishedEvent): any {
|
||||
return {
|
||||
data: BackgroundTaskFinishedEvent2Serializer._toJsonObject(self.data),
|
||||
type: self.type,
|
||||
};
|
||||
},
|
||||
};
|
||||
37
node_modules/svix/src/models/backgroundTaskFinishedEvent2.ts
generated
vendored
Normal file
37
node_modules/svix/src/models/backgroundTaskFinishedEvent2.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type BackgroundTaskStatus,
|
||||
BackgroundTaskStatusSerializer,
|
||||
} from "./backgroundTaskStatus";
|
||||
import {
|
||||
type BackgroundTaskType,
|
||||
BackgroundTaskTypeSerializer,
|
||||
} from "./backgroundTaskType";
|
||||
|
||||
export interface BackgroundTaskFinishedEvent2 {
|
||||
data: any;
|
||||
status: BackgroundTaskStatus;
|
||||
task: BackgroundTaskType;
|
||||
/** The QueueBackgroundTask's ID. */
|
||||
taskId: string;
|
||||
}
|
||||
|
||||
export const BackgroundTaskFinishedEvent2Serializer = {
|
||||
_fromJsonObject(object: any): BackgroundTaskFinishedEvent2 {
|
||||
return {
|
||||
data: object["data"],
|
||||
status: BackgroundTaskStatusSerializer._fromJsonObject(object["status"]),
|
||||
task: BackgroundTaskTypeSerializer._fromJsonObject(object["task"]),
|
||||
taskId: object["taskId"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: BackgroundTaskFinishedEvent2): any {
|
||||
return {
|
||||
data: self.data,
|
||||
status: BackgroundTaskStatusSerializer._toJsonObject(self.status),
|
||||
task: BackgroundTaskTypeSerializer._toJsonObject(self.task),
|
||||
taskId: self.taskId,
|
||||
};
|
||||
},
|
||||
};
|
||||
40
node_modules/svix/src/models/backgroundTaskOut.ts
generated
vendored
Normal file
40
node_modules/svix/src/models/backgroundTaskOut.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type BackgroundTaskStatus,
|
||||
BackgroundTaskStatusSerializer,
|
||||
} from "./backgroundTaskStatus";
|
||||
import {
|
||||
type BackgroundTaskType,
|
||||
BackgroundTaskTypeSerializer,
|
||||
} from "./backgroundTaskType";
|
||||
|
||||
export interface BackgroundTaskOut {
|
||||
data: any;
|
||||
/** The QueueBackgroundTask's ID. */
|
||||
id: string;
|
||||
status: BackgroundTaskStatus;
|
||||
task: BackgroundTaskType;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export const BackgroundTaskOutSerializer = {
|
||||
_fromJsonObject(object: any): BackgroundTaskOut {
|
||||
return {
|
||||
data: object["data"],
|
||||
id: object["id"],
|
||||
status: BackgroundTaskStatusSerializer._fromJsonObject(object["status"]),
|
||||
task: BackgroundTaskTypeSerializer._fromJsonObject(object["task"]),
|
||||
updatedAt: new Date(object["updatedAt"]),
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: BackgroundTaskOut): any {
|
||||
return {
|
||||
data: self.data,
|
||||
id: self.id,
|
||||
status: BackgroundTaskStatusSerializer._toJsonObject(self.status),
|
||||
task: BackgroundTaskTypeSerializer._toJsonObject(self.task),
|
||||
updatedAt: self.updatedAt,
|
||||
};
|
||||
},
|
||||
};
|
||||
17
node_modules/svix/src/models/backgroundTaskStatus.ts
generated
vendored
Normal file
17
node_modules/svix/src/models/backgroundTaskStatus.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// this file is @generated
|
||||
|
||||
export enum BackgroundTaskStatus {
|
||||
Running = "running",
|
||||
Finished = "finished",
|
||||
Failed = "failed",
|
||||
}
|
||||
|
||||
export const BackgroundTaskStatusSerializer = {
|
||||
_fromJsonObject(object: any): BackgroundTaskStatus {
|
||||
return object;
|
||||
},
|
||||
|
||||
_toJsonObject(self: BackgroundTaskStatus): any {
|
||||
return self;
|
||||
},
|
||||
};
|
||||
22
node_modules/svix/src/models/backgroundTaskType.ts
generated
vendored
Normal file
22
node_modules/svix/src/models/backgroundTaskType.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// this file is @generated
|
||||
|
||||
export enum BackgroundTaskType {
|
||||
EndpointReplay = "endpoint.replay",
|
||||
EndpointRecover = "endpoint.recover",
|
||||
ApplicationStats = "application.stats",
|
||||
MessageBroadcast = "message.broadcast",
|
||||
SdkGenerate = "sdk.generate",
|
||||
EventTypeAggregate = "event-type.aggregate",
|
||||
ApplicationPurgeContent = "application.purge_content",
|
||||
EndpointBulkReplay = "endpoint.bulk-replay",
|
||||
}
|
||||
|
||||
export const BackgroundTaskTypeSerializer = {
|
||||
_fromJsonObject(object: any): BackgroundTaskType {
|
||||
return object;
|
||||
},
|
||||
|
||||
_toJsonObject(self: BackgroundTaskType): any {
|
||||
return self;
|
||||
},
|
||||
};
|
||||
51
node_modules/svix/src/models/bulkReplayIn.ts
generated
vendored
Normal file
51
node_modules/svix/src/models/bulkReplayIn.ts
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
// this file is @generated
|
||||
import { type MessageStatus, MessageStatusSerializer } from "./messageStatus";
|
||||
import { type StatusCodeClass, StatusCodeClassSerializer } from "./statusCodeClass";
|
||||
|
||||
export interface BulkReplayIn {
|
||||
channel?: string | null;
|
||||
eventTypes?: string[] | null;
|
||||
since: Date;
|
||||
status?: MessageStatus | null;
|
||||
statusCodeClass?: StatusCodeClass | null;
|
||||
tag?: string | null;
|
||||
until?: Date | null;
|
||||
}
|
||||
|
||||
export const BulkReplayInSerializer = {
|
||||
_fromJsonObject(object: any): BulkReplayIn {
|
||||
return {
|
||||
channel: object["channel"],
|
||||
eventTypes: object["eventTypes"],
|
||||
since: new Date(object["since"]),
|
||||
status:
|
||||
object["status"] != null
|
||||
? MessageStatusSerializer._fromJsonObject(object["status"])
|
||||
: undefined,
|
||||
statusCodeClass:
|
||||
object["statusCodeClass"] != null
|
||||
? StatusCodeClassSerializer._fromJsonObject(object["statusCodeClass"])
|
||||
: undefined,
|
||||
tag: object["tag"],
|
||||
until: object["until"] ? new Date(object["until"]) : null,
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: BulkReplayIn): any {
|
||||
return {
|
||||
channel: self.channel,
|
||||
eventTypes: self.eventTypes,
|
||||
since: self.since,
|
||||
status:
|
||||
self.status != null
|
||||
? MessageStatusSerializer._toJsonObject(self.status)
|
||||
: undefined,
|
||||
statusCodeClass:
|
||||
self.statusCodeClass != null
|
||||
? StatusCodeClassSerializer._toJsonObject(self.statusCodeClass)
|
||||
: undefined,
|
||||
tag: self.tag,
|
||||
until: self.until,
|
||||
};
|
||||
},
|
||||
};
|
||||
19
node_modules/svix/src/models/checkbookConfig.ts
generated
vendored
Normal file
19
node_modules/svix/src/models/checkbookConfig.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface CheckbookConfig {
|
||||
secret: string;
|
||||
}
|
||||
|
||||
export const CheckbookConfigSerializer = {
|
||||
_fromJsonObject(object: any): CheckbookConfig {
|
||||
return {
|
||||
secret: object["secret"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: CheckbookConfig): any {
|
||||
return {
|
||||
secret: self.secret,
|
||||
};
|
||||
},
|
||||
};
|
||||
15
node_modules/svix/src/models/checkbookConfigOut.ts
generated
vendored
Normal file
15
node_modules/svix/src/models/checkbookConfigOut.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// this file is @generated
|
||||
|
||||
// biome-ignore-all lint/suspicious/noEmptyInterface: backwards compat
|
||||
|
||||
export interface CheckbookConfigOut {}
|
||||
|
||||
export const CheckbookConfigOutSerializer = {
|
||||
_fromJsonObject(_object: any): CheckbookConfigOut {
|
||||
return {};
|
||||
},
|
||||
|
||||
_toJsonObject(_self: CheckbookConfigOut): any {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
59
node_modules/svix/src/models/connectorIn.ts
generated
vendored
Normal file
59
node_modules/svix/src/models/connectorIn.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
// this file is @generated
|
||||
import { type ConnectorKind, ConnectorKindSerializer } from "./connectorKind";
|
||||
import { type ConnectorProduct, ConnectorProductSerializer } from "./connectorProduct";
|
||||
|
||||
export interface ConnectorIn {
|
||||
allowedEventTypes?: string[] | null;
|
||||
description?: string;
|
||||
featureFlags?: string[] | null;
|
||||
instructions?: string;
|
||||
kind?: ConnectorKind;
|
||||
logo?: string | null;
|
||||
name: string;
|
||||
productType?: ConnectorProduct | null;
|
||||
transformation: string;
|
||||
/** The Connector's UID. */
|
||||
uid?: string | null;
|
||||
}
|
||||
|
||||
export const ConnectorInSerializer = {
|
||||
_fromJsonObject(object: any): ConnectorIn {
|
||||
return {
|
||||
allowedEventTypes: object["allowedEventTypes"],
|
||||
description: object["description"],
|
||||
featureFlags: object["featureFlags"],
|
||||
instructions: object["instructions"],
|
||||
kind:
|
||||
object["kind"] != null
|
||||
? ConnectorKindSerializer._fromJsonObject(object["kind"])
|
||||
: undefined,
|
||||
logo: object["logo"],
|
||||
name: object["name"],
|
||||
productType:
|
||||
object["productType"] != null
|
||||
? ConnectorProductSerializer._fromJsonObject(object["productType"])
|
||||
: undefined,
|
||||
transformation: object["transformation"],
|
||||
uid: object["uid"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: ConnectorIn): any {
|
||||
return {
|
||||
allowedEventTypes: self.allowedEventTypes,
|
||||
description: self.description,
|
||||
featureFlags: self.featureFlags,
|
||||
instructions: self.instructions,
|
||||
kind:
|
||||
self.kind != null ? ConnectorKindSerializer._toJsonObject(self.kind) : undefined,
|
||||
logo: self.logo,
|
||||
name: self.name,
|
||||
productType:
|
||||
self.productType != null
|
||||
? ConnectorProductSerializer._toJsonObject(self.productType)
|
||||
: undefined,
|
||||
transformation: self.transformation,
|
||||
uid: self.uid,
|
||||
};
|
||||
},
|
||||
};
|
||||
32
node_modules/svix/src/models/connectorKind.ts
generated
vendored
Normal file
32
node_modules/svix/src/models/connectorKind.ts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// this file is @generated
|
||||
|
||||
export enum ConnectorKind {
|
||||
Custom = "Custom",
|
||||
AgenticCommerceProtocol = "AgenticCommerceProtocol",
|
||||
CloseCrm = "CloseCRM",
|
||||
CustomerIo = "CustomerIO",
|
||||
Discord = "Discord",
|
||||
Hubspot = "Hubspot",
|
||||
Inngest = "Inngest",
|
||||
Loops = "Loops",
|
||||
Otel = "Otel",
|
||||
Resend = "Resend",
|
||||
Salesforce = "Salesforce",
|
||||
Segment = "Segment",
|
||||
Sendgrid = "Sendgrid",
|
||||
Slack = "Slack",
|
||||
Teams = "Teams",
|
||||
TriggerDev = "TriggerDev",
|
||||
Windmill = "Windmill",
|
||||
Zapier = "Zapier",
|
||||
}
|
||||
|
||||
export const ConnectorKindSerializer = {
|
||||
_fromJsonObject(object: any): ConnectorKind {
|
||||
return object;
|
||||
},
|
||||
|
||||
_toJsonObject(self: ConnectorKind): any {
|
||||
return self;
|
||||
},
|
||||
};
|
||||
66
node_modules/svix/src/models/connectorOut.ts
generated
vendored
Normal file
66
node_modules/svix/src/models/connectorOut.ts
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
// this file is @generated
|
||||
import { type ConnectorKind, ConnectorKindSerializer } from "./connectorKind";
|
||||
import { type ConnectorProduct, ConnectorProductSerializer } from "./connectorProduct";
|
||||
|
||||
export interface ConnectorOut {
|
||||
allowedEventTypes?: string[] | null;
|
||||
createdAt: Date;
|
||||
description: string;
|
||||
featureFlags?: string[] | null;
|
||||
/** The Connector's ID. */
|
||||
id: string;
|
||||
instructions: string;
|
||||
kind: ConnectorKind;
|
||||
logo?: string | null;
|
||||
name: string;
|
||||
/** The Environment's ID. */
|
||||
orgId: string;
|
||||
productType: ConnectorProduct;
|
||||
transformation: string;
|
||||
transformationUpdatedAt: Date;
|
||||
/** The Connector's UID. */
|
||||
uid?: string | null;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export const ConnectorOutSerializer = {
|
||||
_fromJsonObject(object: any): ConnectorOut {
|
||||
return {
|
||||
allowedEventTypes: object["allowedEventTypes"],
|
||||
createdAt: new Date(object["createdAt"]),
|
||||
description: object["description"],
|
||||
featureFlags: object["featureFlags"],
|
||||
id: object["id"],
|
||||
instructions: object["instructions"],
|
||||
kind: ConnectorKindSerializer._fromJsonObject(object["kind"]),
|
||||
logo: object["logo"],
|
||||
name: object["name"],
|
||||
orgId: object["orgId"],
|
||||
productType: ConnectorProductSerializer._fromJsonObject(object["productType"]),
|
||||
transformation: object["transformation"],
|
||||
transformationUpdatedAt: new Date(object["transformationUpdatedAt"]),
|
||||
uid: object["uid"],
|
||||
updatedAt: new Date(object["updatedAt"]),
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: ConnectorOut): any {
|
||||
return {
|
||||
allowedEventTypes: self.allowedEventTypes,
|
||||
createdAt: self.createdAt,
|
||||
description: self.description,
|
||||
featureFlags: self.featureFlags,
|
||||
id: self.id,
|
||||
instructions: self.instructions,
|
||||
kind: ConnectorKindSerializer._toJsonObject(self.kind),
|
||||
logo: self.logo,
|
||||
name: self.name,
|
||||
orgId: self.orgId,
|
||||
productType: ConnectorProductSerializer._toJsonObject(self.productType),
|
||||
transformation: self.transformation,
|
||||
transformationUpdatedAt: self.transformationUpdatedAt,
|
||||
uid: self.uid,
|
||||
updatedAt: self.updatedAt,
|
||||
};
|
||||
},
|
||||
};
|
||||
45
node_modules/svix/src/models/connectorPatch.ts
generated
vendored
Normal file
45
node_modules/svix/src/models/connectorPatch.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// this file is @generated
|
||||
import { type ConnectorKind, ConnectorKindSerializer } from "./connectorKind";
|
||||
|
||||
export interface ConnectorPatch {
|
||||
allowedEventTypes?: string[] | null;
|
||||
description?: string;
|
||||
featureFlags?: string[] | null;
|
||||
instructions?: string;
|
||||
kind?: ConnectorKind;
|
||||
logo?: string | null;
|
||||
name?: string;
|
||||
transformation?: string;
|
||||
}
|
||||
|
||||
export const ConnectorPatchSerializer = {
|
||||
_fromJsonObject(object: any): ConnectorPatch {
|
||||
return {
|
||||
allowedEventTypes: object["allowedEventTypes"],
|
||||
description: object["description"],
|
||||
featureFlags: object["featureFlags"],
|
||||
instructions: object["instructions"],
|
||||
kind:
|
||||
object["kind"] != null
|
||||
? ConnectorKindSerializer._fromJsonObject(object["kind"])
|
||||
: undefined,
|
||||
logo: object["logo"],
|
||||
name: object["name"],
|
||||
transformation: object["transformation"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: ConnectorPatch): any {
|
||||
return {
|
||||
allowedEventTypes: self.allowedEventTypes,
|
||||
description: self.description,
|
||||
featureFlags: self.featureFlags,
|
||||
instructions: self.instructions,
|
||||
kind:
|
||||
self.kind != null ? ConnectorKindSerializer._toJsonObject(self.kind) : undefined,
|
||||
logo: self.logo,
|
||||
name: self.name,
|
||||
transformation: self.transformation,
|
||||
};
|
||||
},
|
||||
};
|
||||
16
node_modules/svix/src/models/connectorProduct.ts
generated
vendored
Normal file
16
node_modules/svix/src/models/connectorProduct.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// this file is @generated
|
||||
|
||||
export enum ConnectorProduct {
|
||||
Dispatch = "Dispatch",
|
||||
Stream = "Stream",
|
||||
}
|
||||
|
||||
export const ConnectorProductSerializer = {
|
||||
_fromJsonObject(object: any): ConnectorProduct {
|
||||
return object;
|
||||
},
|
||||
|
||||
_toJsonObject(self: ConnectorProduct): any {
|
||||
return self;
|
||||
},
|
||||
};
|
||||
45
node_modules/svix/src/models/connectorUpdate.ts
generated
vendored
Normal file
45
node_modules/svix/src/models/connectorUpdate.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// this file is @generated
|
||||
import { type ConnectorKind, ConnectorKindSerializer } from "./connectorKind";
|
||||
|
||||
export interface ConnectorUpdate {
|
||||
allowedEventTypes?: string[] | null;
|
||||
description?: string;
|
||||
featureFlags?: string[] | null;
|
||||
instructions?: string;
|
||||
kind?: ConnectorKind;
|
||||
logo?: string | null;
|
||||
name?: string;
|
||||
transformation: string;
|
||||
}
|
||||
|
||||
export const ConnectorUpdateSerializer = {
|
||||
_fromJsonObject(object: any): ConnectorUpdate {
|
||||
return {
|
||||
allowedEventTypes: object["allowedEventTypes"],
|
||||
description: object["description"],
|
||||
featureFlags: object["featureFlags"],
|
||||
instructions: object["instructions"],
|
||||
kind:
|
||||
object["kind"] != null
|
||||
? ConnectorKindSerializer._fromJsonObject(object["kind"])
|
||||
: undefined,
|
||||
logo: object["logo"],
|
||||
name: object["name"],
|
||||
transformation: object["transformation"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: ConnectorUpdate): any {
|
||||
return {
|
||||
allowedEventTypes: self.allowedEventTypes,
|
||||
description: self.description,
|
||||
featureFlags: self.featureFlags,
|
||||
instructions: self.instructions,
|
||||
kind:
|
||||
self.kind != null ? ConnectorKindSerializer._toJsonObject(self.kind) : undefined,
|
||||
logo: self.logo,
|
||||
name: self.name,
|
||||
transformation: self.transformation,
|
||||
};
|
||||
},
|
||||
};
|
||||
35
node_modules/svix/src/models/createStreamEventsIn.ts
generated
vendored
Normal file
35
node_modules/svix/src/models/createStreamEventsIn.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
// this file is @generated
|
||||
import { type EventIn, EventInSerializer } from "./eventIn";
|
||||
import { type StreamIn, StreamInSerializer } from "./streamIn";
|
||||
|
||||
export interface CreateStreamEventsIn {
|
||||
events: EventIn[];
|
||||
/**
|
||||
* Optionally creates a new Stream alongside the events.
|
||||
*
|
||||
* If the stream id or uid that is used in the path already exists, this argument is ignored.
|
||||
*/
|
||||
stream?: StreamIn | null;
|
||||
}
|
||||
|
||||
export const CreateStreamEventsInSerializer = {
|
||||
_fromJsonObject(object: any): CreateStreamEventsIn {
|
||||
return {
|
||||
events: object["events"].map((item: EventIn) =>
|
||||
EventInSerializer._fromJsonObject(item)
|
||||
),
|
||||
stream:
|
||||
object["stream"] != null
|
||||
? StreamInSerializer._fromJsonObject(object["stream"])
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: CreateStreamEventsIn): any {
|
||||
return {
|
||||
events: self.events.map((item) => EventInSerializer._toJsonObject(item)),
|
||||
stream:
|
||||
self.stream != null ? StreamInSerializer._toJsonObject(self.stream) : undefined,
|
||||
};
|
||||
},
|
||||
};
|
||||
15
node_modules/svix/src/models/createStreamEventsOut.ts
generated
vendored
Normal file
15
node_modules/svix/src/models/createStreamEventsOut.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// this file is @generated
|
||||
|
||||
// biome-ignore-all lint/suspicious/noEmptyInterface: backwards compat
|
||||
|
||||
export interface CreateStreamEventsOut {}
|
||||
|
||||
export const CreateStreamEventsOutSerializer = {
|
||||
_fromJsonObject(_object: any): CreateStreamEventsOut {
|
||||
return {};
|
||||
},
|
||||
|
||||
_toJsonObject(_self: CreateStreamEventsOut): any {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
30
node_modules/svix/src/models/cronConfig.ts
generated
vendored
Normal file
30
node_modules/svix/src/models/cronConfig.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface CronConfig {
|
||||
/**
|
||||
* Override the default content-type.
|
||||
*
|
||||
* Recommended if the payload is not JSON.
|
||||
*/
|
||||
contentType?: string | null;
|
||||
payload: string;
|
||||
schedule: string;
|
||||
}
|
||||
|
||||
export const CronConfigSerializer = {
|
||||
_fromJsonObject(object: any): CronConfig {
|
||||
return {
|
||||
contentType: object["contentType"],
|
||||
payload: object["payload"],
|
||||
schedule: object["schedule"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: CronConfig): any {
|
||||
return {
|
||||
contentType: self.contentType,
|
||||
payload: self.payload,
|
||||
schedule: self.schedule,
|
||||
};
|
||||
},
|
||||
};
|
||||
22
node_modules/svix/src/models/dashboardAccessOut.ts
generated
vendored
Normal file
22
node_modules/svix/src/models/dashboardAccessOut.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface DashboardAccessOut {
|
||||
token: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export const DashboardAccessOutSerializer = {
|
||||
_fromJsonObject(object: any): DashboardAccessOut {
|
||||
return {
|
||||
token: object["token"],
|
||||
url: object["url"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: DashboardAccessOut): any {
|
||||
return {
|
||||
token: self.token,
|
||||
url: self.url,
|
||||
};
|
||||
},
|
||||
};
|
||||
19
node_modules/svix/src/models/docusignConfig.ts
generated
vendored
Normal file
19
node_modules/svix/src/models/docusignConfig.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface DocusignConfig {
|
||||
secret?: string | null;
|
||||
}
|
||||
|
||||
export const DocusignConfigSerializer = {
|
||||
_fromJsonObject(object: any): DocusignConfig {
|
||||
return {
|
||||
secret: object["secret"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: DocusignConfig): any {
|
||||
return {
|
||||
secret: self.secret,
|
||||
};
|
||||
},
|
||||
};
|
||||
15
node_modules/svix/src/models/docusignConfigOut.ts
generated
vendored
Normal file
15
node_modules/svix/src/models/docusignConfigOut.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// this file is @generated
|
||||
|
||||
// biome-ignore-all lint/suspicious/noEmptyInterface: backwards compat
|
||||
|
||||
export interface DocusignConfigOut {}
|
||||
|
||||
export const DocusignConfigOutSerializer = {
|
||||
_fromJsonObject(_object: any): DocusignConfigOut {
|
||||
return {};
|
||||
},
|
||||
|
||||
_toJsonObject(_self: DocusignConfigOut): any {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
19
node_modules/svix/src/models/easypostConfig.ts
generated
vendored
Normal file
19
node_modules/svix/src/models/easypostConfig.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EasypostConfig {
|
||||
secret?: string | null;
|
||||
}
|
||||
|
||||
export const EasypostConfigSerializer = {
|
||||
_fromJsonObject(object: any): EasypostConfig {
|
||||
return {
|
||||
secret: object["secret"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EasypostConfig): any {
|
||||
return {
|
||||
secret: self.secret,
|
||||
};
|
||||
},
|
||||
};
|
||||
15
node_modules/svix/src/models/easypostConfigOut.ts
generated
vendored
Normal file
15
node_modules/svix/src/models/easypostConfigOut.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// this file is @generated
|
||||
|
||||
// biome-ignore-all lint/suspicious/noEmptyInterface: backwards compat
|
||||
|
||||
export interface EasypostConfigOut {}
|
||||
|
||||
export const EasypostConfigOutSerializer = {
|
||||
_fromJsonObject(_object: any): EasypostConfigOut {
|
||||
return {};
|
||||
},
|
||||
|
||||
_toJsonObject(_self: EasypostConfigOut): any {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
15
node_modules/svix/src/models/emptyResponse.ts
generated
vendored
Normal file
15
node_modules/svix/src/models/emptyResponse.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// this file is @generated
|
||||
|
||||
// biome-ignore-all lint/suspicious/noEmptyInterface: backwards compat
|
||||
|
||||
export interface EmptyResponse {}
|
||||
|
||||
export const EmptyResponseSerializer = {
|
||||
_fromJsonObject(_object: any): EmptyResponse {
|
||||
return {};
|
||||
},
|
||||
|
||||
_toJsonObject(_self: EmptyResponse): any {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
27
node_modules/svix/src/models/endpointCreatedEvent.ts
generated
vendored
Normal file
27
node_modules/svix/src/models/endpointCreatedEvent.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type EndpointCreatedEventData,
|
||||
EndpointCreatedEventDataSerializer,
|
||||
} from "./endpointCreatedEventData";
|
||||
|
||||
/** Sent when an endpoint is created. */
|
||||
export interface EndpointCreatedEvent {
|
||||
data: EndpointCreatedEventData;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export const EndpointCreatedEventSerializer = {
|
||||
_fromJsonObject(object: any): EndpointCreatedEvent {
|
||||
return {
|
||||
data: EndpointCreatedEventDataSerializer._fromJsonObject(object["data"]),
|
||||
type: object["type"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointCreatedEvent): any {
|
||||
return {
|
||||
data: EndpointCreatedEventDataSerializer._toJsonObject(self.data),
|
||||
type: self.type,
|
||||
};
|
||||
},
|
||||
};
|
||||
33
node_modules/svix/src/models/endpointCreatedEventData.ts
generated
vendored
Normal file
33
node_modules/svix/src/models/endpointCreatedEventData.ts
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
// this file is @generated
|
||||
|
||||
/** Sent when an endpoint is created, updated, or deleted */
|
||||
export interface EndpointCreatedEventData {
|
||||
/** The Application's ID. */
|
||||
appId: string;
|
||||
/** The Application's UID. */
|
||||
appUid?: string | null;
|
||||
/** The Endpoint's ID. */
|
||||
endpointId: string;
|
||||
/** The Endpoint's UID. */
|
||||
endpointUid?: string | null;
|
||||
}
|
||||
|
||||
export const EndpointCreatedEventDataSerializer = {
|
||||
_fromJsonObject(object: any): EndpointCreatedEventData {
|
||||
return {
|
||||
appId: object["appId"],
|
||||
appUid: object["appUid"],
|
||||
endpointId: object["endpointId"],
|
||||
endpointUid: object["endpointUid"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointCreatedEventData): any {
|
||||
return {
|
||||
appId: self.appId,
|
||||
appUid: self.appUid,
|
||||
endpointId: self.endpointId,
|
||||
endpointUid: self.endpointUid,
|
||||
};
|
||||
},
|
||||
};
|
||||
27
node_modules/svix/src/models/endpointDeletedEvent.ts
generated
vendored
Normal file
27
node_modules/svix/src/models/endpointDeletedEvent.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type EndpointDeletedEventData,
|
||||
EndpointDeletedEventDataSerializer,
|
||||
} from "./endpointDeletedEventData";
|
||||
|
||||
/** Sent when an endpoint is deleted. */
|
||||
export interface EndpointDeletedEvent {
|
||||
data: EndpointDeletedEventData;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export const EndpointDeletedEventSerializer = {
|
||||
_fromJsonObject(object: any): EndpointDeletedEvent {
|
||||
return {
|
||||
data: EndpointDeletedEventDataSerializer._fromJsonObject(object["data"]),
|
||||
type: object["type"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointDeletedEvent): any {
|
||||
return {
|
||||
data: EndpointDeletedEventDataSerializer._toJsonObject(self.data),
|
||||
type: self.type,
|
||||
};
|
||||
},
|
||||
};
|
||||
33
node_modules/svix/src/models/endpointDeletedEventData.ts
generated
vendored
Normal file
33
node_modules/svix/src/models/endpointDeletedEventData.ts
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
// this file is @generated
|
||||
|
||||
/** Sent when an endpoint is created, updated, or deleted */
|
||||
export interface EndpointDeletedEventData {
|
||||
/** The Application's ID. */
|
||||
appId: string;
|
||||
/** The Application's UID. */
|
||||
appUid?: string | null;
|
||||
/** The Endpoint's ID. */
|
||||
endpointId: string;
|
||||
/** The Endpoint's UID. */
|
||||
endpointUid?: string | null;
|
||||
}
|
||||
|
||||
export const EndpointDeletedEventDataSerializer = {
|
||||
_fromJsonObject(object: any): EndpointDeletedEventData {
|
||||
return {
|
||||
appId: object["appId"],
|
||||
appUid: object["appUid"],
|
||||
endpointId: object["endpointId"],
|
||||
endpointUid: object["endpointUid"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointDeletedEventData): any {
|
||||
return {
|
||||
appId: self.appId,
|
||||
appUid: self.appUid,
|
||||
endpointId: self.endpointId,
|
||||
endpointUid: self.endpointUid,
|
||||
};
|
||||
},
|
||||
};
|
||||
27
node_modules/svix/src/models/endpointDisabledEvent.ts
generated
vendored
Normal file
27
node_modules/svix/src/models/endpointDisabledEvent.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type EndpointDisabledEventData,
|
||||
EndpointDisabledEventDataSerializer,
|
||||
} from "./endpointDisabledEventData";
|
||||
|
||||
/** Sent when an endpoint has been automatically disabled after continuous failures, or manually via an API call. */
|
||||
export interface EndpointDisabledEvent {
|
||||
data: EndpointDisabledEventData;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export const EndpointDisabledEventSerializer = {
|
||||
_fromJsonObject(object: any): EndpointDisabledEvent {
|
||||
return {
|
||||
data: EndpointDisabledEventDataSerializer._fromJsonObject(object["data"]),
|
||||
type: object["type"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointDisabledEvent): any {
|
||||
return {
|
||||
data: EndpointDisabledEventDataSerializer._toJsonObject(self.data),
|
||||
type: self.type,
|
||||
};
|
||||
},
|
||||
};
|
||||
49
node_modules/svix/src/models/endpointDisabledEventData.ts
generated
vendored
Normal file
49
node_modules/svix/src/models/endpointDisabledEventData.ts
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type EndpointDisabledTrigger,
|
||||
EndpointDisabledTriggerSerializer,
|
||||
} from "./endpointDisabledTrigger";
|
||||
|
||||
/** Sent when an endpoint has been automatically disabled after continuous failures, or manually via an API call. */
|
||||
export interface EndpointDisabledEventData {
|
||||
/** The Application's ID. */
|
||||
appId: string;
|
||||
/** The Application's UID. */
|
||||
appUid?: string | null;
|
||||
/** The Endpoint's ID. */
|
||||
endpointId: string;
|
||||
/** The Endpoint's UID. */
|
||||
endpointUid?: string | null;
|
||||
failSince?: Date | null;
|
||||
trigger?: EndpointDisabledTrigger;
|
||||
}
|
||||
|
||||
export const EndpointDisabledEventDataSerializer = {
|
||||
_fromJsonObject(object: any): EndpointDisabledEventData {
|
||||
return {
|
||||
appId: object["appId"],
|
||||
appUid: object["appUid"],
|
||||
endpointId: object["endpointId"],
|
||||
endpointUid: object["endpointUid"],
|
||||
failSince: object["failSince"] ? new Date(object["failSince"]) : null,
|
||||
trigger:
|
||||
object["trigger"] != null
|
||||
? EndpointDisabledTriggerSerializer._fromJsonObject(object["trigger"])
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointDisabledEventData): any {
|
||||
return {
|
||||
appId: self.appId,
|
||||
appUid: self.appUid,
|
||||
endpointId: self.endpointId,
|
||||
endpointUid: self.endpointUid,
|
||||
failSince: self.failSince,
|
||||
trigger:
|
||||
self.trigger != null
|
||||
? EndpointDisabledTriggerSerializer._toJsonObject(self.trigger)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
};
|
||||
16
node_modules/svix/src/models/endpointDisabledTrigger.ts
generated
vendored
Normal file
16
node_modules/svix/src/models/endpointDisabledTrigger.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// this file is @generated
|
||||
|
||||
export enum EndpointDisabledTrigger {
|
||||
Manual = "manual",
|
||||
Automatic = "automatic",
|
||||
}
|
||||
|
||||
export const EndpointDisabledTriggerSerializer = {
|
||||
_fromJsonObject(object: any): EndpointDisabledTrigger {
|
||||
return object;
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointDisabledTrigger): any {
|
||||
return self;
|
||||
},
|
||||
};
|
||||
27
node_modules/svix/src/models/endpointEnabledEvent.ts
generated
vendored
Normal file
27
node_modules/svix/src/models/endpointEnabledEvent.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type EndpointEnabledEventData,
|
||||
EndpointEnabledEventDataSerializer,
|
||||
} from "./endpointEnabledEventData";
|
||||
|
||||
/** Sent when an endpoint has been enabled. */
|
||||
export interface EndpointEnabledEvent {
|
||||
data: EndpointEnabledEventData;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export const EndpointEnabledEventSerializer = {
|
||||
_fromJsonObject(object: any): EndpointEnabledEvent {
|
||||
return {
|
||||
data: EndpointEnabledEventDataSerializer._fromJsonObject(object["data"]),
|
||||
type: object["type"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointEnabledEvent): any {
|
||||
return {
|
||||
data: EndpointEnabledEventDataSerializer._toJsonObject(self.data),
|
||||
type: self.type,
|
||||
};
|
||||
},
|
||||
};
|
||||
33
node_modules/svix/src/models/endpointEnabledEventData.ts
generated
vendored
Normal file
33
node_modules/svix/src/models/endpointEnabledEventData.ts
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
// this file is @generated
|
||||
|
||||
/** Sent when an endpoint has been enabled. */
|
||||
export interface EndpointEnabledEventData {
|
||||
/** The Application's ID. */
|
||||
appId: string;
|
||||
/** The Application's UID. */
|
||||
appUid?: string | null;
|
||||
/** The Endpoint's ID. */
|
||||
endpointId: string;
|
||||
/** The Endpoint's UID. */
|
||||
endpointUid?: string | null;
|
||||
}
|
||||
|
||||
export const EndpointEnabledEventDataSerializer = {
|
||||
_fromJsonObject(object: any): EndpointEnabledEventData {
|
||||
return {
|
||||
appId: object["appId"],
|
||||
appUid: object["appUid"],
|
||||
endpointId: object["endpointId"],
|
||||
endpointUid: object["endpointUid"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointEnabledEventData): any {
|
||||
return {
|
||||
appId: self.appId,
|
||||
appUid: self.appUid,
|
||||
endpointId: self.endpointId,
|
||||
endpointUid: self.endpointUid,
|
||||
};
|
||||
},
|
||||
};
|
||||
19
node_modules/svix/src/models/endpointHeadersIn.ts
generated
vendored
Normal file
19
node_modules/svix/src/models/endpointHeadersIn.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointHeadersIn {
|
||||
headers: { [key: string]: string };
|
||||
}
|
||||
|
||||
export const EndpointHeadersInSerializer = {
|
||||
_fromJsonObject(object: any): EndpointHeadersIn {
|
||||
return {
|
||||
headers: object["headers"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointHeadersIn): any {
|
||||
return {
|
||||
headers: self.headers,
|
||||
};
|
||||
},
|
||||
};
|
||||
27
node_modules/svix/src/models/endpointHeadersOut.ts
generated
vendored
Normal file
27
node_modules/svix/src/models/endpointHeadersOut.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// this file is @generated
|
||||
|
||||
/**
|
||||
* The value of the headers is returned in the `headers` field.
|
||||
*
|
||||
* Sensitive headers that have been redacted are returned in the sensitive field.
|
||||
*/
|
||||
export interface EndpointHeadersOut {
|
||||
headers: { [key: string]: string };
|
||||
sensitive: string[];
|
||||
}
|
||||
|
||||
export const EndpointHeadersOutSerializer = {
|
||||
_fromJsonObject(object: any): EndpointHeadersOut {
|
||||
return {
|
||||
headers: object["headers"],
|
||||
sensitive: object["sensitive"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointHeadersOut): any {
|
||||
return {
|
||||
headers: self.headers,
|
||||
sensitive: self.sensitive,
|
||||
};
|
||||
},
|
||||
};
|
||||
23
node_modules/svix/src/models/endpointHeadersPatchIn.ts
generated
vendored
Normal file
23
node_modules/svix/src/models/endpointHeadersPatchIn.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointHeadersPatchIn {
|
||||
/** A list of headers be be removed */
|
||||
deleteHeaders?: string[];
|
||||
headers: { [key: string]: string };
|
||||
}
|
||||
|
||||
export const EndpointHeadersPatchInSerializer = {
|
||||
_fromJsonObject(object: any): EndpointHeadersPatchIn {
|
||||
return {
|
||||
deleteHeaders: object["deleteHeaders"],
|
||||
headers: object["headers"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointHeadersPatchIn): any {
|
||||
return {
|
||||
deleteHeaders: self.deleteHeaders,
|
||||
headers: self.headers,
|
||||
};
|
||||
},
|
||||
};
|
||||
70
node_modules/svix/src/models/endpointIn.ts
generated
vendored
Normal file
70
node_modules/svix/src/models/endpointIn.ts
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointIn {
|
||||
/** List of message channels this endpoint listens to (omit for all). */
|
||||
channels?: string[] | null;
|
||||
description?: string;
|
||||
disabled?: boolean;
|
||||
filterTypes?: string[] | null;
|
||||
headers?: { [key: string]: string } | null;
|
||||
metadata?: { [key: string]: string };
|
||||
/**
|
||||
* Deprecated, use `throttleRate` instead.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
rateLimit?: number | null;
|
||||
/**
|
||||
* The endpoint's verification secret.
|
||||
*
|
||||
* Format: `base64` encoded random bytes optionally prefixed with `whsec_`.
|
||||
* It is recommended to not set this and let the server generate the secret.
|
||||
*/
|
||||
secret?: string | null;
|
||||
/**
|
||||
* Maximum messages per second to send to this endpoint.
|
||||
*
|
||||
* Outgoing messages will be throttled to this rate.
|
||||
*/
|
||||
throttleRate?: number | null;
|
||||
/** Optional unique identifier for the endpoint. */
|
||||
uid?: string | null;
|
||||
url: string;
|
||||
version?: number | null;
|
||||
}
|
||||
|
||||
export const EndpointInSerializer = {
|
||||
_fromJsonObject(object: any): EndpointIn {
|
||||
return {
|
||||
channels: object["channels"],
|
||||
description: object["description"],
|
||||
disabled: object["disabled"],
|
||||
filterTypes: object["filterTypes"],
|
||||
headers: object["headers"],
|
||||
metadata: object["metadata"],
|
||||
rateLimit: object["rateLimit"],
|
||||
secret: object["secret"],
|
||||
throttleRate: object["throttleRate"],
|
||||
uid: object["uid"],
|
||||
url: object["url"],
|
||||
version: object["version"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointIn): any {
|
||||
return {
|
||||
channels: self.channels,
|
||||
description: self.description,
|
||||
disabled: self.disabled,
|
||||
filterTypes: self.filterTypes,
|
||||
headers: self.headers,
|
||||
metadata: self.metadata,
|
||||
rateLimit: self.rateLimit,
|
||||
secret: self.secret,
|
||||
throttleRate: self.throttleRate,
|
||||
uid: self.uid,
|
||||
url: self.url,
|
||||
version: self.version,
|
||||
};
|
||||
},
|
||||
};
|
||||
56
node_modules/svix/src/models/endpointMessageOut.ts
generated
vendored
Normal file
56
node_modules/svix/src/models/endpointMessageOut.ts
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
// this file is @generated
|
||||
import { type MessageStatus, MessageStatusSerializer } from "./messageStatus";
|
||||
import { type MessageStatusText, MessageStatusTextSerializer } from "./messageStatusText";
|
||||
|
||||
/** A model containing information on a given message plus additional fields on the last attempt for that message. */
|
||||
export interface EndpointMessageOut {
|
||||
/** List of free-form identifiers that endpoints can filter by */
|
||||
channels?: string[] | null;
|
||||
deliverAt?: Date | null;
|
||||
/** Optional unique identifier for the message */
|
||||
eventId?: string | null;
|
||||
/** The event type's name */
|
||||
eventType: string;
|
||||
/** The Message's ID. */
|
||||
id: string;
|
||||
nextAttempt?: Date | null;
|
||||
payload: any;
|
||||
status: MessageStatus;
|
||||
statusText: MessageStatusText;
|
||||
tags?: string[] | null;
|
||||
timestamp: Date;
|
||||
}
|
||||
|
||||
export const EndpointMessageOutSerializer = {
|
||||
_fromJsonObject(object: any): EndpointMessageOut {
|
||||
return {
|
||||
channels: object["channels"],
|
||||
deliverAt: object["deliverAt"] ? new Date(object["deliverAt"]) : null,
|
||||
eventId: object["eventId"],
|
||||
eventType: object["eventType"],
|
||||
id: object["id"],
|
||||
nextAttempt: object["nextAttempt"] ? new Date(object["nextAttempt"]) : null,
|
||||
payload: object["payload"],
|
||||
status: MessageStatusSerializer._fromJsonObject(object["status"]),
|
||||
statusText: MessageStatusTextSerializer._fromJsonObject(object["statusText"]),
|
||||
tags: object["tags"],
|
||||
timestamp: new Date(object["timestamp"]),
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointMessageOut): any {
|
||||
return {
|
||||
channels: self.channels,
|
||||
deliverAt: self.deliverAt,
|
||||
eventId: self.eventId,
|
||||
eventType: self.eventType,
|
||||
id: self.id,
|
||||
nextAttempt: self.nextAttempt,
|
||||
payload: self.payload,
|
||||
status: MessageStatusSerializer._toJsonObject(self.status),
|
||||
statusText: MessageStatusTextSerializer._toJsonObject(self.statusText),
|
||||
tags: self.tags,
|
||||
timestamp: self.timestamp,
|
||||
};
|
||||
},
|
||||
};
|
||||
65
node_modules/svix/src/models/endpointOut.ts
generated
vendored
Normal file
65
node_modules/svix/src/models/endpointOut.ts
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointOut {
|
||||
/** List of message channels this endpoint listens to (omit for all). */
|
||||
channels?: string[] | null;
|
||||
createdAt: Date;
|
||||
/** An example endpoint name. */
|
||||
description: string;
|
||||
disabled?: boolean;
|
||||
filterTypes?: string[] | null;
|
||||
/** The Endpoint's ID. */
|
||||
id: string;
|
||||
metadata: { [key: string]: string };
|
||||
/**
|
||||
* Deprecated, use `throttleRate` instead.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
rateLimit?: number | null;
|
||||
/** Maximum messages per second to send to this endpoint. Outgoing messages will be throttled to this rate. */
|
||||
throttleRate?: number | null;
|
||||
/** Optional unique identifier for the endpoint. */
|
||||
uid?: string | null;
|
||||
updatedAt: Date;
|
||||
url: string;
|
||||
version: number;
|
||||
}
|
||||
|
||||
export const EndpointOutSerializer = {
|
||||
_fromJsonObject(object: any): EndpointOut {
|
||||
return {
|
||||
channels: object["channels"],
|
||||
createdAt: new Date(object["createdAt"]),
|
||||
description: object["description"],
|
||||
disabled: object["disabled"],
|
||||
filterTypes: object["filterTypes"],
|
||||
id: object["id"],
|
||||
metadata: object["metadata"],
|
||||
rateLimit: object["rateLimit"],
|
||||
throttleRate: object["throttleRate"],
|
||||
uid: object["uid"],
|
||||
updatedAt: new Date(object["updatedAt"]),
|
||||
url: object["url"],
|
||||
version: object["version"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointOut): any {
|
||||
return {
|
||||
channels: self.channels,
|
||||
createdAt: self.createdAt,
|
||||
description: self.description,
|
||||
disabled: self.disabled,
|
||||
filterTypes: self.filterTypes,
|
||||
id: self.id,
|
||||
metadata: self.metadata,
|
||||
rateLimit: self.rateLimit,
|
||||
throttleRate: self.throttleRate,
|
||||
uid: self.uid,
|
||||
updatedAt: self.updatedAt,
|
||||
url: self.url,
|
||||
version: self.version,
|
||||
};
|
||||
},
|
||||
};
|
||||
68
node_modules/svix/src/models/endpointPatch.ts
generated
vendored
Normal file
68
node_modules/svix/src/models/endpointPatch.ts
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointPatch {
|
||||
channels?: string[] | null;
|
||||
description?: string;
|
||||
disabled?: boolean;
|
||||
filterTypes?: string[] | null;
|
||||
metadata?: { [key: string]: string };
|
||||
/**
|
||||
* Deprecated, use `throttleRate` instead.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
rateLimit?: number | null;
|
||||
/**
|
||||
* The endpoint's verification secret.
|
||||
*
|
||||
* Format: `base64` encoded random bytes optionally prefixed with `whsec_`.
|
||||
* It is recommended to not set this and let the server generate the secret.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
secret?: string | null;
|
||||
/**
|
||||
* Maximum messages per second to send to this endpoint.
|
||||
*
|
||||
* Outgoing messages will be throttled to this rate.
|
||||
*/
|
||||
throttleRate?: number | null;
|
||||
/** The Endpoint's UID. */
|
||||
uid?: string | null;
|
||||
url?: string;
|
||||
version?: number;
|
||||
}
|
||||
|
||||
export const EndpointPatchSerializer = {
|
||||
_fromJsonObject(object: any): EndpointPatch {
|
||||
return {
|
||||
channels: object["channels"],
|
||||
description: object["description"],
|
||||
disabled: object["disabled"],
|
||||
filterTypes: object["filterTypes"],
|
||||
metadata: object["metadata"],
|
||||
rateLimit: object["rateLimit"],
|
||||
secret: object["secret"],
|
||||
throttleRate: object["throttleRate"],
|
||||
uid: object["uid"],
|
||||
url: object["url"],
|
||||
version: object["version"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointPatch): any {
|
||||
return {
|
||||
channels: self.channels,
|
||||
description: self.description,
|
||||
disabled: self.disabled,
|
||||
filterTypes: self.filterTypes,
|
||||
metadata: self.metadata,
|
||||
rateLimit: self.rateLimit,
|
||||
secret: self.secret,
|
||||
throttleRate: self.throttleRate,
|
||||
uid: self.uid,
|
||||
url: self.url,
|
||||
version: self.version,
|
||||
};
|
||||
},
|
||||
};
|
||||
25
node_modules/svix/src/models/endpointSecretOut.ts
generated
vendored
Normal file
25
node_modules/svix/src/models/endpointSecretOut.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointSecretOut {
|
||||
/**
|
||||
* The endpoint's verification secret.
|
||||
*
|
||||
* Format: `base64` encoded random bytes optionally prefixed with `whsec_`.
|
||||
* It is recommended to not set this and let the server generate the secret.
|
||||
*/
|
||||
key: string;
|
||||
}
|
||||
|
||||
export const EndpointSecretOutSerializer = {
|
||||
_fromJsonObject(object: any): EndpointSecretOut {
|
||||
return {
|
||||
key: object["key"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointSecretOut): any {
|
||||
return {
|
||||
key: self.key,
|
||||
};
|
||||
},
|
||||
};
|
||||
25
node_modules/svix/src/models/endpointSecretRotateIn.ts
generated
vendored
Normal file
25
node_modules/svix/src/models/endpointSecretRotateIn.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointSecretRotateIn {
|
||||
/**
|
||||
* The endpoint's verification secret.
|
||||
*
|
||||
* Format: `base64` encoded random bytes optionally prefixed with `whsec_`.
|
||||
* It is recommended to not set this and let the server generate the secret.
|
||||
*/
|
||||
key?: string | null;
|
||||
}
|
||||
|
||||
export const EndpointSecretRotateInSerializer = {
|
||||
_fromJsonObject(object: any): EndpointSecretRotateIn {
|
||||
return {
|
||||
key: object["key"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointSecretRotateIn): any {
|
||||
return {
|
||||
key: self.key,
|
||||
};
|
||||
},
|
||||
};
|
||||
28
node_modules/svix/src/models/endpointStats.ts
generated
vendored
Normal file
28
node_modules/svix/src/models/endpointStats.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointStats {
|
||||
fail: number;
|
||||
pending: number;
|
||||
sending: number;
|
||||
success: number;
|
||||
}
|
||||
|
||||
export const EndpointStatsSerializer = {
|
||||
_fromJsonObject(object: any): EndpointStats {
|
||||
return {
|
||||
fail: object["fail"],
|
||||
pending: object["pending"],
|
||||
sending: object["sending"],
|
||||
success: object["success"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointStats): any {
|
||||
return {
|
||||
fail: self.fail,
|
||||
pending: self.pending,
|
||||
sending: self.sending,
|
||||
success: self.success,
|
||||
};
|
||||
},
|
||||
};
|
||||
22
node_modules/svix/src/models/endpointTransformationIn.ts
generated
vendored
Normal file
22
node_modules/svix/src/models/endpointTransformationIn.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointTransformationIn {
|
||||
code?: string | null;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export const EndpointTransformationInSerializer = {
|
||||
_fromJsonObject(object: any): EndpointTransformationIn {
|
||||
return {
|
||||
code: object["code"],
|
||||
enabled: object["enabled"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointTransformationIn): any {
|
||||
return {
|
||||
code: self.code,
|
||||
enabled: self.enabled,
|
||||
};
|
||||
},
|
||||
};
|
||||
25
node_modules/svix/src/models/endpointTransformationOut.ts
generated
vendored
Normal file
25
node_modules/svix/src/models/endpointTransformationOut.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointTransformationOut {
|
||||
code?: string | null;
|
||||
enabled?: boolean;
|
||||
updatedAt?: Date | null;
|
||||
}
|
||||
|
||||
export const EndpointTransformationOutSerializer = {
|
||||
_fromJsonObject(object: any): EndpointTransformationOut {
|
||||
return {
|
||||
code: object["code"],
|
||||
enabled: object["enabled"],
|
||||
updatedAt: object["updatedAt"] ? new Date(object["updatedAt"]) : null,
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointTransformationOut): any {
|
||||
return {
|
||||
code: self.code,
|
||||
enabled: self.enabled,
|
||||
updatedAt: self.updatedAt,
|
||||
};
|
||||
},
|
||||
};
|
||||
22
node_modules/svix/src/models/endpointTransformationPatch.ts
generated
vendored
Normal file
22
node_modules/svix/src/models/endpointTransformationPatch.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointTransformationPatch {
|
||||
code?: string | null;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export const EndpointTransformationPatchSerializer = {
|
||||
_fromJsonObject(object: any): EndpointTransformationPatch {
|
||||
return {
|
||||
code: object["code"],
|
||||
enabled: object["enabled"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointTransformationPatch): any {
|
||||
return {
|
||||
code: self.code,
|
||||
enabled: self.enabled,
|
||||
};
|
||||
},
|
||||
};
|
||||
58
node_modules/svix/src/models/endpointUpdate.ts
generated
vendored
Normal file
58
node_modules/svix/src/models/endpointUpdate.ts
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EndpointUpdate {
|
||||
/** List of message channels this endpoint listens to (omit for all). */
|
||||
channels?: string[] | null;
|
||||
description?: string;
|
||||
disabled?: boolean;
|
||||
filterTypes?: string[] | null;
|
||||
metadata?: { [key: string]: string };
|
||||
/**
|
||||
* Deprecated, use `throttleRate` instead.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
rateLimit?: number | null;
|
||||
/**
|
||||
* Maximum messages per second to send to this endpoint.
|
||||
*
|
||||
* Outgoing messages will be throttled to this rate.
|
||||
*/
|
||||
throttleRate?: number | null;
|
||||
/** Optional unique identifier for the endpoint. */
|
||||
uid?: string | null;
|
||||
url: string;
|
||||
version?: number | null;
|
||||
}
|
||||
|
||||
export const EndpointUpdateSerializer = {
|
||||
_fromJsonObject(object: any): EndpointUpdate {
|
||||
return {
|
||||
channels: object["channels"],
|
||||
description: object["description"],
|
||||
disabled: object["disabled"],
|
||||
filterTypes: object["filterTypes"],
|
||||
metadata: object["metadata"],
|
||||
rateLimit: object["rateLimit"],
|
||||
throttleRate: object["throttleRate"],
|
||||
uid: object["uid"],
|
||||
url: object["url"],
|
||||
version: object["version"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointUpdate): any {
|
||||
return {
|
||||
channels: self.channels,
|
||||
description: self.description,
|
||||
disabled: self.disabled,
|
||||
filterTypes: self.filterTypes,
|
||||
metadata: self.metadata,
|
||||
rateLimit: self.rateLimit,
|
||||
throttleRate: self.throttleRate,
|
||||
uid: self.uid,
|
||||
url: self.url,
|
||||
version: self.version,
|
||||
};
|
||||
},
|
||||
};
|
||||
27
node_modules/svix/src/models/endpointUpdatedEvent.ts
generated
vendored
Normal file
27
node_modules/svix/src/models/endpointUpdatedEvent.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// this file is @generated
|
||||
import {
|
||||
type EndpointUpdatedEventData,
|
||||
EndpointUpdatedEventDataSerializer,
|
||||
} from "./endpointUpdatedEventData";
|
||||
|
||||
/** Sent when an endpoint is updated. */
|
||||
export interface EndpointUpdatedEvent {
|
||||
data: EndpointUpdatedEventData;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export const EndpointUpdatedEventSerializer = {
|
||||
_fromJsonObject(object: any): EndpointUpdatedEvent {
|
||||
return {
|
||||
data: EndpointUpdatedEventDataSerializer._fromJsonObject(object["data"]),
|
||||
type: object["type"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointUpdatedEvent): any {
|
||||
return {
|
||||
data: EndpointUpdatedEventDataSerializer._toJsonObject(self.data),
|
||||
type: self.type,
|
||||
};
|
||||
},
|
||||
};
|
||||
33
node_modules/svix/src/models/endpointUpdatedEventData.ts
generated
vendored
Normal file
33
node_modules/svix/src/models/endpointUpdatedEventData.ts
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
// this file is @generated
|
||||
|
||||
/** Sent when an endpoint is created, updated, or deleted */
|
||||
export interface EndpointUpdatedEventData {
|
||||
/** The Application's ID. */
|
||||
appId: string;
|
||||
/** The Application's UID. */
|
||||
appUid?: string | null;
|
||||
/** The Endpoint's ID. */
|
||||
endpointId: string;
|
||||
/** The Endpoint's UID. */
|
||||
endpointUid?: string | null;
|
||||
}
|
||||
|
||||
export const EndpointUpdatedEventDataSerializer = {
|
||||
_fromJsonObject(object: any): EndpointUpdatedEventData {
|
||||
return {
|
||||
appId: object["appId"],
|
||||
appUid: object["appUid"],
|
||||
endpointId: object["endpointId"],
|
||||
endpointUid: object["endpointUid"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EndpointUpdatedEventData): any {
|
||||
return {
|
||||
appId: self.appId,
|
||||
appUid: self.appUid,
|
||||
endpointId: self.endpointId,
|
||||
endpointUid: self.endpointUid,
|
||||
};
|
||||
},
|
||||
};
|
||||
35
node_modules/svix/src/models/environmentIn.ts
generated
vendored
Normal file
35
node_modules/svix/src/models/environmentIn.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
// this file is @generated
|
||||
import { type ConnectorIn, ConnectorInSerializer } from "./connectorIn";
|
||||
import { type EventTypeIn, EventTypeInSerializer } from "./eventTypeIn";
|
||||
|
||||
export interface EnvironmentIn {
|
||||
connectors?: ConnectorIn[] | null;
|
||||
eventTypes?: EventTypeIn[] | null;
|
||||
settings?: any | null;
|
||||
}
|
||||
|
||||
export const EnvironmentInSerializer = {
|
||||
_fromJsonObject(object: any): EnvironmentIn {
|
||||
return {
|
||||
connectors: object["connectors"]?.map((item: ConnectorIn) =>
|
||||
ConnectorInSerializer._fromJsonObject(item)
|
||||
),
|
||||
eventTypes: object["eventTypes"]?.map((item: EventTypeIn) =>
|
||||
EventTypeInSerializer._fromJsonObject(item)
|
||||
),
|
||||
settings: object["settings"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EnvironmentIn): any {
|
||||
return {
|
||||
connectors: self.connectors?.map((item) =>
|
||||
ConnectorInSerializer._toJsonObject(item)
|
||||
),
|
||||
eventTypes: self.eventTypes?.map((item) =>
|
||||
EventTypeInSerializer._toJsonObject(item)
|
||||
),
|
||||
settings: self.settings,
|
||||
};
|
||||
},
|
||||
};
|
||||
41
node_modules/svix/src/models/environmentOut.ts
generated
vendored
Normal file
41
node_modules/svix/src/models/environmentOut.ts
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
// this file is @generated
|
||||
import { type ConnectorOut, ConnectorOutSerializer } from "./connectorOut";
|
||||
import { type EventTypeOut, EventTypeOutSerializer } from "./eventTypeOut";
|
||||
|
||||
export interface EnvironmentOut {
|
||||
connectors: ConnectorOut[];
|
||||
createdAt: Date;
|
||||
eventTypes: EventTypeOut[];
|
||||
settings: any | null;
|
||||
version?: number;
|
||||
}
|
||||
|
||||
export const EnvironmentOutSerializer = {
|
||||
_fromJsonObject(object: any): EnvironmentOut {
|
||||
return {
|
||||
connectors: object["connectors"].map((item: ConnectorOut) =>
|
||||
ConnectorOutSerializer._fromJsonObject(item)
|
||||
),
|
||||
createdAt: new Date(object["createdAt"]),
|
||||
eventTypes: object["eventTypes"].map((item: EventTypeOut) =>
|
||||
EventTypeOutSerializer._fromJsonObject(item)
|
||||
),
|
||||
settings: object["settings"],
|
||||
version: object["version"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EnvironmentOut): any {
|
||||
return {
|
||||
connectors: self.connectors.map((item) =>
|
||||
ConnectorOutSerializer._toJsonObject(item)
|
||||
),
|
||||
createdAt: self.createdAt,
|
||||
eventTypes: self.eventTypes.map((item) =>
|
||||
EventTypeOutSerializer._toJsonObject(item)
|
||||
),
|
||||
settings: self.settings,
|
||||
version: self.version,
|
||||
};
|
||||
},
|
||||
};
|
||||
28
node_modules/svix/src/models/eventExampleIn.ts
generated
vendored
Normal file
28
node_modules/svix/src/models/eventExampleIn.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EventExampleIn {
|
||||
/** The event type's name */
|
||||
eventType: string;
|
||||
/**
|
||||
* If the event type schema contains an array of examples, chooses which one to send.
|
||||
*
|
||||
* Defaults to the first example. Ignored if the schema doesn't contain an array of examples.
|
||||
*/
|
||||
exampleIndex?: number;
|
||||
}
|
||||
|
||||
export const EventExampleInSerializer = {
|
||||
_fromJsonObject(object: any): EventExampleIn {
|
||||
return {
|
||||
eventType: object["eventType"],
|
||||
exampleIndex: object["exampleIndex"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EventExampleIn): any {
|
||||
return {
|
||||
eventType: self.eventType,
|
||||
exampleIndex: self.exampleIndex,
|
||||
};
|
||||
},
|
||||
};
|
||||
23
node_modules/svix/src/models/eventIn.ts
generated
vendored
Normal file
23
node_modules/svix/src/models/eventIn.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EventIn {
|
||||
/** The event type's name */
|
||||
eventType: string;
|
||||
payload: string;
|
||||
}
|
||||
|
||||
export const EventInSerializer = {
|
||||
_fromJsonObject(object: any): EventIn {
|
||||
return {
|
||||
eventType: object["eventType"],
|
||||
payload: object["payload"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EventIn): any {
|
||||
return {
|
||||
eventType: self.eventType,
|
||||
payload: self.payload,
|
||||
};
|
||||
},
|
||||
};
|
||||
26
node_modules/svix/src/models/eventOut.ts
generated
vendored
Normal file
26
node_modules/svix/src/models/eventOut.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
// this file is @generated
|
||||
|
||||
export interface EventOut {
|
||||
/** The event type's name */
|
||||
eventType: string;
|
||||
payload: string;
|
||||
timestamp: Date;
|
||||
}
|
||||
|
||||
export const EventOutSerializer = {
|
||||
_fromJsonObject(object: any): EventOut {
|
||||
return {
|
||||
eventType: object["eventType"],
|
||||
payload: object["payload"],
|
||||
timestamp: new Date(object["timestamp"]),
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EventOut): any {
|
||||
return {
|
||||
eventType: self.eventType,
|
||||
payload: self.payload,
|
||||
timestamp: self.timestamp,
|
||||
};
|
||||
},
|
||||
};
|
||||
28
node_modules/svix/src/models/eventStreamOut.ts
generated
vendored
Normal file
28
node_modules/svix/src/models/eventStreamOut.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// this file is @generated
|
||||
import { type EventOut, EventOutSerializer } from "./eventOut";
|
||||
|
||||
export interface EventStreamOut {
|
||||
data: EventOut[];
|
||||
done: boolean;
|
||||
iterator: string;
|
||||
}
|
||||
|
||||
export const EventStreamOutSerializer = {
|
||||
_fromJsonObject(object: any): EventStreamOut {
|
||||
return {
|
||||
data: object["data"].map((item: EventOut) =>
|
||||
EventOutSerializer._fromJsonObject(item)
|
||||
),
|
||||
done: object["done"],
|
||||
iterator: object["iterator"],
|
||||
};
|
||||
},
|
||||
|
||||
_toJsonObject(self: EventStreamOut): any {
|
||||
return {
|
||||
data: self.data.map((item) => EventOutSerializer._toJsonObject(item)),
|
||||
done: self.done,
|
||||
iterator: self.iterator,
|
||||
};
|
||||
},
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user