@v3finance/core-sdk 0.3.2 → 0.4.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.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/generated/operations.d.ts +8 -0
- package/dist/cjs/generated/operations.d.ts.map +1 -1
- package/dist/cjs/generated/operations.js +10 -2
- package/dist/cjs/generated/operations.js.map +1 -1
- package/dist/cjs/generated/types.d.ts +10 -0
- package/dist/cjs/generated/types.d.ts.map +1 -1
- package/dist/cjs/resources/auth.d.ts +17 -1
- package/dist/cjs/resources/auth.d.ts.map +1 -1
- package/dist/cjs/resources/auth.js +20 -0
- package/dist/cjs/resources/auth.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/generated/operations.d.ts +8 -0
- package/dist/esm/generated/operations.d.ts.map +1 -1
- package/dist/esm/generated/operations.js +10 -2
- package/dist/esm/generated/operations.js.map +1 -1
- package/dist/esm/generated/types.d.ts +10 -0
- package/dist/esm/generated/types.d.ts.map +1 -1
- package/dist/esm/resources/auth.d.ts +17 -1
- package/dist/esm/resources/auth.d.ts.map +1 -1
- package/dist/esm/resources/auth.js +20 -0
- package/dist/esm/resources/auth.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
- package/src/generated/operations.ts +10 -2
- package/src/generated/types.ts +11 -0
- package/src/resources/auth.ts +22 -1
- package/src/version.ts +1 -1
package/src/generated/types.ts
CHANGED
|
@@ -1800,6 +1800,17 @@ export interface CreateVisibilityGrantBody {
|
|
|
1800
1800
|
/** Кого видит субъект: "self" — участников своей группы; "group" — указанной группы (targetGroupId); "vault" — всех участников Vault'а */
|
|
1801
1801
|
export type VisibilityScope = "self" | "group" | "vault"
|
|
1802
1802
|
|
|
1803
|
+
export interface DeviceLoginInfo {
|
|
1804
|
+
/** `client_id`, который заявил начавший вход (`POST /api/auth/device/code`): `web` — веб-версия в браузере, `macos-desktop` — приложение V3 для Mac. Это заявление, а не проверенная личность: начать вход может кто угодно без входа и выбрать любое из двух значений, обе метки дают одну и ту же сессию (без денег и подписей). Годится для текста экрана подтверждения в законном сценарии; предупреждение против фишинга показывать при любом значении и не выдавать это поле за проверку */
|
|
1805
|
+
client: "web" | "macos-desktop"
|
|
1806
|
+
/**
|
|
1807
|
+
* Когда код истекает: после этого подтвердить его нельзя
|
|
1808
|
+
*
|
|
1809
|
+
* format: date-time
|
|
1810
|
+
*/
|
|
1811
|
+
expiresAt: string
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1803
1814
|
export interface EditAssignmentBody {
|
|
1804
1815
|
/** Патч значений (мерджится; null очищает ключ). required остаётся обязательным. Значение архивного поля прислать нельзя (CATEGORY_FIELD_ARCHIVED); если оно осталось с прошлых версий и в патче его нет — переносится как есть */
|
|
1805
1816
|
values: {
|
package/src/resources/auth.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpClient } from '../core/http.js'
|
|
2
|
-
import type { MagicLinkBody } from '../generated/types.js'
|
|
2
|
+
import type { DeviceLoginInfo, MagicLinkBody } from '../generated/types.js'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Signing in.
|
|
@@ -33,4 +33,25 @@ export class AuthResource {
|
|
|
33
33
|
body: input,
|
|
34
34
|
})
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Which client a pending login code was started for — asked by the phone
|
|
39
|
+
* BEFORE it approves the code, to name the client honestly («веб-версия» or
|
|
40
|
+
* «приложение V3 для Mac»).
|
|
41
|
+
*
|
|
42
|
+
* Only a session that may approve logins itself gets an answer: the mobile
|
|
43
|
+
* app. A web or desktop session, and a platform administrator, get 403
|
|
44
|
+
* (`WEB_SESSION_CANNOT_APPROVE`, `ADMIN_CANNOT_APPROVE_WEB_LOGIN`). Any code
|
|
45
|
+
* that cannot be approved — unknown, expired, already used — is the same
|
|
46
|
+
* 404, so the answer reveals nothing about codes.
|
|
47
|
+
*
|
|
48
|
+
* `client` is what the person who started the login declared, not a
|
|
49
|
+
* verified identity: keep the anti-phishing warning for any value.
|
|
50
|
+
* Hyphens in the code are ignored; letter case is not (pass it as shown).
|
|
51
|
+
*/
|
|
52
|
+
deviceLogin(userCode: string): Promise<DeviceLoginInfo> {
|
|
53
|
+
return this.#http.request<DeviceLoginInfo>('GET', '/api/v1/auth/device-login', {
|
|
54
|
+
query: { user_code: userCode },
|
|
55
|
+
})
|
|
56
|
+
}
|
|
36
57
|
}
|
package/src/version.ts
CHANGED