@kanorio/sdk 1.0.0 → 1.1.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.
Files changed (76) hide show
  1. package/README.md +2 -2
  2. package/dist/customer-oauth.d.ts +21 -21
  3. package/dist/customer-oauth.js +12 -12
  4. package/dist/customer.d.ts +22 -22
  5. package/dist/customer.js +20 -11
  6. package/dist/delivery.d.ts +9 -9
  7. package/dist/delivery.js +6 -6
  8. package/dist/edge.d.ts +25 -21
  9. package/dist/edge.js +19 -19
  10. package/dist/forms.d.ts +13 -13
  11. package/dist/forms.js +13 -13
  12. package/dist/generated/delivery.d.ts +35 -7
  13. package/dist/generated/management.d.ts +111 -26
  14. package/dist/http.d.ts +13 -13
  15. package/dist/http.js +8 -8
  16. package/dist/index.js +2 -2
  17. package/dist/locales.d.ts +22 -22
  18. package/dist/locales.js +12 -12
  19. package/dist/management.d.ts +5 -5
  20. package/dist/management.js +3 -3
  21. package/dist/paginate.d.ts +3 -3
  22. package/dist/paginate.js +3 -3
  23. package/dist/preview.d.ts +13 -13
  24. package/dist/preview.js +11 -11
  25. package/dist/protection.d.ts +18 -18
  26. package/dist/protection.js +11 -11
  27. package/dist/revalidate.d.ts +22 -22
  28. package/dist/revalidate.js +14 -14
  29. package/dist/seo.d.ts +20 -20
  30. package/dist/seo.js +20 -20
  31. package/dist/server-key.d.ts +2 -2
  32. package/dist/server-key.js +2 -2
  33. package/dist/shared/api/delivery/cache-tags.d.ts +39 -39
  34. package/dist/shared/api/delivery/cache-tags.js +34 -34
  35. package/dist/shared/api/server-key.d.ts +32 -28
  36. package/dist/shared/api/server-key.js +41 -33
  37. package/dist/shared/business-registry/attribution.d.ts +5 -5
  38. package/dist/shared/business-registry/attribution.js +4 -4
  39. package/dist/shared/business-registry/define.d.ts +1 -1
  40. package/dist/shared/business-registry/define.js +1 -1
  41. package/dist/shared/business-registry/formats/eu-vat.js +4 -4
  42. package/dist/shared/business-registry/formats/hk-br.d.ts +2 -2
  43. package/dist/shared/business-registry/formats/hk-br.js +4 -4
  44. package/dist/shared/business-registry/formats/jp-trn.d.ts +3 -3
  45. package/dist/shared/business-registry/formats/jp-trn.js +4 -4
  46. package/dist/shared/business-registry/formats/kr-brn.d.ts +2 -2
  47. package/dist/shared/business-registry/formats/kr-brn.js +3 -3
  48. package/dist/shared/business-registry/formats/my.d.ts +3 -3
  49. package/dist/shared/business-registry/formats/my.js +4 -4
  50. package/dist/shared/business-registry/formats/sg-uen.js +4 -4
  51. package/dist/shared/business-registry/formats/tw-vat.d.ts +5 -5
  52. package/dist/shared/business-registry/formats/tw-vat.js +6 -6
  53. package/dist/shared/business-registry/index.js +1 -1
  54. package/dist/shared/business-registry/lookup-wire.d.ts +9 -9
  55. package/dist/shared/business-registry/lookup-wire.js +4 -4
  56. package/dist/shared/business-registry/normalize.d.ts +3 -3
  57. package/dist/shared/business-registry/normalize.js +4 -4
  58. package/dist/shared/business-registry/registry.d.ts +9 -9
  59. package/dist/shared/business-registry/registry.js +13 -13
  60. package/dist/shared/business-registry/types.d.ts +20 -20
  61. package/dist/shared/business-registry/types.js +6 -6
  62. package/dist/shared/localization/locale-path.d.ts +18 -18
  63. package/dist/shared/localization/locale-path.js +18 -18
  64. package/dist/shared/localization/request-locale.d.ts +16 -16
  65. package/dist/shared/localization/request-locale.js +13 -13
  66. package/dist/shared/seo/alternates.d.ts +26 -26
  67. package/dist/shared/seo/alternates.js +18 -18
  68. package/dist/shared/types/forms-logic.d.ts +28 -28
  69. package/dist/shared/types/forms-logic.js +27 -27
  70. package/dist/shared/types/number-input.d.ts +2 -2
  71. package/dist/shared/types/number-input.js +3 -3
  72. package/dist/shared/utils/redirect-matching.d.ts +33 -24
  73. package/dist/shared/utils/redirect-matching.js +73 -40
  74. package/dist/typed.d.ts +5 -5
  75. package/dist/typed.js +3 -3
  76. package/package.json +10 -10
@@ -1,43 +1,47 @@
1
1
  /**
2
- * 網站主機金鑰(server key)的共用契約:main、public-sites Worker 與 SDK 讀同一份。
2
+ * The shared contract of server keys: Kanorio's server, its edge worker and the SDK read the same file.
3
3
  *
4
- * 主機金鑰是用途為「網站主機用」的服務帳號金鑰(`knr_sa_`)。站主自建前端的伺服器帶著它代訪客寫入
5
- * (送表單、顧客登入、回報爬蟲),邊緣驗過後才採信它宣稱的訪客 IP。它打不開 Management API。
6
- * 設計見 docs/platform/decisions/0002-operation-context.md「修訂一」。
4
+ * A server key is a service account key issued for a website's own server (`knr_sk_`). The server of a self-hosted front end sends it when writing on behalf of a visitor
5
+ * (submitting a form, customer sign-in, reporting crawlers), and the edge trusts the visitor IP it states only after verifying the key. It cannot open the Management API.
6
+ * See the Authentication page of the developer documentation.
7
7
  */
8
- /** 主機帶金鑰的標頭 */
8
+ /** The header the server sends the key in */
9
9
  export declare const SERVER_KEY_HEADER = "X-Kanorio-Server-Key";
10
- /** 主機轉述的訪客 IP;只在金鑰驗過時採信 */
10
+ /** The visitor IP relayed by the server; trusted only when the key has been verified */
11
11
  export declare const SERVER_KEY_VISITOR_IP_HEADER = "X-Kanorio-Visitor-IP";
