@metabase/client 0.0.0-stage → 0.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 (323) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +661 -0
  3. package/README.md +488 -2
  4. package/dist/auth/credential.d.ts +2 -0
  5. package/dist/auth/credential.js +61 -0
  6. package/dist/auth/oauth-login.d.ts +2 -0
  7. package/dist/auth/oauth-login.js +2 -0
  8. package/dist/auth/oauth-session.d.ts +2 -0
  9. package/dist/auth/oauth-session.js +31 -0
  10. package/dist/card-B6merEUN.d.ts +1392 -0
  11. package/dist/card-BZx4NSr-.d.ts +33 -0
  12. package/dist/client-DNRvXFRm.d.ts +3276 -0
  13. package/dist/client.d.ts +2 -0
  14. package/dist/client.js +95 -0
  15. package/dist/collection-Bib61WiV.d.ts +294 -0
  16. package/dist/collection-CqtGPi4W.d.ts +39 -0
  17. package/dist/content-translation-zfUkE_OG.d.ts +8 -0
  18. package/dist/credential-6aOEGqMH.d.ts +30 -0
  19. package/dist/cron-DThzerR6.d.ts +9 -0
  20. package/dist/csv-upload--K35QedP.d.ts +8 -0
  21. package/dist/dashboard-XTe46250.d.ts +38 -0
  22. package/dist/dashboard-z9i1VUZC.d.ts +970 -0
  23. package/dist/data-action-rS27f2Ji.d.ts +95 -0
  24. package/dist/database-BLUMlywE.d.ts +997 -0
  25. package/dist/database-DqTespfa.d.ts +27 -0
  26. package/dist/dataset-C6lX1-cr.d.ts +4144 -0
  27. package/dist/dataset-Cj3XuKLe.d.ts +23 -0
  28. package/dist/dependency-D8Qs5Xdx.d.ts +827 -0
  29. package/dist/dependency-fN5_7a22.d.ts +299 -0
  30. package/dist/document-oZNDbDfx.d.ts +115 -0
  31. package/dist/domain/card.d.ts +2 -0
  32. package/dist/domain/card.js +140 -0
  33. package/dist/domain/collection.d.ts +2 -0
  34. package/dist/domain/collection.js +137 -0
  35. package/dist/domain/content-translation.d.ts +2 -0
  36. package/dist/domain/content-translation.js +5 -0
  37. package/dist/domain/cron.d.ts +2 -0
  38. package/dist/domain/cron.js +5 -0
  39. package/dist/domain/dashboard.d.ts +2 -0
  40. package/dist/domain/dashboard.js +194 -0
  41. package/dist/domain/data-action.d.ts +2 -0
  42. package/dist/domain/data-action.js +85 -0
  43. package/dist/domain/database.d.ts +2 -0
  44. package/dist/domain/database.js +56 -0
  45. package/dist/domain/dataset.d.ts +2 -0
  46. package/dist/domain/dataset.js +56 -0
  47. package/dist/domain/dependency.d.ts +2 -0
  48. package/dist/domain/dependency.js +165 -0
  49. package/dist/domain/document.d.ts +2 -0
  50. package/dist/domain/document.js +94 -0
  51. package/dist/domain/eid-translation.d.ts +2 -0
  52. package/dist/domain/eid-translation.js +36 -0
  53. package/dist/domain/embedding.d.ts +2 -0
  54. package/dist/domain/embedding.js +9 -0
  55. package/dist/domain/erd.d.ts +2 -0
  56. package/dist/domain/erd.js +45 -0
  57. package/dist/domain/field.d.ts +2 -0
  58. package/dist/domain/field.js +268 -0
  59. package/dist/domain/git-sync.d.ts +2 -0
  60. package/dist/domain/git-sync.js +147 -0
  61. package/dist/domain/glossary.d.ts +2 -0
  62. package/dist/domain/glossary.js +30 -0
  63. package/dist/domain/library.d.ts +2 -0
  64. package/dist/domain/library.js +83 -0
  65. package/dist/domain/measure.d.ts +2 -0
  66. package/dist/domain/measure.js +41 -0
  67. package/dist/domain/metric.d.ts +2 -0
  68. package/dist/domain/metric.js +139 -0
  69. package/dist/domain/moderation-review.d.ts +2 -0
  70. package/dist/domain/moderation-review.js +31 -0
  71. package/dist/domain/notification.d.ts +2 -0
  72. package/dist/domain/notification.js +138 -0
  73. package/dist/domain/parameter.d.ts +2 -0
  74. package/dist/domain/parameter.js +109 -0
  75. package/dist/domain/permission.d.ts +2 -0
  76. package/dist/domain/permission.js +36 -0
  77. package/dist/domain/pulse.d.ts +2 -0
  78. package/dist/domain/pulse.js +133 -0
  79. package/dist/domain/query.d.ts +2 -0
  80. package/dist/domain/query.js +13 -0
  81. package/dist/domain/replacement.d.ts +2 -0
  82. package/dist/domain/replacement.js +93 -0
  83. package/dist/domain/revision.d.ts +2 -0
  84. package/dist/domain/revision.js +63 -0
  85. package/dist/domain/search.d.ts +2 -0
  86. package/dist/domain/search.js +63 -0
  87. package/dist/domain/segment.d.ts +2 -0
  88. package/dist/domain/segment.js +44 -0
  89. package/dist/domain/session-properties.d.ts +2 -0
  90. package/dist/domain/session-properties.js +14 -0
  91. package/dist/domain/setting.d.ts +2 -0
  92. package/dist/domain/setting.js +22 -0
  93. package/dist/domain/setup.d.ts +2 -0
  94. package/dist/domain/setup.js +21 -0
  95. package/dist/domain/snippet.d.ts +2 -0
  96. package/dist/domain/snippet.js +38 -0
  97. package/dist/domain/table.d.ts +2 -0
  98. package/dist/domain/table.js +156 -0
  99. package/dist/domain/text.d.ts +5 -0
  100. package/dist/domain/text.js +6 -0
  101. package/dist/domain/timeline.d.ts +2 -0
  102. package/dist/domain/timeline.js +97 -0
  103. package/dist/domain/transform-dag-run.d.ts +2 -0
  104. package/dist/domain/transform-dag-run.js +19 -0
  105. package/dist/domain/transform-inspector.d.ts +2 -0
  106. package/dist/domain/transform-inspector.js +142 -0
  107. package/dist/domain/transform-job.d.ts +2 -0
  108. package/dist/domain/transform-job.js +109 -0
  109. package/dist/domain/transform-python.d.ts +2 -0
  110. package/dist/domain/transform-python.js +39 -0
  111. package/dist/domain/transform-tag.d.ts +2 -0
  112. package/dist/domain/transform-tag.js +17 -0
  113. package/dist/domain/transform-test.d.ts +2 -0
  114. package/dist/domain/transform-test.js +176 -0
  115. package/dist/domain/transform.d.ts +2 -0
  116. package/dist/domain/transform.js +235 -0
  117. package/dist/domain/upload.d.ts +2 -0
  118. package/dist/domain/upload.js +13 -0
  119. package/dist/domain/user.d.ts +2 -0
  120. package/dist/domain/user.js +16 -0
  121. package/dist/eid-translation-nuhr8St2.d.ts +143 -0
  122. package/dist/embedding-Cz3RUJYf.d.ts +10 -0
  123. package/dist/erd-BdeFEeSy.d.ts +842 -0
  124. package/dist/erd-BujD227Y.d.ts +51 -0
  125. package/dist/errors-DdMlaXqq.js +330 -0
  126. package/dist/errors.d.ts +2 -0
  127. package/dist/errors.js +189 -0
  128. package/dist/features-CnFkUCj2.d.ts +261 -0
  129. package/dist/field-BCRO19mk.d.ts +2547 -0
  130. package/dist/field-Bqn10Fq_.d.ts +50 -0
  131. package/dist/git-sync-DNXrNVCW.d.ts +258 -0
  132. package/dist/git-sync-gAMKsZgN.d.ts +205 -0
  133. package/dist/glossary-CHK3elPj.d.ts +35 -0
  134. package/dist/glossary-CqFlzW33.d.ts +15 -0
  135. package/dist/http/errors.d.ts +2 -0
  136. package/dist/http/errors.js +2 -0
  137. package/dist/http/oauth.d.ts +2 -0
  138. package/dist/http/oauth.js +201 -0
  139. package/dist/http/retry.d.ts +19 -0
  140. package/dist/http/retry.js +33 -0
  141. package/dist/http/transport.d.ts +2 -0
  142. package/dist/http/transport.js +2 -0
  143. package/dist/index.d.ts +60 -0
  144. package/dist/index.js +62 -0
  145. package/dist/json-CZvjc3--.d.ts +19 -0
  146. package/dist/json-pointer.d.ts +4 -0
  147. package/dist/json-pointer.js +7 -0
  148. package/dist/json.d.ts +2 -0
  149. package/dist/json.js +44 -0
  150. package/dist/known-range-DTOBgTEC.d.ts +7 -0
  151. package/dist/library-Cx9h_RkU.d.ts +228 -0
  152. package/dist/list-BT_bBm9Z.d.ts +7 -0
  153. package/dist/list.d.ts +2 -0
  154. package/dist/list.js +1 -0
  155. package/dist/measure-CuMqPbQX.d.ts +108 -0
  156. package/dist/measure-KuXdjZYJ.d.ts +44 -0
  157. package/dist/metric-yvehaVCS.d.ts +2655 -0
  158. package/dist/moderation-review-B4RUTZ6_.d.ts +56 -0
  159. package/dist/network-error-5g4U1iul.js +62 -0
  160. package/dist/notification-BT2TDAd_.d.ts +379 -0
  161. package/dist/notification-BiegPoSD.d.ts +22 -0
  162. package/dist/oauth-C4ordeoJ.d.ts +59 -0
  163. package/dist/oauth-login-CJsT_3EE.d.ts +19 -0
  164. package/dist/oauth-login-D734Jvbq.js +179 -0
  165. package/dist/oauth-session-BlIlcd8Q.d.ts +6 -0
  166. package/dist/paginate-DZWvWvbm.d.ts +24 -0
  167. package/dist/paginate.d.ts +2 -0
  168. package/dist/paginate.js +49 -0
  169. package/dist/parameter-ak-J-IOj.d.ts +190 -0
  170. package/dist/permission-BnCQw5Kp.d.ts +149 -0
  171. package/dist/poll-CIwnee7h.d.ts +15 -0
  172. package/dist/poll.d.ts +2 -0
  173. package/dist/poll.js +47 -0
  174. package/dist/predicates.d.ts +10 -0
  175. package/dist/predicates.js +18 -0
  176. package/dist/pulse-CMc1Rwdj.d.ts +596 -0
  177. package/dist/pulse-dylocLd9.d.ts +18 -0
  178. package/dist/query-Xsin530u.d.ts +23 -0
  179. package/dist/refusal-B9aeHMc9.js +130 -0
  180. package/dist/replacement-CyvtbxGg.d.ts +2467 -0
  181. package/dist/replacement-S9U3gApY.d.ts +128 -0
  182. package/dist/requirement-check-CIA5IHC1.d.ts +17 -0
  183. package/dist/requirements-C0txASN8.d.ts +217 -0
  184. package/dist/resources/card.d.ts +2 -0
  185. package/dist/resources/card.js +103 -0
  186. package/dist/resources/collection.d.ts +2 -0
  187. package/dist/resources/collection.js +110 -0
  188. package/dist/resources/content-translation.d.ts +11 -0
  189. package/dist/resources/content-translation.js +27 -0
  190. package/dist/resources/csv-upload.d.ts +2 -0
  191. package/dist/resources/csv-upload.js +9 -0
  192. package/dist/resources/dashboard.d.ts +2 -0
  193. package/dist/resources/dashboard.js +218 -0
  194. package/dist/resources/data-action.d.ts +105 -0
  195. package/dist/resources/data-action.js +79 -0
  196. package/dist/resources/database.d.ts +2 -0
  197. package/dist/resources/database.js +103 -0
  198. package/dist/resources/dataset.d.ts +2 -0
  199. package/dist/resources/dataset.js +81 -0
  200. package/dist/resources/dependency.d.ts +2 -0
  201. package/dist/resources/dependency.js +150 -0
  202. package/dist/resources/document.d.ts +55 -0
  203. package/dist/resources/document.js +60 -0
  204. package/dist/resources/eid-translation.d.ts +8 -0
  205. package/dist/resources/eid-translation.js +19 -0
  206. package/dist/resources/erd.d.ts +2 -0
  207. package/dist/resources/erd.js +26 -0
  208. package/dist/resources/field.d.ts +2 -0
  209. package/dist/resources/field.js +98 -0
  210. package/dist/resources/git-sync.d.ts +2 -0
  211. package/dist/resources/git-sync.js +362 -0
  212. package/dist/resources/glossary.d.ts +2 -0
  213. package/dist/resources/glossary.js +51 -0
  214. package/dist/resources/library.d.ts +85 -0
  215. package/dist/resources/library.js +90 -0
  216. package/dist/resources/measure.d.ts +2 -0
  217. package/dist/resources/measure.js +57 -0
  218. package/dist/resources/metric.d.ts +2 -0
  219. package/dist/resources/metric.js +50 -0
  220. package/dist/resources/moderation-review.d.ts +23 -0
  221. package/dist/resources/moderation-review.js +24 -0
  222. package/dist/resources/notification.d.ts +2 -0
  223. package/dist/resources/notification.js +93 -0
  224. package/dist/resources/optional-parsed.d.ts +7 -0
  225. package/dist/resources/optional-parsed.js +14 -0
  226. package/dist/resources/permission.d.ts +10 -0
  227. package/dist/resources/permission.js +31 -0
  228. package/dist/resources/pivot-export.d.ts +10 -0
  229. package/dist/resources/pivot-export.js +16 -0
  230. package/dist/resources/pulse.d.ts +2 -0
  231. package/dist/resources/pulse.js +75 -0
  232. package/dist/resources/replacement.d.ts +2 -0
  233. package/dist/resources/replacement.js +82 -0
  234. package/dist/resources/request-body.d.ts +9 -0
  235. package/dist/resources/request-body.js +13 -0
  236. package/dist/resources/revision.d.ts +70 -0
  237. package/dist/resources/revision.js +51 -0
  238. package/dist/resources/search.d.ts +2 -0
  239. package/dist/resources/search.js +57 -0
  240. package/dist/resources/segment.d.ts +2 -0
  241. package/dist/resources/segment.js +55 -0
  242. package/dist/resources/setting.d.ts +11 -0
  243. package/dist/resources/setting.js +43 -0
  244. package/dist/resources/setup.d.ts +8 -0
  245. package/dist/resources/setup.js +18 -0
  246. package/dist/resources/snippet.d.ts +2 -0
  247. package/dist/resources/snippet.js +52 -0
  248. package/dist/resources/table.d.ts +2 -0
  249. package/dist/resources/table.js +275 -0
  250. package/dist/resources/timeline-event.d.ts +12 -0
  251. package/dist/resources/timeline-event.js +51 -0
  252. package/dist/resources/timeline.d.ts +2 -0
  253. package/dist/resources/timeline.js +82 -0
  254. package/dist/resources/transform-dag-run.d.ts +22 -0
  255. package/dist/resources/transform-dag-run.js +32 -0
  256. package/dist/resources/transform-inspector.d.ts +214 -0
  257. package/dist/resources/transform-inspector.js +47 -0
  258. package/dist/resources/transform-job.d.ts +2 -0
  259. package/dist/resources/transform-job.js +90 -0
  260. package/dist/resources/transform-python.d.ts +52 -0
  261. package/dist/resources/transform-python.js +56 -0
  262. package/dist/resources/transform-tag.d.ts +35 -0
  263. package/dist/resources/transform-tag.js +47 -0
  264. package/dist/resources/transform-test.d.ts +2 -0
  265. package/dist/resources/transform-test.js +75 -0
  266. package/dist/resources/transform.d.ts +2 -0
  267. package/dist/resources/transform.js +217 -0
  268. package/dist/resources/upload.d.ts +2 -0
  269. package/dist/resources/upload.js +48 -0
  270. package/dist/resources/user.d.ts +8 -0
  271. package/dist/resources/user.js +11 -0
  272. package/dist/revision-CQBPhohA.d.ts +104 -0
  273. package/dist/search-BxJipLN6.d.ts +26 -0
  274. package/dist/search-NZR6iRBs.d.ts +92 -0
  275. package/dist/segment-D2i34X9l.d.ts +16 -0
  276. package/dist/segment-pj3wklGe.d.ts +47 -0
  277. package/dist/session-properties-COtlxAcK.d.ts +15 -0
  278. package/dist/setting-DXuQGXGF.d.ts +25 -0
  279. package/dist/setup-Ez_U7GmM.d.ts +26 -0
  280. package/dist/signal.d.ts +8 -0
  281. package/dist/signal.js +25 -0
  282. package/dist/snippet-RnnWa4TL.d.ts +16 -0
  283. package/dist/snippet-hEV429Pv.d.ts +41 -0
  284. package/dist/table-B3-UaPHa.d.ts +3229 -0
  285. package/dist/table-B_lfuaHc.d.ts +176 -0
  286. package/dist/tag-qzjGGci8.d.ts +48 -0
  287. package/dist/timeline-C2IEcRlP.d.ts +21 -0
  288. package/dist/timeline-folD3mQ_.d.ts +218 -0
  289. package/dist/transform-CDurgE1D.d.ts +443 -0
  290. package/dist/transform-CXOT5kFe.d.ts +638 -0
  291. package/dist/transform-dag-run-BgZwv1yx.d.ts +49 -0
  292. package/dist/transform-inspector-BUYBt6--.d.ts +374 -0
  293. package/dist/transform-job-29P6BULe.d.ts +237 -0
  294. package/dist/transform-job-CTJImaOd.d.ts +96 -0
  295. package/dist/transform-python-DdDnW6yK.d.ts +56 -0
  296. package/dist/transform-tag-DVUIZTEM.d.ts +25 -0
  297. package/dist/transform-test-A-CJYT6B.d.ts +412 -0
  298. package/dist/transform-test-BwuyrHpT.d.ts +346 -0
  299. package/dist/transport-E0ZaPNWJ.d.ts +462 -0
  300. package/dist/transport-HP7cyo9N.js +397 -0
  301. package/dist/upload-B7PG3ePk.d.ts +12 -0
  302. package/dist/upload-UPfZFdbH.d.ts +22 -0
  303. package/dist/url-CI0pxHOc.d.ts +7 -0
  304. package/dist/url.d.ts +2 -0
  305. package/dist/url.js +34 -0
  306. package/dist/user-2r0OBoO6.d.ts +18 -0
  307. package/dist/version/capability-error.d.ts +2 -0
  308. package/dist/version/capability-error.js +42 -0
  309. package/dist/version/features.d.ts +2 -0
  310. package/dist/version/features.js +143 -0
  311. package/dist/version/known-range.d.ts +2 -0
  312. package/dist/version/known-range.js +7 -0
  313. package/dist/version/probe.d.ts +2 -0
  314. package/dist/version/probe.js +30 -0
  315. package/dist/version/profile.d.ts +2 -0
  316. package/dist/version/profile.js +64 -0
  317. package/dist/version/requirement-check.d.ts +2 -0
  318. package/dist/version/requirement-check.js +62 -0
  319. package/dist/version/requirements.d.ts +2 -0
  320. package/dist/version/requirements.js +219 -0
  321. package/dist/version/tag.d.ts +2 -0
  322. package/dist/version/tag.js +52 -0
  323. package/package.json +65 -4
