mirror of https://github.com/boxyhq/jackson.git
98 lines
2.0 KiB
TypeScript
98 lines
2.0 KiB
TypeScript
enum DirectorySyncProviders {
|
|
'azure-scim-v2' = 'Azure SCIM v2.0',
|
|
'onelogin-scim-v2' = 'OneLogin SCIM v2.0',
|
|
'okta-scim-v2' = 'Okta SCIM v2.0',
|
|
'jumpcloud-scim-v2' = 'JumpCloud v2.0',
|
|
'generic-scim-v2' = 'Generic SCIM v2.0',
|
|
'google' = 'Google',
|
|
}
|
|
|
|
type DirectorySyncEventType =
|
|
| 'user.created'
|
|
| 'user.updated'
|
|
| 'user.deleted'
|
|
| 'group.created'
|
|
| 'group.updated'
|
|
| 'group.deleted'
|
|
| 'group.user_added'
|
|
| 'group.user_removed';
|
|
|
|
type DirectoryType = keyof typeof DirectorySyncProviders;
|
|
|
|
type UserWithGroup = User & { group: Group };
|
|
|
|
type DirectorySyncEventData = User | Group | UserWithGroup;
|
|
|
|
interface DirectorySyncEvent {
|
|
directory_id: Directory['id'];
|
|
event: DirectorySyncEventType;
|
|
data: DirectorySyncEventData;
|
|
tenant: string;
|
|
product: string;
|
|
}
|
|
|
|
export type Directory = {
|
|
id: string;
|
|
name: string;
|
|
tenant: string;
|
|
product: string;
|
|
type: DirectoryType;
|
|
log_webhook_events: boolean;
|
|
scim: {
|
|
path: string;
|
|
endpoint?: string;
|
|
secret: string;
|
|
};
|
|
webhook: {
|
|
endpoint: string;
|
|
secret: string;
|
|
};
|
|
deactivated?: boolean;
|
|
google_domain?: string;
|
|
google_access_token?: string;
|
|
google_refresh_token?: string;
|
|
};
|
|
|
|
export type User = {
|
|
id: string;
|
|
email: string;
|
|
first_name: string;
|
|
last_name: string;
|
|
active: boolean;
|
|
raw?: any;
|
|
};
|
|
|
|
export type Group = {
|
|
id: string;
|
|
name: string;
|
|
raw?: any;
|
|
};
|
|
|
|
export interface WebhookEventLog {
|
|
id: string;
|
|
webhook_endpoint: string;
|
|
created_at: Date;
|
|
status_code?: number;
|
|
delivered?: boolean;
|
|
payload: DirectorySyncEvent | DirectorySyncEvent[];
|
|
}
|
|
|
|
export type AttributeMapping = {
|
|
key: string;
|
|
value: string;
|
|
};
|
|
|
|
export type SAMLFederationApp = {
|
|
id: string;
|
|
name: string;
|
|
tenant: string;
|
|
product: string;
|
|
acsUrl: string;
|
|
entityId: string;
|
|
logoUrl: string | null;
|
|
faviconUrl: string | null;
|
|
primaryColor: string | null;
|
|
tenants?: string[]; // To support multiple tenants for a single app
|
|
mappings: AttributeMapping[] | null;
|
|
};
|