@topgroup/diginext
Version:
A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.
310 lines • 9.24 kB
TypeScript
/// <reference types="mongoose/types/aggregate" />
/// <reference types="mongoose/types/callback" />
/// <reference types="mongoose/types/collection" />
/// <reference types="mongoose/types/connection" />
/// <reference types="mongoose/types/cursor" />
/// <reference types="mongoose/types/document" />
/// <reference types="mongoose/types/error" />
/// <reference types="mongoose/types/expressions" />
/// <reference types="mongoose/types/helpers" />
/// <reference types="mongoose/types/middlewares" />
/// <reference types="mongoose/types/indexes" />
/// <reference types="mongoose/types/models" />
/// <reference types="mongoose/types/mongooseoptions" />
/// <reference types="mongoose/types/pipelinestage" />
/// <reference types="mongoose/types/populate" />
/// <reference types="mongoose/types/query" />
/// <reference types="mongoose/types/schemaoptions" />
/// <reference types="mongoose/types/schematypes" />
/// <reference types="mongoose/types/session" />
/// <reference types="mongoose/types/types" />
/// <reference types="mongoose/types/utility" />
/// <reference types="mongoose/types/validation" />
/// <reference types="mongoose/types/virtuals" />
/// <reference types="mongoose/types/inferschematype" />
import type { Types } from "mongoose";
import { Schema } from "mongoose";
import type { HiddenBodyKeys } from "../interfaces";
import type { WebhookChannel } from "../interfaces/SystemTypes";
import type { ICloudDatabase, ICloudDatabaseBackup, IContainerRegistry, IFramework, IGitProvider } from ".";
import type { IApp } from "./App";
import type { IBase } from "./Base";
import type { ICluster } from "./Cluster";
import type { IProject } from "./Project";
import type { IRole } from "./Role";
import type { ITeam } from "./Team";
import type { IWorkspace } from "./Workspace";
export interface ProviderInfo {
name: string;
user_id?: string;
access_token?: string;
}
export interface AccessTokenInfo {
access_token: string;
refresh_token?: string;
expiredTimestamp: number;
expiredDate: Date;
expiredDateGTM7: string;
}
/**
* ### User access permission settings:
* - `undefined`: all
* - `[]`: none
* - `[ ...project_id... ]`: some
*/
export type UserAccessPermissions = {
projects?: (IProject | Types.ObjectId | string)[];
apps?: (IApp | Types.ObjectId | string)[];
clusters?: (ICluster | Types.ObjectId | string)[];
databases?: (ICloudDatabase | Types.ObjectId | string)[];
database_backups?: (ICloudDatabaseBackup | Types.ObjectId | string)[];
gits?: (IGitProvider | Types.ObjectId | string)[];
frameworks?: (IFramework | Types.ObjectId | string)[];
container_registries?: (IContainerRegistry | Types.ObjectId | string)[];
};
export type UserDto = Omit<IUser, keyof HiddenBodyKeys>;
export interface IUser extends IBase {
name: string;
/**
* Unique username of a user
* This equavilent with "slug"
*/
username?: string;
type?: string;
/**
* User email address
*/
email: string;
/**
* Is this user's email or phone verified?
*/
verified?: boolean;
/**
* User profile picture URL
*/
image?: string;
/**
* List of Cloud Providers which this user can access to
*/
providers?: ProviderInfo[];
/**
* User password (hashed)
*/
password?: string;
/**
* User ID in DXUP.DEV
*/
dxUserId?: string;
/**
* User token
*/
token?: AccessTokenInfo;
roles?: (IRole | Types.ObjectId | string)[];
activeRole?: IRole | Types.ObjectId | string;
teams?: (ITeam | Types.ObjectId | string)[];
workspaces?: (IWorkspace | Types.ObjectId | string)[];
activeWorkspace?: IWorkspace | Types.ObjectId | string;
/**
* User access permission settings
*/
allowAccess?: UserAccessPermissions;
/**
* User settings
*/
settings?: {
notification: {
workspace?: WebhookChannel[];
project?: WebhookChannel[];
app?: WebhookChannel[];
build?: WebhookChannel[];
deploy?: WebhookChannel[];
};
};
}
export declare const userSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
collection: string;
timestamps: true;
}, {
createdAt: NativeDate;
updatedAt: NativeDate;
} & {
type: string;
workspaces: Types.ObjectId[];
public: boolean;
active: boolean;
createdAt: Date;
updatedAt: Date;
roles: Types.ObjectId[];
verified: boolean;
providers: Types.DocumentArray<{
name?: string;
access_token?: string;
user_id?: string;
}>;
teams: Types.ObjectId[];
username?: string;
workspace?: Types.ObjectId;
workspaceId?: Types.ObjectId;
email?: string;
name?: string;
slug?: string;
token?: {
access_token: string;
expiredTimestamp: number;
expiredDate: Date;
expiredDateGTM7: string;
refresh_token?: string;
};
project?: Types.ObjectId;
projectId?: Types.ObjectId;
image?: string;
owner?: Types.ObjectId;
settings?: any;
metadata?: any;
ownerSlug?: string;
ownerId?: Types.ObjectId;
workspaceSlug?: string;
updatedBy?: Types.ObjectId;
updatedById?: Types.ObjectId;
deletedBy?: Types.ObjectId;
deletedById?: Types.ObjectId;
deletedAt?: Date;
migratedAt?: Date;
password?: string;
dxUserId?: string;
activeRole?: Types.ObjectId;
activeWorkspace?: Types.ObjectId;
allowAccess?: {
projects: Types.ObjectId[];
apps: Types.ObjectId[];
container_registries: Types.ObjectId[];
clusters: Types.ObjectId[];
databases: Types.ObjectId[];
database_backups: Types.ObjectId[];
gits: Types.ObjectId[];
frameworks: Types.ObjectId[];
};
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
createdAt: NativeDate;
updatedAt: NativeDate;
} & {
type: string;
workspaces: Types.ObjectId[];
public: boolean;
active: boolean;
createdAt: Date;
updatedAt: Date;
roles: Types.ObjectId[];
verified: boolean;
providers: Types.DocumentArray<{
name?: string;
access_token?: string;
user_id?: string;
}>;
teams: Types.ObjectId[];
username?: string;
workspace?: Types.ObjectId;
workspaceId?: Types.ObjectId;
email?: string;
name?: string;
slug?: string;
token?: {
access_token: string;
expiredTimestamp: number;
expiredDate: Date;
expiredDateGTM7: string;
refresh_token?: string;
};
project?: Types.ObjectId;
projectId?: Types.ObjectId;
image?: string;
owner?: Types.ObjectId;
settings?: any;
metadata?: any;
ownerSlug?: string;
ownerId?: Types.ObjectId;
workspaceSlug?: string;
updatedBy?: Types.ObjectId;
updatedById?: Types.ObjectId;
deletedBy?: Types.ObjectId;
deletedById?: Types.ObjectId;
deletedAt?: Date;
migratedAt?: Date;
password?: string;
dxUserId?: string;
activeRole?: Types.ObjectId;
activeWorkspace?: Types.ObjectId;
allowAccess?: {
projects: Types.ObjectId[];
apps: Types.ObjectId[];
container_registries: Types.ObjectId[];
clusters: Types.ObjectId[];
databases: Types.ObjectId[];
database_backups: Types.ObjectId[];
gits: Types.ObjectId[];
frameworks: Types.ObjectId[];
};
}>> & import("mongoose").FlatRecord<{
createdAt: NativeDate;
updatedAt: NativeDate;
} & {
type: string;
workspaces: Types.ObjectId[];
public: boolean;
active: boolean;
createdAt: Date;
updatedAt: Date;
roles: Types.ObjectId[];
verified: boolean;
providers: Types.DocumentArray<{
name?: string;
access_token?: string;
user_id?: string;
}>;
teams: Types.ObjectId[];
username?: string;
workspace?: Types.ObjectId;
workspaceId?: Types.ObjectId;
email?: string;
name?: string;
slug?: string;
token?: {
access_token: string;
expiredTimestamp: number;
expiredDate: Date;
expiredDateGTM7: string;
refresh_token?: string;
};
project?: Types.ObjectId;
projectId?: Types.ObjectId;
image?: string;
owner?: Types.ObjectId;
settings?: any;
metadata?: any;
ownerSlug?: string;
ownerId?: Types.ObjectId;
workspaceSlug?: string;
updatedBy?: Types.ObjectId;
updatedById?: Types.ObjectId;
deletedBy?: Types.ObjectId;
deletedById?: Types.ObjectId;
deletedAt?: Date;
migratedAt?: Date;
password?: string;
dxUserId?: string;
activeRole?: Types.ObjectId;
activeWorkspace?: Types.ObjectId;
allowAccess?: {
projects: Types.ObjectId[];
apps: Types.ObjectId[];
container_registries: Types.ObjectId[];
clusters: Types.ObjectId[];
databases: Types.ObjectId[];
database_backups: Types.ObjectId[];
gits: Types.ObjectId[];
frameworks: Types.ObjectId[];
};
}> & {
_id: Types.ObjectId;
}>;
//# sourceMappingURL=User.d.ts.map