197 lines
4.6 KiB
TypeScript
197 lines
4.6 KiB
TypeScript
import * as plugins from '../plugins.ts';
|
|
import * as data from '../data/index.ts';
|
|
|
|
// ============================================================================
|
|
// Organization Requests
|
|
// ============================================================================
|
|
|
|
export interface IReq_GetOrganizations extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_GetOrganizations
|
|
> {
|
|
method: 'getOrganizations';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
};
|
|
response: {
|
|
organizations: data.IOrganization[];
|
|
};
|
|
}
|
|
|
|
export interface IReq_GetOrganization extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_GetOrganization
|
|
> {
|
|
method: 'getOrganization';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
organizationId: string;
|
|
};
|
|
response: {
|
|
organization: data.IOrganizationDetail;
|
|
};
|
|
}
|
|
|
|
export interface IReq_CreateOrganization extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_CreateOrganization
|
|
> {
|
|
method: 'createOrganization';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
name: string;
|
|
displayName?: string;
|
|
description?: string;
|
|
isPublic?: boolean;
|
|
};
|
|
response: {
|
|
organization: data.IOrganization;
|
|
};
|
|
}
|
|
|
|
export interface IReq_UpdateOrganization extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_UpdateOrganization
|
|
> {
|
|
method: 'updateOrganization';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
organizationId: string;
|
|
name?: string;
|
|
displayName?: string;
|
|
description?: string;
|
|
avatarUrl?: string;
|
|
website?: string;
|
|
isPublic?: boolean;
|
|
settings?: Partial<data.IOrganizationSettings>;
|
|
};
|
|
response: {
|
|
organization: data.IOrganization;
|
|
};
|
|
}
|
|
|
|
export interface IReq_DeleteOrganization extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_DeleteOrganization
|
|
> {
|
|
method: 'deleteOrganization';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
organizationId: string;
|
|
};
|
|
response: {
|
|
message: string;
|
|
};
|
|
}
|
|
|
|
export interface IReq_GetOrganizationMembers extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_GetOrganizationMembers
|
|
> {
|
|
method: 'getOrganizationMembers';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
organizationId: string;
|
|
};
|
|
response: {
|
|
members: data.IOrganizationMember[];
|
|
};
|
|
}
|
|
|
|
export interface IReq_AddOrganizationMember extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_AddOrganizationMember
|
|
> {
|
|
method: 'addOrganizationMember';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
organizationId: string;
|
|
userId: string;
|
|
role: data.TOrganizationRole;
|
|
};
|
|
response: {
|
|
member: {
|
|
userId: string;
|
|
role: data.TOrganizationRole;
|
|
addedAt: string;
|
|
};
|
|
};
|
|
}
|
|
|
|
export interface IReq_UpdateOrganizationMember extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_UpdateOrganizationMember
|
|
> {
|
|
method: 'updateOrganizationMember';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
organizationId: string;
|
|
userId: string;
|
|
role: data.TOrganizationRole;
|
|
};
|
|
response: {
|
|
member: {
|
|
userId: string;
|
|
role: data.TOrganizationRole;
|
|
};
|
|
};
|
|
}
|
|
|
|
export interface IReq_RemoveOrganizationMember extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_RemoveOrganizationMember
|
|
> {
|
|
method: 'removeOrganizationMember';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
organizationId: string;
|
|
userId: string;
|
|
};
|
|
response: {
|
|
message: string;
|
|
};
|
|
}
|
|
|
|
// ============================================================================
|
|
// Organization Redirect Requests
|
|
// ============================================================================
|
|
|
|
export interface IReq_GetOrgRedirects extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_GetOrgRedirects
|
|
> {
|
|
method: 'getOrgRedirects';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
organizationId: string;
|
|
};
|
|
response: {
|
|
redirects: data.IOrgRedirect[];
|
|
};
|
|
}
|
|
|
|
export interface IReq_DeleteOrgRedirect extends
|
|
plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_DeleteOrgRedirect
|
|
> {
|
|
method: 'deleteOrgRedirect';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
redirectId: string;
|
|
};
|
|
response: {
|
|
message: string;
|
|
};
|
|
}
|