Skip to content

Commit 61cd236

Browse files
authored
Update generated code (#8)
1 parent 5819ebe commit 61cd236

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

src/adminapi.ts

+43
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ class Flows {
105105
return res.body as adminv1.Flow;
106106
}
107107

108+
/**
109+
* Create a signup flow.
110+
*
111+
* This invites a person to join the app.
112+
*/
113+
async createSignup(input: FlowCreateSignupInput): Promise<adminv1.Flow>;
114+
async createSignup(...args: any[]): Promise<adminv1.Flow> {
115+
const req = build({
116+
call: "admin.flows.createSignup",
117+
method: "POST",
118+
path: "/admin/v1/flows:createSignup",
119+
args,
120+
});
121+
122+
const res = await this.transport.execute(req);
123+
return res.body as adminv1.Flow;
124+
}
125+
108126
/**
109127
* Retrieves specified flow.
110128
*/
@@ -876,6 +894,31 @@ interface FlowCreateJoinOrganizationInput extends RequestOptions {
876894
ttl?: string;
877895
}
878896

897+
/**
898+
* The input options for the `flows.createSignup` method.
899+
*/
900+
interface FlowCreateSignupInput extends RequestOptions {
901+
// The email address of the person to invite.
902+
email?: string;
903+
// The display name of the person to invite.
904+
displayName?: string;
905+
// Whether to create an organization as part of the signup flow.
906+
createOrganization?: boolean;
907+
// The identifier of the user sending the invite.
908+
creatorUserId?: string;
909+
// The time the flow will expire.
910+
//
911+
// This field is not allowed if `ttl` is specified.
912+
expireTime?: Date | null;
913+
// The amount of time a flow will be available (e.g. `86400s`).
914+
//
915+
// This must be a string with the number of seconds followed by a
916+
// trailing `s`.
917+
//
918+
// This field is not allowed if `expireTime` is specified.
919+
ttl?: string;
920+
}
921+
879922
/**
880923
* The input options for the `flows.get` method.
881924
*/

src/userapi.ts

+63
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,24 @@ class Flows {
8989
return res.body as userv1.Flow;
9090
}
9191

92+
/**
93+
* Creates a signup flow.
94+
*
95+
* This invites a person to join the app.
96+
*/
97+
async createSignup(input: FlowCreateSignupInput): Promise<userv1.Flow>;
98+
async createSignup(...args: any[]): Promise<userv1.Flow> {
99+
const req = build({
100+
call: "user.flows.createSignup",
101+
method: "POST",
102+
path: "/user/v1/flows:createSignup",
103+
args,
104+
});
105+
106+
const res = await this.transport.execute(req);
107+
return res.body as userv1.Flow;
108+
}
109+
92110
/**
93111
* Retrieves specified flow.
94112
*/
@@ -110,6 +128,31 @@ class Flows {
110128
return res.body as userv1.Flow;
111129
}
112130

131+
/**
132+
* Approve a flow.
133+
*
134+
* This will approve the specified flow and start the next step
135+
* in the flow (e.g. for a join organization flow it will send the
136+
* invitee an email with a link to join the organization).
137+
*/
138+
async approve(
139+
flowId: string,
140+
input?: Omit<FlowApproveInput, "flowId">,
141+
): Promise<userv1.Flow>;
142+
async approve(input: FlowApproveInput): Promise<userv1.Flow>;
143+
async approve(...args: any[]): Promise<userv1.Flow> {
144+
const req = build({
145+
call: "user.flows.approve",
146+
method: "POST",
147+
path: "/user/v1/flows/{flowId}:approve",
148+
idempotent: true,
149+
args,
150+
});
151+
152+
const res = await this.transport.execute(req);
153+
return res.body as userv1.Flow;
154+
}
155+
113156
/**
114157
* Consume the flow.
115158
*
@@ -420,6 +463,18 @@ interface FlowCreateJoinOrganizationInput extends RequestOptions {
420463
displayName?: string;
421464
}
422465

466+
/**
467+
* The input options for the `flows.createSignup` method.
468+
*/
469+
interface FlowCreateSignupInput extends RequestOptions {
470+
// The email address of the person to invite.
471+
email?: string;
472+
// The display name of the person to invite.
473+
displayName?: string;
474+
// Whether to create an organization as part of the signup flow.
475+
createOrganization?: boolean;
476+
}
477+
423478
/**
424479
* The input options for the `flows.get` method.
425480
*/
@@ -428,6 +483,14 @@ interface FlowGetInput extends RequestOptions {
428483
flowId: string;
429484
}
430485

486+
/**
487+
* The input options for the `flows.approve` method.
488+
*/
489+
interface FlowApproveInput extends RequestOptions {
490+
// The identifier of the flow.
491+
flowId: string;
492+
}
493+
431494
/**
432495
* The input options for the `flows.consume` method.
433496
*/

0 commit comments

Comments
 (0)