@@ -0,0 +1,397 @@
1
+ import { SessionProperties } from "./domain/session-properties.js";
2
+ import { NetworkError, ResponseShapeError, TimeoutError, ValidationError, errorMessage, isNonInterruptFailure } from "./errors.js";
3
+ import { JSON_CONTENT_TYPE, parseJson } from "./json.js";
4
+ import { combineAborts, throwIfAborted, untilAborted } from "./signal.js";
5
+ import { normalizeUrl } from "./url.js";
6
+ import { a as HttpError, p as isRetryableStatus } from "./errors-DdMlaXqq.js";
7
+ import { CapabilityError } from "./version/capability-error.js";
8
+ import { createServerProfile } from "./version/profile.js";
9
+ import { PROBE_PATH, probeBudget, serverInfoFromProperties } from "./version/probe.js";
10
+ import { featureFailures } from "./version/requirement-check.js";
11
+ import { assertCredentialHeaderSafe, credentialAuthHeader, credentialSecrets } from "./auth/credential.js";
12
+ import { n as isConnectionClosed, t as buildNetworkError } from "./network-error-5g4U1iul.js";
13
+ import { backoffDelay, runWithRetries } from "./http/retry.js";
14
+ //#region src/http/response-shape.ts
15
+ async function parseJsonResponse(text, schema, context) {
16
+ try {
17
+ return parseJson(text, schema, { source: context.url });
18
+ } catch (error) {
19
+ if (error instanceof ValidationError) throw ResponseShapeError.fromZodIssues({
20
+ kind: "zod",
21
+ method: context.method,
22
+ url: context.url,
23
+ status: context.status,
24
+ zodIssues: error.developerDetail.zodIssues,
25
+ serverTag: await context.getServerTag(),
26
+ serverSkew: context.serverSkew
27
+ });
28
+ throw error;
29
+ }
30
+ }
31
+ //#endregion
32
+ //#region src/http/transport.ts
33
+ const DEFAULT_METHOD = "GET";
34
+ const DEFAULT_TIMEOUT_MS = 3e4;
35
+ const OCTET_STREAM_CONTENT_TYPE = "application/octet-stream";
36
+ const TEXT_CONTENT_TYPE_PREFIX = "text/";
37
+ const ERROR_BODY_BYTE_CAP = 64 * 1024;
38
+ const IDEMPOTENT_METHODS = /* @__PURE__ */ new Set([
39
+ "GET",
40
+ "HEAD",
41
+ "OPTIONS"
42
+ ]);
43
+ function createTransport(config, options) {
44
+ const baseUrl = normalizeUrl(config.url);
45
+ assertCredentialHeaderSafe(config.credential);
46
+ const fetchImpl = options.fetchImpl ?? globalThis.fetch.bind(globalThis);
47
+ let inForce = options.server ?? null;
48
+ let newest = null;
49
+ let probesStarted = 0;
50
+ let applied = null;
51
+ const inFlight = /* @__PURE__ */ new Set();
52
+ const getServerTag = options.getServerTag ?? (async () => tagOf(inForce));
53
+ const refreshCredential = options.refreshCredential;
54
+ let credential = config.credential;
55
+ const knownSecrets = new Set(credentialSecrets(credential));
56
+ const redactionContext = { knownSecrets };
57
+ let refreshInFlight = null;
58
+ function tryRefreshCredential() {
59
+ const refresh = refreshCredential;
60
+ if (credential.kind !== "oauth" || refresh === void 0) return Promise.resolve(false);
61
+ refreshInFlight ??= refreshOnce(refresh).finally(() => {
62
+ refreshInFlight = null;
63
+ });
64
+ return refreshInFlight;
65
+ }
66
+ async function refreshOnce(refresh) {
67
+ const next = await refresh();
68
+ if (next === null) return false;
69
+ credential = next;
70
+ for (const secret of credentialSecrets(next)) knownSecrets.add(secret);
71
+ return true;
72
+ }
73
+ async function attemptOnce(prepared, attempt) {
74
+ const hasRetriesLeft = attempt < prepared.retries;
75
+ const timeoutSignal = AbortSignal.timeout(prepared.timeoutMs);
76
+ const combined = combineAborts(timeoutSignal, prepared.cancelSignal);
77
+ let response;
78
+ try {
79
+ response = await fetchImpl(prepared.url, {
80
+ method: prepared.method,
81
+ headers: prepared.headers,
82
+ body: prepared.body,
83
+ signal: combined
84
+ });
85
+ } catch (error) {
86
+ throwIfAborted(prepared.cancelSignal);
87
+ const isStaleSocketFirstTry = attempt === 0 && isConnectionClosed(error);
88
+ if (prepared.idempotent && (hasRetriesLeft || isStaleSocketFirstTry)) return {
89
+ kind: "retry",
90
+ delayMs: backoffDelay({ attempt })
91
+ };
92
+ if (timeoutSignal.aborted) throw new TimeoutError(`Request timed out after ${prepared.timeoutMs}ms`, {
93
+ kind: "http",
94
+ method: prepared.method,
95
+ url: prepared.url,
96
+ timeoutMs: prepared.timeoutMs
97
+ });
98
+ throw buildNetworkError(error, prepared.method, prepared.url);
99
+ }
100
+ const canRetryStatus = hasRetriesLeft && prepared.idempotent;
101
+ if (!response.ok && isRetryableStatus(response.status) && canRetryStatus) {
102
+ const retryAfter = response.headers.get("Retry-After");
103
+ response.body?.cancel().catch(() => void 0);
104
+ return {
105
+ kind: "retry",
106
+ delayMs: backoffDelay({
107
+ attempt,
108
+ retryAfterHeader: retryAfter
109
+ })
110
+ };
111
+ }
112
+ if (!response.ok) {
113
+ const rawBody = await readBodyForError(response);
114
+ const serverTag = await getServerTag();
115
+ throw new HttpError({
116
+ status: response.status,
117
+ statusText: response.statusText,
118
+ method: prepared.method,
119
+ url: prepared.url,
120
+ responseHeaders: response.headers,
121
+ rawBody,
122
+ serverTag,
123
+ redactionContext
124
+ });
125
+ }
126
+ assertContentType(response, prepared);
127
+ return {
128
+ kind: "success",
129
+ response
130
+ };
131
+ }
132
+ async function executeRaw(prepared) {
133
+ try {
134
+ return await runWithRetries((attempt) => attemptOnce(prepared, attempt), prepared.cancelSignal);
135
+ } catch (error) {
136
+ throwIfAborted(prepared.cancelSignal);
137
+ throw error;
138
+ }
139
+ }
140
+ async function executeWithAuthRefresh(path, opts) {
141
+ const prepared = prepare(path, opts);
142
+ try {
143
+ return {
144
+ response: await executeRaw(prepared),
145
+ prepared
146
+ };
147
+ } catch (error) {
148
+ if (error instanceof HttpError && error.status === 401) {
149
+ if (await tryRefreshCredential()) {
150
+ const retried = prepare(path, opts);
151
+ return {
152
+ response: await executeRaw(retried),
153
+ prepared: retried
154
+ };
155
+ }
156
+ }
157
+ throw error;
158
+ }
159
+ }
160
+ function prepare(path, opts = {}) {
161
+ const method = opts.method ?? "GET";
162
+ const expectContentType = opts.expectContentType ?? "json";
163
+ const url = buildUrl(baseUrl, path, opts.query);
164
+ const headers = new Headers();
165
+ const auth = credentialAuthHeader(credential);
166
+ headers.set(auth.name, auth.value);
167
+ headers.set("accept", acceptHeader(expectContentType));
168
+ headers.set("user-agent", options.userAgent);
169
+ let body = null;
170
+ if (opts.body !== void 0 && opts.body !== null) if (typeof opts.body === "string" || opts.body instanceof URLSearchParams) body = opts.body;
171
+ else if (opts.body instanceof FormData || opts.body instanceof ReadableStream) body = opts.body;
172
+ else if (opts.body instanceof Uint8Array) {
173
+ body = opts.body;
174
+ headers.set("content-type", OCTET_STREAM_CONTENT_TYPE);
175
+ } else {
176
+ body = JSON.stringify(opts.body);
177
+ headers.set("content-type", JSON_CONTENT_TYPE);
178
+ }
179
+ return {
180
+ url,
181
+ method,
182
+ headers,
183
+ body,
184
+ expectContentType,
185
+ retries: opts.retries ?? 3,
186
+ idempotent: opts.idempotent ?? IDEMPOTENT_METHODS.has(method),
187
+ timeoutMs: opts.timeoutMs ?? 3e4,
188
+ cancelSignal: combineAborts(opts.signal, options.signal)
189
+ };
190
+ }
191
+ async function readJson(path, opts = {}) {
192
+ const chosenFor = inForce;
193
+ const { response, prepared } = await executeWithAuthRefresh(path, {
194
+ ...opts,
195
+ expectContentType: "json"
196
+ });
197
+ return {
198
+ text: await response.text(),
199
+ context: {
200
+ method: prepared.method,
201
+ url: prepared.url,
202
+ status: response.status,
203
+ ...namingOf(chosenFor)
204
+ }
205
+ };
206
+ }
207
+ function namingOf(profile) {
208
+ if (profile === null) return {
209
+ getServerTag,
210
+ serverSkew: null
211
+ };
212
+ return {
213
+ getServerTag: async () => profile.version.tag,
214
+ serverSkew: profile.skew
215
+ };
216
+ }
217
+ async function runProbe(order, budget) {
218
+ const read = await readJson(PROBE_PATH, probeBudget(budget));
219
+ const properties = await parseJsonResponse(read.text, SessionProperties, read.context);
220
+ const info = serverInfoFromProperties(properties);
221
+ const profile = createServerProfile(info);
222
+ if (applied === null || applied.order < order) {
223
+ options.onServerProbed?.(info, profile);
224
+ applied = {
225
+ order,
226
+ profile
227
+ };
228
+ inForce = profile;
229
+ }
230
+ return {
231
+ properties,
232
+ profile,
233
+ read
234
+ };
235
+ }
236
+ function startProbe(budget) {
237
+ probesStarted += 1;
238
+ const probed = runProbe(probesStarted, budget);
239
+ newest = probed;
240
+ inFlight.add(probed);
241
+ probed.then(() => {
242
+ inFlight.delete(probed);
243
+ }, () => {
244
+ inFlight.delete(probed);
245
+ if (newest === probed) newest = null;
246
+ });
247
+ return probed;
248
+ }
249
+ function appliedProfile() {
250
+ return applied === null ? null : applied.profile;
251
+ }
252
+ function verifying() {
253
+ const settled = appliedProfile();
254
+ if (newest === null && settled !== null) return Promise.resolve(settled);
255
+ return (newest ?? startProbe({})).then((probed) => probed.profile, fallBackTo(appliedProfile));
256
+ }
257
+ function profileInForce() {
258
+ const current = inForce;
259
+ if (current === null) return verifying();
260
+ if (newest === null) return Promise.resolve(current);
261
+ return newest.then((probed) => probed.profile, fallBackTo(() => inForce));
262
+ }
263
+ async function server(wait = {}) {
264
+ throwIfAborted(wait.signal);
265
+ return untilAborted(profileInForce(), wait.signal);
266
+ }
267
+ async function verifiedServer(wait = {}) {
268
+ throwIfAborted(wait.signal);
269
+ return untilAborted(verifying(), wait.signal);
270
+ }
271
+ async function probe(reader, read = {}) {
272
+ const { signal, ...budget } = read;
273
+ throwIfAborted(signal);
274
+ const probed = await untilAborted(startProbe(budget), signal);
275
+ const context = {
276
+ ...probed.read.context,
277
+ ...namingOf(probed.profile)
278
+ };
279
+ return parseJsonResponse(probed.read.text, reader, context);
280
+ }
281
+ async function probesSettled() {
282
+ while (inFlight.size > 0) await Promise.allSettled(inFlight);
283
+ }
284
+ async function requireFeatures(features, wait = {}) {
285
+ if (features.length === 0) return;
286
+ const profile = await preflightServer(wait);
287
+ if (profile === null) return;
288
+ for (const failure of featureFailures(features, profile)) refuseBeforeSending(new CapabilityError(failure));
289
+ }
290
+ async function preflightServer(wait = {}) {
291
+ try {
292
+ return await verifiedServer(wait);
293
+ } catch (error) {
294
+ if (!isNonInterruptFailure(error)) throw error;
295
+ skipOrThrow({
296
+ kind: "unverified",
297
+ failure: error
298
+ });
299
+ return null;
300
+ }
301
+ }
302
+ function refuseBeforeSending(refusal) {
303
+ skipOrThrow({
304
+ kind: "refused",
305
+ refusal
306
+ });
307
+ }
308
+ function skipOrThrow(skipped) {
309
+ const hook = options.onPreflightSkipped;
310
+ if (hook === void 0) throw skippedError(skipped);
311
+ hook(skipped);
312
+ }
313
+ return {
314
+ server,
315
+ verifiedServer,
316
+ probe,
317
+ requireFeatures,
318
+ preflightServer,
319
+ refuseBeforeSending,
320
+ probesSettled,
321
+ async requestRaw(path, opts) {
322
+ return (await executeWithAuthRefresh(path, opts ?? {})).response;
323
+ },
324
+ async requestParsed(schema, path, opts) {
325
+ const read = await readJson(path, opts);
326
+ return parseJsonResponse(read.text, schema, read.context);
327
+ },
328
+ async requestStream(path, opts) {
329
+ const { response, prepared } = await executeWithAuthRefresh(path, {
330
+ ...opts,
331
+ expectContentType: opts?.expectContentType ?? "binary"
332
+ });
333
+ if (!response.body) throw new NetworkError("Response had no body to stream", {
334
+ method: prepared.method,
335
+ url: prepared.url,
336
+ cause: "missing body"
337
+ });
338
+ return response.body;
339
+ }
340
+ };
341
+ }
342
+ function skippedError(skipped) {
343
+ return skipped.kind === "refused" ? skipped.refusal : skipped.failure;
344
+ }
345
+ function fallBackTo(fallback) {
346
+ return (error) => {
347
+ const profile = fallback();
348
+ if (profile !== null && isNonInterruptFailure(error)) return profile;
349
+ throw error;
350
+ };
351
+ }
352
+ function tagOf(profile) {
353
+ return profile === null ? null : profile.version.tag;
354
+ }
355
+ function buildUrl(baseUrl, path, query) {
356
+ const normalizedPath = path.startsWith("/") ? path : `/${path}`;
357
+ const target = new URL(baseUrl + normalizedPath);
358
+ if (query) for (const [key, value] of Object.entries(query)) {
359
+ if (value === void 0) continue;
360
+ if (Array.isArray(value)) for (const entry of value) target.searchParams.append(key, String(entry));
361
+ else target.searchParams.append(key, String(value));
362
+ }
363
+ return target.toString();
364
+ }
365
+ function acceptHeader(expected) {
366
+ if (expected === "json") return JSON_CONTENT_TYPE;
367
+ if (expected === "text") return "text/*";
368
+ return "*/*";
369
+ }
370
+ function assertContentType(response, prepared) {
371
+ if (prepared.expectContentType === "binary") return;
372
+ const contentType = response.headers.get("content-type");
373
+ if (contentType === null) throwContentTypeMismatch(response, prepared, prepared.expectContentType);
374
+ if (prepared.expectContentType === "json" && !contentType.includes("application/json")) throwContentTypeMismatch(response, prepared, "json");
375
+ if (prepared.expectContentType === "text" && !contentType.startsWith(TEXT_CONTENT_TYPE_PREFIX)) throwContentTypeMismatch(response, prepared, "text");
376
+ }
377
+ function throwContentTypeMismatch(response, prepared, expected) {
378
+ const actual = response.headers.get("content-type") ?? "no content-type";
379
+ throw new HttpError({
380
+ status: response.status,
381
+ statusText: response.statusText,
382
+ method: prepared.method,
383
+ url: prepared.url,
384
+ responseHeaders: response.headers,
385
+ rawBody: null,
386
+ overrideUserMessage: `Expected ${expected} response but got ${actual}`
387
+ });
388
+ }
389
+ async function readBodyForError(response) {
390
+ try {
391
+ return Buffer.from(await response.arrayBuffer()).subarray(0, ERROR_BODY_BYTE_CAP).toString("utf8");
392
+ } catch (error) {
393
+ return `[body read failed: ${errorMessage(error)}]`;
394
+ }
395
+ }
396
+ //#endregion
397
+ export { DEFAULT_TIMEOUT_MS as n, createTransport as r, DEFAULT_METHOD as t };
@@ -0,0 +1,12 @@
1
+ import { f as RequestOptions, h as Transport } from "./transport-E0ZaPNWJ.js";
2
+ import { t as UploadResult } from "./upload-UPfZFdbH.js";
3
+ import { t as CsvFile } from "./csv-upload--K35QedP.js";
4
+ //#region src/resources/upload.d.ts
5
+ interface UploadCsvParams {
6
+ collection_id: string;
7
+ }
8
+ declare function uploadResource(transport: Transport): {
9
+ createFromCsv: (file: CsvFile, params: UploadCsvParams, options?: RequestOptions) => Promise<UploadResult>;
10
+ };
11
+ //#endregion
12
+ export { uploadResource as n, UploadCsvParams as t };
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ //#region src/domain/upload.d.ts
3
+ declare const UploadResult: z.ZodObject<{
4
+ model_id: z.ZodNumber;
5
+ table_id: z.ZodNumber;
6
+ }, z.core.$strip>;
7
+ type UploadResult = z.infer<typeof UploadResult>;
8
+ declare const UploadUpdateAction: z.ZodEnum<{
9
+ replace: "replace";
10
+ append: "append";
11
+ }>;
12
+ type UploadUpdateAction = z.infer<typeof UploadUpdateAction>;
13
+ declare const UploadUpdateResult: z.ZodObject<{
14
+ table_id: z.ZodNumber;
15
+ action: z.ZodEnum<{
16
+ replace: "replace";
17
+ append: "append";
18
+ }>;
19
+ }, z.core.$strip>;
20
+ type UploadUpdateResult = z.infer<typeof UploadUpdateResult>;
21
+ //#endregion
22
+ export { UploadUpdateAction as n, UploadUpdateResult as r, UploadResult as t };
@@ -0,0 +1,7 @@
1
+ //#region src/url.d.ts
2
+ declare function normalizeUrl(input: string): string;
3
+ declare function displayUrl(input: string): string;
4
+ declare function isLoopbackHost(hostname: string): boolean;
5
+ declare function assertEndpointOrigin(endpoint: string, baseUrl: string, label: string): void;
6
+ //#endregion
7
+ export { normalizeUrl as i, displayUrl as n, isLoopbackHost as r, assertEndpointOrigin as t };
package/dist/url.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { i as normalizeUrl, n as displayUrl, r as isLoopbackHost, t as assertEndpointOrigin } from "./url-CI0pxHOc.js";
2
+ export { assertEndpointOrigin, displayUrl, isLoopbackHost, normalizeUrl };
package/dist/url.js ADDED
@@ -0,0 +1,34 @@
1
+ import { ConfigError } from "./errors.js";
2
+ //#region src/url.ts
3
+ function normalizeUrl(input) {
4
+ const trimmed = input.trim().replace(/\/+$/, "");
5
+ if (!/^https?:\/\//i.test(trimmed)) throw new ConfigError("URL must start with http:// or https://");
6
+ return trimmed;
7
+ }
8
+ function displayUrl(input) {
9
+ const parsed = new URL(input);
10
+ const path = parsed.pathname.replace(/\/+$/, "");
11
+ return `${parsed.origin}${path}`;
12
+ }
13
+ const LOOPBACK_HOSTS = /* @__PURE__ */ new Set([
14
+ "localhost",
15
+ "127.0.0.1",
16
+ "::1",
17
+ "[::1]"
18
+ ]);
19
+ function isLoopbackHost(hostname) {
20
+ return LOOPBACK_HOSTS.has(hostname.toLowerCase());
21
+ }
22
+ function assertEndpointOrigin(endpoint, baseUrl, label) {
23
+ let parsed;
24
+ try {
25
+ parsed = new URL(endpoint);
26
+ } catch {
27
+ throw new ConfigError(`OAuth ${label} is not a valid URL: ${endpoint}`);
28
+ }
29
+ const base = new URL(baseUrl);
30
+ if (parsed.protocol !== "https:" && !isLoopbackHost(parsed.hostname)) throw new ConfigError(`OAuth ${label} must use https: ${endpoint}`);
31
+ if (parsed.origin !== base.origin) throw new ConfigError(`OAuth ${label} origin (${parsed.origin}) does not match the Metabase URL (${base.origin})`);
32
+ }
33
+ //#endregion
34
+ export { assertEndpointOrigin, displayUrl, isLoopbackHost, normalizeUrl };
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ //#region src/domain/user.d.ts
3
+ declare const CurrentUser: z.ZodObject<{
4
+ id: z.ZodNumber;
5
+ email: z.ZodEmail;
6
+ common_name: z.ZodString;
7
+ is_superuser: z.ZodBoolean;
8
+ }, z.core.$loose>;
9
+ type CurrentUser = z.infer<typeof CurrentUser>;
10
+ declare const CurrentUserCompact: z.ZodObject<{
11
+ id: z.ZodNumber;
12
+ email: z.ZodEmail;
13
+ common_name: z.ZodString;
14
+ is_superuser: z.ZodBoolean;
15
+ }, z.core.$strip>;
16
+ type CurrentUserCompact = z.infer<typeof CurrentUserCompact>;
17
+ //#endregion
18
+ export { CurrentUserCompact as n, CurrentUser as t };
@@ -0,0 +1,2 @@
1
+ import { C as versionTooOldMessage, S as missingTokenFeatureMessage, b as RequirementFailure, x as RequirementReason, y as CapabilityError } from "../transport-E0ZaPNWJ.js";
2
+ export { CapabilityError, RequirementFailure, RequirementReason, missingTokenFeatureMessage, versionTooOldMessage };
@@ -0,0 +1,42 @@
1
+ import { MetabaseError } from "../errors.js";
2
+ import "../errors-DdMlaXqq.js";
3
+ import { FEATURE_NAMES } from "./features.js";
4
+ import { z } from "zod";
5
+ //#region src/version/capability-error.ts
6
+ const RequirementReason = z.enum([
7
+ "version-too-old",
8
+ "missing-token-feature",
9
+ "superseded-by-feature"
10
+ ]);
11
+ const RequirementFailure = z.object({
12
+ reason: RequirementReason,
13
+ detail: z.string(),
14
+ feature: z.enum(FEATURE_NAMES),
15
+ since: z.number().int(),
16
+ tokenFeature: z.string().nullable(),
17
+ serverVersion: z.string()
18
+ });
19
+ function versionTooOldMessage(since, serverVersion) {
20
+ return `This operation requires Metabase v${since}+ (this server is ${serverVersion}). Upgrade Metabase to use it.`;
21
+ }
22
+ function missingTokenFeatureMessage(tokenFeature) {
23
+ return `This operation requires the '${tokenFeature}' premium feature (not enabled on this server).`;
24
+ }
25
+ var CapabilityError = class extends MetabaseError {
26
+ category = "capability";
27
+ isRetryable = false;
28
+ developerDetail;
29
+ constructor(failure, refusal = null) {
30
+ super(capabilityMessage(failure, refusal), refusal === null ? void 0 : { cause: refusal });
31
+ this.name = "CapabilityError";
32
+ this.developerDetail = failure;
33
+ }
34
+ };
35
+ function capabilityMessage(failure, refusal) {
36
+ if (refusal === null || refusal.status !== 400) return failure.detail;
37
+ const said = refusal.serverMessage;
38
+ if (said === null) return failure.detail;
39
+ return `${failure.detail}\nMetabase answered ${refusal.status}: ${said}`;
40
+ }
41
+ //#endregion
42
+ export { CapabilityError, RequirementFailure, RequirementReason, missingTokenFeatureMessage, versionTooOldMessage };
@@ -0,0 +1,2 @@
1
+ import { a as FeatureRule, c as TokenGap, d as isFeatureName, f as ruleGap, i as FeatureName, l as VersionGap, n as FEATURE_RULES, o as Features, r as FeatureGap, s as RuleMajor, t as FEATURE_NAMES, u as evaluateFeatures } from "../features-CnFkUCj2.js";
2
+ export { FEATURE_NAMES, FEATURE_RULES, FeatureGap, FeatureName, FeatureRule, Features, RuleMajor, TokenGap, VersionGap, evaluateFeatures, isFeatureName, ruleGap };
@@ -0,0 +1,143 @@
1
+ import { z } from "zod";
2
+ //#region src/version/features.ts
3
+ const FEATURE_RULES = {
4
+ dataActionCollections: { since: 65 },
5
+ dataActionsWithoutModel: { since: 65 },
6
+ transforms: { since: 59 },
7
+ transformJobActivation: { since: 61 },
8
+ measures: { since: 59 },
9
+ library: {
10
+ since: 59,
11
+ tokenFeature: "library"
12
+ },
13
+ libraryDashboards: { since: 65 },
14
+ remoteSync: {
15
+ since: 58,
16
+ tokenFeature: "remote_sync"
17
+ },
18
+ remoteSyncRemoteChanges: {
19
+ since: 59,
20
+ tokenFeature: "remote_sync"
21
+ },
22
+ remoteSyncCollectionsOnlyUpdate: { since: 60 },
23
+ remoteSyncExportPreflight: {
24
+ since: 63,
25
+ tokenFeature: "remote_sync"
26
+ },
27
+ remoteSyncBranchGuard: { since: 63 },
28
+ remoteSyncMerge: {
29
+ since: 63,
30
+ tokenFeature: "remote_sync"
31
+ },
32
+ contentTranslation: {
33
+ since: 58,
34
+ tokenFeature: "content_translation"
35
+ },
36
+ contentVerification: {
37
+ since: 58,
38
+ tokenFeature: "content_verification"
39
+ },
40
+ transformTargetTableId: { since: 61 },
41
+ transformTargetTableLinkedOnCreate: {
42
+ since: 61,
43
+ until: 61
44
+ },
45
+ transformJobRunIdIsNumeric: { since: 64 },
46
+ transformCheckpointReset: { since: 60 },
47
+ fieldDataSensitivity: { since: 64 },
48
+ fieldRemappingAppendsDisplayColumns: {
49
+ since: 58,
50
+ until: 59
51
+ },
52
+ transformDagRuns: { since: 64 },
53
+ unifiedTransformRuns: { since: 64 },
54
+ transformTests: {
55
+ since: 65,
56
+ tokenFeature: "transforms-testing"
57
+ },
58
+ libraryChildrenCarryType: { since: 62 },
59
+ collectionItemsTotalOnEmptyPage: { since: 64 },
60
+ invalidMbqlIsBadRequest: { since: 59 },
61
+ boxplotDisplay: { since: 59 },
62
+ nativeTableTemplateTag: { since: 59 },
63
+ smartLinkMeasureModel: { since: 60 },
64
+ dashboardSubscriptionFilters: {
65
+ since: 58,
66
+ tokenFeature: "dashboard_subscription_filters"
67
+ },
68
+ dependencyGraph: {
69
+ since: 58,
70
+ tokenFeature: "dependencies"
71
+ },
72
+ dependencyItemListings: {
73
+ since: 59,
74
+ tokenFeature: "dependencies"
75
+ },
76
+ dependencyAsyncBackfill: {
77
+ since: 60,
78
+ tokenFeature: "dependencies"
79
+ },
80
+ measureDependencyGraph: { since: 59 },
81
+ tableListAccessFilters: { since: 59 },
82
+ tableListTransformTargets: { since: 60 },
83
+ tableListPublishedFilter: { since: 63 },
84
+ tableUnusedFilter: {
85
+ since: 58,
86
+ tokenFeature: "dependencies"
87
+ },
88
+ tableDataLayerTiers: { since: 59 },
89
+ bulkTableEdit: { since: 59 },
90
+ tableUserValueWithdrawal: { since: 64 },
91
+ bulkTableSync: { since: 59 },
92
+ erd: {
93
+ since: 62,
94
+ tokenFeature: "schema-viewer"
95
+ },
96
+ documentCopy: { since: 59 },
97
+ transformInspector: {
98
+ since: 60,
99
+ tokenFeature: "transforms-python"
100
+ },
101
+ pythonLibrary: {
102
+ since: 58,
103
+ tokenFeature: "transforms-python"
104
+ },
105
+ pythonTestRun: {
106
+ since: 60,
107
+ tokenFeature: "transforms-python"
108
+ },
109
+ sourceReplacement: {
110
+ since: 60,
111
+ tokenFeature: "dependencies"
112
+ },
113
+ metricDefinitionQuery: { since: 60 },
114
+ metricDimensionListing: { since: 64 },
115
+ oauthFullAccessScopeUnadvertised: { since: 64 },
116
+ exportCsvByteOrderMark: { since: 63 }
117
+ };
118
+ function isFeatureName(name) {
119
+ return Object.hasOwn(FEATURE_RULES, name);
120
+ }
121
+ const FEATURE_NAMES = Object.keys(FEATURE_RULES).filter(isFeatureName);
122
+ const Features = z.record(z.enum(FEATURE_NAMES), z.boolean());
123
+ function evaluateFeatures(major, tokenFeatures) {
124
+ const entries = FEATURE_NAMES.map((name) => [name, ruleHolds(FEATURE_RULES[name], major, tokenFeatures)]);
125
+ return Features.parse(Object.fromEntries(entries));
126
+ }
127
+ function ruleHolds(rule, major, tokenFeatures) {
128
+ return ruleGap(rule, major, tokenFeatures) === null;
129
+ }
130
+ function ruleGap(rule, major, tokenFeatures) {
131
+ if (!versionHolds(rule, major)) return { kind: "version" };
132
+ if (rule.tokenFeature === void 0) return null;
133
+ return tokenFeatures !== null && tokenFeatures[rule.tokenFeature] === true ? null : {
134
+ kind: "token",
135
+ tokenFeature: rule.tokenFeature
136
+ };
137
+ }
138
+ function versionHolds(rule, major) {
139
+ if (major === "development") return rule.until === void 0;
140
+ return major >= rule.since && (rule.until === void 0 || major <= rule.until);
141
+ }
142
+ //#endregion
143
+ export { FEATURE_NAMES, FEATURE_RULES, Features, evaluateFeatures, isFeatureName, ruleGap };
@@ -0,0 +1,2 @@
1
+ import { t as KNOWN_RANGE } from "../known-range-DTOBgTEC.js";
2
+ export { KNOWN_RANGE };