File size: 1,011 Bytes
7fc5208
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

interface KVNamespace {
  put: (key: string, value: string, options?: { expiration?: number, expirationTtl?: number, metadata?: object }) => Promise<void>;
  get: (key: string) => Promise<string | null>;
  delete: (key: string) => Promise<void>;
}

interface Env {
  API_TOKEN: string;    // API 访问令牌
  JWT_SECRET: string;   // JWT 密钥
  USER_NAME: string;    // 用户名
  PASSWORD: string;     // 密码
  ENTRA_CLIENT_ID:string;
  ENTRA_CLIENT_SECRET:string;
  AUTH_REDIRECT_URI:string;
  PROOF_GODGODGAME_TOKEN:string;
  PROOF_IGIVEN_TOKEN:string;
  KV: KVNamespace;
  ASSETS:any;
}

/**
 * 登录凭证接口
 */
interface LoginCredentials {
  /** 用户名 */
  username: string;
  /** 密码 */
  password: string;
}


interface RouteContext {
  request: Request;
  functionPath: string;
  waitUntil: (promise: Promise<any>) => void;
  passThroughOnException: () => void;
  next: (input?: Request | string, init?: RequestInit) => Promise<Response>;
  env: Env;
  params: any;
  data: any;
}