Skip to content

Commit e28add5

Browse files
authored
Update OpenAPI spec and regenerate libs (#1769)
2 parents 33e2b6e + 70b1ab7 commit e28add5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+13075
-9079
lines changed

javascript/src/api/ingestEndpoint.ts

+205
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
// this file is @generated
2+
import {
3+
IngestEndpointHeadersIn,
4+
IngestEndpointHeadersInSerializer,
5+
} from "../models/ingestEndpointHeadersIn";
6+
import {
7+
IngestEndpointHeadersOut,
8+
IngestEndpointHeadersOutSerializer,
9+
} from "../models/ingestEndpointHeadersOut";
10+
import { IngestEndpointIn, IngestEndpointInSerializer } from "../models/ingestEndpointIn";
11+
import {
12+
IngestEndpointOut,
13+
IngestEndpointOutSerializer,
14+
} from "../models/ingestEndpointOut";
15+
import {
16+
IngestEndpointSecretIn,
17+
IngestEndpointSecretInSerializer,
18+
} from "../models/ingestEndpointSecretIn";
19+
import {
20+
IngestEndpointSecretOut,
21+
IngestEndpointSecretOutSerializer,
22+
} from "../models/ingestEndpointSecretOut";
23+
import {
24+
IngestEndpointUpdate,
25+
IngestEndpointUpdateSerializer,
26+
} from "../models/ingestEndpointUpdate";
27+
import {
28+
ListResponseIngestEndpointOut,
29+
ListResponseIngestEndpointOutSerializer,
30+
} from "../models/listResponseIngestEndpointOut";
31+
import { Ordering } from "../models/ordering";
32+
import { HttpMethod, SvixRequest, SvixRequestContext } from "../request";
33+
34+
export interface IngestEndpointListOptions {
35+
/** Limit the number of returned items */
36+
limit?: number;
37+
/** The iterator returned from a prior invocation */
38+
iterator?: string | null;
39+
/** The sorting order of the returned items */
40+
order?: Ordering;
41+
}
42+
43+
export interface IngestEndpointCreateOptions {
44+
idempotencyKey?: string;
45+
}
46+
47+
export interface IngestEndpointRotateSecretOptions {
48+
idempotencyKey?: string;
49+
}
50+
51+
export class IngestEndpoint {
52+
public constructor(private readonly requestCtx: SvixRequestContext) {}
53+
54+
/** List ingest endpoints. */
55+
public list(
56+
options?: IngestEndpointListOptions
57+
): Promise<ListResponseIngestEndpointOut> {
58+
const request = new SvixRequest(
59+
HttpMethod.GET,
60+
"/ingest/api/v1/source/{source_id}/endpoint"
61+
);
62+
63+
request.setQueryParam("limit", options?.limit);
64+
request.setQueryParam("iterator", options?.iterator);
65+
request.setQueryParam("order", options?.order);
66+
67+
return request.send(
68+
this.requestCtx,
69+
ListResponseIngestEndpointOutSerializer._fromJsonObject
70+
);
71+
}
72+
73+
/** Create an ingest endpoint. */
74+
public create(
75+
ingestEndpointIn: IngestEndpointIn,
76+
options?: IngestEndpointCreateOptions
77+
): Promise<IngestEndpointOut> {
78+
const request = new SvixRequest(
79+
HttpMethod.POST,
80+
"/ingest/api/v1/source/{source_id}/endpoint"
81+
);
82+
83+
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
84+
request.setBody(IngestEndpointInSerializer._toJsonObject(ingestEndpointIn));
85+
86+
return request.send(this.requestCtx, IngestEndpointOutSerializer._fromJsonObject);
87+
}
88+
89+
/** Get an ingest endpoint. */
90+
public get(endpointId: string): Promise<IngestEndpointOut> {
91+
const request = new SvixRequest(
92+
HttpMethod.GET,
93+
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}"
94+
);
95+
96+
request.setPathParam("endpoint_id", endpointId);
97+
98+
return request.send(this.requestCtx, IngestEndpointOutSerializer._fromJsonObject);
99+
}
100+
101+
/** Update an ingest endpoint. */
102+
public update(
103+
endpointId: string,
104+
ingestEndpointUpdate: IngestEndpointUpdate
105+
): Promise<IngestEndpointOut> {
106+
const request = new SvixRequest(
107+
HttpMethod.PUT,
108+
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}"
109+
);
110+
111+
request.setPathParam("endpoint_id", endpointId);
112+
request.setBody(IngestEndpointUpdateSerializer._toJsonObject(ingestEndpointUpdate));
113+
114+
return request.send(this.requestCtx, IngestEndpointOutSerializer._fromJsonObject);
115+
}
116+
117+
/** Delete an ingest endpoint. */
118+
public delete(endpointId: string): Promise<void> {
119+
const request = new SvixRequest(
120+
HttpMethod.DELETE,
121+
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}"
122+
);
123+
124+
request.setPathParam("endpoint_id", endpointId);
125+
126+
return request.sendNoResponseBody(this.requestCtx);
127+
}
128+
129+
/** Get the additional headers to be sent with the ingest. */
130+
public getHeaders(endpointId: string): Promise<IngestEndpointHeadersOut> {
131+
const request = new SvixRequest(
132+
HttpMethod.GET,
133+
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers"
134+
);
135+
136+
request.setPathParam("endpoint_id", endpointId);
137+
138+
return request.send(
139+
this.requestCtx,
140+
IngestEndpointHeadersOutSerializer._fromJsonObject
141+
);
142+
}
143+
144+
/** Set the additional headers to be sent to the endpoint. */
145+
public updateHeaders(
146+
endpointId: string,
147+
ingestEndpointHeadersIn: IngestEndpointHeadersIn
148+
): Promise<void> {
149+
const request = new SvixRequest(
150+
HttpMethod.PUT,
151+
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers"
152+
);
153+
154+
request.setPathParam("endpoint_id", endpointId);
155+
request.setBody(
156+
IngestEndpointHeadersInSerializer._toJsonObject(ingestEndpointHeadersIn)
157+
);
158+
159+
return request.sendNoResponseBody(this.requestCtx);
160+
}
161+
162+
/**
163+
* Get an ingest endpoint's signing secret.
164+
*
165+
* This is used to verify the authenticity of the webhook.
166+
* For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
167+
*/
168+
public getSecret(endpointId: string): Promise<IngestEndpointSecretOut> {
169+
const request = new SvixRequest(
170+
HttpMethod.GET,
171+
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret"
172+
);
173+
174+
request.setPathParam("endpoint_id", endpointId);
175+
176+
return request.send(
177+
this.requestCtx,
178+
IngestEndpointSecretOutSerializer._fromJsonObject
179+
);
180+
}
181+
182+
/**
183+
* Rotates an ingest endpoint's signing secret.
184+
*
185+
* The previous secret will remain valid for the next 24 hours.
186+
*/
187+
public rotateSecret(
188+
endpointId: string,
189+
ingestEndpointSecretIn: IngestEndpointSecretIn,
190+
options?: IngestEndpointRotateSecretOptions
191+
): Promise<void> {
192+
const request = new SvixRequest(
193+
HttpMethod.POST,
194+
"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate"
195+
);
196+
197+
request.setPathParam("endpoint_id", endpointId);
198+
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
199+
request.setBody(
200+
IngestEndpointSecretInSerializer._toJsonObject(ingestEndpointSecretIn)
201+
);
202+
203+
return request.sendNoResponseBody(this.requestCtx);
204+
}
205+
}

