@authara/react-native 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -91,6 +91,10 @@ export type ListCurrentUserOrganizationsOptions = {
91
91
  cursor?: string;
92
92
  limit?: number;
93
93
  };
94
+ export type CreateOrganizationForCurrentUserOptions = {
95
+ audience?: "app";
96
+ body: API.CreateOrganizationRequest;
97
+ };
94
98
  export type ListCurrentOrganizationMembersOptions = {
95
99
  cursor?: string;
96
100
  limit?: number;
@@ -254,6 +258,7 @@ export declare class GeneratedAutharaApiClient extends AutharaClient {
254
258
  loginWithMicrosoft(options: LoginWithMicrosoftOptions): Promise<API.AuthSession>;
255
259
  getMicrosoftLoginOptions(options?: GetMicrosoftLoginOptionsOptions): Promise<API.MicrosoftLoginOptions>;
256
260
  listCurrentUserOrganizations(options?: ListCurrentUserOrganizationsOptions): Promise<API.OrganizationSummaries>;
261
+ createOrganizationForCurrentUser(options: CreateOrganizationForCurrentUserOptions): Promise<API.AuthSession>;
257
262
  getCurrentOrganization(): Promise<API.OrganizationSummary>;
258
263
  listCurrentOrganizationMembers(options?: ListCurrentOrganizationMembersOptions): Promise<API.CurrentOrganizationMembers>;
259
264
  getPublicOrganization(options: GetPublicOrganizationOptions): Promise<API.OrganizationEnvelope>;
@@ -155,6 +155,14 @@ export class GeneratedAutharaApiClient extends AutharaClient {
155
155
  authenticated: true,
156
156
  });
157
157
  }
158
+ createOrganizationForCurrentUser(options) {
159
+ return this.request("POST", `/auth/api/v1/organizations`, {
160
+ query: { audience: options?.audience },
161
+ body: options.body,
162
+ csrf: true,
163
+ authenticated: true,
164
+ });
165
+ }
158
166
  getCurrentOrganization() {
159
167
  return this.request("GET", `/auth/api/v1/organizations/current`, { authenticated: true });
160
168
  }
@@ -79,6 +79,7 @@ export interface AuthSession {
79
79
  user: AuthUser;
80
80
  access_token: string;
81
81
  refresh_token: string;
82
+ organization_state: OrganizationSessionState;
82
83
  }
83
84
  export interface AuthUser {
84
85
  id: string;
@@ -122,6 +123,9 @@ export interface ChangePasswordRequest {
122
123
  export interface ChangeUsernameRequest {
123
124
  username: string;
124
125
  }
126
+ export interface CreateOrganizationRequest {
127
+ name: string;
128
+ }
125
129
  export interface CurrentOrganizationMember {
126
130
  user_id: string;
127
131
  email: string;
@@ -274,6 +278,11 @@ export interface OrganizationMembers {
274
278
  next_cursor?: string;
275
279
  }
276
280
  export type OrganizationRole = "owner" | "admin" | "member";
281
+ export interface OrganizationSessionState {
282
+ status: "active" | "organization_required";
283
+ can_accept_invitation: boolean;
284
+ can_create_organization: boolean;
285
+ }
277
286
  export interface OrganizationSummaries {
278
287
  organizations: Array<OrganizationSummary>;
279
288
  next_cursor?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authara/react-native",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Official React Native client, hooks, and native-provider buttons for Authara",
5
5
  "keywords": [
6
6
  "authentication",