12
12
  /**
13
- * Worker → main:這個請求帶著驗過的主機金鑰(值是金鑰 id)。main 只在它與 Worker 金鑰(X-API-Key)俱全時
14
- * 才採信 `x-kanorio-client-ip` 裡主機轉述的訪客 IP(apps/main/lib/utils/ip-address.ts)。
13
+ * Edge worker to server: this request carries a verified server key (the value is the key id). The server trusts the relayed visitor IP in
14
+ * `x-kanorio-client-ip` only when this header and the worker's own key (X-API-Key) are both present.
15
15
  */
16
16
  export declare const SERVER_KEY_ID_FORWARD_HEADER = "x-kanorio-server-key-id";
17
17
  /**
18
- * 服務帳號授予與金鑰 scopes 裡的機器專用標記。不在「人的權限目錄」(`ALL_PERMISSIONS`)裡:
19
- * 沒有任何團隊角色持有它、角色編輯器不會出現、PAT 與 OAuth 選不到。建立這種服務帳號只需要 `developer:manage`。
18
+ * Machine-only marker in a service account's grants and its keys' scopes. It is not in the catalog of permissions people can hold:
19
+ * no team role has it, the role editor does not show it, and personal access tokens and OAuth cannot select it. Creating such a service account only needs `developer:manage`.
20
20
  */
21
21
  export declare const STOREFRONT_SERVER_SCOPE = "storefront:server";
22
- export declare const SERVER_KEY_PREFIX = "knr_sa_";
22
+ /**
23
+ * The server key's own prefix: one prefix per credential type (as GitHub and Stripe do), so whoever holds a key, and leak scanners, can tell from the prefix
24
+ * that it cannot open the Management API. Service account keys for managing a site start with `knr_sa_`.
25
+ */
26
+ export declare const SERVER_KEY_PREFIX = "knr_sk_";
23
27
  export declare function isServerKeyFormat(raw: string): boolean;
24
28
  /**
25
- * 外部視角探針用的假金鑰(格式正確、永遠不存在):監控每輪拿它 POST 一個站,確認假金鑰會被拒。
26
- * 邊緣認得它,照常驗證與拒絕,但不計入該站的「主機金鑰驗證失敗」異常訊號(那是我們自己的探針,不是有人在試)。
29
+ * A fake key for outside-in probes (well-formed and never valid): monitoring POSTs with it to a site every round to confirm that fake keys are refused.
30
+ * The edge recognizes it, verifies and refuses it as usual, but does not count it toward the site's failed-server-key signal (it is Kanorio's own probe, not someone guessing).
27
31
  */
28
32
  export declare const PROBE_FAKE_SERVER_KEY: string;
29
- /** 服務帳號的用途:由授予是否帶 `STOREFRONT_SERVER_SCOPE` 決定,建立後不可改 */
33
+ /** A service account's purpose: decided by whether its grant carries `STOREFRONT_SERVER_SCOPE`, and fixed after creation */
30
34
  export type ServiceAccountPurpose = "management" | "storefront_server";
31
35
  export declare function purposeOfGrant(permissions: readonly string[]): ServiceAccountPurpose;
32
- /** 環境變數的慣用名稱(後台的一次性顯示、CLI `--write-env`、文件都用這個) */
36
+ /** Conventional environment variable name (used by the dashboard's one-time display, the CLI's `--write-env` and the documentation) */
33
37
  export declare const SERVER_KEY_ENV_NAME = "KANORIO_SERVER_KEY";
34
- /** Worker → main 驗證端點的回應 */
38
+ /** Response of the edge worker's verification call to the server */
35
39
  export interface ServerKeyVerifyResponse {
36
40
  valid: boolean;
37
41
  tokenId?: string;
38
- /** ISO 時間;null=不過期 */
42
+ /** ISO time; null means it does not expire */
39
43
  expiresAt?: string | null;
40
- /** 來源限制(空陣列=不限制);比對的是實際連線 IP 與 ASN */
44
+ /** Source restrictions (an empty array means none); matched against the actual connecting IP and ASN */
41
45
  allowedCidrs?: string[];
42
46
  allowedAsns?: number[];
43
47
  }
@@ -45,26 +49,26 @@ export interface ParsedIp {
45
49
  version: 4 | 6;
46
50
  bytes: number[];
47
51
  }
48
- /** 解析 IP;`::ffff:a.b.c.d` 視為 IPv4。不合法回 null */
52
+ /** Parses an IP; `::ffff:a.b.c.d` is treated as IPv4. null when invalid */
49
53
  export declare function parseIp(raw: string): ParsedIp | null;
50
54
  export declare function isPublicIp(ip: ParsedIp): boolean;
51
55
  /**
52
- * 主機轉述的訪客 IP:必須是合法的公開位址,否則視為沒帶(回 null)。
53
- * 設錯的反向代理會把 10.x 這類內網位址轉過來,照收的話全站訪客會共用一個限流桶。
56
+ * The visitor IP relayed by the server: it must be a valid public address, otherwise it counts as absent (null).
57
+ * A misconfigured reverse proxy relays internal addresses such as 10.x; accepting them would put every visitor of the site in one rate-limit bucket.
54
58
  */
55
59
  export declare function normalizeVisitorIp(raw: string | null | undefined): string | null;
56
- /** 限流桶的鍵:IPv4 用整個位址,IPv6 用 /64(同一個用戶端通常拿到整段 /64) */
60
+ /** Rate-limit bucket key: the whole address for IPv4, the /64 for IPv6 (one client usually gets a whole /64) */
57
61
  export declare function rateLimitKeyForIp(ip: string): string;
58
62
  export interface ParsedCidr {
59
63
  version: 4 | 6;
60
64
  bytes: number[];
61
65
  bits: number;
62
- /** 正規化後的寫法(網路位址+前綴長度) */
66
+ /** Normalized form (network address and prefix length) */
63
67
  text: string;
64
68
  }
65
69
  /**
66
- * 解析來源限制的一筆 IP 或 CIDR。單一 IP 視為 /32(IPv6 為 /128)。
67
- * 拒收:格式錯、非公開網段、前綴過寬。
70
+ * Parses one IP or CIDR of a source restriction. A single IP is a /32 (/128 for IPv6).
71
+ * Rejected: malformed input, non-public ranges and prefixes that are too wide.
68
72
  */
