-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Org group entity, fix auth, add identity (#11)
* org group entity * add identity creation from snap * get providers identity details in auth flow * hotfix
- Loading branch information
Showing
15 changed files
with
178 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './org-groups' | ||
export * from './orgs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum OrgGroupIncludes { | ||
GroupUsers = 'group_users', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './org-groups' | ||
export * from './orgs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { api, OrgGroup, OrgGroupCreate, OrgGroupRequestQueryParams } from '@/api' | ||
|
||
export const loadOrgGroups = async (orgId: string, query?: OrgGroupRequestQueryParams) => { | ||
const { data } = await api.get<OrgGroup[]>(`/v1/orgs/${orgId}/groups`, { | ||
query, | ||
}) | ||
|
||
return data | ||
} | ||
|
||
export const createOrgGroup = async (orgId: string, createOpts: OrgGroupCreate) => { | ||
const { data } = await api.post<OrgGroup>(`/v1/orgs/${orgId}/groups`, { | ||
body: { | ||
data: { | ||
...createOpts, | ||
}, | ||
}, | ||
}) | ||
|
||
return data | ||
} | ||
|
||
export const loadOrgGroupById = async ( | ||
orgId: string, | ||
groupId: string, | ||
query?: OrgGroupRequestQueryParams, | ||
) => { | ||
const { data } = await api.get<OrgGroup>(`/v1/orgs/${orgId}/groups/${groupId}`, { | ||
query, | ||
}) | ||
|
||
return data | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './org-groups' | ||
export * from './orgs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { OrgGroupIncludes } from '@/api' | ||
|
||
export type OrgGroupMetadata = { | ||
name: string | ||
description: string | ||
// TODO: other metadata e. g. styles | ||
} | ||
|
||
export type OrgGroupRule = { | ||
scheme: string | ||
required: boolean | ||
} | ||
|
||
export type GroupUser = { | ||
id: string | ||
type: 'group-users' | ||
group_id: string | ||
user_id: string | ||
role: { | ||
name: string | ||
value: number | ||
} | ||
created_at: string | ||
updated_at: string | ||
} | ||
|
||
export type OrgGroup = { | ||
id: string | ||
type: 'groups' | ||
org_id: string | ||
metadata: OrgGroupMetadata | ||
rules: OrgGroupRule[] | ||
created_at: string | ||
group_users: GroupUser[] | ||
} | ||
|
||
export type OrgGroupCreate = { | ||
type: 'groups-create' | ||
attributes: { | ||
metadata: OrgGroupMetadata | ||
rules: OrgGroupRule[] | ||
} | ||
} | ||
|
||
export type OrgGroupRequestQueryParams = { | ||
include?: OrgGroupIncludes | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.