@yhgale/shared 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -207,7 +207,8 @@ function parseSignInAttempt(json) {
207
207
  supportedSecondFactors: json.supportedSecondFactors ?? [],
208
208
  firstFactorVerification: json.firstFactorVerification ?? null,
209
209
  secondFactorVerification: json.secondFactorVerification ?? null,
210
- createdSessionId: json.createdSessionId ?? null
210
+ createdSessionId: json.createdSessionId ?? null,
211
+ secondFactorEnrollmentRecommended: json.secondFactorEnrollmentRecommended ?? false
211
212
  };
212
213
  }
213
214
  function parseSignInResponse(json) {
@@ -394,6 +394,8 @@ interface SignInAttemptJSON {
394
394
  secondFactorVerification?: VerificationJSON | null;
395
395
  /** 命中并完成 → 落地 session id */
396
396
  createdSessionId?: GaleId | null;
397
+ /** 实例建议用户补充 MFA;仅提示,不阻断已经完成的登录。 */
398
+ secondFactorEnrollmentRecommended?: boolean;
397
399
  /** 仅 complete 响应里出现;前端用于在当前域名设置 cookie(dev 跨端口场景) */
398
400
  clientSafeRefreshToken?: string | null;
399
401
  }
@@ -412,6 +414,7 @@ interface SignInAttemptResource {
412
414
  firstFactorVerification: VerificationJSON | null;
413
415
  secondFactorVerification: VerificationJSON | null;
414
416
  createdSessionId: GaleId | null;
417
+ secondFactorEnrollmentRecommended?: boolean;
415
418
  }
416
419
  /** fapi `/v1/client/sign_ins` 响应外层 envelope */
417
420
  interface SignInResponseJSON {
package/package.json CHANGED
@@ -1,34 +1,62 @@
1
1
  {
2
2
  "name": "@yhgale/shared",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Cross-platform shared layer for gale: types, errors, constants, React hooks/context (shared across framework adapters).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
10
+ "source": "./src/index.ts",
11
+ "default": "./dist/index.js"
12
12
  },
13
13
  "./types": {
14
- "types": "./dist/types/index.d.ts",
15
- "import": "./dist/types/index.js"
14
+ "source": "./src/types/index.ts",
15
+ "default": "./dist/types/index.js"
16
16
  },
17
17
  "./errors": {
18
- "types": "./dist/errors/index.d.ts",
19
- "import": "./dist/errors/index.js"
18
+ "source": "./src/errors/index.ts",
19
+ "default": "./dist/errors/index.js"
20
20
  },
21
21
  "./react": {
22
- "types": "./dist/react/index.d.ts",
23
- "import": "./dist/react/index.js"
22
+ "source": "./src/react/index.ts",
23
+ "default": "./dist/react/index.js"
24
24
  }
25
25
  },
26
26
  "publishConfig": {
27
+ "main": "./dist/index.js",
28
+ "types": "./dist/index.d.ts",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ },
34
+ "./types": {
35
+ "types": "./dist/types/index.d.ts",
36
+ "import": "./dist/types/index.js"
37
+ },
38
+ "./errors": {
39
+ "types": "./dist/errors/index.d.ts",
40
+ "import": "./dist/errors/index.js"
41
+ },
42
+ "./react": {
43
+ "types": "./dist/react/index.d.ts",
44
+ "import": "./dist/react/index.js"
45
+ }
46
+ },
27
47
  "access": "public"
28
48
  },
29
49
  "files": [
30
50
  "dist"
31
51
  ],
52
+ "scripts": {
53
+ "build": "tsup",
54
+ "dev": "tsc -p tsconfig.build.json --watch",
55
+ "lint": "eslint src",
56
+ "typecheck": "tsc --noEmit",
57
+ "clean": "rm -rf dist .turbo *.tsbuildinfo",
58
+ "test": "vitest run --passWithNoTests"
59
+ },
32
60
  "dependencies": {},
33
61
  "devDependencies": {
34
62
  "@simplewebauthn/browser": "^13.3.0",
@@ -37,13 +65,5 @@
37
65
  "vitest": "^2.1.8",
38
66
  "@types/node": "^22.10.2",
39
67
  "tsup": "8.5.1"
40
- },
41
- "scripts": {
42
- "build": "tsup",
43
- "dev": "tsc -p tsconfig.build.json --watch",
44
- "lint": "eslint src",
45
- "typecheck": "tsc --noEmit",
46
- "clean": "rm -rf dist .turbo *.tsbuildinfo",
47
- "test": "vitest run --passWithNoTests"
48
68
  }
49
- }
69
+ }