javascript/src/api/message.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// this file is @generated
22
import {
3-
ExpungAllContentsOut,
4-
ExpungAllContentsOutSerializer,
5-
} from "../models/expungAllContentsOut";
3+
ExpungeAllContentsOut,
4+
ExpungeAllContentsOutSerializer,
5+
} from "../models/expungeAllContentsOut";
66
import {
77
ListResponseMessageOut,
88
ListResponseMessageOutSerializer,
@@ -115,7 +115,7 @@ export class Message {
115115
public expungeAllContents(
116116
appId: string,
117117
options?: MessageExpungeAllContentsOptions
118-
): Promise<ExpungAllContentsOut> {
118+
): Promise<ExpungeAllContentsOut> {
119119
const request = new SvixRequest(
120120
HttpMethod.POST,
121121
"/api/v1/app/{app_id}/msg/expunge-all-contents"
@@ -124,7 +124,7 @@ export class Message {
124124
request.setPathParam("app_id", appId);
125125
request.setHeaderParam("idempotency-key", options?.idempotencyKey);
126126

127-
return request.send(this.requestCtx, ExpungAllContentsOutSerializer._fromJsonObject);
127+
return request.send(this.requestCtx, ExpungeAllContentsOutSerializer._fromJsonObject);
128128
}
129129

130130
/** Get a message by its ID or eventID. */

javascript/src/models/endpointIn.ts

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface EndpointIn {
77
description?: string;
88
disabled?: boolean;
99
filterTypes?: string[] | null;
10+
headers?: { [key: string]: string } | null;
1011
metadata?: { [key: string]: string };
1112
rateLimit?: number | null;
1213
/**
@@ -29,6 +30,7 @@ export const EndpointInSerializer = {
2930
description: object["description"],
3031
disabled: object["disabled"],
3132
filterTypes: object["filterTypes"],
33+
headers: object["headers"],
3234
metadata: object["metadata"],
3335
rateLimit: object["rateLimit"],
3436
secret: object["secret"],
@@ -44,6 +46,7 @@ export const EndpointInSerializer = {
4446
description: self.description,
4547
disabled: self.disabled,
4648
filterTypes: self.filterTypes,
49+
headers: self.headers,
4750
metadata: self.metadata,
4851
rateLimit: self.rateLimit,
4952
secret: self.secret,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// this file is @generated
2+
/* eslint @typescript-eslint/no-explicit-any: 0 */
3+
import {
4+
BackgroundTaskStatus,
5+
BackgroundTaskStatusSerializer,
6+
} from "./backgroundTaskStatus";
7+
import { BackgroundTaskType, BackgroundTaskTypeSerializer } from "./backgroundTaskType";
8+
9+
export interface ExpungeAllContentsOut {
10+
/** The QueueBackgroundTask's ID. */
11+
id: string;
12+
status: BackgroundTaskStatus;
13+
task: BackgroundTaskType;
14+
}
15+
16+
export const ExpungeAllContentsOutSerializer = {
17+
_fromJsonObject(object: any): ExpungeAllContentsOut {
18+
return {
19+
id: object["id"],
20+
status: BackgroundTaskStatusSerializer._fromJsonObject(object["status"]),
21+
task: BackgroundTaskTypeSerializer._fromJsonObject(object["task"]),
22+
};
23+
},
24+
25+
_toJsonObject(self: ExpungeAllContentsOut): any {
26+
return {
27+
id: self.id,
28+
status: BackgroundTaskStatusSerializer._toJsonObject(self.status),
29+
task: BackgroundTaskTypeSerializer._toJsonObject(self.task),
30+
};
31+
},
32+
};

javascript/src/models/index.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ export { EventTypeIn } from "./eventTypeIn";
3838
export { EventTypeOut } from "./eventTypeOut";
3939
export { EventTypePatch } from "./eventTypePatch";
4040
export { EventTypeUpdate } from "./eventTypeUpdate";
41-
export { ExpungAllContentsOut } from "./expungAllContentsOut";
41+
export { ExpungeAllContentsOut } from "./expungeAllContentsOut";
42+
export { IngestEndpointHeadersIn } from "./ingestEndpointHeadersIn";
43+
export { IngestEndpointHeadersOut } from "./ingestEndpointHeadersOut";
44+
export { IngestEndpointIn } from "./ingestEndpointIn";
45+
export { IngestEndpointOut } from "./ingestEndpointOut";
46+
export { IngestEndpointSecretIn } from "./ingestEndpointSecretIn";
47+
export { IngestEndpointSecretOut } from "./ingestEndpointSecretOut";
48+
export { IngestEndpointUpdate } from "./ingestEndpointUpdate";
4249
export { IntegrationIn } from "./integrationIn";
4350
export { IntegrationKeyOut } from "./integrationKeyOut";
4451
export { IntegrationOut } from "./integrationOut";
@@ -48,6 +55,7 @@ export { ListResponseBackgroundTaskOut } from "./listResponseBackgroundTaskOut";
4855
export { ListResponseEndpointMessageOut } from "./listResponseEndpointMessageOut";
4956
export { ListResponseEndpointOut } from "./listResponseEndpointOut";
5057
export { ListResponseEventTypeOut } from "./listResponseEventTypeOut";
58+
export { ListResponseIngestEndpointOut } from "./listResponseIngestEndpointOut";
5159
export { ListResponseIntegrationOut } from "./listResponseIntegrationOut";
5260
export { ListResponseMessageAttemptOut } from "./listResponseMessageAttemptOut";
5361
export { ListResponseMessageEndpointOut } from "./listResponseMessageEndpointOut";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// this file is @generated
2+
/* eslint @typescript-eslint/no-explicit-any: 0 */
3+
4+
export interface IngestEndpointHeadersIn {
5+
headers: { [key: string]: string };
6+
}
7+
8+
export const IngestEndpointHeadersInSerializer = {
9+
_fromJsonObject(object: any): IngestEndpointHeadersIn {
10+
return {
11+
headers: object["headers"],
12+
};
13+
},
14+
15+
_toJsonObject(self: IngestEndpointHeadersIn): any {
16+
return {
17+
headers: self.headers,
18+
};
19+
},
20+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// this file is @generated
2+
/* eslint @typescript-eslint/no-explicit-any: 0 */
3+
4+
export interface IngestEndpointHeadersOut {
5+
headers: { [key: string]: string };
6+
sensitive: string[];
7+
}
8+
9+
export const IngestEndpointHeadersOutSerializer = {
10+
_fromJsonObject(object: any): IngestEndpointHeadersOut {
11+
return {
12+
headers: object["headers"],
13+
sensitive: object["sensitive"],
14+
};
15+
},
16+
17+
_toJsonObject(self: IngestEndpointHeadersOut): any {
18+
return {
19+
headers: self.headers,
20+
sensitive: self.sensitive,
21+
};
22+
},
23+
};

0 commit comments

Comments
 (0)