@pmate/account-sdk 0.7.0 → 0.7.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/account-sdk",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src",
@@ -14,11 +14,6 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "scripts": {
18
- "npm:publish": "npm publish --registry https://registry.npmjs.org/",
19
- "test": "vitest run",
20
- "test:watch": "vitest"
21
- },
22
17
  "peerDependencies": {
23
18
  "jotai": "*",
24
19
  "jotai-family": "*",
@@ -36,10 +31,10 @@
36
31
  }
37
32
  },
38
33
  "dependencies": {
39
- "@pmate/auth-widgets": "^0.1.0",
34
+ "@pmate/auth-widgets": "^0.1.1",
40
35
  "@pmate/lang": "^1.0.2",
41
- "@pmate/meta": "^1.1.3",
42
- "@pmate/service-core": "^1.0.0",
36
+ "@pmate/meta": "^1.1.4",
37
+ "@pmate/service-core": "^1.0.1",
43
38
  "@pmate/utils": "^1.0.3",
44
39
  "browser-image-compression": "^2.0.2",
45
40
  "elysia": "^1.4.19",
@@ -48,13 +43,18 @@
48
43
  "react-use": "^17.6.0"
49
44
  },
50
45
  "devDependencies": {
51
- "@types/react": "catalog:",
52
- "@types/react-dom": "catalog:",
46
+ "@types/react": "^19.2.7",
47
+ "@types/react-dom": "^19.2.3",
53
48
  "@vitejs/plugin-react": "^4.2.1",
54
49
  "jsdom": "^26.1.0",
55
50
  "react-dom": "*",
56
51
  "typescript": "^5.2.2",
57
- "vite": "catalog:",
52
+ "vite": "^7.3.1",
58
53
  "vitest": "^4.0.17"
54
+ },
55
+ "scripts": {
56
+ "npm:publish": "npm publish --registry https://registry.npmjs.org/",
57
+ "test": "vitest run",
58
+ "test:watch": "vitest"
59
59
  }
60
- }
60
+ }
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  AuthLoginResponse,
3
3
  AuthRequest,
4
4
  AuthSession,
@@ -34,7 +34,9 @@ export class AccountService {
34
34
  })
35
35
  }
36
36
 
37
- public static async login(request: AuthRequest): Promise<AuthLoginResponse> {
37
+ public static async login(
38
+ request: AuthRequest
39
+ ): Promise<AuthLoginResponse> {
38
40
  return AccountService.authRequest<AuthLoginResponse>("/login", {
39
41
  method: "POST",
40
42
  body: JSON.stringify(request),
package/src/api/Api.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Maybe, isMaybe } from "@pmate/utils"
2
- import { ServerResponse } from "@pmate/meta"
2
+ import type { ServerResponse } from "@pmate/meta"
3
3
  import { cacheInMem } from "./cacheInMem"
4
4
 
5
5
  const checkLink = async (url: string | Maybe<string>): Promise<boolean> => {
@@ -2,7 +2,8 @@ import { lru } from "@pmate/utils"
2
2
  import type { AppConfig, AppThemePreset, ProfileStep } from "../types/app"
3
3
 
4
4
  const APPS_ENDPOINT =
5
- process.env.VITE_PUBLIC_APPS_SERVER_ENDPOINT || "https://apps-api.pmate.chat"
5
+ import.meta.env.VITE_PUBLIC_APPS_SERVER_ENDPOINT ||
6
+ "https://apps-api.pmate.chat"
6
7
  const DEFAULT_ICON = "https://parrot-static.pmate.chat/parrot-logo.png"
7
8
  const DEFAULT_THEME_PRESET: AppThemePreset = "default"
8
9
 
@@ -1,4 +1,4 @@
1
- import { GroupInfo, Profile } from "@pmate/meta"
1
+ import type { GroupInfo, Profile } from "@pmate/meta"
2
2
  import { Api } from "./Api"
3
3
 
4
4
  const endpoint = "https://api-global-qa.skedo.cn/account"
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  AccountState,
3
3
  CreateProfileRequest,
4
4
  Profile,
@@ -1,4 +1,4 @@
1
- import { AccountState, Profile } from "@pmate/meta"
1
+ import type { AccountState, Profile } from "@pmate/meta"
2
2
  import { atom } from "jotai"
3
3
  import { accountAtom } from "./accountAtom"
4
4
 
@@ -1,4 +1,4 @@
1
- import { Profile } from "@pmate/meta"
1
+ import type { Profile } from "@pmate/meta"
2
2
  import { atomWithRefresh } from "jotai/utils"
3
3
  import { atomFamily, type AtomFamily } from "jotai-family"
4
4
  import type { WritableAtom } from "jotai"
@@ -1,4 +1,4 @@
1
- import { Profile } from "@pmate/meta"
1
+ import type { Profile } from "@pmate/meta"
2
2
  import { atomWithLoadable } from "./atomWithLoadable"
3
3
  import { ProfileService } from "../api/ProfileService"
4
4
  import { resolveAppId } from "../utils/resolveAppId"
@@ -1,4 +1,4 @@
1
- import { Profile } from "@pmate/meta"
1
+ import type { Profile } from "@pmate/meta"
2
2
  import { atom } from "jotai"
3
3
  import { AccountManagerV2 } from "../utils/AccountManagerV2"
4
4
  import { resolveAppId } from "../utils/resolveAppId"
@@ -1,6 +1,8 @@
1
1
  import { VoiceList } from "@pmate/meta"
2
- import { Difficulty, UserSettings } from "@pmate/meta"
3
- import { WritableAtom, atom } from "jotai"
2
+ import { Difficulty } from "@pmate/meta"
3
+ import type { UserSettings } from "@pmate/meta"
4
+ import { atom } from "jotai"
5
+ import type { WritableAtom } from "jotai"
4
6
  import { LSKEYS, localStorageJsonAtom } from "./localStorageAtom"
5
7
 
6
8
  const defaultSettings: UserSettings = {
@@ -5,11 +5,11 @@ import {
5
5
  import { useSetAtom } from "jotai"
6
6
  import {
7
7
  Component,
8
- PropsWithChildren,
9
8
  useCallback,
10
9
  useEffect,
11
10
  useState,
12
11
  } from "react"
12
+ import type { PropsWithChildren } from "react"
13
13
  import { accountAtom } from "../atoms/accountAtom"
14
14
  import { userLogoutAtom } from "../atoms/userLogoutAtom"
15
15
  import { useAuthSnapshot } from "../hooks/useAuthSnapshot"
@@ -1,5 +1,6 @@
1
1
  import { useCallback, useMemo } from "react"
2
- import { isProfileStepType, ProfileStepType } from "../utils/profileStep"
2
+ import { isProfileStepType } from "../utils/profileStep"
3
+ import type { ProfileStepType } from "../utils/profileStep"
3
4
  import { useAppConfig } from "./useAppConfig"
4
5
 
5
6
  type UseProfileStepFlowParams = {
@@ -1,5 +1,5 @@
1
1
  import { EmitterV2 } from "@pmate/utils"
2
- import {
2
+ import type {
3
3
  AccountState,
4
4
  LangShort,
5
5
  LocalProfileState,