Skip to content

Commit 0a58e05

Browse files
feat: add events SSE streaming, bulk refresh token revocation, and query string builder (#1331)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 76d9f3b commit 0a58e05

151 files changed

Lines changed: 6957 additions & 696 deletions

File tree

Some content is hidden

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

reference.md

Lines changed: 164 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,6 +2153,7 @@ To search by checkpoint, use the following parameters:
21532153
const pageableResponse = await client.connections.list({
21542154
from: "from",
21552155
take: 1,
2156+
strategy: ["ad"],
21562157
name: "name",
21572158
fields: "fields",
21582159
include_fields: true,
@@ -2165,6 +2166,7 @@ for await (const item of pageableResponse) {
21652166
let page = await client.connections.list({
21662167
from: "from",
21672168
take: 1,
2169+
strategy: ["ad"],
21682170
name: "name",
21692171
fields: "fields",
21702172
include_fields: true,
@@ -4008,6 +4010,78 @@ await client.eventStreams.test("id", {
40084010
</dl>
40094011
</details>
40104012

4013+
## Events
4014+
4015+
<details><summary><code>client.events.<a href="/src/management/api/resources/events/client/Client.ts">subscribe</a>({ ...params }) -> core.Stream&lt;Management.EventStreamSubscribeEventsResponseContent&gt;</code></summary>
4016+
<dl>
4017+
<dd>
4018+
4019+
#### 📝 Description
4020+
4021+
<dl>
4022+
<dd>
4023+
4024+
<dl>
4025+
<dd>
4026+
4027+
Subscribe to events via Server-Sent Events (SSE)
4028+
4029+
</dd>
4030+
</dl>
4031+
</dd>
4032+
</dl>
4033+
4034+
#### 🔌 Usage
4035+
4036+
<dl>
4037+
<dd>
4038+
4039+
<dl>
4040+
<dd>
4041+
4042+
```typescript
4043+
const response = await client.events.subscribe({
4044+
from: "from",
4045+
from_timestamp: "from_timestamp",
4046+
event_type: ["group.created"],
4047+
});
4048+
for await (const item of response) {
4049+
console.log(item);
4050+
}
4051+
```
4052+
4053+
</dd>
4054+
</dl>
4055+
</dd>
4056+
</dl>
4057+
4058+
#### ⚙️ Parameters
4059+
4060+
<dl>
4061+
<dd>
4062+
4063+
<dl>
4064+
<dd>
4065+
4066+
**request:** `Management.SubscribeEventsRequestParameters`
4067+
4068+
</dd>
4069+
</dl>
4070+
4071+
<dl>
4072+
<dd>
4073+
4074+
**requestOptions:** `EventsClient.RequestOptions`
4075+
4076+
</dd>
4077+
</dl>
4078+
</dd>
4079+
</dl>
4080+
4081+
</dd>
4082+
</dl>
4083+
</details>
4084+
40114085
## Flows
40124086

40134087
<details><summary><code>client.flows.<a href="/src/management/api/resources/flows/client/Client.ts">list</a>({ ...params }) -> core.Page&lt;Management.FlowSummary, Management.ListFlowsOffsetPaginatedResponseContent&gt;</code></summary>
@@ -4027,6 +4101,7 @@ const pageableResponse = await client.flows.list({
40274101
page: 1,
40284102
per_page: 1,
40294103
include_totals: true,
4104+
hydrate: ["form_count"],
40304105
synchronous: true,
40314106
});
40324107
for await (const item of pageableResponse) {
@@ -4038,6 +4113,7 @@ let page = await client.flows.list({
40384113
page: 1,
40394114
per_page: 1,
40404115
include_totals: true,
4116+
hydrate: ["form_count"],
40414117
synchronous: true,
40424118
});
40434119
while (page.hasNextPage()) {
@@ -4143,7 +4219,9 @@ await client.flows.create({
41434219
<dd>
41444220

41454221
```typescript
4146-
await client.flows.get("id");
4222+
await client.flows.get("id", {
4223+
hydrate: ["form_count"],
4224+
});
41474225
```
41484226

41494227
</dd>
@@ -4309,6 +4387,7 @@ const pageableResponse = await client.forms.list({
43094387
page: 1,
43104388
per_page: 1,
43114389
include_totals: true,
4390+
hydrate: ["flow_count"],
43124391
});
43134392
for await (const item of pageableResponse) {
43144393
console.log(item);
@@ -4319,6 +4398,7 @@ let page = await client.forms.list({
43194398
page: 1,
43204399
per_page: 1,
43214400
include_totals: true,
4401+
hydrate: ["flow_count"],
43224402
});
43234403
while (page.hasNextPage()) {
43244404
page = page.getNextPage();
@@ -4423,7 +4503,9 @@ await client.forms.create({
44234503
<dd>
44244504

44254505
```typescript
4426-
await client.forms.get("id");
4506+
await client.forms.get("id", {
4507+
hydrate: ["flow_count"],
4508+
});
44274509
```
44284510

44294511
</dd>
@@ -4823,6 +4905,7 @@ const pageableResponse = await client.groups.list({
48234905
connection_id: "connection_id",
48244906
name: "name",
48254907
external_id: "external_id",
4908+
search: "search",
48264909
fields: "fields",
48274910
include_fields: true,
48284911
from: "from",
@@ -4837,6 +4920,7 @@ let page = await client.groups.list({
48374920
connection_id: "connection_id",
48384921
name: "name",
48394922
external_id: "external_id",
4923+
search: "search",
48404924
fields: "fields",
48414925
include_fields: true,
48424926
from: "from",
@@ -7521,6 +7605,69 @@ const response = page.response;
75217605
</dl>
75227606
</details>
75237607

7608+
<details><summary><code>client.refreshTokens.<a href="/src/management/api/resources/refreshTokens/client/Client.ts">revoke</a>({ ...params }) -> void</code></summary>
7609+
<dl>
7610+
<dd>
7611+
7612+
#### 📝 Description
7613+
7614+
<dl>
7615+
<dd>
7616+
7617+
<dl>
7618+
<dd>
7619+
7620+
Revoke refresh tokens in bulk by ID list, user, user+client, or client.
7621+
7622+
</dd>
7623+
</dl>
7624+
</dd>
7625+
</dl>
7626+
7627+
#### 🔌 Usage
7628+
7629+
<dl>
7630+
<dd>
7631+
7632+
<dl>
7633+
<dd>
7634+
7635+
```typescript
7636+
await client.refreshTokens.revoke();
7637+
```
7638+
7639+
</dd>
7640+
</dl>
7641+
</dd>
7642+
</dl>
7643+
7644+
#### ⚙️ Parameters
7645+
7646+
<dl>
7647+
<dd>
7648+
7649+
<dl>
7650+
<dd>
7651+
7652+
**request:** `Management.RevokeRefreshTokensRequestContent`
7653+
7654+
</dd>
7655+
</dl>
7656+
7657+
<dl>
7658+
<dd>
7659+
7660+
**requestOptions:** `RefreshTokensClient.RequestOptions`
7661+
7662+
</dd>
7663+
</dl>
7664+
</dd>
7665+
</dl>
7666+
7667+
</dd>
7668+
</dl>
7669+
</details>
7670+
75247671
<details><summary><code>client.refreshTokens.<a href="/src/management/api/resources/refreshTokens/client/Client.ts">get</a>(id) -> Management.GetRefreshTokenResponseContent</code></summary>
75257672
<dl>
75267673
<dd>
@@ -7749,6 +7896,7 @@ Retrieve details of all APIs associated with your tenant.
77497896

77507897
```typescript
77517898
const pageableResponse = await client.resourceServers.list({
7899+
identifiers: ["identifiers"],
77527900
page: 1,
77537901
per_page: 1,
77547902
include_totals: true,
@@ -7760,6 +7908,7 @@ for await (const item of pageableResponse) {
77607908

77617909
// Or you can manually iterate page-by-page
77627910
let page = await client.resourceServers.list({
7911+
identifiers: ["identifiers"],
77637912
page: 1,
77647913
per_page: 1,
77657914
include_totals: true,
@@ -10440,7 +10589,7 @@ const response = page.response;
1044010589
<dl>
1044110590
<dd>
1044210591

10443-
Retrieve details about a single User Attribute Profile specified by ID.
10592+
Create a User Attribute Profile
1044410593

1044510594
</dd>
1044610595
</dl>
@@ -15635,6 +15784,7 @@ Retrieve all connections that are enabled for the specified <a href="https://www
1563515784

1563615785
```typescript
1563715786
const pageableResponse = await client.clients.connections.get("id", {
15787+
strategy: ["ad"],
1563815788
from: "from",
1563915789
take: 1,
1564015790
fields: "fields",
@@ -15646,6 +15796,7 @@ for await (const item of pageableResponse) {
1564615796

1564715797
// Or you can manually iterate page-by-page
1564815798
let page = await client.clients.connections.get("id", {
15799+
strategy: ["ad"],
1564915800
from: "from",
1565015801
take: 1,
1565115802
fields: "fields",
@@ -18062,7 +18213,9 @@ const response = page.response;
1806218213
<dd>
1806318214

1806418215
```typescript
18065-
await client.flows.executions.get("flow_id", "execution_id");
18216+
await client.flows.executions.get("flow_id", "execution_id", {
18217+
hydrate: ["debug"],
18218+
});
1806618219
```
1806718220

1806818221
</dd>
@@ -22202,6 +22355,7 @@ await client.keys.signing.revoke("kid");
2220222355
const pageableResponse = await client.organizations.clientGrants.list("id", {
2220322356
audience: "audience",
2220422357
client_id: "client_id",
22358+
grant_ids: ["grant_ids"],
2220522359
page: 1,
2220622360
per_page: 1,
2220722361
include_totals: true,
@@ -22214,6 +22368,7 @@ for await (const item of pageableResponse) {
2221422368
let page = await client.organizations.clientGrants.list("id", {
2221522369
audience: "audience",
2221622370
client_id: "client_id",
22371+
grant_ids: ["grant_ids"],
2221722372
page: 1,
2221822373
per_page: 1,
2221922374
include_totals: true,
@@ -25663,7 +25818,7 @@ await client.roles.users.assign("id", {
2566325818
<dl>
2566425819
<dd>
2566525820

25666-
Retrieves text customizations for a given self-service profile, language and Self Service SSO Flow page.
25821+
Retrieves text customizations for a given self-service profile, language and Self-Service Enterprise Configuration flow page.
2566725822

2566825823
</dd>
2566925824
</dl>
@@ -25742,7 +25897,7 @@ await client.selfServiceProfiles.customText.list("id", "en", "get-started");
2574225897
<dl>
2574325898
<dd>
2574425899

25745-
Updates text customizations for a given self-service profile, language and Self Service SSO Flow page.
25900+
Updates text customizations for a given self-service profile, language and Self-Service Enterprise Configuration flow page.
2574625901

2574725902
</dd>
2574825903
</dl>
@@ -25833,7 +25988,7 @@ await client.selfServiceProfiles.customText.set("id", "en", "get-started", {
2583325988
<dl>
2583425989
<dd>
2583525990

25836-
Creates an SSO access ticket to initiate the Self Service SSO Flow using a self-service profile.
25991+
Creates an access ticket to initiate the Self-Service Enterprise Configuration flow using a self-service profile.
2583725992

2583825993
</dd>
2583925994
</dl>
@@ -25904,7 +26059,7 @@ await client.selfServiceProfiles.ssoTicket.create("id");
2590426059
<dl>
2590526060
<dd>
2590626061

25907-
Revokes an SSO access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service SSO session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a `202 Accepted` response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a `202 Accepted` response is also returned, signaling that no further action is required.
26062+
Revokes a Self-Service Enterprise Configuration access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service Enterprise Configuration session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a `202 Accepted` response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a `202 Accepted` response is also returned, signaling that no further action is required.
2590826063
Clients should treat these `202` responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found.
2590926064

2591026065
</dd>
@@ -28446,7 +28601,7 @@ await client.users.sessions.delete("user_id");
2844628601
<dl>
2844728602
<dd>
2844828603

28449-
List a verifiable credential templates.
28604+
List verifiable credential templates.
2845028605

2845128606
</dd>
2845228607
</dl>

src/management/Client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { CustomDomainsClient } from "./api/resources/customDomains/client/Client
1212
import { DeviceCredentialsClient } from "./api/resources/deviceCredentials/client/Client.js";
1313
import { EmailsClient } from "./api/resources/emails/client/Client.js";
1414
import { EmailTemplatesClient } from "./api/resources/emailTemplates/client/Client.js";
15+
import { EventsClient } from "./api/resources/events/client/Client.js";
1516
import { EventStreamsClient } from "./api/resources/eventStreams/client/Client.js";
1617
import { FlowsClient } from "./api/resources/flows/client/Client.js";
1718
import { FormsClient } from "./api/resources/forms/client/Client.js";
@@ -66,6 +67,7 @@ export class ManagementClient {
6667
protected _deviceCredentials: DeviceCredentialsClient | undefined;
6768
protected _emailTemplates: EmailTemplatesClient | undefined;
6869
protected _eventStreams: EventStreamsClient | undefined;
70+
protected _events: EventsClient | undefined;
6971
protected _flows: FlowsClient | undefined;
7072
protected _forms: FormsClient | undefined;
7173
protected _userGrants: UserGrantsClient | undefined;
@@ -144,6 +146,10 @@ export class ManagementClient {
144146
return (this._eventStreams ??= new EventStreamsClient(this._options));
145147
}
146148

149+
public get events(): EventsClient {
150+
return (this._events ??= new EventsClient(this._options));
151+
}
152+
147153
public get flows(): FlowsClient {
148154
return (this._flows ??= new FlowsClient(this._options));
149155
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// This file was auto-generated by Fern from our API Definition.
2+
3+
import * as core from "../../core/index.js";
4+
import * as errors from "../../errors/index.js";
5+
6+
export class GoneError extends errors.ManagementError {
7+
constructor(body?: unknown, rawResponse?: core.RawResponse) {
8+
super({
9+
message: "GoneError",
10+
statusCode: 410,
11+
body: body,
12+
rawResponse: rawResponse,
13+
});
14+
Object.setPrototypeOf(this, new.target.prototype);
15+
if (Error.captureStackTrace) {
16+
Error.captureStackTrace(this, this.constructor);
17+
}
18+
19+
this.name = this.constructor.name;
20+
}
21+
}

0 commit comments

Comments
 (0)