69
73
  export declare function parseAllowedCidr(raw: string): ParsedCidr | null;
70
74
  export declare function ipInCidr(ip: string, cidr: ParsedCidr): boolean;
@@ -76,9 +80,9 @@ export interface SourcePolicy {
76
80
  }
77
81
  export declare function hasSourcePolicy(policy: SourcePolicy): boolean;
78
82
  /**
79
- * 來源限制判定(比照 Stripe 存取政策):設了哪一類條件,那一類就必須符合;兩類都設就兩類都要符合。
80
- * 比對的是 Cloudflare 給的實際連線 IP 與 ASN,不是主機轉述的訪客 IP。
81
- * 有 ASN 條件但拿不到 ASN(本機開發、邊緣沒帶)時視為不符合。
83
+ * Source restriction check (like Stripe's access policies): whichever kind of condition is set must match; when both are set, both must match.
84
+ * Matched against the actual connecting IP and ASN from Cloudflare, not the visitor IP relayed by the server.
85
+ * With an ASN condition but no ASN available (local development, or the edge did not send it), the check fails.
82
86
  */
83
87
  export declare function isSourceAllowed(policy: SourcePolicy, source: {
84
88
  ip: string | null;
@@ -1,42 +1,50 @@
1
- // 由 `pnpm --filter @kanorio/sdk gen` 從 packages/shared 複製,請勿手改(契約測試鎖兩份相同)。
1
+ // Copied from Kanorio's shared code by `pnpm --filter @kanorio/sdk gen`. Do not edit by hand; a contract test keeps the two copies identical.
2
2
  /**
3
- * 網站主機金鑰(server key)的共用契約:main、public-sites Worker 與 SDK 讀同一份。
3
+ * The shared contract of server keys: Kanorio's server, its edge worker and the SDK read the same file.
4
4
  *
5
- * 主機金鑰是用途為「網站主機用」的服務帳號金鑰(`knr_sa_`)。站主自建前端的伺服器帶著它代訪客寫入
6
- * (送表單、顧客登入、回報爬蟲),邊緣驗過後才採信它宣稱的訪客 IP。它打不開 Management API。
7
- * 設計見 docs/platform/decisions/0002-operation-context.md「修訂一」。
5
+ * A server key is a service account key issued for a website's own server (`knr_sk_`). The server of a self-hosted front end sends it when writing on behalf of a visitor
6
+ * (submitting a form, customer sign-in, reporting crawlers), and the edge trusts the visitor IP it states only after verifying the key. It cannot open the Management API.
7
+ * See the Authentication page of the developer documentation.
8
8
  */
9
- /** 主機帶金鑰的標頭 */
9
+ /** The header the server sends the key in */
10
10
  export const SERVER_KEY_HEADER = "X-Kanorio-Server-Key";
11
- /** 主機轉述的訪客 IP;只在金鑰驗過時採信 */
11
+ /** The visitor IP relayed by the server; trusted only when the key has been verified */
12
12
  export const SERVER_KEY_VISITOR_IP_HEADER = "X-Kanorio-Visitor-IP";
13
13
  /**
14
- * Worker → main:這個請求帶著驗過的主機金鑰(值是金鑰 id)。main 只在它與 Worker 金鑰(X-API-Key)俱全時
15
- * 才採信 `x-kanorio-client-ip` 裡主機轉述的訪客 IP(apps/main/lib/utils/ip-address.ts)。
14
+ * Edge worker to server: this request carries a verified server key (the value is the key id). The server trusts the relayed visitor IP in
15
+ * `x-kanorio-client-ip` only when this header and the worker's own key (X-API-Key) are both present.
16
16
  */
17
17
  export const SERVER_KEY_ID_FORWARD_HEADER = "x-kanorio-server-key-id";
18
18
  /**
19
- * 服務帳號授予與金鑰 scopes 裡的機器專用標記。不在「人的權限目錄」(`ALL_PERMISSIONS`)裡:
20
- * 沒有任何團隊角色持有它、角色編輯器不會出現、PAT 與 OAuth 選不到。建立這種服務帳號只需要 `developer:manage`。
19
+ * Machine-only marker in a service account's grants and its keys' scopes. It is not in the catalog of permissions people can hold:
20
+ * no team role has it, the role editor does not show it, and personal access tokens and OAuth cannot select it. Creating such a service account only needs `developer:manage`.
21
21
  */
22
22
  export const STOREFRONT_SERVER_SCOPE = "storefront:server";
23
- export const SERVER_KEY_PREFIX = "knr_sa_";
24
- /** `knr_sa_` + 43 字元 base64url(32 bytes)。格式不符就不必回源查 */
25
- const SERVER_KEY_PATTERN = /^knr_sa_[A-Za-z0-9_-]{43}$/;
23
+ /**
24
+ * The server key's own prefix: one prefix per credential type (as GitHub and Stripe do), so whoever holds a key, and leak scanners, can tell from the prefix
25
+ * that it cannot open the Management API. Service account keys for managing a site start with `knr_sa_`.
26
+ */
27
+ export const SERVER_KEY_PREFIX = "knr_sk_";
28
+ /**
29
+ * The prefix followed by 43 base64url characters (32 bytes). A malformed key is rejected without a lookup.
30
+ * Server keys have this one prefix only.
31
+ * Keys issued earlier with `knr_sa_` are not accepted and must be created again.
32
+ */
33
+ const SERVER_KEY_PATTERN = /^knr_sk_[A-Za-z0-9_-]{43}$/;
26
34
  export function isServerKeyFormat(raw) {
27
35
  return SERVER_KEY_PATTERN.test(raw);
28
36
  }
29
37
  /**
30
- * 外部視角探針用的假金鑰(格式正確、永遠不存在):監控每輪拿它 POST 一個站,確認假金鑰會被拒。
31
- * 邊緣認得它,照常驗證與拒絕,但不計入該站的「主機金鑰驗證失敗」異常訊號(那是我們自己的探針,不是有人在試)。
38
+ * A fake key for outside-in probes (well-formed and never valid): monitoring POSTs with it to a site every round to confirm that fake keys are refused.
39
+ * The edge recognizes it, verifies and refuses it as usual, but does not count it toward the site's failed-server-key signal (it is Kanorio's own probe, not someone guessing).
32
40
  */
33
41
  export const PROBE_FAKE_SERVER_KEY = `${SERVER_KEY_PREFIX}${"0".repeat(43)}`;
34
42
  export function purposeOfGrant(permissions) {
35
43
  return permissions.includes(STOREFRONT_SERVER_SCOPE) ? "storefront_server" : "management";
36
44
  }
37
- /** 環境變數的慣用名稱(後台的一次性顯示、CLI `--write-env`、文件都用這個) */
45
+ /** Conventional environment variable name (used by the dashboard's one-time display, the CLI's `--write-env` and the documentation) */
38
46
  export const SERVER_KEY_ENV_NAME = "KANORIO_SERVER_KEY";
39
- // ─── IP 工具(Worker 與 main 共用;不依賴 node:net,Workers 也能跑) ───
47
+ // --- IP utilities (shared by the edge worker and the server; no node:net dependency, so they run on Workers) ---
40
48
  function parseIpv4(value) {
41
49
  const parts = value.split(".");
42
50
  if (parts.length !== 4)
@@ -52,7 +60,7 @@ function parseIpv4(value) {
52
60
  }
53
61
  return out;
54
62
  }
55
- /** IPv6 → 16 bytes;支援 `::` 壓縮與結尾的 IPv4(`::ffff:1.2.3.4`)。不收 zone id */
63
+ /** IPv6 to 16 bytes; supports `::` compression and a trailing IPv4 (`::ffff:1.2.3.4`). Zone ids are not accepted */
56
64
  function parseIpv6(value) {
57
65
  if (!value.includes(":") || value.includes("%"))
58
66
  return null;
@@ -94,7 +102,7 @@ function parseIpv6(value) {
94
102
  bytes.splice(12, 4, ...tailV4);
95
103
  return bytes;
96
104
  }
97
- /** 解析 IP;`::ffff:a.b.c.d` 視為 IPv4。不合法回 null */
105
+ /** Parses an IP; `::ffff:a.b.c.d` is treated as IPv4. null when invalid */
98
106
  export function parseIp(raw) {
99
107
  const value = raw.trim();
100
108
  if (!value || value.length > 45)
@@ -121,7 +129,7 @@ function inPrefix(bytes, prefix, bits) {
121
129
  const mask = (0xff << (8 - rest)) & 0xff;
122
130
  return ((bytes[full] ?? 0) & mask) === ((prefix[full] ?? 0) & mask);
123
131
  }
124
- /** 不可路由到公網的位址:私有、loopback、link-local、CGNAT、文件用、多播與保留網段 */
132
+ /** Addresses not routable on the public internet: private, loopback, link-local, CGNAT, documentation, multicast and reserved ranges */
125
133
  const NON_PUBLIC_V4 = [
126
134
  [[0, 0, 0, 0], 8],
127
135
  [[10, 0, 0, 0], 8],
@@ -138,15 +146,15 @@ const NON_PUBLIC_V4 = [
138
146
  [[224, 0, 0, 0], 3],
139
147
  ];
140
148
  const NON_PUBLIC_V6 = [
141
- // ::/127(未指定與 loopback)
149
+ // ::/127 (unspecified and loopback)
142
150
  [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 127],
143
151
  // fc00::/7 unique local
144
152
  [[0xfc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 7],
145
153
  // fe80::/10 link-local
146
154
  [[0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 10],
147
- // ff00::/8 多播
155
+ // ff00::/8 multicast
148
156
  [[0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 8],
149
- // 2001:db8::/32 文件用
157
+ // 2001:db8::/32 documentation
150
158
  [[0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 32],
151
159
  ];
152
160
  export function isPublicIp(ip) {
@@ -162,8 +170,8 @@ function formatIp(ip) {
162
170
  return groups.join(":");
163
171
  }
164
172
  /**
165
- * 主機轉述的訪客 IP:必須是合法的公開位址,否則視為沒帶(回 null)。
166
- * 設錯的反向代理會把 10.x 這類內網位址轉過來,照收的話全站訪客會共用一個限流桶。
173
+ * The visitor IP relayed by the server: it must be a valid public address, otherwise it counts as absent (null).
174
+ * A misconfigured reverse proxy relays internal addresses such as 10.x; accepting them would put every visitor of the site in one rate-limit bucket.
167
175
  */
168
176
  export function normalizeVisitorIp(raw) {
169
177
  if (!raw)
@@ -173,7 +181,7 @@ export function normalizeVisitorIp(raw) {
173
181
  return null;
174
182
  return formatIp(parsed);
175
183
  }
176
- /** 限流桶的鍵:IPv4 用整個位址,IPv6 用 /64(同一個用戶端通常拿到整段 /64) */
184
+ /** Rate-limit bucket key: the whole address for IPv4, the /64 for IPv6 (one client usually gets a whole /64) */
177
185
  export function rateLimitKeyForIp(ip) {
178
186
  const parsed = parseIp(ip);
179
187
  if (!parsed)
@@ -182,11 +190,11 @@ export function rateLimitKeyForIp(ip) {
182
190
  return formatIp(parsed);
183
191
  return `${formatIp({ version: 6, bytes: [...parsed.bytes.slice(0, 8), 0, 0, 0, 0, 0, 0, 0, 0] })}/64`;
184
192
  }
185
- /** 最寬只收到 IPv4 /8、IPv6 /16:再寬就等於沒限制 */
193
+ /** The widest ranges accepted are IPv4 /8 and IPv6 /16: anything wider is no restriction at all */
186
194
  const MIN_PREFIX_BITS = { 4: 8, 6: 16 };
187
195
  /**
188
- * 解析來源限制的一筆 IP 或 CIDR。單一 IP 視為 /32(IPv6 為 /128)。
189
- * 拒收:格式錯、非公開網段、前綴過寬。
196
+ * Parses one IP or CIDR of a source restriction. A single IP is a /32 (/128 for IPv6).
197
+ * Rejected: malformed input, non-public ranges and prefixes that are too wide.
190
198
  */
191
199
  export function parseAllowedCidr(raw) {
192
200
  const value = raw.trim();
@@ -228,9 +236,9 @@ export function hasSourcePolicy(policy) {
228
236
  return policy.allowedCidrs.length > 0 || policy.allowedAsns.length > 0;
229
237
  }
230
238
  /**
231
- * 來源限制判定(比照 Stripe 存取政策):設了哪一類條件,那一類就必須符合;兩類都設就兩類都要符合。
232
- * 比對的是 Cloudflare 給的實際連線 IP 與 ASN,不是主機轉述的訪客 IP。
233
- * 有 ASN 條件但拿不到 ASN(本機開發、邊緣沒帶)時視為不符合。
239
+ * Source restriction check (like Stripe's access policies): whichever kind of condition is set must match; when both are set, both must match.
240
+ * Matched against the actual connecting IP and ASN from Cloudflare, not the visitor IP relayed by the server.
241
+ * With an ASN condition but no ASN available (local development, or the edge did not send it), the check fails.
234
242
  */
235
243
  export function isSourceAllowed(policy, source) {
236
244
  if (policy.allowedCidrs.length > 0) {
@@ -1,14 +1,14 @@
1
1
  import type { RegistryAttributionWire } from "./types.js";
2
- /** 登記資料的來源(是哪個登記,不是從哪條路徑取得) */
2
+ /** The source of registry data (which registry it is, not the route it was fetched through) */
3
3
  export type RegistrySource = "fia_tax_registration" | "gcis_company";
4
4
  /**
5
- * 政府開放資料的來源標示。授權條件(政府資料開放授權條款-第 1 版)要求使用時標示提供機關,
6
- * 所以回應、自動帶入的畫面與文件都要帶這一份。
5
+ * Attribution for government open data. The license (Taiwan's Open Government Data License, version 1) requires naming the providing agency on use,
6
+ * so responses, prefilled screens and documentation all carry this.
7
7
  */
8
8
  export declare const REGISTRY_ATTRIBUTION: Record<RegistrySource, RegistryAttributionWire>;
9
9
  export declare function registryAttribution(source: RegistrySource, dataDate?: string): RegistryAttributionWire;
10
10
  /**
11
- * 顯示來源標示時用哪個機關名稱:中文介面用原文,其餘語系用英文名稱。
12
- * 結帳、顧客中心、表單與後台都用這一份,不各自判斷語系。
11
+ * Which agency name to show in the attribution: the original name in Chinese interfaces, the English name in every other locale.
12
+ * Checkout, the customer account, forms and the dashboard all use this instead of deciding by locale themselves.
13
13
  */
14
14
  export declare function registryProviderName(attribution: Pick<RegistryAttributionWire, "provider" | "providerEn">, locale: string | null | undefined): string;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * 政府開放資料的來源標示。授權條件(政府資料開放授權條款-第 1 版)要求使用時標示提供機關,
3
- * 所以回應、自動帶入的畫面與文件都要帶這一份。
2
+ * Attribution for government open data. The license (Taiwan's Open Government Data License, version 1) requires naming the providing agency on use,
3
+ * so responses, prefilled screens and documentation all carry this.
4
4
  */
5
5
  export const REGISTRY_ATTRIBUTION = {
6
6
  fia_tax_registration: {
@@ -20,8 +20,8 @@ export function registryAttribution(source, dataDate) {
20
20
  return dataDate ? { ...REGISTRY_ATTRIBUTION[source], dataDate } : REGISTRY_ATTRIBUTION[source];
21
21
  }
22
22
  /**
23
- * 顯示來源標示時用哪個機關名稱:中文介面用原文,其餘語系用英文名稱。
24
- * 結帳、顧客中心、表單與後台都用這一份,不各自判斷語系。
23
+ * Which agency name to show in the attribution: the original name in Chinese interfaces, the English name in every other locale.
24
+ * Checkout, the customer account, forms and the dashboard all use this instead of deciding by locale themselves.
25
25
  */
26
26
  export function registryProviderName(attribution, locale) {
27
27
  return locale?.toLowerCase().startsWith("zh") ? attribution.provider : attribution.providerEn;
@@ -1,3 +1,3 @@
1
1
  import type { TaxIdFormatDefinition } from "./types.js";
2
- /** 宣告一個稅號格式。只做型別收斂;登錄在 registry.ts */
2
+ /** Declares a tax ID format. It only narrows types; formats are registered in registry.ts */
3
3
  export declare function defineTaxIdFormat(definition: TaxIdFormatDefinition): TaxIdFormatDefinition;
@@ -1,4 +1,4 @@
1
- /** 宣告一個稅號格式。只做型別收斂;登錄在 registry.ts */
1
+ /** Declares a tax ID format. It only narrows types; formats are registered in registry.ts */
2
2
  export function defineTaxIdFormat(definition) {
3
3
  return definition;
4
4
  }
@@ -1,10 +1,10 @@
1
- // 由 `pnpm --filter @kanorio/sdk gen` 從 packages/shared 複製,請勿手改(契約測試鎖兩份相同)。
1
+ // Copied from Kanorio's shared code by `pnpm --filter @kanorio/sdk gen`. Do not edit by hand; a contract test keeps the two copies identical.
2
2
  import { defineTaxIdFormat } from "../define.js";
3
3
  import { stripSeparators } from "../normalize.js";
4
4
  /**
5
- * 歐盟 VAT 識別號:會員國前綴+各國格式。希臘的前綴是 EL(國碼是 GR)。
6
- * 各國格式依歐盟 VIES 的公開說明整理,尚未逐國對照官方文件核實,所以只警示、不擋;
7
- * 各國的檢查碼也還沒做。使用者只打號碼沒打前綴時補上前綴。
5
+ * EU VAT identification number: a member state prefix plus that country's format. Greece's prefix is EL (its country code is GR).
6
+ * The country formats follow the EU's public VIES notes and are not verified against each country's official documentation yet, so this only warns and never blocks;
7
+ * the countries' check digits are not implemented either. When the user types only the number, the prefix is added.
8
8
  */
9
9
  const EU_VAT = {
10
10
  AT: { prefix: "AT", pattern: /^ATU\d{8}$/, example: "ATU12345678" },
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 香港商業登記號碼:8 碼數字(2023-12 起同時是「唯一業務識別碼」的號碼部分)。
3
- * 商業登記證上的完整號碼是「8 碼-分行 3 碼-…」,貼上整串時只取前 8 碼。官方沒有公開檢查碼。
2
+ * Hong Kong Business Registration number: 8 digits (since December 2023 also the number part of the Unique Business Identifier).
3
+ * The full number on a Business Registration Certificate is "8 digits - 3-digit branch - ...", so only the first 8 digits are taken from a pasted full number. No check digit is published.
4
4
  */
5
5
  export declare const hkBr: import("../types.js").TaxIdFormatDefinition;
@@ -1,9 +1,9 @@
1
- // 由 `pnpm --filter @kanorio/sdk gen` 從 packages/shared 複製,請勿手改(契約測試鎖兩份相同)。
1
+ // Copied from Kanorio's shared code by `pnpm --filter @kanorio/sdk gen`. Do not edit by hand; a contract test keeps the two copies identical.
2
2
  import { defineTaxIdFormat } from "../define.js";
3
3
  import { stripSeparators } from "../normalize.js";
4
4
  /**
5
- * 香港商業登記號碼:8 碼數字(2023-12 起同時是「唯一業務識別碼」的號碼部分)。
6
- * 商業登記證上的完整號碼是「8 碼-分行 3 碼-…」,貼上整串時只取前 8 碼。官方沒有公開檢查碼。
5
+ * Hong Kong Business Registration number: 8 digits (since December 2023 also the number part of the Unique Business Identifier).
6
+ * The full number on a Business Registration Certificate is "8 digits - 3-digit branch - ...", so only the first 8 digits are taken from a pasted full number. No check digit is published.
7
7
  */
8
8
  export const hkBr = defineTaxIdFormat({
9
9
  type: "hk_br",
@@ -11,7 +11,7 @@ export const hkBr = defineTaxIdFormat({
11
11
  stripeType: "hk_br",
12
12
  normalize: (cleaned) => {
13
13
  const digits = stripSeparators(cleaned);
14
- // 完整的登記證號碼:8 碼+分行 3 碼+年月等,共 16 碼
14
+ // The full certificate number: 8 digits, a 3-digit branch, year and month and so on, 16 digits in total
15
15
  return /^\d{16}$/.test(digits) && /\D/.test(cleaned) ? digits.slice(0, 8) : digits;
16
16
  },
17
17
  validate: (normalized) => (/^\d{8}$/.test(normalized) ? null : "FORMAT"),
@@ -1,6 +1,6 @@
1
1
  /**
2
- * 日本適格請求書發行事業者登錄番號:「T」+13 碼數字(國稅廳)。
3
- * 法人是 T+法人番號(有檢查碼);個人事業者是另外配發的 13 碼,官方沒有說明它是否滿足法人番號的檢查碼,
4
- * 所以這裡只驗格式,不驗檢查碼。只打 13 碼數字時補上 T。
2
+ * Japan's Qualified Invoice Issuer registration number: "T" plus 13 digits (National Tax Agency).
3
+ * A corporation's is T plus its Corporate Number (which has a check digit); a sole proprietor's is a separately assigned 13 digits, and the authority does not say whether it satisfies the Corporate Number check digit,
4
+ * so only the format is validated here, not a check digit. When only 13 digits are typed, the T is added.
5
5
  */
6
6
  export declare const jpTrn: import("../types.js").TaxIdFormatDefinition;
@@ -1,10 +1,10 @@
1
- // 由 `pnpm --filter @kanorio/sdk gen` 從 packages/shared 複製,請勿手改(契約測試鎖兩份相同)。
1
+ // Copied from Kanorio's shared code by `pnpm --filter @kanorio/sdk gen`. Do not edit by hand; a contract test keeps the two copies identical.
2
2
  import { defineTaxIdFormat } from "../define.js";
3
3
  import { stripSeparators } from "../normalize.js";
4
4
  /**
5
- * 日本適格請求書發行事業者登錄番號:「T」+13 碼數字(國稅廳)。
6
- * 法人是 T+法人番號(有檢查碼);個人事業者是另外配發的 13 碼,官方沒有說明它是否滿足法人番號的檢查碼,
7
- * 所以這裡只驗格式,不驗檢查碼。只打 13 碼數字時補上 T。
5
+ * Japan's Qualified Invoice Issuer registration number: "T" plus 13 digits (National Tax Agency).
6
+ * A corporation's is T plus its Corporate Number (which has a check digit); a sole proprietor's is a separately assigned 13 digits, and the authority does not say whether it satisfies the Corporate Number check digit,
7
+ * so only the format is validated here, not a check digit. When only 13 digits are typed, the T is added.
8
8
  */
9
9
  export const jpTrn = defineTaxIdFormat({
10
10
  type: "jp_trn",
@@ -1,6 +1,6 @@
1
1
  /**
2
- * 韓國事業者登錄番號:10 碼數字(常寫成 XXX-XX-XXXXX)+檢查碼。
3
- * 前 9 碼乘上權重 [1,3,7,1,3,7,1,3,5] 加總,再加上「第 9 碼 × 5」的十位數;(10 − 總和 % 10) % 10 要等於第 10 碼。
2
+ * South Korea's Business Registration Number: 10 digits (often written XXX-XX-XXXXX) with a check digit.
3
+ * The first 9 digits are multiplied by the weights [1,3,7,1,3,7,1,3,5] and summed, plus the tens digit of "9th digit x 5"; (10 - sum % 10) % 10 must equal the 10th digit.
4
4
  */
5
5
  export declare function isValidKrBrn(normalized: string): boolean;
6
6
  export declare const krBrn: import("../types.js").TaxIdFormatDefinition;
@@ -1,10 +1,10 @@
1
- // 由 `pnpm --filter @kanorio/sdk gen` 從 packages/shared 複製,請勿手改(契約測試鎖兩份相同)。
1
+ // Copied from Kanorio's shared code by `pnpm --filter @kanorio/sdk gen`. Do not edit by hand; a contract test keeps the two copies identical.
2
2
  import { defineTaxIdFormat } from "../define.js";
3
3
  import { stripSeparators } from "../normalize.js";
4
4
  const WEIGHTS = [1, 3, 7, 1, 3, 7, 1, 3, 5];
5
5
  /**
6
- * 韓國事業者登錄番號:10 碼數字(常寫成 XXX-XX-XXXXX)+檢查碼。
7
- * 前 9 碼乘上權重 [1,3,7,1,3,7,1,3,5] 加總,再加上「第 9 碼 × 5」的十位數;(10 − 總和 % 10) % 10 要等於第 10 碼。
6
+ * South Korea's Business Registration Number: 10 digits (often written XXX-XX-XXXXX) with a check digit.
7
+ * The first 9 digits are multiplied by the weights [1,3,7,1,3,7,1,3,5] and summed, plus the tens digit of "9th digit x 5"; (10 - sum % 10) % 10 must equal the 10th digit.
8
8
  */
9
9
  export function isValidKrBrn(normalized) {
10
10
  if (!/^\d{10}$/.test(normalized))
@@ -1,7 +1,7 @@
1
1
  /**
2
- * 馬來西亞稅號。兩種都依公開範例整理、尚未對照 LHDN 與關稅局的官方文件核實,只警示不擋。
3
- * - my_itn:所得稅號(TIN),類別字母 1–2 碼+數字(如 C 1234567890);電子發票(MyInvois)用的就是它
4
- * - my_sst:銷售與服務稅登記號(如 A12-3456-78912345)
2
+ * Malaysian tax IDs. Both follow public examples and are not verified against the official documentation of LHDN and Customs yet, so they only warn and never block.
3
+ * - my_itn: income tax number (TIN), a 1 to 2 letter category plus digits (for example C 1234567890); this is the one e-invoicing (MyInvois) uses
4
+ * - my_sst: Sales and Service Tax registration number (for example A12-3456-78912345)
5
5
  */
6
6
  export declare const myItn: import("../types.js").TaxIdFormatDefinition;
7
7
  export declare const mySst: import("../types.js").TaxIdFormatDefinition;
@@ -1,10 +1,10 @@
1
- // 由 `pnpm --filter @kanorio/sdk gen` 從 packages/shared 複製,請勿手改(契約測試鎖兩份相同)。
1
+ // Copied from Kanorio's shared code by `pnpm --filter @kanorio/sdk gen`. Do not edit by hand; a contract test keeps the two copies identical.
2
2
  import { defineTaxIdFormat } from "../define.js";
3
3
  import { stripSeparators } from "../normalize.js";
4
4
  /**
5
- * 馬來西亞稅號。兩種都依公開範例整理、尚未對照 LHDN 與關稅局的官方文件核實,只警示不擋。
6
- * - my_itn:所得稅號(TIN),類別字母 1–2 碼+數字(如 C 1234567890);電子發票(MyInvois)用的就是它
7
- * - my_sst:銷售與服務稅登記號(如 A12-3456-78912345)
5
+ * Malaysian tax IDs. Both follow public examples and are not verified against the official documentation of LHDN and Customs yet, so they only warn and never block.
6
+ * - my_itn: income tax number (TIN), a 1 to 2 letter category plus digits (for example C 1234567890); this is the one e-invoicing (MyInvois) uses
7
+ * - my_sst: Sales and Service Tax registration number (for example A12-3456-78912345)
8
8
  */
9
9
  export const myItn = defineTaxIdFormat({
10
10
  type: "my_itn",
@@ -1,10 +1,10 @@
1
- // 由 `pnpm --filter @kanorio/sdk gen` 從 packages/shared 複製,請勿手改(契約測試鎖兩份相同)。
1
+ // Copied from Kanorio's shared code by `pnpm --filter @kanorio/sdk gen`. Do not edit by hand; a contract test keeps the two copies identical.
2
2
  import { defineTaxIdFormat } from "../define.js";
3
3
  import { stripSeparators } from "../normalize.js";
4
4
  /**
5
- * 新加坡 UEN:三種格式——商號(8 碼數字+字母)、本地公司(西元年 4 碼+5 碼數字+字母)、
6
- * 其他實體(T/S/R+年 2 碼+類別 2 字母+4 碼數字+字母)。
7
- * 結尾的檢查字母演算法官方沒有公開,這裡只驗格式;格式依 ACRA 的公開說明整理、尚未逐條核實,只警示不擋。
5
+ * Singapore UEN, in three formats: businesses (8 digits plus a letter), local companies (a 4-digit year, 5 digits and a letter)
6
+ * and other entities (T, S or R, a 2-digit year, a 2-letter category, 4 digits and a letter).
7
+ * The algorithm of the trailing check letter is not published, so only the format is validated; the formats follow ACRA's public notes and are not verified line by line yet, so this only warns and never blocks.
8
8
  */
9
9
  const SG_UEN = [/^\d{8}[A-Z]$/, /^(18|19|20)\d{2}\d{5}[A-Z]$/, /^[TSR]\d{2}[A-Z]{2}\d{4}[A-Z]$/];
10
10
  export const sgUen = defineTaxIdFormat({
@@ -1,10 +1,10 @@
1
1
  /**
2
- * 台灣統一編號:8 碼數字+檢查碼(財政部 112 年 4 月新制)。
2
+ * Taiwan's Unified Business Number: 8 digits including a check digit (the Ministry of Finance's rule revised in April 2023).
3
3
  *
4
- * 各位數乘上權重 [1,2,1,2,1,2,4,1],乘積為兩位數時取十位+個位,加總後能被 5 整除即有效
5
- * (舊制是被 10 整除;財政部為擴增號碼空間放寬,新制配發的 04595252、10458570、62176616 在舊制會被誤判)。
6
- * 例外:第 7 碼是 7 時(乘積 28 可視為 10 或 1),總和加 1 能被 5 整除也有效。
7
- * 來源:財政部財政資訊中心「營利事業統一編號檢查碼邏輯修正說明」。
4
+ * Each digit is multiplied by the weights [1,2,1,2,1,2,4,1]; a two-digit product contributes its tens digit plus its ones digit, and the number is valid when the sum is divisible by 5
5
+ * (the old rule required divisibility by 10; the ministry relaxed it to enlarge the number space, and 04595252, 10458570 and 62176616, issued under the new rule, would be misjudged by the old one).
6
+ * Exception: when the 7th digit is 7 (the product 28 can count as 10 or 1), the number is also valid when the sum plus 1 is divisible by 5.
7
+ * Source: the Fiscal Information Agency (Ministry of Finance, Taiwan), notice on the revised check digit logic for the Unified Business Number.
8
8
  */
9
9
  export declare function isValidTwVat(normalized: string): boolean;
10
10
  export declare const twVat: import("../types.js").TaxIdFormatDefinition;
@@ -1,15 +1,15 @@
1
- // 由 `pnpm --filter @kanorio/sdk gen` 從 packages/shared 複製,請勿手改(契約測試鎖兩份相同)。
1
+ // Copied from Kanorio's shared code by `pnpm --filter @kanorio/sdk gen`. Do not edit by hand; a contract test keeps the two copies identical.
2
2
  import { defineTaxIdFormat } from "../define.js";
3
3
  import { stripSeparators } from "../normalize.js";
4
4
  const WEIGHTS = [1, 2, 1, 2, 1, 2, 4, 1];
5
5
  const sumOfDigits = (n) => (n < 10 ? n : Math.floor(n / 10) + (n % 10));
6
6
  /**
7
- * 台灣統一編號:8 碼數字+檢查碼(財政部 112 年 4 月新制)。
7
+ * Taiwan's Unified Business Number: 8 digits including a check digit (the Ministry of Finance's rule revised in April 2023).
8
8
  *
9
- * 各位數乘上權重 [1,2,1,2,1,2,4,1],乘積為兩位數時取十位+個位,加總後能被 5 整除即有效
10
- * (舊制是被 10 整除;財政部為擴增號碼空間放寬,新制配發的 04595252、10458570、62176616 在舊制會被誤判)。
11
- * 例外:第 7 碼是 7 時(乘積 28 可視為 10 或 1),總和加 1 能被 5 整除也有效。
12
- * 來源:財政部財政資訊中心「營利事業統一編號檢查碼邏輯修正說明」。
9
+ * Each digit is multiplied by the weights [1,2,1,2,1,2,4,1]; a two-digit product contributes its tens digit plus its ones digit, and the number is valid when the sum is divisible by 5
10
+ * (the old rule required divisibility by 10; the ministry relaxed it to enlarge the number space, and 04595252, 10458570 and 62176616, issued under the new rule, would be misjudged by the old one).
11
+ * Exception: when the 7th digit is 7 (the product 28 can count as 10 or 1), the number is also valid when the sum plus 1 is divisible by 5.
12
+ * Source: the Fiscal Information Agency (Ministry of Finance, Taiwan), notice on the revised check digit logic for the Unified Business Number.
13
13
  */
14
14
  export function isValidTwVat(normalized) {
15
15
  if (!/^\d{8}$/.test(normalized))
@@ -1,4 +1,4 @@
1
- // 由 `pnpm --filter @kanorio/sdk gen` 從 packages/shared 複製,請勿手改(契約測試鎖兩份相同)。
1
+ // Copied from Kanorio's shared code by `pnpm --filter @kanorio/sdk gen`. Do not edit by hand; a contract test keeps the two copies identical.
2
2
  export * from "./types.js";
3
3
  export * from "./define.js";
4
4
  export * from "./normalize.js";
@@ -1,8 +1,8 @@
1
1
  /**
2
- * 稅號登記查詢的回應形狀(綁定情境的查詢端點 → 前台的稅號輸入元件)。零依賴,資料夾內只用相對 import。
2
+ * Response shape of a tax ID registry lookup (from the context-bound lookup endpoint to the storefront's tax ID input). No dependencies; only relative imports inside this folder.
3
3
  *
4
- * 這個查詢只用來「自動帶入名稱」與「標示」,任何結果都不能拿來擋送出:
5
- * `NOT_FOUND` 只代表公開資料裡沒查到,不代表稅號無效。
4
+ * The lookup is only for prefilling the name and labeling; no result may ever block a submit:
5
+ * `NOT_FOUND` only means the public data has no match, not that the tax ID is invalid.
6
6
  */
7
7
  import type { RegistryAttributionWire, TaxIdType } from "./types.js";
8
8
  export type TaxIdLookupStatus = "VERIFIED" | "NOT_FOUND" | "VALID_FORMAT" | "UNAVAILABLE";
@@ -11,21 +11,21 @@ export interface TaxIdLookupWire {
11
11
  status: TaxIdLookupStatus;
12
12
  country: string;
13
13
  type: TaxIdType;
14
- /** 正規化後的稅號 */
14
+ /** The normalized tax ID */
15
15
  normalized: string;
16
- /** `VERIFIED` 時才有 */
16
+ /** Present only when `VERIFIED` */
17
17
  registry?: {
18
18
  name: string;
19
19
  address?: string;
20
- /** ACTIVE/SUSPENDED/CLOSED/UNKNOWN(來源沒給就是 UNKNOWN,不要當成營業中) */
20
+ /** ACTIVE, SUSPENDED, CLOSED or UNKNOWN (UNKNOWN when the source does not say; do not treat it as active) */
21
21
  registryStatus: string;
22
- /** 名稱含造字、多數字型顯示成方框:不要自動帶入,讓對方自己填 */
22
+ /** The name contains custom characters most fonts show as boxes: do not prefill it, let the person type it */
23
23
  nameHasPrivateUse?: boolean;
24
24
  };
25
- /** 用到政府開放資料時必須一併顯示的來源標示 */
25
+ /** The attribution that must be shown whenever government open data is used */
26
26
  attribution?: RegistryAttributionWire;
27
27
  }
28
- /** 查不了(情境不符、被限流、格式不對);前台一律當成「沒有可帶入的資料」,不顯示錯誤 */
28
+ /** The lookup could not run (wrong context, rate limited, bad format); the storefront always treats it as nothing to prefill and shows no error */
29
29
  export interface TaxIdLookupUnavailableWire {
30
30
  ok: false;
31
31
  reason: "invalid_tax_id" | "unavailable" | "rate_limited";
@@ -1,8 +1,8 @@
1
- // 由 `pnpm --filter @kanorio/sdk gen` 從 packages/shared 複製,請勿手改(契約測試鎖兩份相同)。
1
+ // Copied from Kanorio's shared code by `pnpm --filter @kanorio/sdk gen`. Do not edit by hand; a contract test keeps the two copies identical.
2
2
  /**
3
- * 稅號登記查詢的回應形狀(綁定情境的查詢端點 → 前台的稅號輸入元件)。零依賴,資料夾內只用相對 import。
3
+ * Response shape of a tax ID registry lookup (from the context-bound lookup endpoint to the storefront's tax ID input). No dependencies; only relative imports inside this folder.
4
4
  *
5
- * 這個查詢只用來「自動帶入名稱」與「標示」,任何結果都不能拿來擋送出:
6
- * `NOT_FOUND` 只代表公開資料裡沒查到,不代表稅號無效。
5
+ * The lookup is only for prefilling the name and labeling; no result may ever block a submit:
6
+ * `NOT_FOUND` only means the public data has no match, not that the tax ID is invalid.
7
7
  */
8
8
  export {};