@torrow/sdk-auth 0.6.0 → 0.8.0

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.
@@ -5,7 +5,7 @@ import { TorrowClientConfig, DeviceInfo } from '@torrow/sdk-client';
5
5
  *
6
6
  * Здесь: snapshot / `TokenStorage` / `AppCredentials` / `TokenSessionOptions` /
7
7
  * статусы сессии. HTTP Basic wire (`AuthIdentityBasic`) — в sdk-client;
8
- * маппинг `appCredentials` → Basic — внутренняя `appCredentialsToAuthIdentityBasic`
8
+ * defaults и маппинг `appCredentials` → Basic — в `app-credentials.ts`
9
9
  * (не реэкспортируется из `index.ts`).
10
10
  *
11
11
  * Карта слоёв конфигов — в JSDoc {@link TokenSessionOptions}.
@@ -51,22 +51,17 @@ type RefreshFailureAction = "clear" | "keep" | "throw";
51
51
  *
52
52
  * Это **не** логин пользователя: `clientId` / `clientSecret` типа клиента на шлюзе.
53
53
  * На wire уходит как `AuthIdentityBasic` (`username`/`password`) в
54
- * `TorrowClientConfig.authIdentityBasic` — маппинг делает `TokenSession` внутри пакета
54
+ * `TorrowClientConfig.authIdentityBasic` — маппинг выполняется внутри пакета
55
55
  * (функция не публичная: приложениям достаточно `appCredentials`).
56
56
  *
57
57
  * **Где:** `TokenSessionOptions.appCredentials`, `TorrowAuth.connect|login*|fromTokens`.
58
58
  */
59
59
  type AppCredentials = {
60
+ /** Идентификатор приложения; передаётся как username в HTTP Basic. */
60
61
  clientId: string;
62
+ /** Секрет приложения; передаётся как password в HTTP Basic. */
61
63
  clientSecret: string;
62
64
  };
63
- /**
64
- * Дефолтные app credentials SDK для `/api/v1/auth/*`, если {@link TokenSessionOptions.appCredentials}
65
- * не передан. Своё приложение может переопределить явной парой.
66
- *
67
- * Публикуется в npm `@torrow/sdk-auth` (inspectable); свой prod-secret — только override / BFF.
68
- */
69
- declare const DEFAULT_APP_CREDENTIALS: AppCredentials;
70
65
  /**
71
66
  * Состояние пользовательской сессии (`TokenSession.status` / `onStatusChange`).
72
67
  * Не путать с `TorrowAuth.anonymous` (клиент без Bearer, без сессии).
@@ -125,4 +120,4 @@ type TokenSessionOptions = Pick<TorrowClientConfig, "baseUrl" | "fetch" | "defau
125
120
  skipEnsureFreshOnOpen?: boolean;
126
121
  };
127
122
 
128
- export { type AuthTokenSnapshot as A, DEFAULT_APP_CREDENTIALS as D, type RefreshFailureAction as R, type TokenStorage as T, type TokenSessionOptions as a, type TokenSessionStatus as b, type TokenSessionStatusListener as c, type AppCredentials as d };
123
+ export type { AppCredentials as A, RefreshFailureAction as R, TokenSessionOptions as T, TokenStorage as a, TokenSessionStatus as b, TokenSessionStatusListener as c, AuthTokenSnapshot as d };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torrow/sdk-auth",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "TorrowAuth session facade for @torrow/sdk-client (connect, OTP, link login, storage, 401 retry)",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -28,10 +28,10 @@
28
28
  "access": "public"
29
29
  },
30
30
  "peerDependencies": {
31
- "@torrow/sdk-client": "^0.6.0"
31
+ "@torrow/sdk-client": "^0.8.0"
32
32
  },
33
33
  "dependencies": {
34
- "@torrow/sdk-client": "^0.6.0"
34
+ "@torrow/sdk-client": "^0.8.0"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "tsup",