@@ -89,6 +89,24 @@ class Flows {
89
89
return res . body as userv1 . Flow ;
90
90
}
91
91
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
+
92
110
/**
93
111
* Retrieves specified flow.
94
112
*/
@@ -110,6 +128,31 @@ class Flows {
110
128
return res . body as userv1 . Flow ;
111
129
}
112
130
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
+
113
156
/**
114
157
* Consume the flow.
115
158
*
@@ -420,6 +463,18 @@ interface FlowCreateJoinOrganizationInput extends RequestOptions {
420
463
displayName ?: string ;
421
464
}
422
465
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
+
423
478
/**
424
479
* The input options for the `flows.get` method.
425
480
*/
@@ -428,6 +483,14 @@ interface FlowGetInput extends RequestOptions {
428
483
flowId : string ;
429
484
}
430
485
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
+
431
494
/**
432
495
* The input options for the `flows.consume` method.
433
496
*/
0 commit comments