@torrow/sdk-auth 0.8.0 → 0.9.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/README.md +27 -9
- package/dist/index.d.ts +27 -56
- package/dist/index.js +819 -430
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/{types-C4e90uOw.d.ts → types-M7DBG6bO.d.ts} +6 -4
- package/package.json +3 -3
package/dist/node.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TorrowClientConfig, DeviceInfo } from '@torrow/sdk-client';
|
|
1
|
+
import { TorrowClientConfig, DeviceInfo, TorrowSdkError } from '@torrow/sdk-client';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Публичные типы опций и контрактов **`@torrow/sdk-auth`**.
|
|
@@ -40,7 +40,7 @@ interface TokenStorage {
|
|
|
40
40
|
}
|
|
41
41
|
/** Поведение при «логическом» отказе refresh (не сеть / не 429/502–504).
|
|
42
42
|
*
|
|
43
|
-
* - **`keep`** —
|
|
43
|
+
* - **`keep`** — не выполнять дополнительную очистку (память могла измениться до storage-сбоя); `ensureFresh` / `connect` завершаются без throw
|
|
44
44
|
* (статус может быть `expired`).
|
|
45
45
|
* - **`throw`** — пробросить ошибку refresh.
|
|
46
46
|
* - **`clear`** — очистить access/refresh локально.
|
|
@@ -104,9 +104,11 @@ type TokenSessionOptions = Pick<TorrowClientConfig, "baseUrl" | "fetch" | "defau
|
|
|
104
104
|
accessTokenSkewMs?: number;
|
|
105
105
|
/**
|
|
106
106
|
* Решить судьбу refresh при ошибке. По умолчанию: временные шлюзовые коды → `keep`,
|
|
107
|
-
*
|
|
107
|
+
* не-HTTP/storage → `keep`, остальной HTTP → `clear`. Callback получает безопасный
|
|
108
|
+
* `TorrowSdkError` текущего refresh с уже выполненными предметными шагами; его собственный
|
|
109
|
+
* сбой получает `CallbackFailed`. При storage-сбое уже применённая память не откатывается.
|
|
108
110
|
*/
|
|
109
|
-
onRefreshFailure?: (err:
|
|
111
|
+
onRefreshFailure?: (err: TorrowSdkError) => RefreshFailureAction | Promise<RefreshFailureAction>;
|
|
110
112
|
/**
|
|
111
113
|
* 401 → refresh → один retry (через обёртку `fetch`).
|
|
112
114
|
* По умолчанию **`true`**. Выключи (`false`), если свой interceptor/`fetch` уже ретраит
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@torrow/sdk-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
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.
|
|
31
|
+
"@torrow/sdk-client": "^0.9.1"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@torrow/sdk-client": "^0.
|
|
34
|
+
"@torrow/sdk-client": "^0.9.1"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsup",
|