mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
14
packages/global/support/wallet/sub/api.d.ts
vendored
14
packages/global/support/wallet/sub/api.d.ts
vendored
@@ -1,14 +1,26 @@
|
||||
import { StandardSubLevelEnum, SubModeEnum } from './constants';
|
||||
import { TeamSubSchema } from './type.d';
|
||||
|
||||
export type SubDatasetSizeParams = {
|
||||
size: number;
|
||||
};
|
||||
export type StandardSubPlanParams = {
|
||||
level: `${StandardSubLevelEnum}`;
|
||||
mode: `${SubModeEnum}`;
|
||||
};
|
||||
|
||||
export type SubDatasetSizePreviewCheckResponse = {
|
||||
payForNewSub: boolean; // Does this change require payment
|
||||
newSubSize: number; // new sub dataset size
|
||||
alreadySubSize: number; // old sub dataset size
|
||||
payPrice: number; // this change require payment
|
||||
newPlanPrice: number; // the new sub price
|
||||
newSubStartTime: Date;
|
||||
newSubExpiredTime: Date;
|
||||
balanceEnough: boolean; // team balance is enough
|
||||
};
|
||||
export type StandardSubPlanUpdateResponse = {
|
||||
balanceEnough: boolean; // team balance is enough
|
||||
teamBalance: number;
|
||||
payPrice?: number;
|
||||
planPrice: number;
|
||||
planPointPrice: number;
|
||||
|
@@ -1,3 +1,5 @@
|
||||
export const POINTS_SCALE = 10000;
|
||||
|
||||
export enum SubTypeEnum {
|
||||
standard = 'standard',
|
||||
extraDatasetSize = 'extraDatasetSize',
|
||||
@@ -17,16 +19,20 @@ export const subTypeMap = {
|
||||
|
||||
export enum SubStatusEnum {
|
||||
active = 'active',
|
||||
expired = 'expired'
|
||||
canceled = 'canceled'
|
||||
}
|
||||
export const subStatusMap = {
|
||||
[SubStatusEnum.active]: {
|
||||
label: 'support.wallet.subscription.status.active'
|
||||
},
|
||||
[SubStatusEnum.expired]: {
|
||||
[SubStatusEnum.canceled]: {
|
||||
label: 'support.wallet.subscription.status.canceled'
|
||||
}
|
||||
};
|
||||
export const subSelectMap = {
|
||||
true: SubStatusEnum.active,
|
||||
false: SubStatusEnum.canceled
|
||||
};
|
||||
|
||||
export enum SubModeEnum {
|
||||
month = 'month',
|
||||
@@ -34,11 +40,11 @@ export enum SubModeEnum {
|
||||
}
|
||||
export const subModeMap = {
|
||||
[SubModeEnum.month]: {
|
||||
label: 'support.wallet.subscription.mode.Month',
|
||||
label: 'support.wallet.subscription.mode.month',
|
||||
durationMonth: 1
|
||||
},
|
||||
[SubModeEnum.year]: {
|
||||
label: 'support.wallet.subscription.mode.Year',
|
||||
label: 'support.wallet.subscription.mode.year',
|
||||
durationMonth: 12
|
||||
}
|
||||
};
|
||||
@@ -57,7 +63,7 @@ export const standardSubLevelMap = {
|
||||
},
|
||||
[StandardSubLevelEnum.experience]: {
|
||||
label: 'support.wallet.subscription.standardSubLevel.experience',
|
||||
desc: ''
|
||||
desc: 'support.wallet.subscription.standardSubLevel.experience desc'
|
||||
},
|
||||
[StandardSubLevelEnum.team]: {
|
||||
label: 'support.wallet.subscription.standardSubLevel.team',
|
||||
|
43
packages/global/support/wallet/sub/type.d.ts
vendored
43
packages/global/support/wallet/sub/type.d.ts
vendored
@@ -2,19 +2,19 @@ import { StandardSubLevelEnum, SubModeEnum, SubStatusEnum, SubTypeEnum } from '.
|
||||
|
||||
// Content of plan
|
||||
export type TeamStandardSubPlanItemType = {
|
||||
price: number; // read price / month
|
||||
pointPrice: number; // read price/ one thousand
|
||||
totalPoints: number; // n
|
||||
price: number; // read price
|
||||
pointPrice: number; // read price/ one ten thousand
|
||||
maxTeamMember: number;
|
||||
maxAppAmount: number; // max app or plugin amount
|
||||
maxDatasetAmount: number;
|
||||
chatHistoryStoreDuration: number; // n day
|
||||
maxDatasetSize: number;
|
||||
customApiKey: boolean;
|
||||
customCopyright: boolean; // feature
|
||||
websiteSyncInterval: number; // n hours
|
||||
trainingWeight: number; // 1~4
|
||||
permissionCustomApiKey: boolean;
|
||||
permissionCustomCopyright: boolean; // feature
|
||||
permissionWebsiteSync: boolean;
|
||||
permissionReRank: boolean;
|
||||
reRankWeight: number; // 1~4
|
||||
totalPoints: number; // n ten thousand
|
||||
};
|
||||
|
||||
export type StandSubPlanLevelMapType = Record<
|
||||
@@ -27,9 +27,6 @@ export type SubPlanType = {
|
||||
[SubTypeEnum.extraDatasetSize]: {
|
||||
price: number;
|
||||
};
|
||||
[SubTypeEnum.extraPoints]: {
|
||||
price: number;
|
||||
};
|
||||
};
|
||||
|
||||
export type TeamSubSchema = {
|
||||
@@ -37,32 +34,40 @@ export type TeamSubSchema = {
|
||||
teamId: string;
|
||||
type: `${SubTypeEnum}`;
|
||||
status: `${SubStatusEnum}`;
|
||||
currentMode: `${SubModeEnum}`;
|
||||
nextMode: `${SubModeEnum}`;
|
||||
startTime: Date;
|
||||
expiredTime: Date;
|
||||
price: number;
|
||||
|
||||
currentMode: `${SubModeEnum}`;
|
||||
nextMode: `${SubModeEnum}`;
|
||||
currentSubLevel: `${StandardSubLevelEnum}`;
|
||||
nextSubLevel: `${StandardSubLevelEnum}`;
|
||||
|
||||
pointPrice: number;
|
||||
totalPoints: number;
|
||||
surplusPoints: number;
|
||||
|
||||
currentExtraDatasetSize: number;
|
||||
nextExtraDatasetSize: number;
|
||||
|
||||
currentExtraPoints: number;
|
||||
nextExtraPoints: number;
|
||||
|
||||
surplusPoints: number;
|
||||
|
||||
// abandon
|
||||
datasetStoreAmount?: number;
|
||||
renew?: boolean;
|
||||
};
|
||||
|
||||
export type FeTeamPlanStatusType = {
|
||||
export type FeTeamSubType = {
|
||||
[SubTypeEnum.standard]?: TeamSubSchema;
|
||||
standardConstants?: TeamStandardSubPlanItemType;
|
||||
[SubTypeEnum.extraDatasetSize]?: TeamSubSchema;
|
||||
[SubTypeEnum.extraPoints]?: TeamSubSchema;
|
||||
|
||||
standardMaxDatasetSize: number;
|
||||
totalPoints: number;
|
||||
usedPoints: number;
|
||||
standardMaxDatasetSize?: number;
|
||||
standardMaxPoints?: number;
|
||||
|
||||
// standard + extra
|
||||
standardMaxPoints: number;
|
||||
datasetMaxSize: number;
|
||||
usedDatasetSize: number;
|
||||
};
|
||||
|
Reference in New Issue
Block a user