@wport/cli 0.9.1 → 0.9.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/CHANGELOG.md +13 -0
- package/dist/index.js +14 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [0.9.2] — 2026-08-24
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **請求來源標記(pm_48 交付 B,BR-039)**:CLI 對 talent 後端的每個請求帶 `X-Source: cli`
|
|
13
|
+
header——單一常數 `CLI_SOURCE` 收斂,四個出口共用(jobs typed client、enterprise transport、
|
|
14
|
+
personal client、OAuth device flow)。後端(交付 A)已上線,將來源落入 API access log 的
|
|
15
|
+
`source` 欄供 audit。S3 presigned PUT 刻意**不帶**(自訂 header 會破 SigV4 簽章)。
|
|
16
|
+
對外行為零變更:指令、輸出、exit code 契約均不受影響。
|
|
17
|
+
- 姊妹套件 `@wport/core` / `@wport/sdk` 同步發 **0.1.1**:exports map 修正——`import` /
|
|
18
|
+
`require` 條件各自對應正確的 types 檔(`index.d.ts` / `index.d.cts`),並導出
|
|
19
|
+
`./package.json`;修正 TypeScript `moduleResolution: node16 / bundler` 下的型別解析。
|
|
20
|
+
|
|
8
21
|
## [0.9.1] — 2026-08-17
|
|
9
22
|
|
|
10
23
|
### Changed
|
package/dist/index.js
CHANGED
|
@@ -291,6 +291,7 @@ function channelBanner() {
|
|
|
291
291
|
// src/lib/global-opts.ts
|
|
292
292
|
var DEFAULT_BASE_URL = channelBaseUrl(currentChannel());
|
|
293
293
|
var API_BASE_ENV_VAR = "WPORT_API_BASE";
|
|
294
|
+
var CLI_SOURCE = "cli";
|
|
294
295
|
var DEFAULT_LOCALE = "zh-TW";
|
|
295
296
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
296
297
|
function resolveContext(command) {
|
|
@@ -386,7 +387,8 @@ function registerJobsSearch(parent) {
|
|
|
386
387
|
baseUrl: ctx.baseUrl,
|
|
387
388
|
locale: ctx.locale,
|
|
388
389
|
timeoutMs: ctx.timeoutMs,
|
|
389
|
-
userAgent: (0, import_core2.buildUserAgent)("wport-cli", "0.9.
|
|
390
|
+
userAgent: (0, import_core2.buildUserAgent)("wport-cli", "0.9.2"),
|
|
391
|
+
source: CLI_SOURCE
|
|
390
392
|
});
|
|
391
393
|
const { data, error, response } = await client.GET("/api/jobs/search", {
|
|
392
394
|
params: { query }
|
|
@@ -630,7 +632,8 @@ function registerJobsView(parent) {
|
|
|
630
632
|
baseUrl: ctx.baseUrl,
|
|
631
633
|
locale: ctx.locale,
|
|
632
634
|
timeoutMs: ctx.timeoutMs,
|
|
633
|
-
userAgent: (0, import_core3.buildUserAgent)("wport-cli", "0.9.
|
|
635
|
+
userAgent: (0, import_core3.buildUserAgent)("wport-cli", "0.9.2"),
|
|
636
|
+
source: CLI_SOURCE
|
|
634
637
|
});
|
|
635
638
|
if (flags.batch) {
|
|
636
639
|
await runBatchView(encIdArg, flags, client, ctx.timeoutMs);
|
|
@@ -1070,7 +1073,8 @@ async function oauthPost(opts, path, body) {
|
|
|
1070
1073
|
method: "POST",
|
|
1071
1074
|
headers: {
|
|
1072
1075
|
"Accept-Language": opts.locale,
|
|
1073
|
-
"User-Agent": (0, import_core5.buildUserAgent)("wport-cli", "0.9.
|
|
1076
|
+
"User-Agent": (0, import_core5.buildUserAgent)("wport-cli", "0.9.2"),
|
|
1077
|
+
"X-Source": CLI_SOURCE,
|
|
1074
1078
|
Accept: "application/json",
|
|
1075
1079
|
"Content-Type": "application/json"
|
|
1076
1080
|
},
|
|
@@ -1152,7 +1156,7 @@ function registerDoctorCommand(program2) {
|
|
|
1152
1156
|
}
|
|
1153
1157
|
async function runDoctor(ctx) {
|
|
1154
1158
|
const line = (s = "") => process.stdout.write(s + "\n");
|
|
1155
|
-
line(`wport-cli ${"0.9.
|
|
1159
|
+
line(`wport-cli ${"0.9.2"}`);
|
|
1156
1160
|
line(` bundled schema fingerprint: ${"839e8a891dfb"}`);
|
|
1157
1161
|
line("");
|
|
1158
1162
|
line("Resolved configuration:");
|
|
@@ -1212,7 +1216,8 @@ async function probeServer(ctx, line) {
|
|
|
1212
1216
|
baseUrl: ctx.baseUrl,
|
|
1213
1217
|
locale: ctx.locale,
|
|
1214
1218
|
timeoutMs: ctx.timeoutMs,
|
|
1215
|
-
userAgent: (0, import_core7.buildUserAgent)("wport-cli", "0.9.
|
|
1219
|
+
userAgent: (0, import_core7.buildUserAgent)("wport-cli", "0.9.2"),
|
|
1220
|
+
source: CLI_SOURCE
|
|
1216
1221
|
});
|
|
1217
1222
|
const { response } = await client.GET("/api/jobs/search", { params: { query: { pageSize: 1 } } });
|
|
1218
1223
|
if (response.ok) {
|
|
@@ -1241,7 +1246,7 @@ async function probeAuthServer(ctx, line) {
|
|
|
1241
1246
|
var import_core8 = require("@wport/core");
|
|
1242
1247
|
var transport = __toESM(require("@wport/core"));
|
|
1243
1248
|
function withUserAgent(opts) {
|
|
1244
|
-
return { ...opts, userAgent: (0, import_core8.buildUserAgent)("wport-cli", "0.9.
|
|
1249
|
+
return { ...opts, userAgent: (0, import_core8.buildUserAgent)("wport-cli", "0.9.2"), source: CLI_SOURCE };
|
|
1245
1250
|
}
|
|
1246
1251
|
function decorateEnterpriseError(err) {
|
|
1247
1252
|
if (!(err instanceof import_core8.WportHttpError)) return err;
|
|
@@ -2736,7 +2741,8 @@ async function attemptRequest(opts, method, path, accessToken, body, query, extr
|
|
|
2736
2741
|
const headers = {
|
|
2737
2742
|
Authorization: `Bearer ${accessToken}`,
|
|
2738
2743
|
"Accept-Language": opts.locale,
|
|
2739
|
-
"User-Agent": (0, import_core29.buildUserAgent)("wport-cli", "0.9.
|
|
2744
|
+
"User-Agent": (0, import_core29.buildUserAgent)("wport-cli", "0.9.2"),
|
|
2745
|
+
"X-Source": CLI_SOURCE,
|
|
2740
2746
|
Accept: "application/json"
|
|
2741
2747
|
};
|
|
2742
2748
|
if (body !== void 0) headers["Content-Type"] = "application/json";
|
|
@@ -3677,7 +3683,7 @@ function registerPersonalCommand(program2) {
|
|
|
3677
3683
|
|
|
3678
3684
|
// src/index.ts
|
|
3679
3685
|
var program = new import_commander.Command();
|
|
3680
|
-
program.name("wport").description("wport CLI \u2014 terminal interface to the W101 Talent Search Hub public API").version("0.9.
|
|
3686
|
+
program.name("wport").description("wport CLI \u2014 terminal interface to the W101 Talent Search Hub public API").version("0.9.2", "-v, --version", "output the CLI version").option("--lang <locale>", "Accept-Language locale: zh-TW | en-US | vi-VN | th-TH | id-ID").option("--api <url>", "override API base URL").option("--output <fmt>", "output format: table | json").option("--no-color", "disable color output").option("--timeout <ms>", "HTTP timeout in milliseconds", (v) => Number(v));
|
|
3681
3687
|
registerJobsCommand(program);
|
|
3682
3688
|
registerConfigCommand(program);
|
|
3683
3689
|
registerDoctorCommand(program);
|