@wport/cli 0.9.1 → 0.9.3

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 CHANGED
@@ -5,6 +5,37 @@
5
5
 
6
6
  ---
7
7
 
8
+ ## [0.9.3] — 2026-08-26
9
+
10
+ ### Changed
11
+
12
+ - 依賴 bump:`@wport/core` `^0.1.0` → `^0.2.0`(0.x 的 caret 不跨 minor,需顯式升)。
13
+ CLI 對外行為零變更:指令、輸出、exit code 契約(0/2/3/4/5)均不受影響——core 0.2.0 的
14
+ 5xx 錯誤自 `WportError` 改為帶 `status` 的 `WportHttpError`,兩者在 `exitCodeForError`
15
+ 同落 exit 4(review F-008 附帶核對 + 743 tests 驗證)。
16
+ - 姊妹套件同步發版(pm_48 交付 C 的 SDK 地基):
17
+ - **`@wport/core` 0.2.0**:`throwForHttpStatus` 任何非 2xx(含 5xx)一律拋帶 `status`/`body`
18
+ 的 `WportHttpError`(先前 5xx 拋裸 `WportError`,下游拿不到 http status);`buildUserAgent`
19
+ 改 `globalThis` 存取 `process`(非 Node runtime / 無 node types 的 tsc 環境不再炸)。
20
+ - **`@wport/sdk` 0.2.0**:新增 `enterprise.me()`(GET /me)/`enterprise.usage()`、
21
+ `enterprise.jobs.view/publish/unpublish/copy`;`WportClientOptions.source` 覆寫
22
+ (BR-039 通道標記,預設仍 `typescript_sdk`);`CompanyMe` 對齊 wire 實形
23
+ `{ company: { enc_id, name } }`;`__SDK_VERSION__` 加 typeof 防禦(source-bundling
24
+ 消費者不再 ReferenceError)。此三包即 `mcp.wport.me` remote MCP(交付 C)的執行底座。
25
+
26
+ ## [0.9.2] — 2026-08-24
27
+
28
+ ### Added
29
+
30
+ - **請求來源標記(pm_48 交付 B,BR-039)**:CLI 對 talent 後端的每個請求帶 `X-Source: cli`
31
+ header——單一常數 `CLI_SOURCE` 收斂,四個出口共用(jobs typed client、enterprise transport、
32
+ personal client、OAuth device flow)。後端(交付 A)已上線,將來源落入 API access log 的
33
+ `source` 欄供 audit。S3 presigned PUT 刻意**不帶**(自訂 header 會破 SigV4 簽章)。
34
+ 對外行為零變更:指令、輸出、exit code 契約均不受影響。
35
+ - 姊妹套件 `@wport/core` / `@wport/sdk` 同步發 **0.1.1**:exports map 修正——`import` /
36
+ `require` 條件各自對應正確的 types 檔(`index.d.ts` / `index.d.cts`),並導出
37
+ `./package.json`;修正 TypeScript `moduleResolution: node16 / bundler` 下的型別解析。
38
+
8
39
  ## [0.9.1] — 2026-08-17
9
40
 
10
41
  ### 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.1")
390
+ userAgent: (0, import_core2.buildUserAgent)("wport-cli", "0.9.3"),
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.1")
635
+ userAgent: (0, import_core3.buildUserAgent)("wport-cli", "0.9.3"),
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.1"),
1076
+ "User-Agent": (0, import_core5.buildUserAgent)("wport-cli", "0.9.3"),
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.1"}`);
1159
+ line(`wport-cli ${"0.9.3"}`);
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.1")
1219
+ userAgent: (0, import_core7.buildUserAgent)("wport-cli", "0.9.3"),
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.1") };
1249
+ return { ...opts, userAgent: (0, import_core8.buildUserAgent)("wport-cli", "0.9.3"), 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.1"),
2744
+ "User-Agent": (0, import_core29.buildUserAgent)("wport-cli", "0.9.3"),
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.1", "-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));
3686
+ program.name("wport").description("wport CLI \u2014 terminal interface to the W101 Talent Search Hub public API").version("0.9.3", "-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);