@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,40 +1,73 @@
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
- * 網址轉址「比對 + 迴圈偵測」的單一真實來源(跨 app 契約)。
3
+ * The single source of truth for URL redirect matching and loop detection (a contract across apps).
4
4
  *
5
- * - public-sites middleware 於 runtime 用 `matchRedirect` 執行實際轉址。
6
- * - apps/main 於存檔前用 `isSelfLoop` / `findRedirectLoopKeys` / `hasRedirectChainLoop`
7
- * 模擬同一套比對來偵測迴圈。
5
+ * - The hosted-site middleware uses `matchRedirect` at runtime to perform redirects.
6
+ * - Before saving, the server uses `isSelfLoop`, `findRedirectLoopKeys` and `hasRedirectChainLoop`
7
+ * to simulate the same matching and detect loops.
8
8
  *
9
- * 兩者共用此模組,比對語意(精確優先 → 最長 wildcard prefix → 相對/wildcard 目標解析)
10
- * 永遠一致,不會 drift。純字串函式,無 React / node 依賴,可於 edge runtime 安全打包。
9
+ * Both use this module, so the matching rules (exact first, then the longest wildcard prefix, then resolving relative and wildcard targets)
10
+ * never drift apart. Pure string functions with no React or Node dependency, safe to bundle for an edge runtime.
11
11
  */
12
- /** 迴圈模擬時 wildcard 來源的代表子路徑(僅內部使用,避免與真實路徑碰撞)。 */
12
+ /** Representative sub-path of a wildcard source during loop simulation (internal only, chosen not to collide with real paths). */
13
13
  const LOOP_PROBE = "__kanorio_loop_probe__";
14
14
  /**
15
- * 迴圈偵測的全域步數預算:正常輸入遠低於此值。
16
- * 僅在病態輸入(大量 wildcard 規則)時觸發,避免存檔動作耗時過久;
17
- * 超出後停止偵測,殘餘由 middleware runtime 保險與瀏覽器 ERR_TOO_MANY_REDIRECTS 兜底。
15
+ * Global step budget for loop detection: normal input stays far below it.
16
+ * It only triggers on pathological input (very many wildcard rules), to keep a save from taking too long;
17
+ * past it detection stops, and the rest is covered by the middleware's runtime guard and the browser's ERR_TOO_MANY_REDIRECTS.
18
18
  */
19
19
  const MAX_TOTAL_STEPS = 200_000;
