@deepseek-ai/dsh-deepseek-account-platform 0.1.7-alpha.1 → 0.1.7-alpha.2
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.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/index.js +5 -2
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.js +2 -2
- package/package.json +12 -12
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/credentials/deepseek-account-platform/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 94816e5819027b0d68d39379a9905dfe02768029
|
|
6
|
+
README.zh.md: 9e1df8a19881960e4d4b4423f9cfa89c463d237d
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ New attempts map the caller’s UI language to Platform en_US or zh_CN; active a
|
|
|
11
11
|
|
|
12
12
|
getPlatformSession exports the stored grant only when its issuer matches platformOrigin. This Host-only operation supports native Platform embedding without widening the model/file origin configured for resolveToken.
|
|
13
13
|
|
|
14
|
-
`desktopPlatform` defaults to `null`.
|
|
14
|
+
`desktopPlatform` defaults to `null`. Every profile then sends `x-client-platform: web` on Host authorization, profile, balance, and logout requests; the Desktop profile supplies `darwin` or `win32`, replacing it with `x-client-platform: desktop-mac` or `desktop-win`. The provider owns that header, so deployment configuration cannot override it. Embedded Platform document and API requests receive the same platform header alongside their deployment headers, only at the configured origin.
|
|
15
15
|
|
|
16
16
|
## Summary
|
|
17
17
|
|
package/README.zh.md
CHANGED
|
@@ -11,7 +11,7 @@ kind: "package-reference"
|
|
|
11
11
|
|
|
12
12
|
getPlatformSession 仅在已存授权的 issuer 与 platformOrigin 一致时导出该授权。这个仅限 Host 的操作支持原生 Platform 内嵌,不扩大 resolveToken 配置的模型及文件请求来源。
|
|
13
13
|
|
|
14
|
-
`desktopPlatform` 默认为 `null
|
|
14
|
+
`desktopPlatform` 默认为 `null`。此时所有 profile 的 Host 授权、资料、余额和退登请求都携带 `x-client-platform: web`;Desktop profile 提供 `darwin` 或 `win32`,改为携带 `x-client-platform: desktop-mac` 或 `desktop-win`。该请求头由 provider 拥有,部署配置无法覆盖。内嵌 Platform 的文档与 API 请求仅向配置来源发送相同的平台请求头,同时保留其他部署请求头。
|
|
15
15
|
|
|
16
16
|
## 概述
|
|
17
17
|
|
package/lib/index.js
CHANGED
|
@@ -435,7 +435,10 @@ var PlatformAccount = class extends DeepSeekAccount {
|
|
|
435
435
|
if (!["http:", "https:"].includes(inference.protocol) || inference.username || inference.password || inference.pathname !== "/" || inference.search || inference.hash) throw new Error("account: inferenceOrigin must be an HTTP(S) origin without credentials, path, query or fragment");
|
|
436
436
|
this.inferenceOrigin = inference.origin;
|
|
437
437
|
this.rewriteBrowserOrigin = resolved.rewriteBrowserOrigin;
|
|
438
|
-
this.clientHeaders =
|
|
438
|
+
this.clientHeaders = {
|
|
439
|
+
"x-client-platform": "web",
|
|
440
|
+
...desktopClientHeaders(resolved.desktopPlatform)
|
|
441
|
+
};
|
|
439
442
|
this.requestHeaders = platformHeaders(resolved.requestHeaders);
|
|
440
443
|
const accountHeaders = platformHeaders(resolved.accountRequestHeaders);
|
|
441
444
|
this.accountRequestHeaders = {
|
|
@@ -542,7 +545,7 @@ var PlatformAccount = class extends DeepSeekAccount {
|
|
|
542
545
|
origin: this.origin,
|
|
543
546
|
token: stored.token,
|
|
544
547
|
...this.embeddedPageDist ? { embeddedPageDist: this.embeddedPageDist } : {},
|
|
545
|
-
|
|
548
|
+
requestHeaders
|
|
546
549
|
};
|
|
547
550
|
}
|
|
548
551
|
async readCurrentGrant(lifetime) {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { DeepSeekAccount, type PlatformSession, type AccountDetails, type Accoun
|
|
|
5
5
|
export interface Config {
|
|
6
6
|
/** Platform origin serving auth-api and browser pages. */
|
|
7
7
|
platformOrigin?: string;
|
|
8
|
-
/** Native desktop identity for Host API and embedded Platform requests; null
|
|
8
|
+
/** Native desktop identity for Host API and embedded Platform requests; null identifies the client as web. */
|
|
9
9
|
desktopPlatform?: 'darwin' | 'win32' | null;
|
|
10
10
|
/** Optional frontend deployment selector for embedded Usage and Top-up pages. */
|
|
11
11
|
embeddedPageDist?: string;
|
package/lib/types/index.js
CHANGED
|
@@ -64,7 +64,7 @@ export class PlatformAccount extends DeepSeekAccount {
|
|
|
64
64
|
}
|
|
65
65
|
this.inferenceOrigin = inference.origin;
|
|
66
66
|
this.rewriteBrowserOrigin = resolved.rewriteBrowserOrigin;
|
|
67
|
-
this.clientHeaders = desktopClientHeaders(resolved.desktopPlatform);
|
|
67
|
+
this.clientHeaders = { 'x-client-platform': 'web', ...desktopClientHeaders(resolved.desktopPlatform) };
|
|
68
68
|
this.requestHeaders = platformHeaders(resolved.requestHeaders);
|
|
69
69
|
const accountHeaders = platformHeaders(resolved.accountRequestHeaders);
|
|
70
70
|
this.accountRequestHeaders = { ...this.requestHeaders, ...accountHeaders };
|
|
@@ -162,7 +162,7 @@ export class PlatformAccount extends DeepSeekAccount {
|
|
|
162
162
|
const requestHeaders = { ...this.accountRequestHeaders, ...this.clientHeaders };
|
|
163
163
|
return { origin: this.origin, token: stored.token,
|
|
164
164
|
...(this.embeddedPageDist ? { embeddedPageDist: this.embeddedPageDist } : {}),
|
|
165
|
-
|
|
165
|
+
requestHeaders };
|
|
166
166
|
}
|
|
167
167
|
async readCurrentGrant(lifetime) {
|
|
168
168
|
if (this.closed)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-deepseek-account-platform",
|
|
3
3
|
"description": "Authorize DeepSeek accounts through browser PKCE",
|
|
4
|
-
"version": "0.1.7-alpha.
|
|
4
|
+
"version": "0.1.7-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -32,21 +32,21 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@deepseek-ai/cordis": "
|
|
36
|
-
"@deepseek-ai/dsh-deepseek-account": "
|
|
37
|
-
"@deepseek-ai/dsh-authorization": "
|
|
38
|
-
"@deepseek-ai/dsh-credentials": "
|
|
39
|
-
"@deepseek-ai/dsh-host-webserver": "
|
|
35
|
+
"@deepseek-ai/cordis": "~4.0.4",
|
|
36
|
+
"@deepseek-ai/dsh-deepseek-account": "0.1.7-alpha.2",
|
|
37
|
+
"@deepseek-ai/dsh-authorization": "0.1.7-alpha.2",
|
|
38
|
+
"@deepseek-ai/dsh-credentials": "0.1.7-alpha.2",
|
|
39
|
+
"@deepseek-ai/dsh-host-webserver": "0.1.7-alpha.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@deepseek-ai/
|
|
43
|
-
"@deepseek-ai/dsh-
|
|
44
|
-
"@deepseek-ai/dsh-
|
|
45
|
-
"@deepseek-ai/dsh-
|
|
46
|
-
"@deepseek-ai/
|
|
42
|
+
"@deepseek-ai/dsh-deepseek-account": "0.1.7-alpha.2",
|
|
43
|
+
"@deepseek-ai/dsh-authorization": "0.1.7-alpha.2",
|
|
44
|
+
"@deepseek-ai/dsh-credentials": "0.1.7-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-host-webserver": "0.1.7-alpha.2",
|
|
46
|
+
"@deepseek-ai/cordis": "~4.0.4"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"zod": "^4.4.3",
|
|
50
|
-
"@deepseek-ai/schemastery": "
|
|
50
|
+
"@deepseek-ai/schemastery": "~3.18.4"
|
|
51
51
|
}
|
|
52
52
|
}
|