feat: enrich task record details
This commit is contained in:
@@ -16,6 +16,7 @@ export interface AuthUser {
|
||||
apiKeyId?: string;
|
||||
apiKeySecret?: string;
|
||||
apiKeyName?: string;
|
||||
apiKeyPrefix?: string;
|
||||
}
|
||||
|
||||
export interface AuthResponse {
|
||||
@@ -56,6 +57,7 @@ export interface IntegrationPlatform {
|
||||
provider: string;
|
||||
platformKey: string;
|
||||
name: string;
|
||||
internalName?: string;
|
||||
baseUrl?: string;
|
||||
authType: string;
|
||||
status: 'enabled' | 'disabled' | string;
|
||||
@@ -64,6 +66,9 @@ export interface IntegrationPlatform {
|
||||
defaultDiscountFactor: number;
|
||||
pricingRuleSetId?: string;
|
||||
config?: Record<string, unknown>;
|
||||
credentialsPreview?: Record<string, unknown>;
|
||||
retryPolicy?: RateLimitPolicy | Record<string, unknown>;
|
||||
rateLimitPolicy?: RateLimitPolicy;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -75,6 +80,7 @@ export type RateLimitMetric =
|
||||
| 'tpm_input'
|
||||
| 'tpm_output'
|
||||
| 'rpm'
|
||||
| 'rps'
|
||||
| 'concurrent'
|
||||
| 'queue_size';
|
||||
|
||||
@@ -85,6 +91,8 @@ export interface CatalogProvider {
|
||||
displayName: string;
|
||||
providerType: string;
|
||||
iconPath?: string;
|
||||
defaultBaseUrl?: string;
|
||||
defaultAuthType?: string;
|
||||
source?: 'gateway' | 'server-main' | 'sync' | 'server-main.integration-platform' | string;
|
||||
capabilitySchema?: Record<string, unknown>;
|
||||
defaultRateLimitPolicy?: RateLimitPolicy;
|
||||
@@ -100,6 +108,8 @@ export interface CatalogProviderUpsertRequest {
|
||||
displayName: string;
|
||||
providerType?: string;
|
||||
iconPath?: string;
|
||||
defaultBaseUrl?: string;
|
||||
defaultAuthType?: string;
|
||||
source?: 'gateway' | 'server-main' | 'sync' | 'server-main.integration-platform' | string;
|
||||
capabilitySchema?: Record<string, unknown>;
|
||||
defaultRateLimitPolicy?: RateLimitPolicy;
|
||||
@@ -112,12 +122,19 @@ export interface BaseModelCatalogItem {
|
||||
providerKey: string;
|
||||
canonicalModelKey: string;
|
||||
providerModelName: string;
|
||||
modelType: 'chat' | 'image' | 'video' | 'audio' | 'embedding' | 'music' | 'digital_human' | 'model_3d' | string;
|
||||
displayName: string;
|
||||
modelType: string[];
|
||||
modelAlias: string;
|
||||
displayName?: string;
|
||||
capabilities?: Record<string, unknown>;
|
||||
baseBillingConfig?: BillingConfig;
|
||||
defaultRateLimitPolicy?: RateLimitPolicy;
|
||||
pricingRuleSetId?: string;
|
||||
runtimePolicySetId?: string;
|
||||
runtimePolicyOverride?: RuntimePolicyOverride;
|
||||
metadata?: Record<string, unknown>;
|
||||
catalogType?: 'system' | 'custom' | string;
|
||||
defaultSnapshot?: Record<string, unknown>;
|
||||
customizedAt?: string;
|
||||
pricingVersion: number;
|
||||
status: 'active' | 'deprecated' | 'hidden' | string;
|
||||
createdAt: string;
|
||||
@@ -128,12 +145,18 @@ export interface BaseModelUpsertRequest {
|
||||
providerKey: string;
|
||||
canonicalModelKey?: string;
|
||||
providerModelName: string;
|
||||
modelType: string;
|
||||
modelType: string[];
|
||||
modelAlias?: string;
|
||||
displayName?: string;
|
||||
capabilities?: Record<string, unknown>;
|
||||
baseBillingConfig?: BillingConfig;
|
||||
defaultRateLimitPolicy?: RateLimitPolicy;
|
||||
pricingRuleSetId?: string;
|
||||
runtimePolicySetId?: string;
|
||||
runtimePolicyOverride?: RuntimePolicyOverride;
|
||||
metadata?: Record<string, unknown>;
|
||||
catalogType?: 'system' | 'custom' | string;
|
||||
defaultSnapshot?: Record<string, unknown>;
|
||||
pricingVersion?: number;
|
||||
status?: 'active' | 'deprecated' | 'hidden' | string;
|
||||
}
|
||||
@@ -213,6 +236,40 @@ export interface PricingRuleSetUpsertRequest {
|
||||
rules: PricingRuleInput[];
|
||||
}
|
||||
|
||||
export interface RuntimePolicySet {
|
||||
id: string;
|
||||
policyKey: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
rateLimitPolicy?: RateLimitPolicy | Record<string, unknown>;
|
||||
retryPolicy?: Record<string, unknown>;
|
||||
autoDisablePolicy?: Record<string, unknown>;
|
||||
degradePolicy?: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
status: 'active' | 'disabled' | string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface RuntimePolicySetUpsertRequest {
|
||||
policyKey: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
rateLimitPolicy?: RateLimitPolicy | Record<string, unknown>;
|
||||
retryPolicy?: Record<string, unknown>;
|
||||
autoDisablePolicy?: Record<string, unknown>;
|
||||
degradePolicy?: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
status?: 'active' | 'disabled' | string;
|
||||
}
|
||||
|
||||
export interface RuntimePolicyOverride {
|
||||
rateLimitPolicy?: RateLimitPolicy | Record<string, unknown>;
|
||||
retryPolicy?: Record<string, unknown>;
|
||||
autoDisablePolicy?: Record<string, unknown>;
|
||||
degradePolicy?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface GatewayUser {
|
||||
id: string;
|
||||
userKey: string;
|
||||
@@ -238,6 +295,26 @@ export interface GatewayUser {
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface GatewayUserUpsertRequest {
|
||||
userKey?: string;
|
||||
source?: 'gateway' | 'server-main' | 'sync' | string;
|
||||
externalUserId?: string;
|
||||
username: string;
|
||||
displayName?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
avatarUrl?: string;
|
||||
password?: string;
|
||||
gatewayTenantId?: string;
|
||||
tenantId?: string;
|
||||
tenantKey?: string;
|
||||
defaultUserGroupId?: string;
|
||||
roles?: string[];
|
||||
authProfile?: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
status?: 'active' | 'disabled' | 'locked' | 'deleted' | string;
|
||||
}
|
||||
|
||||
export interface GatewayTenant {
|
||||
id: string;
|
||||
tenantKey: string;
|
||||
@@ -258,6 +335,21 @@ export interface GatewayTenant {
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface GatewayTenantUpsertRequest {
|
||||
tenantKey: string;
|
||||
source?: 'gateway' | 'server-main' | 'sync' | string;
|
||||
externalTenantId?: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
defaultUserGroupId?: string;
|
||||
planKey?: string;
|
||||
billingProfile?: Record<string, unknown>;
|
||||
rateLimitPolicy?: RateLimitPolicy;
|
||||
authPolicy?: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
status?: 'active' | 'disabled' | 'locked' | 'deleted' | string;
|
||||
}
|
||||
|
||||
export interface UserGroup {
|
||||
id: string;
|
||||
groupKey: string;
|
||||
@@ -269,11 +361,26 @@ export interface UserGroup {
|
||||
billingDiscountPolicy?: Record<string, unknown>;
|
||||
rateLimitPolicy?: RateLimitPolicy;
|
||||
quotaPolicy?: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
status: 'active' | 'disabled' | string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface UserGroupUpsertRequest {
|
||||
groupKey: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
source?: 'gateway' | 'server-main' | 'sync' | string;
|
||||
priority?: number;
|
||||
rechargeDiscountPolicy?: Record<string, unknown>;
|
||||
billingDiscountPolicy?: Record<string, unknown>;
|
||||
rateLimitPolicy?: RateLimitPolicy;
|
||||
quotaPolicy?: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
status?: 'active' | 'disabled' | string;
|
||||
}
|
||||
|
||||
export interface UserGroupMembership {
|
||||
id: string;
|
||||
groupId: string;
|
||||
@@ -288,6 +395,57 @@ export interface UserGroupMembership {
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export type GatewayAccessSubjectType = 'user_group' | 'tenant' | 'user' | 'api_key';
|
||||
export type GatewayAccessResourceType = 'platform' | 'platform_model' | 'base_model';
|
||||
export type GatewayAccessEffect = 'allow' | 'deny';
|
||||
|
||||
export interface GatewayAccessRule {
|
||||
id: string;
|
||||
subjectType: GatewayAccessSubjectType | string;
|
||||
subjectId: string;
|
||||
resourceType: GatewayAccessResourceType | string;
|
||||
resourceId: string;
|
||||
effect: GatewayAccessEffect | string;
|
||||
priority: number;
|
||||
minPermissionLevel: number;
|
||||
conditions?: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
status: 'active' | 'disabled' | string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface GatewayAccessRuleUpsertRequest {
|
||||
subjectType: GatewayAccessSubjectType | string;
|
||||
subjectId: string;
|
||||
resourceType: GatewayAccessResourceType | string;
|
||||
resourceId: string;
|
||||
effect: GatewayAccessEffect | string;
|
||||
priority?: number;
|
||||
minPermissionLevel?: number;
|
||||
conditions?: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
status?: 'active' | 'disabled' | string;
|
||||
}
|
||||
|
||||
export interface GatewayAccessRuleResourceRequest {
|
||||
resourceType: GatewayAccessResourceType | string;
|
||||
resourceId: string;
|
||||
priority?: number;
|
||||
minPermissionLevel?: number;
|
||||
conditions?: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
status?: 'active' | 'disabled' | string;
|
||||
}
|
||||
|
||||
export interface GatewayAccessRuleBatchRequest {
|
||||
subjectType: GatewayAccessSubjectType | string;
|
||||
subjectId: string;
|
||||
effect: GatewayAccessEffect | string;
|
||||
upsertResources?: GatewayAccessRuleResourceRequest[];
|
||||
deleteResources?: GatewayAccessRuleResourceRequest[];
|
||||
}
|
||||
|
||||
export interface GatewayApiKey {
|
||||
id: string;
|
||||
gatewayTenantId?: string;
|
||||
@@ -313,6 +471,10 @@ export interface CreatedGatewayApiKey {
|
||||
secret: string;
|
||||
}
|
||||
|
||||
export interface PlayableGatewayApiKey extends GatewayApiKey {
|
||||
secret: string;
|
||||
}
|
||||
|
||||
export interface GatewayWalletAccount {
|
||||
id: string;
|
||||
gatewayTenantId?: string;
|
||||
@@ -406,6 +568,11 @@ export interface PlatformModel {
|
||||
pricingRuleSetId?: string;
|
||||
billingConfigOverride?: BillingConfig;
|
||||
billingConfig?: BillingConfig;
|
||||
permissionConfig?: Record<string, unknown>;
|
||||
retryPolicy?: Record<string, unknown>;
|
||||
rateLimitPolicy?: RateLimitPolicy;
|
||||
runtimePolicySetId?: string;
|
||||
runtimePolicyOverride?: RuntimePolicyOverride;
|
||||
enabled: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
@@ -433,14 +600,29 @@ export interface GatewayTask {
|
||||
gatewayTenantId?: string;
|
||||
tenantId?: string;
|
||||
tenantKey?: string;
|
||||
apiKeyId?: string;
|
||||
apiKeyName?: string;
|
||||
apiKeyPrefix?: string;
|
||||
userGroupId?: string;
|
||||
userGroupKey?: string;
|
||||
userGroupPolicySnapshot?: Record<string, unknown>;
|
||||
model: string;
|
||||
modelType?: string;
|
||||
requestedModel?: string;
|
||||
resolvedModel?: string;
|
||||
requestId?: string;
|
||||
request?: Record<string, unknown>;
|
||||
status: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' | string;
|
||||
result?: Record<string, unknown>;
|
||||
billings?: unknown[];
|
||||
usage?: Record<string, unknown>;
|
||||
metrics?: Record<string, unknown>;
|
||||
billingSummary?: Record<string, unknown>;
|
||||
finalChargeAmount?: number;
|
||||
responseStartedAt?: string;
|
||||
responseFinishedAt?: string;
|
||||
responseDurationMs?: number;
|
||||
finishedAt?: string;
|
||||
error?: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
|
||||
Reference in New Issue
Block a user