20
+ /** Paths that need no encoding: unreserved characters and the separators allowed in a path (most rules take this route and skip parsing) */
21
+ const PLAIN_PATH_PATTERN = /^[A-Za-z0-9\-._~/*!$&'()+,;=:@]*$/;
22
+ /** Cache of canonical forms: within one isolate the rule strings are the same on every request; cleared entirely past the limit */
23
+ const _canonicalPathCache = new Map();
24
+ const CANONICAL_PATH_CACHE_MAX = 5000;
20
25
  /**
21
- * 依比對規則解析單一路徑:精確比對優先,否則最長 wildcard prefix(`sourcePath` 結尾 `/*`)。
22
- * 目標結尾 `/*` 時保留剩餘子路徑;否則全部導向同一目標。
23
- * 回傳命中的規則、解析後目標字串(可為站內相對路徑或完整外部網址)與狀態碼;無匹配回傳 null。
26
+ * Paths are matched in canonical form: the percent-encoding browsers actually send, with escape codes in uppercase; query and fragment are not part of the path.
27
+ *
28
+ * A visitor's pathname arrives encoded (`/%E7%94%A2%E5%93%81.pdf`), while the source an owner typed may be raw characters
29
+ * or an encoded string pasted from the address bar (in either case). Compared as plain strings, a rule written in raw characters would never match.
30
+ * Both sides go through this function before comparing; it parses with the WHATWG URL, so the result agrees with browsers and `NextRequest.nextUrl.pathname`.
31
+ */
32
+ export function canonicalRedirectPath(path) {
33
+ if (!path.startsWith("/") || PLAIN_PATH_PATTERN.test(path))
34
+ return path;
35
+ const cached = _canonicalPathCache.get(path);
36
+ if (cached !== undefined)
37
+ return cached;
38
+ let encoded = path;
39
+ try {
40
+ encoded = new URL(`http://x${path}`).pathname;
41
+ }
42
+ catch {
43
+ // Cannot be parsed (an unpaired surrogate, for example): left as is, which means it never matches
44
+ }
45
+ const canonical = encoded.replace(/%[0-9a-f]{2}/gi, (escape) => escape.toUpperCase());
46
+ if (_canonicalPathCache.size >= CANONICAL_PATH_CACHE_MAX)
47
+ _canonicalPathCache.clear();
48
+ _canonicalPathCache.set(path, canonical);
49
+ return canonical;
50
+ }
51
+ /**
52
+ * Resolves one path by the matching rules: exact match first, otherwise the longest wildcard prefix (a `sourcePath` ending in `/*`).
53
+ * A target ending in `/*` keeps the remaining sub-path; otherwise everything goes to the same target.
54
+ * Returns the matched rule, the resolved target (an in-site relative path or a full external URL) and the status code; null without a match.
55
+ * Path and source are both compared in the canonical form of `canonicalRedirectPath` (raw and percent-encoded are the same path).
24
56
  */
25
57
  export function matchRedirect(pathname, rules) {
26
- // 1. 精確比對 pathname(大小寫敏感,符合 URL 標準)
27
- const exact = rules.find((rule) => rule.sourcePath === pathname);
58
+ const requested = canonicalRedirectPath(pathname);
59
+ // 1. Exact pathname match (case-sensitive, per the URL standard)
60
+ const exact = rules.find((rule) => canonicalRedirectPath(rule.sourcePath) === requested);
28
61
  if (exact) {
29
62
  return { rule: exact, target: exact.targetUrl, statusCode: exact.statusCode ?? 301 };
30
63
  }
31
- // 2. wildcard prefix match(longest prefix wins)
64
+ // 2. Wildcard prefix match (the longest prefix wins)
32
65
  let best = null;
33
66
  for (const rule of rules) {
34
67
  if (!rule.sourcePath.endsWith("/*"))
35
68
  continue;
36
- const prefix = rule.sourcePath.slice(0, -1); // "/blog/*" → "/blog/"
37
- if (pathname.startsWith(prefix)) {
69
+ const prefix = canonicalRedirectPath(rule.sourcePath).slice(0, -1); // "/blog/*" → "/blog/"
70
+ if (requested.startsWith(prefix)) {
38
71
  if (!best || prefix.length > best.prefix.length) {
39
72
  best = { prefix, rule };
40
73
  }
@@ -42,15 +75,15 @@ export function matchRedirect(pathname, rules) {
42
75
  }
43
76
  if (!best)
44
77
  return null;
45
- const suffix = pathname.slice(best.prefix.length); // 剩餘子路徑
78
+ const suffix = requested.slice(best.prefix.length); // the remaining sub-path (already encoded, still a valid URL once appended to the target)
46
79
  const target = best.rule.targetUrl.endsWith("/*")
47
80
  ? best.rule.targetUrl.slice(0, -1) + suffix
48
81
  : best.rule.targetUrl;
49
82
  return { rule: best.rule, target, statusCode: best.rule.statusCode ?? 301 };
50
83
  }
51
84
  /**
52
- * 多語網站的轉址比對(ADR-0010 決策 18):先比帶語系的規則(完整路徑、目標原樣),再比共用規則(無前綴路徑)。
53
- * `scoped` 為 true 時目標已含語系前綴;false 時呼叫端把站內目標接回請求語系的前綴(與既有行為相同)。
85
+ * Redirect matching on multilingual sites: locale-specific rules first (full path, target as is), then shared rules (unprefixed path).
86
+ * When `scoped` is true the target already includes the locale prefix; when false the caller adds the request locale's prefix to in-site targets (the existing behavior).
54
87
  */
55
88
  export function matchLocalizedRedirect(fullPathname, localePathname, rules) {
56
89
  const scopedRules = rules.filter((rule) => rule.locale);
@@ -63,17 +96,17 @@ export function matchLocalizedRedirect(fullPathname, localePathname, rules) {
63
96
  const hit = matchRedirect(localePathname, shared);
64
97
  return hit ? { ...hit, scoped: false } : null;
65
98
  }
66
- /** strip 結尾斜線(保留根 "/"),供自我轉址比對。 */
99
+ /** Strips the trailing slash (keeping the root "/"), for self-redirect comparison. */
67
100
  export function stripTrailingSlash(value) {
68
101
  return value.length > 1 && value.endsWith("/") ? value.slice(0, -1) : value;
69
102
  }
70
- /** 精確自我轉址(/foo 與 /foo/ 視為相同)。 */
103
+ /** Exact self-redirect (/foo and /foo/ are the same). */
71
104
  export function isExactSelf(source, target) {
72
105
  return stripTrailingSlash(source) === stripTrailingSlash(target);
73
106
  }
74
107
  /**
75
- * wildcard 來源,且站內相對目標落在來源涵蓋範圍內(例如 "/*" → "/"、"/blog/*" → "/blog/x")。
76
- * 範圍外目標("/blog/*" → "/about")與外部網址不算。
108
+ * A wildcard source whose in-site relative target falls inside what the source covers ("/*" to "/", "/blog/*" to "/blog/x").
109
+ * Targets outside it ("/blog/*" to "/about") and external URLs do not count.
77
110
  */
78
111
  export function isScopeLoop(source, target) {
79
112
  if (!source.endsWith("/*") || !target.startsWith("/"))
@@ -82,18 +115,18 @@ export function isScopeLoop(source, target) {
82
115
  const targetBase = target.endsWith("/*") ? target.slice(0, -1) : target;
83
116
  return targetBase.startsWith(srcPrefix);
84
117
  }
85
- /** 單條規則是否自我迴圈(精確自我轉址或 wildcard 自我涵蓋)。 */
118
+ /** Whether a single rule loops on itself (an exact self-redirect or a wildcard covering its own target). */
86
119
  export function isSelfLoop(source, target) {
87
120
  return isExactSelf(source, target) || isScopeLoop(source, target);
88
121
  }
89
122
  /**
90
- * 找出參與跨規則轉址迴圈(例如 /a → /b 且 /b → /a)的規則 key。
123
+ * Finds the keys of rules that take part in a redirect loop across rules (for example /a to /b and /b to /a).
91
124
  *
92
- * 從每條規則的代表路徑出發,重複套用 `matchRedirect` 逐跳解析,以 visited-set 偵測 cycle。
93
- * 單條自我迴圈應由呼叫端以 `isSelfLoop` 先行處理,這裡專注多條互指。
125
+ * Starting from each rule's representative path, it applies `matchRedirect` hop by hop and detects a cycle with a visited set.
126
+ * Single-rule self-loops should be handled first by the caller with `isSelfLoop`; this focuses on rules pointing at each other.
94
127
  *
95
- * 精確化:`maxHops = 規則數 + 1`。在此 functional 結構下,非循環走訪最多經過「規則數」個
96
- * 不同狀態即終止,故 `規則數 + 1` 為精確上限、零誤判;成長型鏈(永不終止)會在超過上限時被判為迴圈。
128
+ * Precision: `maxHops = number of rules + 1`. In this functional structure an acyclic walk ends after visiting at most as many
129
+ * distinct states as there are rules, so `number of rules + 1` is an exact bound with no false positives; a growing chain (never ending) is judged a loop once it exceeds the bound.
97
130
  */
98
131
  export function findRedirectLoopKeys(rules) {
99
132
  const loopKeys = new Set();
@@ -101,7 +134,7 @@ export function findRedirectLoopKeys(rules) {
101
134
  let budget = MAX_TOTAL_STEPS;
102
135
  for (const start of rules) {
103
136
  if (budget <= 0)
104
- break; // 病態輸入:耗盡預算,停止偵測(交由 runtime 保險兜底)
137
+ break; // pathological input: the budget is spent, stop detecting (the runtime guard covers the rest)
105
138
  const sample = start.sourcePath.endsWith("/*")
106
139
  ? start.sourcePath.slice(0, -1) + LOOP_PROBE
107
140
  : start.sourcePath;
@@ -110,20 +143,20 @@ export function findRedirectLoopKeys(rules) {
110
143
  let cur = sample;
111
144
  for (let i = 0; i < maxHops; i++) {
112
145
  if (budget-- <= 0 || cur === null) {
113
- cur = null; // 預算耗盡,保守視為終止(不誤判為迴圈)
146
+ cur = null; // budget spent: conservatively treated as ended (not misjudged as a loop)
114
147
  break;
115
148
  }
116
- // 明確標註型別:cur 於迴圈末尾會被賦值為 matched.target,若讓 matched 走型別推斷
117
- // 會與 cur 形成循環推斷(TS7022)。標註後切斷循環。
149
+ // The type is annotated explicitly: cur is assigned matched.target at the end of the loop, and letting matched be inferred
150
+ // would form a circular inference with cur (TS7022). The annotation breaks the cycle.
118
151
  const matched = matchRedirect(cur, rules);
119
- // 無匹配或外部網址 → 轉址鏈就此終止,無迴圈
152
+ // No match or an external URL: the redirect chain ends here, no loop
120
153
  if (!matched || !matched.target.startsWith("/")) {
121
154
  cur = null;
122
155
  break;
123
156
  }
124
157
  usedKeys.push(matched.rule.key);
125
158
  if (seen.has(matched.target)) {
126
- // 回到走過的路徑 → 迴圈,標記途經的所有規則
159
+ // Back on a path already visited: a loop; mark every rule on the way
127
160
  usedKeys.forEach((k) => loopKeys.add(k));
128
161
  cur = null;
129
162
  break;
@@ -131,13 +164,13 @@ export function findRedirectLoopKeys(rules) {
131
164
  seen.add(matched.target);
132
165
  cur = matched.target;
133
166
  }
134
- // 走滿 maxHops 仍未終止 → 成長型無限鏈,保守視為迴圈
167
+ // Still not ended after maxHops: a growing endless chain, conservatively treated as a loop
135
168
  if (cur !== null)
136
169
  usedKeys.forEach((k) => loopKeys.add(k));
137
170
  }
138
171
  return loopKeys;
139
172
  }
140
- /** 是否存在跨規則轉址迴圈。單條自我迴圈請另以 `isSelfLoop` 檢查。 */
173
+ /** Whether a redirect loop across rules exists. Check single-rule self-loops separately with `isSelfLoop`. */
141
174
  export function hasRedirectChainLoop(rules) {
142
175
  const keyed = rules.map((r, i) => ({
143
176
  key: String(i),
package/dist/typed.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * 以 openapi-typescript 產生的 `paths` 介面推導型別的最小客戶端:
3
- * `client.get("/sites/{siteId}", { params: { siteId }, query })` 會檢查路徑、路徑參數、查詢、body 與成功回應型別。
4
- * 不做執行期驗證;伺服端怎麼回就怎麼給。
2
+ * A minimal client typed from the `paths` interface that openapi-typescript generates:
3
+ * `client.get("/sites/{siteId}", { params: { siteId }, query })` checks the path, path parameters, query, body and the success response type.
4
+ * No runtime validation; whatever the server answers is passed through.
5
5
  */
6
6
  import type { HttpClient } from "./http.js";
7
7
  type HttpMethod = "get" | "post" | "put" | "patch" | "delete";
@@ -58,7 +58,7 @@ type JsonOf<R> = R extends {
58
58
  export type SuccessResponseOf<O> = {
59
59
  [S in SuccessStatus & keyof ResponsesOf<O>]: JsonOf<ResponsesOf<O>[S]>;
60
60
  }[SuccessStatus & keyof ResponsesOf<O>];
61
- /** 沒有這種參數時不收;可省略(`undefined`)或每個欄位都選填(`{}` 也合法,例如只有 `locale?` 的查詢)時不強迫呼叫端傳 */
61
+ /** Not accepted when there is no such parameter; optional (`undefined`) or all-optional (`{}` is valid too, for a query with only `locale?`) parameters need not be passed */
62
62
  type OptionalIfNever<K extends string, T> = [T] extends [never] ? {
63
63
  [k in K]?: undefined;
64
64
  } : undefined extends T ? {
@@ -78,7 +78,7 @@ export interface TypedClient<P> {
78
78
  put<K extends PathsWithMethod<P, "put">>(path: K, req?: TypedRequest<OperationOf<P, K, "put">>): Promise<SuccessResponseOf<OperationOf<P, K, "put">>>;
79
79
  patch<K extends PathsWithMethod<P, "patch">>(path: K, req?: TypedRequest<OperationOf<P, K, "patch">>): Promise<SuccessResponseOf<OperationOf<P, K, "patch">>>;
80
80
  delete<K extends PathsWithMethod<P, "delete">>(path: K, req?: TypedRequest<OperationOf<P, K, "delete">>): Promise<SuccessResponseOf<OperationOf<P, K, "delete">>>;
81
- /** 底層 HTTP(未型別化) */
81
+ /** The underlying HTTP client (untyped) */
82
82
  http: HttpClient;
83
83
  }
84
84
  export declare function createTypedClient<P>(http: HttpClient): TypedClient<P>;
package/dist/typed.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * 以 openapi-typescript 產生的 `paths` 介面推導型別的最小客戶端:
3
- * `client.get("/sites/{siteId}", { params: { siteId }, query })` 會檢查路徑、路徑參數、查詢、body 與成功回應型別。
4
- * 不做執行期驗證;伺服端怎麼回就怎麼給。
2
+ * A minimal client typed from the `paths` interface that openapi-typescript generates:
3
+ * `client.get("/sites/{siteId}", { params: { siteId }, query })` checks the path, path parameters, query, body and the success response type.
4
+ * No runtime validation; whatever the server answers is passed through.
5
5
  */
6
6
  function fillPath(template, params) {
7
7
  return template.replace(/\{([^}]+)\}/g, (_, name) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanorio/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Typed fetch clients and headless helpers (SEO rewrites, JSON-LD, webhook revalidateTag) for the Kanorio Management API, Content Delivery API and Customer API.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -30,39 +30,39 @@
30
30
  "exports": {
31
31
  ".": {
32
32
  "types": "./dist/index.d.ts",
33
- "import": "./dist/index.js"
33
+ "default": "./dist/index.js"
34
34
  },
35
35
  "./management": {
36
36
  "types": "./dist/management.d.ts",
37
- "import": "./dist/management.js"
37
+ "default": "./dist/management.js"
38
38
  },
39
39
  "./delivery": {
40
40
  "types": "./dist/delivery.d.ts",
41
- "import": "./dist/delivery.js"
41
+ "default": "./dist/delivery.js"
42
42
  },
43
43
  "./customer": {
44
44
  "types": "./dist/customer.d.ts",
45
- "import": "./dist/customer.js"
45
+ "default": "./dist/customer.js"
46
46
  },
47
47
  "./customer-oauth": {
48
48
  "types": "./dist/customer-oauth.d.ts",
49
- "import": "./dist/customer-oauth.js"
49
+ "default": "./dist/customer-oauth.js"
50
50
  },
51
51
  "./edge": {
52
52
  "types": "./dist/edge.d.ts",
53
- "import": "./dist/edge.js"
53
+ "default": "./dist/edge.js"
54
54
  },
55
55
  "./forms": {
56
56
  "types": "./dist/forms.d.ts",
57
- "import": "./dist/forms.js"
57
+ "default": "./dist/forms.js"
58
58
  },
59
59
  "./tax-id": {
60
60
  "types": "./dist/tax-id.d.ts",
61
- "import": "./dist/tax-id.js"
61
+ "default": "./dist/tax-id.js"
62
62
  },
63
63
  "./preview": {
64
64
  "types": "./dist/preview.d.ts",
65
- "import": "./dist/preview.js"
65
+ "default": "./dist/preview.js"
66
66
  }
67
67
  },
68
68
  "files": [