@datakable/core 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{codes-BKdS9EiO.d.cts → codes-OsjAR3Wz.d.cts} +16 -4
- package/dist/{codes-BKdS9EiO.d.ts → codes-OsjAR3Wz.d.ts} +16 -4
- package/dist/column-filters.d.cts +2 -2
- package/dist/column-filters.d.ts +2 -2
- package/dist/diagnostics/build.cjs +6 -3
- package/dist/diagnostics/build.cjs.map +1 -1
- package/dist/diagnostics/build.js +4 -2
- package/dist/diagnostics/build.js.map +1 -1
- package/dist/diagnostics/hub.cjs +1 -1
- package/dist/diagnostics/hub.cjs.map +1 -1
- package/dist/diagnostics/hub.js +2 -2
- package/dist/diagnostics/hub.js.map +1 -1
- package/dist/{explain-DcUZfFh5.d.ts → explain-Dn99IQt0.d.ts} +1 -1
- package/dist/{explain-aagaYHcy.d.cts → explain-vkD2cewE.d.cts} +1 -1
- package/dist/feature/define.cjs +3 -1
- package/dist/feature/define.cjs.map +1 -1
- package/dist/feature/define.js +3 -1
- package/dist/feature/define.js.map +1 -1
- package/dist/feature/runtime.cjs.map +1 -1
- package/dist/feature/runtime.js.map +1 -1
- package/dist/features/pagination/codes.cjs +5 -3
- package/dist/features/pagination/codes.cjs.map +1 -1
- package/dist/features/pagination/codes.js +5 -3
- package/dist/features/pagination/codes.js.map +1 -1
- package/dist/features/pagination/pagination.cjs +3 -1
- package/dist/features/pagination/pagination.cjs.map +1 -1
- package/dist/features/pagination/pagination.js +3 -1
- package/dist/features/pagination/pagination.js.map +1 -1
- package/dist/features/search/search-index.cjs +38 -34
- package/dist/features/search/search-index.cjs.map +1 -1
- package/dist/features/search/search-index.js +39 -35
- package/dist/features/search/search-index.js.map +1 -1
- package/dist/features/search/search.cjs +42 -16
- package/dist/features/search/search.cjs.map +1 -1
- package/dist/features/search/search.js +42 -16
- package/dist/features/search/search.js.map +1 -1
- package/dist/features/sorting/sorting.cjs +3 -3
- package/dist/features/sorting/sorting.cjs.map +1 -1
- package/dist/features/sorting/sorting.js +3 -3
- package/dist/features/sorting/sorting.js.map +1 -1
- package/dist/index.d.cts +9 -7
- package/dist/index.d.ts +9 -7
- package/dist/intercept/cell-batch.cjs +3 -0
- package/dist/intercept/cell-batch.cjs.map +1 -1
- package/dist/intercept/cell-batch.js +3 -0
- package/dist/intercept/cell-batch.js.map +1 -1
- package/dist/pagination.d.cts +2 -2
- package/dist/pagination.d.ts +2 -2
- package/dist/pipeline/row.cjs +8 -7
- package/dist/pipeline/row.cjs.map +1 -1
- package/dist/pipeline/row.js +8 -7
- package/dist/pipeline/row.js.map +1 -1
- package/dist/schema.d.cts +2 -2
- package/dist/schema.d.ts +2 -2
- package/dist/{search-async-entry-BmQYT120.d.ts → search-async-entry-DGSw2pDL.d.ts} +2 -2
- package/dist/{search-async-entry-C3mXxLP8.d.cts → search-async-entry-v5JdEk5Y.d.cts} +2 -2
- package/dist/search-async.d.cts +3 -3
- package/dist/search-async.d.ts +3 -3
- package/dist/search.d.cts +4 -4
- package/dist/search.d.ts +4 -4
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/sorting.d.cts +6 -3
- package/dist/sorting.d.ts +6 -3
- package/dist/validity.d.cts +2 -2
- package/dist/validity.d.ts +2 -2
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { D as Diagnostic, c as DiagnosticCode, d as DiagnosticDetails, a as EmitOptions, T as Trigger, P as Phase, j as DiagnosticStateSummary, f as RedactLevel, k as RedactionOptions, l as DiagnosticDefinition, I as InvalidRowsMode, e as TableSchema, S as StandardSchemaV1, E as Emit } from './codes-
|
|
2
|
-
export { B as BadResponse, m as BuildInput, n as DK_UNSAFE_REDACTION, o as DatakableConfigError, p as DatakableError, q as DatakableSchemaError, r as DiagnosticCatalog, s as DiagnosticContext, t as DiagnosticLevel, u as DiagnosticMessages, v as DiagnosticMeta, w as DiagnosticText, x as FlaggedInvalidRow, F as FlaggedRow, h as InvalidRow, L as Location, y as REDACTED, z as RedactField, g as RedactFn, A as Redactor, b as Row, R as RowIssue, i as RowKey, C as SCHEMA_INGEST, G as SENSITIVE, H as SchemaIssueColumn, J as SchemaOutcome, K as SlotDefinition, M as SlotReturns, V as ValidRow, N as asyncDiagnostics, O as boundaryDiagnostics, Q as buildDiagnostic, U as columnFiltersDiagnostics, W as comparatorDiagnostics, X as coreDiagnostics, Y as dataCheckDiagnostics, Z as dataMutationDiagnostics, _ as defineDiagnostic, $ as defineSlot, a0 as describeReturn, a1 as describeValue, a2 as envDiagnostics, a3 as featureDiagnostics, a4 as fetchDiagnostics, a5 as formatSlot, a6 as formatWhere, a7 as getDiagnosticDefinition, a8 as getDiagnosticText, a9 as getSlot, aa as hasMessages, ab as hashRowKey, ac as installMessages, ad as isStandardSchema, ae as keepDiagnostics, af as listDiagnosticCodes, ag as matchesSlot, ah as optionDiagnostics, ai as paginationDiagnostics, aj as pipelineDiagnostics, ak as resolveRedaction, al as rowKeyDiagnostics, am as schemaDiagnostics, an as scrubError, ao as scrubSchemaIssue, ap as searchDiagnostics, aq as slotDiagnostics, ar as sortingDiagnostics, as as ssrDiagnostics, at as stepDiagnostics, au as tableDiagnostics, av as throwConfigError, aw as validityDiagnostics, ax as versioningDiagnostics } from './codes-
|
|
3
|
-
import { S as Stage, A as AnyFeature, I as InterceptorRuntime, a as Interceptor, F as Feature, b as FixedTypes, c as FeatureContext, R as RowModelContext, d as AnyRow, e as FeatureTypes, O as OpName, f as InterceptorContext, g as OpResult, T as TableState, h as TableOptions, i as ServerFetcher, j as TableStateFor, k as Table, l as ApiOf } from './explain-
|
|
4
|
-
export { m as AccessorColumn, n as Apply, B as BuiltinOperations, C as CELL_FALLBACK, o as CellContext, p as CellFailures, q as CellSlot, r as ColumnDef, s as ColumnValues, t as ContextBase, u as ContextPool, v as ControlledState, w as Core, E as ExplainStep, x as FetchOutcome, y as FetchParams, z as FetchResult, D as Fetcher, G as FilterFor, H as HotOpWarning, J as InterceptorRuntimeOptions, K as InvalidCellContext, L as IsAny, M as KeyColumn, N as Listener, P as LooseRow, Q as OpInput, U as OpKind, V as OpOutput, W as OpSpec, X as OperationInfo, Y as Operations, Z as OptionRule, _ as OptionType, $ as OptionsDefinition, a0 as OptionsSchema, a1 as Path, a2 as PathValue, a3 as Primitive, a4 as RenderReq, a5 as RowExplanation, a6 as RowModel, a7 as RowModelStatus, a8 as RowOf, a9 as RowStep, aa as RowStepOutcome, ab as SERVER_SOURCE, ac as SliceUpdater, ad as SortAlgorithm, ae as StateOf, af as TableDiagnosticsOptions, ag as TableExplanation, ah as UPDATE_DEPTH_LIMIT, ai as Updater, aj as createContext, ak as createContextPool, al as createInterceptorRuntime, am as defineInterceptor, an as defineOptions, ao as emitTableDiagnostic, ap as getOperation, aq as isOptionsDefinition, ar as listOperations, as as registerOperation, at as runCells } from './explain-
|
|
1
|
+
import { D as Diagnostic, c as DiagnosticCode, d as DiagnosticDetails, a as EmitOptions, T as Trigger, P as Phase, j as DiagnosticStateSummary, f as RedactLevel, k as RedactionOptions, l as DiagnosticDefinition, I as InvalidRowsMode, e as TableSchema, S as StandardSchemaV1, E as Emit } from './codes-OsjAR3Wz.js';
|
|
2
|
+
export { B as BadResponse, m as BuildInput, n as DK_UNSAFE_REDACTION, o as DatakableConfigError, p as DatakableError, q as DatakableSchemaError, r as DiagnosticCatalog, s as DiagnosticContext, t as DiagnosticLevel, u as DiagnosticMessages, v as DiagnosticMeta, w as DiagnosticText, x as FlaggedInvalidRow, F as FlaggedRow, h as InvalidRow, L as Location, y as REDACTED, z as RedactField, g as RedactFn, A as Redactor, b as Row, R as RowIssue, i as RowKey, C as SCHEMA_INGEST, G as SENSITIVE, H as SchemaIssueColumn, J as SchemaOutcome, K as SlotDefinition, M as SlotReturns, V as ValidRow, N as asyncDiagnostics, O as boundaryDiagnostics, Q as buildDiagnostic, U as columnFiltersDiagnostics, W as comparatorDiagnostics, X as coreDiagnostics, Y as dataCheckDiagnostics, Z as dataMutationDiagnostics, _ as defineDiagnostic, $ as defineSlot, a0 as describeReturn, a1 as describeValue, a2 as envDiagnostics, a3 as featureDiagnostics, a4 as fetchDiagnostics, a5 as formatSlot, a6 as formatWhere, a7 as getDiagnosticDefinition, a8 as getDiagnosticText, a9 as getSlot, aa as hasMessages, ab as hashRowKey, ac as installMessages, ad as isStandardSchema, ae as keepDiagnostics, af as listDiagnosticCodes, ag as matchesSlot, ah as optionDiagnostics, ai as paginationDiagnostics, aj as pipelineDiagnostics, ak as resolveRedaction, al as rowKeyDiagnostics, am as schemaDiagnostics, an as scrubError, ao as scrubSchemaIssue, ap as searchDiagnostics, aq as slotDiagnostics, ar as sortingDiagnostics, as as ssrDiagnostics, at as stepDiagnostics, au as tableDiagnostics, av as throwConfigError, aw as validityDiagnostics, ax as versioningDiagnostics } from './codes-OsjAR3Wz.js';
|
|
3
|
+
import { S as Stage, A as AnyFeature, I as InterceptorRuntime, a as Interceptor, F as Feature, b as FixedTypes, c as FeatureContext, R as RowModelContext, d as AnyRow, e as FeatureTypes, O as OpName, f as InterceptorContext, g as OpResult, T as TableState, h as TableOptions, i as ServerFetcher, j as TableStateFor, k as Table, l as ApiOf } from './explain-Dn99IQt0.js';
|
|
4
|
+
export { m as AccessorColumn, n as Apply, B as BuiltinOperations, C as CELL_FALLBACK, o as CellContext, p as CellFailures, q as CellSlot, r as ColumnDef, s as ColumnValues, t as ContextBase, u as ContextPool, v as ControlledState, w as Core, E as ExplainStep, x as FetchOutcome, y as FetchParams, z as FetchResult, D as Fetcher, G as FilterFor, H as HotOpWarning, J as InterceptorRuntimeOptions, K as InvalidCellContext, L as IsAny, M as KeyColumn, N as Listener, P as LooseRow, Q as OpInput, U as OpKind, V as OpOutput, W as OpSpec, X as OperationInfo, Y as Operations, Z as OptionRule, _ as OptionType, $ as OptionsDefinition, a0 as OptionsSchema, a1 as Path, a2 as PathValue, a3 as Primitive, a4 as RenderReq, a5 as RowExplanation, a6 as RowModel, a7 as RowModelStatus, a8 as RowOf, a9 as RowStep, aa as RowStepOutcome, ab as SERVER_SOURCE, ac as SliceUpdater, ad as SortAlgorithm, ae as StateOf, af as TableDiagnosticsOptions, ag as TableExplanation, ah as UPDATE_DEPTH_LIMIT, ai as Updater, aj as createContext, ak as createContextPool, al as createInterceptorRuntime, am as defineInterceptor, an as defineOptions, ao as emitTableDiagnostic, ap as getOperation, aq as isOptionsDefinition, ar as listOperations, as as registerOperation, at as runCells } from './explain-Dn99IQt0.js';
|
|
5
5
|
import { ColumnFiltersTypes } from './column-filters.js';
|
|
6
6
|
export { ColumnFilter, ColumnFiltersApi, ColumnFiltersOptions, ColumnFiltersState, ContainsFilter, CustomFilter, EqualsFilter, InFilter, RangeFilter, RangeValue, columnFilters } from './column-filters.js';
|
|
7
7
|
import { PaginationState, PaginationApi } from './pagination.js';
|
|
8
8
|
export { PaginationOptions, pagination } from './pagination.js';
|
|
9
9
|
import { SearchApi } from './search.js';
|
|
10
10
|
export { SearchOptions, SearchTyping, SearchWait, search } from './search.js';
|
|
11
|
-
import { S as SearchState } from './search-async-entry-
|
|
12
|
-
export { A as AsyncSearchFn, a as SEARCH_ENGINE, b as SearchFn, c as SearchFnContext, d as SearchOutcome, e as SearchResult, f as SearchStatus, w as withSearchFn } from './search-async-entry-
|
|
11
|
+
import { S as SearchState } from './search-async-entry-DGSw2pDL.js';
|
|
12
|
+
export { A as AsyncSearchFn, a as SEARCH_ENGINE, b as SearchFn, c as SearchFnContext, d as SearchOutcome, e as SearchResult, f as SearchStatus, w as withSearchFn } from './search-async-entry-DGSw2pDL.js';
|
|
13
13
|
import { SortingTypes } from './sorting.js';
|
|
14
14
|
export { SortAlgorithmOption, SortDirection, SortEntry, SortingApi, SortingOptions, SortingState, compareValues, sorting, typeRank } from './sorting.js';
|
|
15
15
|
import { ValidityState, ValidityApi } from './validity.js';
|
|
@@ -110,6 +110,7 @@ interface DiagnosticsOptions {
|
|
|
110
110
|
max: number;
|
|
111
111
|
windowMs: number;
|
|
112
112
|
};
|
|
113
|
+
/** Clock (epoch ms) for `occurrences` and the rate limit. Default `wallClock` (never `Date`, #7). */
|
|
113
114
|
now?: () => number;
|
|
114
115
|
}
|
|
115
116
|
interface Diagnostics {
|
|
@@ -157,7 +158,8 @@ interface FixedFeatureDefinition<Name extends string, S, A> extends Omit<Feature
|
|
|
157
158
|
rowModel?: (indices: Uint32Array, state: S, ctx: RowModelContext<AnyRow>) => Uint32Array;
|
|
158
159
|
}
|
|
159
160
|
/**
|
|
160
|
-
* Defines a feature (§3.3).
|
|
161
|
+
* Defines a feature (§3.3). Returns `definition` as is (it exists for typing) and installs the
|
|
162
|
+
* feature runtime.
|
|
161
163
|
*
|
|
162
164
|
* Row-typed feature (all built-ins): declare the types interface and pass both type arguments.
|
|
163
165
|
*
|
|
@@ -25,7 +25,10 @@ __export(cell_batch_exports, {
|
|
|
25
25
|
runCells: () => runCells
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(cell_batch_exports);
|
|
28
|
+
var import_catalog = require("../diagnostics/catalog.cjs");
|
|
28
29
|
var import_classify = require("./classify.cjs");
|
|
30
|
+
var import_codes = require("./codes.cjs");
|
|
31
|
+
(0, import_catalog.keepDiagnostics)(import_codes.boundaryDiagnostics);
|
|
29
32
|
var CELL_FALLBACK = {
|
|
30
33
|
accessor: void 0,
|
|
31
34
|
format: "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/intercept/cell-batch.ts"],"sourcesContent":["import type { Emit, EmitOptions } from '../diagnostics/types'\nimport { errorName } from './classify'\n\n/** The cell slots of `column:batch`. */\nexport type CellSlot = 'accessor' | 'format' | 'filterFn' | 'sortBy'\n\n/**\n * Per failed cell (§3.4): `''` (format) / `undefined` (accessor) / non-matching (filter fn) /\n * `undefined`, sorted last as a missing value (sortBy).\n */\nexport const CELL_FALLBACK = {\n accessor: undefined,\n format: '',\n filterFn: false,\n sortBy: undefined,\n} as const\n\nconst CELL_FALLBACK_TEXT: Record<CellSlot, string> = {\n accessor: 'the failed cells read as undefined',\n format: \"the failed cells render ''\",\n filterFn: 'the failed rows are treated as non-matching',\n sortBy: 'the failed rows sort as missing values (last)',\n}\n\n/**\n * Failures of one column's cells in one pipeline run, recorded as numbers (§3.4): a count, the\n * first `sample` row indices and the first error. No per-cell allocation; `where` and text are\n * built only in {@link CellFailures.report}. Reuse one instance per column across runs.\n */\nexport class CellFailures {\n count = 0\n private first: unknown\n private readonly rows: Uint32Array\n\n constructor(sample = 5) {\n this.rows = new Uint32Array(sample)\n }\n\n add(row: number, error: unknown): void {\n if (this.count === 0) this.first = error\n if (this.count < this.rows.length) this.rows[this.count] = row\n this.count++\n }\n\n /** The recorded sample of failing row indices (a view; valid until the next reset). */\n sample(): Uint32Array {\n return this.rows.subarray(0, Math.min(this.count, this.rows.length))\n }\n\n reset(): void {\n this.count = 0\n this.first = undefined\n }\n\n /**\n * Emits one `DK_CALLBACK_FAILED` for this column (if any cell failed), then resets. `where` is the\n * slot path `columns[<index>].<slot>`; `field` replaces the slot name in that path when the\n * failing column field differs (`key` for a key column whose getter threw).\n */\n report(\n emit: Emit,\n columnIndex: number,\n columnId: string,\n slot: CellSlot,\n options?: EmitOptions,\n field: string = slot,\n ): void {\n if (this.count === 0) return\n const name = errorName(this.first)\n emit(\n 'DK_CALLBACK_FAILED',\n {\n slot: `columns[${columnIndex}].${field}`,\n column: columnId,\n rows: Array.from(this.sample()),\n count: this.count,\n fallback: CELL_FALLBACK_TEXT[slot],\n ...(name === undefined ? {} : { errorName: name }),\n },\n { ...options, cause: this.first },\n )\n this.reset()\n }\n}\n\n/**\n * The body of a `column:batch`: runs `cell` for each row in `rows` and writes `out[row]`. A throwing\n * cell gets `fallback` and is recorded in `failures` — the loop never throws per cell and never\n * dispatches an interceptor per cell. Call `failures.report(...)` once after the loop.\n */\nexport function runCells<R>(\n rows: Uint32Array,\n cell: (row: number) => R,\n out: { [row: number]: R },\n fallback: R,\n failures: CellFailures,\n): void {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i] as number\n try {\n out[row] = cell(row)\n } catch (e) {\n out[row] = fallback\n failures.add(row, e)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/intercept/cell-batch.ts"],"sourcesContent":["import { keepDiagnostics } from '../diagnostics/catalog'\nimport type { Emit, EmitOptions } from '../diagnostics/types'\nimport { errorName } from './classify'\nimport { boundaryDiagnostics } from './codes'\n\n// CellFailures emits DK_CALLBACK_FAILED: keep its definition wherever this module is bundled (a\n// feature entry alone brings the feature runtime, and with it the column cache, #5).\nkeepDiagnostics(boundaryDiagnostics)\n\n/** The cell slots of `column:batch`. */\nexport type CellSlot = 'accessor' | 'format' | 'filterFn' | 'sortBy'\n\n/**\n * Per failed cell (§3.4): `''` (format) / `undefined` (accessor) / non-matching (filter fn) /\n * `undefined`, sorted last as a missing value (sortBy).\n */\nexport const CELL_FALLBACK = {\n accessor: undefined,\n format: '',\n filterFn: false,\n sortBy: undefined,\n} as const\n\nconst CELL_FALLBACK_TEXT: Record<CellSlot, string> = {\n accessor: 'the failed cells read as undefined',\n format: \"the failed cells render ''\",\n filterFn: 'the failed rows are treated as non-matching',\n sortBy: 'the failed rows sort as missing values (last)',\n}\n\n/**\n * Failures of one column's cells in one pipeline run, recorded as numbers (§3.4): a count, the\n * first `sample` row indices and the first error. No per-cell allocation; `where` and text are\n * built only in {@link CellFailures.report}. Reuse one instance per column across runs.\n */\nexport class CellFailures {\n count = 0\n private first: unknown\n private readonly rows: Uint32Array\n\n constructor(sample = 5) {\n this.rows = new Uint32Array(sample)\n }\n\n add(row: number, error: unknown): void {\n if (this.count === 0) this.first = error\n if (this.count < this.rows.length) this.rows[this.count] = row\n this.count++\n }\n\n /** The recorded sample of failing row indices (a view; valid until the next reset). */\n sample(): Uint32Array {\n return this.rows.subarray(0, Math.min(this.count, this.rows.length))\n }\n\n reset(): void {\n this.count = 0\n this.first = undefined\n }\n\n /**\n * Emits one `DK_CALLBACK_FAILED` for this column (if any cell failed), then resets. `where` is the\n * slot path `columns[<index>].<slot>`; `field` replaces the slot name in that path when the\n * failing column field differs (`key` for a key column whose getter threw).\n */\n report(\n emit: Emit,\n columnIndex: number,\n columnId: string,\n slot: CellSlot,\n options?: EmitOptions,\n field: string = slot,\n ): void {\n if (this.count === 0) return\n const name = errorName(this.first)\n emit(\n 'DK_CALLBACK_FAILED',\n {\n slot: `columns[${columnIndex}].${field}`,\n column: columnId,\n rows: Array.from(this.sample()),\n count: this.count,\n fallback: CELL_FALLBACK_TEXT[slot],\n ...(name === undefined ? {} : { errorName: name }),\n },\n { ...options, cause: this.first },\n )\n this.reset()\n }\n}\n\n/**\n * The body of a `column:batch`: runs `cell` for each row in `rows` and writes `out[row]`. A throwing\n * cell gets `fallback` and is recorded in `failures` — the loop never throws per cell and never\n * dispatches an interceptor per cell. Call `failures.report(...)` once after the loop.\n */\nexport function runCells<R>(\n rows: Uint32Array,\n cell: (row: number) => R,\n out: { [row: number]: R },\n fallback: R,\n failures: CellFailures,\n): void {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i] as number\n try {\n out[row] = cell(row)\n } catch (e) {\n out[row] = fallback\n failures.add(row, e)\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAgC;AAEhC,sBAA0B;AAC1B,mBAAoC;AAAA,IAIpC,gCAAgB,gCAAmB;AAS5B,IAAM,gBAAgB;AAAA,EAC3B,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,QAAQ;AACV;AAEA,IAAM,qBAA+C;AAAA,EACnD,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,QAAQ;AACV;AAOO,IAAM,eAAN,MAAmB;AAAA,EAKxB,YAAY,SAAS,GAAG;AAJxB,iBAAQ;AAKN,SAAK,OAAO,IAAI,YAAY,MAAM;AAAA,EACpC;AAAA,EAEA,IAAI,KAAa,OAAsB;AACrC,QAAI,KAAK,UAAU,EAAG,MAAK,QAAQ;AACnC,QAAI,KAAK,QAAQ,KAAK,KAAK,OAAQ,MAAK,KAAK,KAAK,KAAK,IAAI;AAC3D,SAAK;AAAA,EACP;AAAA;AAAA,EAGA,SAAsB;AACpB,WAAO,KAAK,KAAK,SAAS,GAAG,KAAK,IAAI,KAAK,OAAO,KAAK,KAAK,MAAM,CAAC;AAAA,EACrE;AAAA,EAEA,QAAc;AACZ,SAAK,QAAQ;AACb,SAAK,QAAQ;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OACE,MACA,aACA,UACA,MACA,SACA,QAAgB,MACV;AACN,QAAI,KAAK,UAAU,EAAG;AACtB,UAAM,WAAO,2BAAU,KAAK,KAAK;AACjC;AAAA,MACE;AAAA,MACA;AAAA,QACE,MAAM,WAAW,WAAW,KAAK,KAAK;AAAA,QACtC,QAAQ;AAAA,QACR,MAAM,MAAM,KAAK,KAAK,OAAO,CAAC;AAAA,QAC9B,OAAO,KAAK;AAAA,QACZ,UAAU,mBAAmB,IAAI;AAAA,QACjC,GAAI,SAAS,SAAY,CAAC,IAAI,EAAE,WAAW,KAAK;AAAA,MAClD;AAAA,MACA,EAAE,GAAG,SAAS,OAAO,KAAK,MAAM;AAAA,IAClC;AACA,SAAK,MAAM;AAAA,EACb;AACF;AAOO,SAAS,SACd,MACA,MACA,KACA,UACA,UACM;AACN,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,MAAM,KAAK,CAAC;AAClB,QAAI;AACF,UAAI,GAAG,IAAI,KAAK,GAAG;AAAA,IACrB,SAAS,GAAG;AACV,UAAI,GAAG,IAAI;AACX,eAAS,IAAI,KAAK,CAAC;AAAA,IACrB;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// src/intercept/cell-batch.ts
|
|
2
|
+
import { keepDiagnostics } from "../diagnostics/catalog.js";
|
|
2
3
|
import { errorName } from "./classify.js";
|
|
4
|
+
import { boundaryDiagnostics } from "./codes.js";
|
|
5
|
+
keepDiagnostics(boundaryDiagnostics);
|
|
3
6
|
var CELL_FALLBACK = {
|
|
4
7
|
accessor: void 0,
|
|
5
8
|
format: "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/intercept/cell-batch.ts"],"sourcesContent":["import type { Emit, EmitOptions } from '../diagnostics/types'\nimport { errorName } from './classify'\n\n/** The cell slots of `column:batch`. */\nexport type CellSlot = 'accessor' | 'format' | 'filterFn' | 'sortBy'\n\n/**\n * Per failed cell (§3.4): `''` (format) / `undefined` (accessor) / non-matching (filter fn) /\n * `undefined`, sorted last as a missing value (sortBy).\n */\nexport const CELL_FALLBACK = {\n accessor: undefined,\n format: '',\n filterFn: false,\n sortBy: undefined,\n} as const\n\nconst CELL_FALLBACK_TEXT: Record<CellSlot, string> = {\n accessor: 'the failed cells read as undefined',\n format: \"the failed cells render ''\",\n filterFn: 'the failed rows are treated as non-matching',\n sortBy: 'the failed rows sort as missing values (last)',\n}\n\n/**\n * Failures of one column's cells in one pipeline run, recorded as numbers (§3.4): a count, the\n * first `sample` row indices and the first error. No per-cell allocation; `where` and text are\n * built only in {@link CellFailures.report}. Reuse one instance per column across runs.\n */\nexport class CellFailures {\n count = 0\n private first: unknown\n private readonly rows: Uint32Array\n\n constructor(sample = 5) {\n this.rows = new Uint32Array(sample)\n }\n\n add(row: number, error: unknown): void {\n if (this.count === 0) this.first = error\n if (this.count < this.rows.length) this.rows[this.count] = row\n this.count++\n }\n\n /** The recorded sample of failing row indices (a view; valid until the next reset). */\n sample(): Uint32Array {\n return this.rows.subarray(0, Math.min(this.count, this.rows.length))\n }\n\n reset(): void {\n this.count = 0\n this.first = undefined\n }\n\n /**\n * Emits one `DK_CALLBACK_FAILED` for this column (if any cell failed), then resets. `where` is the\n * slot path `columns[<index>].<slot>`; `field` replaces the slot name in that path when the\n * failing column field differs (`key` for a key column whose getter threw).\n */\n report(\n emit: Emit,\n columnIndex: number,\n columnId: string,\n slot: CellSlot,\n options?: EmitOptions,\n field: string = slot,\n ): void {\n if (this.count === 0) return\n const name = errorName(this.first)\n emit(\n 'DK_CALLBACK_FAILED',\n {\n slot: `columns[${columnIndex}].${field}`,\n column: columnId,\n rows: Array.from(this.sample()),\n count: this.count,\n fallback: CELL_FALLBACK_TEXT[slot],\n ...(name === undefined ? {} : { errorName: name }),\n },\n { ...options, cause: this.first },\n )\n this.reset()\n }\n}\n\n/**\n * The body of a `column:batch`: runs `cell` for each row in `rows` and writes `out[row]`. A throwing\n * cell gets `fallback` and is recorded in `failures` — the loop never throws per cell and never\n * dispatches an interceptor per cell. Call `failures.report(...)` once after the loop.\n */\nexport function runCells<R>(\n rows: Uint32Array,\n cell: (row: number) => R,\n out: { [row: number]: R },\n fallback: R,\n failures: CellFailures,\n): void {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i] as number\n try {\n out[row] = cell(row)\n } catch (e) {\n out[row] = fallback\n failures.add(row, e)\n }\n }\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/intercept/cell-batch.ts"],"sourcesContent":["import { keepDiagnostics } from '../diagnostics/catalog'\nimport type { Emit, EmitOptions } from '../diagnostics/types'\nimport { errorName } from './classify'\nimport { boundaryDiagnostics } from './codes'\n\n// CellFailures emits DK_CALLBACK_FAILED: keep its definition wherever this module is bundled (a\n// feature entry alone brings the feature runtime, and with it the column cache, #5).\nkeepDiagnostics(boundaryDiagnostics)\n\n/** The cell slots of `column:batch`. */\nexport type CellSlot = 'accessor' | 'format' | 'filterFn' | 'sortBy'\n\n/**\n * Per failed cell (§3.4): `''` (format) / `undefined` (accessor) / non-matching (filter fn) /\n * `undefined`, sorted last as a missing value (sortBy).\n */\nexport const CELL_FALLBACK = {\n accessor: undefined,\n format: '',\n filterFn: false,\n sortBy: undefined,\n} as const\n\nconst CELL_FALLBACK_TEXT: Record<CellSlot, string> = {\n accessor: 'the failed cells read as undefined',\n format: \"the failed cells render ''\",\n filterFn: 'the failed rows are treated as non-matching',\n sortBy: 'the failed rows sort as missing values (last)',\n}\n\n/**\n * Failures of one column's cells in one pipeline run, recorded as numbers (§3.4): a count, the\n * first `sample` row indices and the first error. No per-cell allocation; `where` and text are\n * built only in {@link CellFailures.report}. Reuse one instance per column across runs.\n */\nexport class CellFailures {\n count = 0\n private first: unknown\n private readonly rows: Uint32Array\n\n constructor(sample = 5) {\n this.rows = new Uint32Array(sample)\n }\n\n add(row: number, error: unknown): void {\n if (this.count === 0) this.first = error\n if (this.count < this.rows.length) this.rows[this.count] = row\n this.count++\n }\n\n /** The recorded sample of failing row indices (a view; valid until the next reset). */\n sample(): Uint32Array {\n return this.rows.subarray(0, Math.min(this.count, this.rows.length))\n }\n\n reset(): void {\n this.count = 0\n this.first = undefined\n }\n\n /**\n * Emits one `DK_CALLBACK_FAILED` for this column (if any cell failed), then resets. `where` is the\n * slot path `columns[<index>].<slot>`; `field` replaces the slot name in that path when the\n * failing column field differs (`key` for a key column whose getter threw).\n */\n report(\n emit: Emit,\n columnIndex: number,\n columnId: string,\n slot: CellSlot,\n options?: EmitOptions,\n field: string = slot,\n ): void {\n if (this.count === 0) return\n const name = errorName(this.first)\n emit(\n 'DK_CALLBACK_FAILED',\n {\n slot: `columns[${columnIndex}].${field}`,\n column: columnId,\n rows: Array.from(this.sample()),\n count: this.count,\n fallback: CELL_FALLBACK_TEXT[slot],\n ...(name === undefined ? {} : { errorName: name }),\n },\n { ...options, cause: this.first },\n )\n this.reset()\n }\n}\n\n/**\n * The body of a `column:batch`: runs `cell` for each row in `rows` and writes `out[row]`. A throwing\n * cell gets `fallback` and is recorded in `failures` — the loop never throws per cell and never\n * dispatches an interceptor per cell. Call `failures.report(...)` once after the loop.\n */\nexport function runCells<R>(\n rows: Uint32Array,\n cell: (row: number) => R,\n out: { [row: number]: R },\n fallback: R,\n failures: CellFailures,\n): void {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i] as number\n try {\n out[row] = cell(row)\n } catch (e) {\n out[row] = fallback\n failures.add(row, e)\n }\n }\n}\n"],"mappings":";AAAA,SAAS,uBAAuB;AAEhC,SAAS,iBAAiB;AAC1B,SAAS,2BAA2B;AAIpC,gBAAgB,mBAAmB;AAS5B,IAAM,gBAAgB;AAAA,EAC3B,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,QAAQ;AACV;AAEA,IAAM,qBAA+C;AAAA,EACnD,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,QAAQ;AACV;AAOO,IAAM,eAAN,MAAmB;AAAA,EAKxB,YAAY,SAAS,GAAG;AAJxB,iBAAQ;AAKN,SAAK,OAAO,IAAI,YAAY,MAAM;AAAA,EACpC;AAAA,EAEA,IAAI,KAAa,OAAsB;AACrC,QAAI,KAAK,UAAU,EAAG,MAAK,QAAQ;AACnC,QAAI,KAAK,QAAQ,KAAK,KAAK,OAAQ,MAAK,KAAK,KAAK,KAAK,IAAI;AAC3D,SAAK;AAAA,EACP;AAAA;AAAA,EAGA,SAAsB;AACpB,WAAO,KAAK,KAAK,SAAS,GAAG,KAAK,IAAI,KAAK,OAAO,KAAK,KAAK,MAAM,CAAC;AAAA,EACrE;AAAA,EAEA,QAAc;AACZ,SAAK,QAAQ;AACb,SAAK,QAAQ;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OACE,MACA,aACA,UACA,MACA,SACA,QAAgB,MACV;AACN,QAAI,KAAK,UAAU,EAAG;AACtB,UAAM,OAAO,UAAU,KAAK,KAAK;AACjC;AAAA,MACE;AAAA,MACA;AAAA,QACE,MAAM,WAAW,WAAW,KAAK,KAAK;AAAA,QACtC,QAAQ;AAAA,QACR,MAAM,MAAM,KAAK,KAAK,OAAO,CAAC;AAAA,QAC9B,OAAO,KAAK;AAAA,QACZ,UAAU,mBAAmB,IAAI;AAAA,QACjC,GAAI,SAAS,SAAY,CAAC,IAAI,EAAE,WAAW,KAAK;AAAA,MAClD;AAAA,MACA,EAAE,GAAG,SAAS,OAAO,KAAK,MAAM;AAAA,IAClC;AACA,SAAK,MAAM;AAAA,EACb;AACF;AAOO,SAAS,SACd,MACA,MACA,KACA,UACA,UACM;AACN,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,MAAM,KAAK,CAAC;AAClB,QAAI;AACF,UAAI,GAAG,IAAI,KAAK,GAAG;AAAA,IACrB,SAAS,GAAG;AACV,UAAI,GAAG,IAAI;AACX,eAAS,IAAI,KAAK,CAAC;AAAA,IACrB;AAAA,EACF;AACF;","names":[]}
|
package/dist/pagination.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ai as paginationDiagnostics } from './codes-
|
|
2
|
-
import { F as Feature, b as FixedTypes } from './explain-
|
|
1
|
+
export { ai as paginationDiagnostics } from './codes-OsjAR3Wz.cjs';
|
|
2
|
+
import { F as Feature, b as FixedTypes } from './explain-vkD2cewE.cjs';
|
|
3
3
|
import { a as DataMode } from './mode-DFV8ryXo.cjs';
|
|
4
4
|
|
|
5
5
|
interface PaginationState {
|
package/dist/pagination.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ai as paginationDiagnostics } from './codes-
|
|
2
|
-
import { F as Feature, b as FixedTypes } from './explain-
|
|
1
|
+
export { ai as paginationDiagnostics } from './codes-OsjAR3Wz.js';
|
|
2
|
+
import { F as Feature, b as FixedTypes } from './explain-Dn99IQt0.js';
|
|
3
3
|
import { a as DataMode } from './mode-DFV8ryXo.js';
|
|
4
4
|
|
|
5
5
|
interface PaginationState {
|
package/dist/pipeline/row.cjs
CHANGED
|
@@ -27,29 +27,30 @@ __export(row_exports, {
|
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(row_exports);
|
|
29
29
|
var NO_ISSUES = Object.freeze([]);
|
|
30
|
+
var SOURCE = /* @__PURE__ */ Symbol();
|
|
31
|
+
SOURCE;
|
|
30
32
|
var Row = class {
|
|
31
|
-
#source;
|
|
32
33
|
/** @internal Rows are created by the pipeline. */
|
|
33
34
|
constructor(source, index, key, original) {
|
|
34
35
|
this.key = key;
|
|
35
36
|
this.index = index;
|
|
36
37
|
this.original = original;
|
|
37
|
-
this
|
|
38
|
+
this[SOURCE] = source;
|
|
38
39
|
}
|
|
39
40
|
/** `false` for a row flagged by schema validation (`invalidRows: 'flag'`). */
|
|
40
41
|
get valid() {
|
|
41
|
-
return this
|
|
42
|
+
return this[SOURCE].issues(this.index) === void 0;
|
|
42
43
|
}
|
|
43
44
|
/** The row's schema issues (empty for a valid row). */
|
|
44
45
|
get issues() {
|
|
45
|
-
return this
|
|
46
|
+
return this[SOURCE].issues(this.index) ?? NO_ISSUES;
|
|
46
47
|
}
|
|
47
48
|
/**
|
|
48
49
|
* The value of column `id` for this row (`key` path or `accessor`); `undefined` for an unknown
|
|
49
50
|
* column. Never throws: a throwing accessor reports `DK_CALLBACK_FAILED` and reads `undefined`.
|
|
50
51
|
*/
|
|
51
52
|
getValue(id) {
|
|
52
|
-
return this
|
|
53
|
+
return this[SOURCE].value(this.index, this.original, id);
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
56
|
* The schema issues whose path points into column `id`, matched segment by segment: the issue
|
|
@@ -58,8 +59,8 @@ var Row = class {
|
|
|
58
59
|
* so they get only those. Empty for a valid row or an unknown column.
|
|
59
60
|
*/
|
|
60
61
|
getCellIssues(id) {
|
|
61
|
-
const issues = this
|
|
62
|
-
return issues === void 0 ? NO_ISSUES : this
|
|
62
|
+
const issues = this[SOURCE].issues(this.index);
|
|
63
|
+
return issues === void 0 ? NO_ISSUES : this[SOURCE].cellIssues(issues, id);
|
|
63
64
|
}
|
|
64
65
|
};
|
|
65
66
|
function sparse(length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pipeline/row.ts"],"sourcesContent":["/** A row identity: the `rowKey` value, or the fallback (§5.2). */\nexport type RowKey = string | number\n\n/** A validation issue of a row (Standard Schema v1 issue shape, §5.1). */\nexport interface RowIssue {\n readonly message: string\n readonly path?: readonly (PropertyKey | { readonly key: PropertyKey })[] | undefined\n}\n\n/** What a {@link Row} reads its cells through (internal; one per `columns` reference). */\nexport interface RowSource {\n value(index: number, original: unknown, id: string): unknown\n /** Schema issues of a flagged row (`invalidRows: 'flag'`); `undefined` for a valid row. */\n issues(index: number): readonly RowIssue[] | undefined\n /** The issues of a flagged row that touch column `id` (`matchCellIssues`). */\n cellIssues(issues: readonly RowIssue[], id: string): readonly RowIssue[]\n}\n\nexport const NO_ISSUES: readonly RowIssue[] = Object.freeze([])\n\n/**\n * One visible row (§6.6). Created only for the rows `getRowModel()` returns, never for the whole\n * data set (§9.1), and only when read ({@link lazyRows}); the methods live on the prototype, so a\n * row costs its four fields.\n */\nexport class Row<T = unknown> {\n /** The row's `rowKey` value (the row index without `rowKey`). */\n readonly key: RowKey\n /** Position in the ingested data. */\n readonly index: number\n /** The row object as passed in `data`. */\n readonly original: T\n readonly
|
|
1
|
+
{"version":3,"sources":["../../src/pipeline/row.ts"],"sourcesContent":["/** A row identity: the `rowKey` value, or the fallback (§5.2). */\nexport type RowKey = string | number\n\n/** A validation issue of a row (Standard Schema v1 issue shape, §5.1). */\nexport interface RowIssue {\n readonly message: string\n readonly path?: readonly (PropertyKey | { readonly key: PropertyKey })[] | undefined\n}\n\n/** What a {@link Row} reads its cells through (internal; one per `columns` reference). */\nexport interface RowSource {\n value(index: number, original: unknown, id: string): unknown\n /** Schema issues of a flagged row (`invalidRows: 'flag'`); `undefined` for a valid row. */\n issues(index: number): readonly RowIssue[] | undefined\n /** The issues of a flagged row that touch column `id` (`matchCellIssues`). */\n cellIssues(issues: readonly RowIssue[], id: string): readonly RowIssue[]\n}\n\nexport const NO_ISSUES: readonly RowIssue[] = Object.freeze([])\n\n/**\n * The key a {@link Row} keeps its {@link RowSource} under. A symbol, not a `#private` field: a\n * proxy-based store (Vue `ref` / `reactive`, Pinia, MobX) calls the getters and methods with\n * `this` = its proxy, which has no private slot, so `#source` threw there (#11). A symbol key\n * reads through any proxy, stays out of `Object.keys` and JSON, and is not exported.\n */\nconst SOURCE = Symbol()\n\n/**\n * One visible row (§6.6). Created only for the rows `getRowModel()` returns, never for the whole\n * data set (§9.1), and only when read ({@link lazyRows}); the methods live on the prototype, so a\n * row costs its four fields.\n */\nexport class Row<T = unknown> {\n /** The row's `rowKey` value (the row index without `rowKey`). */\n readonly key: RowKey\n /** Position in the ingested data. */\n readonly index: number\n /** The row object as passed in `data`. */\n readonly original: T\n /** @internal */\n private readonly [SOURCE]: RowSource\n\n /** @internal Rows are created by the pipeline. */\n constructor(source: RowSource, index: number, key: RowKey, original: T) {\n this.key = key\n this.index = index\n this.original = original\n this[SOURCE] = source\n }\n\n /** `false` for a row flagged by schema validation (`invalidRows: 'flag'`). */\n get valid(): boolean {\n return this[SOURCE].issues(this.index) === undefined\n }\n\n /** The row's schema issues (empty for a valid row). */\n get issues(): readonly RowIssue[] {\n return this[SOURCE].issues(this.index) ?? NO_ISSUES\n }\n\n /**\n * The value of column `id` for this row (`key` path or `accessor`); `undefined` for an unknown\n * column. Never throws: a throwing accessor reports `DK_CALLBACK_FAILED` and reads `undefined`.\n */\n getValue(id: string): unknown {\n return this[SOURCE].value(this.index, this.original, id)\n }\n\n /**\n * The schema issues whose path points into column `id`, matched segment by segment: the issue\n * path equals the column key, or one contains the other (`address` ↔ `address.city`, never\n * `addressLine`). Row-level issues (no path) count for every cell; accessor columns have no key,\n * so they get only those. Empty for a valid row or an unknown column.\n */\n getCellIssues(id: string): readonly RowIssue[] {\n const issues = this[SOURCE].issues(this.index)\n return issues === undefined ? NO_ISSUES : this[SOURCE].cellIssues(issues, id)\n }\n}\n\n/** A valid row under `invalidRows: 'flag'`: `original` is the schema output. */\nexport type ValidRow<T> = Row<T> & { readonly valid: true }\n\n/** A flagged row (`invalidRows: 'flag'`): `original` is the raw, unvalidated value. */\nexport type FlaggedInvalidRow = Row<unknown> & { readonly valid: false }\n\n/** `getRowModel().rows` under `invalidRows: 'flag'` (§5.1): narrow on `row.valid`. */\nexport type FlaggedRow<T> = ValidRow<T> | FlaggedInvalidRow\n\n/**\n * An empty array of `length` without a backing store: setting `length` (or `new Array(n)`)\n * allocates `n` slots; a write at `n - 1` then deleting it leaves sparse (dictionary) elements. V8\n * turns it back into a plain array once it is filled.\n */\nfunction sparse<R>(length: number): R[] {\n const a: R[] = []\n if (length > 0) {\n a[length - 1] = undefined as R\n delete a[length - 1]\n }\n return a\n}\n\n/** `p` as an index below `length` (a canonical array index string), else `-1`. */\nexport function arrayIndex(p: string | symbol, length: number): number {\n const i = typeof p === 'string' ? Number(p) : -1\n return i >= 0 && i < length && String(i) === p ? i : -1\n}\n\n/**\n * `RowModel.rows` without a `Row` per visible row up front (§9.3 memory: 90k rows unpaginated): a\n * real array (`Array.isArray`, `length`, index reads, iteration, every array method) over a sparse\n * target that builds row `i` with `make(i)` the first time it is read and keeps it, so identity is\n * stable. `Object.keys` / `ownKeys` build every row first.\n */\nexport function lazyRows<R>(length: number, make: (i: number) => R): R[] {\n const t = sparse<R>(length)\n /** Builds row `i` (an index from {@link arrayIndex}; `-1` is not one) unless it exists. */\n const build = (i: number) => {\n if (i >= 0 && !(i in t)) t[i] = make(i)\n }\n return new Proxy(t, {\n get(_, p, receiver) {\n build(arrayIndex(p, length))\n return Reflect.get(t, p, receiver)\n },\n has: (_, p) => arrayIndex(p, length) >= 0 || Reflect.has(t, p),\n getOwnPropertyDescriptor(_, p) {\n build(arrayIndex(p, length))\n return Reflect.getOwnPropertyDescriptor(t, p)\n },\n ownKeys() {\n for (let i = 0; i < length; i++) build(i)\n return Reflect.ownKeys(t)\n },\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,IAAM,YAAiC,OAAO,OAAO,CAAC,CAAC;AAQ9D,IAAM,SAAS,uBAAO;AAeF;AARb,IAAM,MAAN,MAAuB;AAAA;AAAA,EAW5B,YAAY,QAAmB,OAAe,KAAa,UAAa;AACtE,SAAK,MAAM;AACX,SAAK,QAAQ;AACb,SAAK,WAAW;AAChB,SAAK,MAAM,IAAI;AAAA,EACjB;AAAA;AAAA,EAGA,IAAI,QAAiB;AACnB,WAAO,KAAK,MAAM,EAAE,OAAO,KAAK,KAAK,MAAM;AAAA,EAC7C;AAAA;AAAA,EAGA,IAAI,SAA8B;AAChC,WAAO,KAAK,MAAM,EAAE,OAAO,KAAK,KAAK,KAAK;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAS,IAAqB;AAC5B,WAAO,KAAK,MAAM,EAAE,MAAM,KAAK,OAAO,KAAK,UAAU,EAAE;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,cAAc,IAAiC;AAC7C,UAAM,SAAS,KAAK,MAAM,EAAE,OAAO,KAAK,KAAK;AAC7C,WAAO,WAAW,SAAY,YAAY,KAAK,MAAM,EAAE,WAAW,QAAQ,EAAE;AAAA,EAC9E;AACF;AAgBA,SAAS,OAAU,QAAqB;AACtC,QAAM,IAAS,CAAC;AAChB,MAAI,SAAS,GAAG;AACd,MAAE,SAAS,CAAC,IAAI;AAChB,WAAO,EAAE,SAAS,CAAC;AAAA,EACrB;AACA,SAAO;AACT;AAGO,SAAS,WAAW,GAAoB,QAAwB;AACrE,QAAM,IAAI,OAAO,MAAM,WAAW,OAAO,CAAC,IAAI;AAC9C,SAAO,KAAK,KAAK,IAAI,UAAU,OAAO,CAAC,MAAM,IAAI,IAAI;AACvD;AAQO,SAAS,SAAY,QAAgB,MAA6B;AACvE,QAAM,IAAI,OAAU,MAAM;AAE1B,QAAM,QAAQ,CAAC,MAAc;AAC3B,QAAI,KAAK,KAAK,EAAE,KAAK,GAAI,GAAE,CAAC,IAAI,KAAK,CAAC;AAAA,EACxC;AACA,SAAO,IAAI,MAAM,GAAG;AAAA,IAClB,IAAI,GAAG,GAAG,UAAU;AAClB,YAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,aAAO,QAAQ,IAAI,GAAG,GAAG,QAAQ;AAAA,IACnC;AAAA,IACA,KAAK,CAAC,GAAG,MAAM,WAAW,GAAG,MAAM,KAAK,KAAK,QAAQ,IAAI,GAAG,CAAC;AAAA,IAC7D,yBAAyB,GAAG,GAAG;AAC7B,YAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,aAAO,QAAQ,yBAAyB,GAAG,CAAC;AAAA,IAC9C;AAAA,IACA,UAAU;AACR,eAAS,IAAI,GAAG,IAAI,QAAQ,IAAK,OAAM,CAAC;AACxC,aAAO,QAAQ,QAAQ,CAAC;AAAA,IAC1B;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/dist/pipeline/row.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
// src/pipeline/row.ts
|
|
2
2
|
var NO_ISSUES = Object.freeze([]);
|
|
3
|
+
var SOURCE = /* @__PURE__ */ Symbol();
|
|
4
|
+
SOURCE;
|
|
3
5
|
var Row = class {
|
|
4
|
-
#source;
|
|
5
6
|
/** @internal Rows are created by the pipeline. */
|
|
6
7
|
constructor(source, index, key, original) {
|
|
7
8
|
this.key = key;
|
|
8
9
|
this.index = index;
|
|
9
10
|
this.original = original;
|
|
10
|
-
this
|
|
11
|
+
this[SOURCE] = source;
|
|
11
12
|
}
|
|
12
13
|
/** `false` for a row flagged by schema validation (`invalidRows: 'flag'`). */
|
|
13
14
|
get valid() {
|
|
14
|
-
return this
|
|
15
|
+
return this[SOURCE].issues(this.index) === void 0;
|
|
15
16
|
}
|
|
16
17
|
/** The row's schema issues (empty for a valid row). */
|
|
17
18
|
get issues() {
|
|
18
|
-
return this
|
|
19
|
+
return this[SOURCE].issues(this.index) ?? NO_ISSUES;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* The value of column `id` for this row (`key` path or `accessor`); `undefined` for an unknown
|
|
22
23
|
* column. Never throws: a throwing accessor reports `DK_CALLBACK_FAILED` and reads `undefined`.
|
|
23
24
|
*/
|
|
24
25
|
getValue(id) {
|
|
25
|
-
return this
|
|
26
|
+
return this[SOURCE].value(this.index, this.original, id);
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* The schema issues whose path points into column `id`, matched segment by segment: the issue
|
|
@@ -31,8 +32,8 @@ var Row = class {
|
|
|
31
32
|
* so they get only those. Empty for a valid row or an unknown column.
|
|
32
33
|
*/
|
|
33
34
|
getCellIssues(id) {
|
|
34
|
-
const issues = this
|
|
35
|
-
return issues === void 0 ? NO_ISSUES : this
|
|
35
|
+
const issues = this[SOURCE].issues(this.index);
|
|
36
|
+
return issues === void 0 ? NO_ISSUES : this[SOURCE].cellIssues(issues, id);
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
39
|
function sparse(length) {
|
package/dist/pipeline/row.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pipeline/row.ts"],"sourcesContent":["/** A row identity: the `rowKey` value, or the fallback (§5.2). */\nexport type RowKey = string | number\n\n/** A validation issue of a row (Standard Schema v1 issue shape, §5.1). */\nexport interface RowIssue {\n readonly message: string\n readonly path?: readonly (PropertyKey | { readonly key: PropertyKey })[] | undefined\n}\n\n/** What a {@link Row} reads its cells through (internal; one per `columns` reference). */\nexport interface RowSource {\n value(index: number, original: unknown, id: string): unknown\n /** Schema issues of a flagged row (`invalidRows: 'flag'`); `undefined` for a valid row. */\n issues(index: number): readonly RowIssue[] | undefined\n /** The issues of a flagged row that touch column `id` (`matchCellIssues`). */\n cellIssues(issues: readonly RowIssue[], id: string): readonly RowIssue[]\n}\n\nexport const NO_ISSUES: readonly RowIssue[] = Object.freeze([])\n\n/**\n * One visible row (§6.6). Created only for the rows `getRowModel()` returns, never for the whole\n * data set (§9.1), and only when read ({@link lazyRows}); the methods live on the prototype, so a\n * row costs its four fields.\n */\nexport class Row<T = unknown> {\n /** The row's `rowKey` value (the row index without `rowKey`). */\n readonly key: RowKey\n /** Position in the ingested data. */\n readonly index: number\n /** The row object as passed in `data`. */\n readonly original: T\n readonly
|
|
1
|
+
{"version":3,"sources":["../../src/pipeline/row.ts"],"sourcesContent":["/** A row identity: the `rowKey` value, or the fallback (§5.2). */\nexport type RowKey = string | number\n\n/** A validation issue of a row (Standard Schema v1 issue shape, §5.1). */\nexport interface RowIssue {\n readonly message: string\n readonly path?: readonly (PropertyKey | { readonly key: PropertyKey })[] | undefined\n}\n\n/** What a {@link Row} reads its cells through (internal; one per `columns` reference). */\nexport interface RowSource {\n value(index: number, original: unknown, id: string): unknown\n /** Schema issues of a flagged row (`invalidRows: 'flag'`); `undefined` for a valid row. */\n issues(index: number): readonly RowIssue[] | undefined\n /** The issues of a flagged row that touch column `id` (`matchCellIssues`). */\n cellIssues(issues: readonly RowIssue[], id: string): readonly RowIssue[]\n}\n\nexport const NO_ISSUES: readonly RowIssue[] = Object.freeze([])\n\n/**\n * The key a {@link Row} keeps its {@link RowSource} under. A symbol, not a `#private` field: a\n * proxy-based store (Vue `ref` / `reactive`, Pinia, MobX) calls the getters and methods with\n * `this` = its proxy, which has no private slot, so `#source` threw there (#11). A symbol key\n * reads through any proxy, stays out of `Object.keys` and JSON, and is not exported.\n */\nconst SOURCE = Symbol()\n\n/**\n * One visible row (§6.6). Created only for the rows `getRowModel()` returns, never for the whole\n * data set (§9.1), and only when read ({@link lazyRows}); the methods live on the prototype, so a\n * row costs its four fields.\n */\nexport class Row<T = unknown> {\n /** The row's `rowKey` value (the row index without `rowKey`). */\n readonly key: RowKey\n /** Position in the ingested data. */\n readonly index: number\n /** The row object as passed in `data`. */\n readonly original: T\n /** @internal */\n private readonly [SOURCE]: RowSource\n\n /** @internal Rows are created by the pipeline. */\n constructor(source: RowSource, index: number, key: RowKey, original: T) {\n this.key = key\n this.index = index\n this.original = original\n this[SOURCE] = source\n }\n\n /** `false` for a row flagged by schema validation (`invalidRows: 'flag'`). */\n get valid(): boolean {\n return this[SOURCE].issues(this.index) === undefined\n }\n\n /** The row's schema issues (empty for a valid row). */\n get issues(): readonly RowIssue[] {\n return this[SOURCE].issues(this.index) ?? NO_ISSUES\n }\n\n /**\n * The value of column `id` for this row (`key` path or `accessor`); `undefined` for an unknown\n * column. Never throws: a throwing accessor reports `DK_CALLBACK_FAILED` and reads `undefined`.\n */\n getValue(id: string): unknown {\n return this[SOURCE].value(this.index, this.original, id)\n }\n\n /**\n * The schema issues whose path points into column `id`, matched segment by segment: the issue\n * path equals the column key, or one contains the other (`address` ↔ `address.city`, never\n * `addressLine`). Row-level issues (no path) count for every cell; accessor columns have no key,\n * so they get only those. Empty for a valid row or an unknown column.\n */\n getCellIssues(id: string): readonly RowIssue[] {\n const issues = this[SOURCE].issues(this.index)\n return issues === undefined ? NO_ISSUES : this[SOURCE].cellIssues(issues, id)\n }\n}\n\n/** A valid row under `invalidRows: 'flag'`: `original` is the schema output. */\nexport type ValidRow<T> = Row<T> & { readonly valid: true }\n\n/** A flagged row (`invalidRows: 'flag'`): `original` is the raw, unvalidated value. */\nexport type FlaggedInvalidRow = Row<unknown> & { readonly valid: false }\n\n/** `getRowModel().rows` under `invalidRows: 'flag'` (§5.1): narrow on `row.valid`. */\nexport type FlaggedRow<T> = ValidRow<T> | FlaggedInvalidRow\n\n/**\n * An empty array of `length` without a backing store: setting `length` (or `new Array(n)`)\n * allocates `n` slots; a write at `n - 1` then deleting it leaves sparse (dictionary) elements. V8\n * turns it back into a plain array once it is filled.\n */\nfunction sparse<R>(length: number): R[] {\n const a: R[] = []\n if (length > 0) {\n a[length - 1] = undefined as R\n delete a[length - 1]\n }\n return a\n}\n\n/** `p` as an index below `length` (a canonical array index string), else `-1`. */\nexport function arrayIndex(p: string | symbol, length: number): number {\n const i = typeof p === 'string' ? Number(p) : -1\n return i >= 0 && i < length && String(i) === p ? i : -1\n}\n\n/**\n * `RowModel.rows` without a `Row` per visible row up front (§9.3 memory: 90k rows unpaginated): a\n * real array (`Array.isArray`, `length`, index reads, iteration, every array method) over a sparse\n * target that builds row `i` with `make(i)` the first time it is read and keeps it, so identity is\n * stable. `Object.keys` / `ownKeys` build every row first.\n */\nexport function lazyRows<R>(length: number, make: (i: number) => R): R[] {\n const t = sparse<R>(length)\n /** Builds row `i` (an index from {@link arrayIndex}; `-1` is not one) unless it exists. */\n const build = (i: number) => {\n if (i >= 0 && !(i in t)) t[i] = make(i)\n }\n return new Proxy(t, {\n get(_, p, receiver) {\n build(arrayIndex(p, length))\n return Reflect.get(t, p, receiver)\n },\n has: (_, p) => arrayIndex(p, length) >= 0 || Reflect.has(t, p),\n getOwnPropertyDescriptor(_, p) {\n build(arrayIndex(p, length))\n return Reflect.getOwnPropertyDescriptor(t, p)\n },\n ownKeys() {\n for (let i = 0; i < length; i++) build(i)\n return Reflect.ownKeys(t)\n },\n })\n}\n"],"mappings":";AAkBO,IAAM,YAAiC,OAAO,OAAO,CAAC,CAAC;AAQ9D,IAAM,SAAS,uBAAO;AAeF;AARb,IAAM,MAAN,MAAuB;AAAA;AAAA,EAW5B,YAAY,QAAmB,OAAe,KAAa,UAAa;AACtE,SAAK,MAAM;AACX,SAAK,QAAQ;AACb,SAAK,WAAW;AAChB,SAAK,MAAM,IAAI;AAAA,EACjB;AAAA;AAAA,EAGA,IAAI,QAAiB;AACnB,WAAO,KAAK,MAAM,EAAE,OAAO,KAAK,KAAK,MAAM;AAAA,EAC7C;AAAA;AAAA,EAGA,IAAI,SAA8B;AAChC,WAAO,KAAK,MAAM,EAAE,OAAO,KAAK,KAAK,KAAK;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAS,IAAqB;AAC5B,WAAO,KAAK,MAAM,EAAE,MAAM,KAAK,OAAO,KAAK,UAAU,EAAE;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,cAAc,IAAiC;AAC7C,UAAM,SAAS,KAAK,MAAM,EAAE,OAAO,KAAK,KAAK;AAC7C,WAAO,WAAW,SAAY,YAAY,KAAK,MAAM,EAAE,WAAW,QAAQ,EAAE;AAAA,EAC9E;AACF;AAgBA,SAAS,OAAU,QAAqB;AACtC,QAAM,IAAS,CAAC;AAChB,MAAI,SAAS,GAAG;AACd,MAAE,SAAS,CAAC,IAAI;AAChB,WAAO,EAAE,SAAS,CAAC;AAAA,EACrB;AACA,SAAO;AACT;AAGO,SAAS,WAAW,GAAoB,QAAwB;AACrE,QAAM,IAAI,OAAO,MAAM,WAAW,OAAO,CAAC,IAAI;AAC9C,SAAO,KAAK,KAAK,IAAI,UAAU,OAAO,CAAC,MAAM,IAAI,IAAI;AACvD;AAQO,SAAS,SAAY,QAAgB,MAA6B;AACvE,QAAM,IAAI,OAAU,MAAM;AAE1B,QAAM,QAAQ,CAAC,MAAc;AAC3B,QAAI,KAAK,KAAK,EAAE,KAAK,GAAI,GAAE,CAAC,IAAI,KAAK,CAAC;AAAA,EACxC;AACA,SAAO,IAAI,MAAM,GAAG;AAAA,IAClB,IAAI,GAAG,GAAG,UAAU;AAClB,YAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,aAAO,QAAQ,IAAI,GAAG,GAAG,QAAQ;AAAA,IACnC;AAAA,IACA,KAAK,CAAC,GAAG,MAAM,WAAW,GAAG,MAAM,KAAK,KAAK,QAAQ,IAAI,GAAG,CAAC;AAAA,IAC7D,yBAAyB,GAAG,GAAG;AAC7B,YAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,aAAO,QAAQ,yBAAyB,GAAG,CAAC;AAAA,IAC9C;AAAA,IACA,UAAU;AACR,eAAS,IAAI,GAAG,IAAI,QAAQ,IAAK,OAAM,CAAC;AACxC,aAAO,QAAQ,QAAQ,CAAC;AAAA,IAC1B;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/dist/schema.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StandardSchemaV1, e as TableSchema } from './codes-
|
|
2
|
-
export { q as DatakableSchemaError, h as InvalidRow, I as InvalidRowsMode, C as SCHEMA_INGEST, H as SchemaIssueColumn, J as SchemaOutcome, ad as isStandardSchema, am as schemaDiagnostics } from './codes-
|
|
1
|
+
import { S as StandardSchemaV1, e as TableSchema } from './codes-OsjAR3Wz.cjs';
|
|
2
|
+
export { q as DatakableSchemaError, h as InvalidRow, I as InvalidRowsMode, C as SCHEMA_INGEST, H as SchemaIssueColumn, J as SchemaOutcome, ad as isStandardSchema, am as schemaDiagnostics } from './codes-OsjAR3Wz.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Opts a Standard Schema v1 (zod, valibot, arktype, …) into table validation (§5.1):
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as StandardSchemaV1, e as TableSchema } from './codes-
|
|
2
|
-
export { q as DatakableSchemaError, h as InvalidRow, I as InvalidRowsMode, C as SCHEMA_INGEST, H as SchemaIssueColumn, J as SchemaOutcome, ad as isStandardSchema, am as schemaDiagnostics } from './codes-
|
|
1
|
+
import { S as StandardSchemaV1, e as TableSchema } from './codes-OsjAR3Wz.js';
|
|
2
|
+
export { q as DatakableSchemaError, h as InvalidRow, I as InvalidRowsMode, C as SCHEMA_INGEST, H as SchemaIssueColumn, J as SchemaOutcome, ad as isStandardSchema, am as schemaDiagnostics } from './codes-OsjAR3Wz.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Opts a Standard Schema v1 (zod, valibot, arktype, …) into table validation (§5.1):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as RowKey } from './codes-
|
|
2
|
-
import { R as RowModelContext, c as FeatureContext } from './explain-
|
|
1
|
+
import { i as RowKey } from './codes-OsjAR3Wz.js';
|
|
2
|
+
import { R as RowModelContext, c as FeatureContext } from './explain-Dn99IQt0.js';
|
|
3
3
|
|
|
4
4
|
/** What `setSearch` / `flushSearch` resolve to; they never reject. */
|
|
5
5
|
interface SearchOutcome {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as RowKey } from './codes-
|
|
2
|
-
import { R as RowModelContext, c as FeatureContext } from './explain-
|
|
1
|
+
import { i as RowKey } from './codes-OsjAR3Wz.cjs';
|
|
2
|
+
import { R as RowModelContext, c as FeatureContext } from './explain-vkD2cewE.cjs';
|
|
3
3
|
|
|
4
4
|
/** What `setSearch` / `flushSearch` resolve to; they never reject. */
|
|
5
5
|
interface SearchOutcome {
|
package/dist/search-async.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ap as searchDiagnostics } from './codes-
|
|
2
|
-
export { A as AsyncSearchFn, a as SEARCH_ENGINE, b as SearchFn, c as SearchFnContext, e as SearchResult, w as withSearchFn } from './search-async-entry-
|
|
3
|
-
import './explain-
|
|
1
|
+
export { ap as searchDiagnostics } from './codes-OsjAR3Wz.cjs';
|
|
2
|
+
export { A as AsyncSearchFn, a as SEARCH_ENGINE, b as SearchFn, c as SearchFnContext, e as SearchResult, w as withSearchFn } from './search-async-entry-v5JdEk5Y.cjs';
|
|
3
|
+
import './explain-vkD2cewE.cjs';
|
package/dist/search-async.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ap as searchDiagnostics } from './codes-
|
|
2
|
-
export { A as AsyncSearchFn, a as SEARCH_ENGINE, b as SearchFn, c as SearchFnContext, e as SearchResult, w as withSearchFn } from './search-async-entry-
|
|
3
|
-
import './explain-
|
|
1
|
+
export { ap as searchDiagnostics } from './codes-OsjAR3Wz.js';
|
|
2
|
+
export { A as AsyncSearchFn, a as SEARCH_ENGINE, b as SearchFn, c as SearchFnContext, e as SearchResult, w as withSearchFn } from './search-async-entry-DGSw2pDL.js';
|
|
3
|
+
import './explain-Dn99IQt0.js';
|
package/dist/search.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { ap as searchDiagnostics } from './codes-
|
|
2
|
-
import { d as AnyRow, F as Feature, b as FixedTypes } from './explain-
|
|
1
|
+
export { ap as searchDiagnostics } from './codes-OsjAR3Wz.cjs';
|
|
2
|
+
import { d as AnyRow, F as Feature, b as FixedTypes } from './explain-vkD2cewE.cjs';
|
|
3
3
|
import { a as DataMode } from './mode-DFV8ryXo.cjs';
|
|
4
|
-
import { d as SearchOutcome, A as AsyncSearchFn, S as SearchState } from './search-async-entry-
|
|
5
|
-
export { a as SEARCH_ENGINE, b as SearchFn, c as SearchFnContext, e as SearchResult, f as SearchStatus, w as withSearchFn } from './search-async-entry-
|
|
4
|
+
import { d as SearchOutcome, A as AsyncSearchFn, S as SearchState } from './search-async-entry-v5JdEk5Y.cjs';
|
|
5
|
+
export { a as SEARCH_ENGINE, b as SearchFn, c as SearchFnContext, e as SearchResult, f as SearchStatus, w as withSearchFn } from './search-async-entry-v5JdEk5Y.cjs';
|
|
6
6
|
|
|
7
7
|
interface SearchApi {
|
|
8
8
|
/** Sets `input` (and `query`, with the client's immediate typing strategy). */
|
package/dist/search.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { ap as searchDiagnostics } from './codes-
|
|
2
|
-
import { d as AnyRow, F as Feature, b as FixedTypes } from './explain-
|
|
1
|
+
export { ap as searchDiagnostics } from './codes-OsjAR3Wz.js';
|
|
2
|
+
import { d as AnyRow, F as Feature, b as FixedTypes } from './explain-Dn99IQt0.js';
|
|
3
3
|
import { a as DataMode } from './mode-DFV8ryXo.js';
|
|
4
|
-
import { d as SearchOutcome, A as AsyncSearchFn, S as SearchState } from './search-async-entry-
|
|
5
|
-
export { a as SEARCH_ENGINE, b as SearchFn, c as SearchFnContext, e as SearchResult, f as SearchStatus, w as withSearchFn } from './search-async-entry-
|
|
4
|
+
import { d as SearchOutcome, A as AsyncSearchFn, S as SearchState } from './search-async-entry-DGSw2pDL.js';
|
|
5
|
+
export { a as SEARCH_ENGINE, b as SearchFn, c as SearchFnContext, e as SearchResult, f as SearchStatus, w as withSearchFn } from './search-async-entry-DGSw2pDL.js';
|
|
6
6
|
|
|
7
7
|
interface SearchApi {
|
|
8
8
|
/** Sets `input` (and `query`, with the client's immediate typing strategy). */
|
package/dist/server.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as Interceptor, D as Fetcher, i as ServerFetcher } from './explain-
|
|
2
|
-
export { x as FetchOutcome, y as FetchParams, z as FetchResult, ab as SERVER_SOURCE } from './explain-
|
|
3
|
-
export { B as BadResponse, N as asyncDiagnostics, a4 as fetchDiagnostics } from './codes-
|
|
1
|
+
import { a as Interceptor, D as Fetcher, i as ServerFetcher } from './explain-vkD2cewE.cjs';
|
|
2
|
+
export { x as FetchOutcome, y as FetchParams, z as FetchResult, ab as SERVER_SOURCE } from './explain-vkD2cewE.cjs';
|
|
3
|
+
export { B as BadResponse, N as asyncDiagnostics, a4 as fetchDiagnostics } from './codes-OsjAR3Wz.cjs';
|
|
4
4
|
|
|
5
5
|
/** Spec §7.1: a request that has not settled after 30 s is aborted (`DK_ASYNC_TIMEOUT`). */
|
|
6
6
|
declare const DEFAULT_ASYNC_TIMEOUT = 30000;
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as Interceptor, D as Fetcher, i as ServerFetcher } from './explain-
|
|
2
|
-
export { x as FetchOutcome, y as FetchParams, z as FetchResult, ab as SERVER_SOURCE } from './explain-
|
|
3
|
-
export { B as BadResponse, N as asyncDiagnostics, a4 as fetchDiagnostics } from './codes-
|
|
1
|
+
import { a as Interceptor, D as Fetcher, i as ServerFetcher } from './explain-Dn99IQt0.js';
|
|
2
|
+
export { x as FetchOutcome, y as FetchParams, z as FetchResult, ab as SERVER_SOURCE } from './explain-Dn99IQt0.js';
|
|
3
|
+
export { B as BadResponse, N as asyncDiagnostics, a4 as fetchDiagnostics } from './codes-OsjAR3Wz.js';
|
|
4
4
|
|
|
5
5
|
/** Spec §7.1: a request that has not settled after 30 s is aborted (`DK_ASYNC_TIMEOUT`). */
|
|
6
6
|
declare const DEFAULT_ASYNC_TIMEOUT = 30000;
|
package/dist/sorting.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { W as comparatorDiagnostics, ar as sortingDiagnostics } from './codes-
|
|
2
|
-
import { ad as SortAlgorithm, a1 as Path, e as FeatureTypes, F as Feature } from './explain-
|
|
1
|
+
export { W as comparatorDiagnostics, ar as sortingDiagnostics } from './codes-OsjAR3Wz.cjs';
|
|
2
|
+
import { ad as SortAlgorithm, a1 as Path, e as FeatureTypes, F as Feature } from './explain-vkD2cewE.cjs';
|
|
3
3
|
import { a as DataMode } from './mode-DFV8ryXo.cjs';
|
|
4
4
|
|
|
5
5
|
/** The rank of `v` in {@link RANK}. */
|
|
@@ -47,7 +47,10 @@ interface SortingTypes extends FeatureTypes {
|
|
|
47
47
|
*/
|
|
48
48
|
type SortAlgorithmOption = SortAlgorithm;
|
|
49
49
|
interface SortingOptions {
|
|
50
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Locale(s) of the string collator (`Intl.Collator(locale, { numeric: true })`). Default `'en'`,
|
|
52
|
+
* not the runtime's: the server and the browser must sort alike (SSR hydration, #12).
|
|
53
|
+
*/
|
|
51
54
|
locale?: string | readonly string[];
|
|
52
55
|
/** The sort algorithm (default `'auto'`); a column's `sortAlgorithm` takes precedence. */
|
|
53
56
|
algorithm?: SortAlgorithmOption;
|
package/dist/sorting.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { W as comparatorDiagnostics, ar as sortingDiagnostics } from './codes-
|
|
2
|
-
import { ad as SortAlgorithm, a1 as Path, e as FeatureTypes, F as Feature } from './explain-
|
|
1
|
+
export { W as comparatorDiagnostics, ar as sortingDiagnostics } from './codes-OsjAR3Wz.js';
|
|
2
|
+
import { ad as SortAlgorithm, a1 as Path, e as FeatureTypes, F as Feature } from './explain-Dn99IQt0.js';
|
|
3
3
|
import { a as DataMode } from './mode-DFV8ryXo.js';
|
|
4
4
|
|
|
5
5
|
/** The rank of `v` in {@link RANK}. */
|
|
@@ -47,7 +47,10 @@ interface SortingTypes extends FeatureTypes {
|
|
|
47
47
|
*/
|
|
48
48
|
type SortAlgorithmOption = SortAlgorithm;
|
|
49
49
|
interface SortingOptions {
|
|
50
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Locale(s) of the string collator (`Intl.Collator(locale, { numeric: true })`). Default `'en'`,
|
|
52
|
+
* not the runtime's: the server and the browser must sort alike (SSR hydration, #12).
|
|
53
|
+
*/
|
|
51
54
|
locale?: string | readonly string[];
|
|
52
55
|
/** The sort algorithm (default `'auto'`); a column's `sortAlgorithm` takes precedence. */
|
|
53
56
|
algorithm?: SortAlgorithmOption;
|
package/dist/validity.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { aw as validityDiagnostics } from './codes-
|
|
2
|
-
import { F as Feature, b as FixedTypes } from './explain-
|
|
1
|
+
export { aw as validityDiagnostics } from './codes-OsjAR3Wz.cjs';
|
|
2
|
+
import { F as Feature, b as FixedTypes } from './explain-vkD2cewE.cjs';
|
|
3
3
|
|
|
4
4
|
/** Which rows the `validity` step keeps (§6.2). */
|
|
5
5
|
type ValidityState = 'all' | 'valid' | 'invalid';
|
package/dist/validity.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { aw as validityDiagnostics } from './codes-
|
|
2
|
-
import { F as Feature, b as FixedTypes } from './explain-
|
|
1
|
+
export { aw as validityDiagnostics } from './codes-OsjAR3Wz.js';
|
|
2
|
+
import { F as Feature, b as FixedTypes } from './explain-Dn99IQt0.js';
|
|
3
3
|
|
|
4
4
|
/** Which rows the `validity` step keeps (§6.2). */
|
|
5
5
|
type ValidityState = 'all' | 'valid' | 'invalid';
|
package/dist/version.cjs
CHANGED
package/dist/version.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts","../package.json"],"sourcesContent":["// Read from package.json at build time (the bundler inlines the one field), so a release never\n// ships a stale hard-coded version.\nimport { version } from '../package.json'\n\n/** The `@datakable/core` version (`context.package`, docs URLs, the global version registry). */\nexport const VERSION: string = version\n","{\n \"name\": \"@datakable/core\",\n \"version\": \"1.0.
|
|
1
|
+
{"version":3,"sources":["../src/version.ts","../package.json"],"sourcesContent":["// Read from package.json at build time (the bundler inlines the one field), so a release never\n// ships a stale hard-coded version.\nimport { version } from '../package.json'\n\n/** The `@datakable/core` version (`context.package`, docs URLs, the global version registry). */\nexport const VERSION: string = version\n","{\n \"name\": \"@datakable/core\",\n \"version\": \"1.0.1\",\n \"description\": \"Headless, framework-agnostic core of DataKable \\u2014 table state, sorting, filtering and types.\",\n \"license\": \"MIT\",\n \"author\": \"Supakit Kitjanabumrungsak\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/Ink01101011/datakable.git\",\n \"directory\": \"packages/core\"\n },\n \"homepage\": \"https://github.com/Ink01101011/datakable#readme\",\n \"bugs\": \"https://github.com/Ink01101011/datakable/issues\",\n \"keywords\": [\n \"react\",\n \"datatable\",\n \"table\",\n \"data-grid\",\n \"typescript\",\n \"type-safe\",\n \"headless\"\n ],\n \"type\": \"module\",\n \"sideEffects\": [\n \"./dist/messages/index.js\",\n \"./dist/messages/index.cjs\"\n ],\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"./column-filters\": {\n \"import\": {\n \"types\": \"./dist/column-filters.d.ts\",\n \"default\": \"./dist/features/column-filters/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/column-filters.d.cts\",\n \"default\": \"./dist/features/column-filters/index.cjs\"\n }\n },\n \"./validity\": {\n \"import\": {\n \"types\": \"./dist/validity.d.ts\",\n \"default\": \"./dist/features/validity/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/validity.d.cts\",\n \"default\": \"./dist/features/validity/index.cjs\"\n }\n },\n \"./search\": {\n \"import\": {\n \"types\": \"./dist/search.d.ts\",\n \"default\": \"./dist/features/search/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/search.d.cts\",\n \"default\": \"./dist/features/search/index.cjs\"\n }\n },\n \"./sorting\": {\n \"import\": {\n \"types\": \"./dist/sorting.d.ts\",\n \"default\": \"./dist/features/sorting/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/sorting.d.cts\",\n \"default\": \"./dist/features/sorting/index.cjs\"\n }\n },\n \"./pagination\": {\n \"import\": {\n \"types\": \"./dist/pagination.d.ts\",\n \"default\": \"./dist/features/pagination/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/pagination.d.cts\",\n \"default\": \"./dist/features/pagination/index.cjs\"\n }\n },\n \"./messages\": {\n \"import\": {\n \"types\": \"./dist/messages.d.ts\",\n \"default\": \"./dist/messages/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/messages.d.cts\",\n \"default\": \"./dist/messages/index.cjs\"\n }\n },\n \"./schema\": {\n \"import\": {\n \"types\": \"./dist/schema.d.ts\",\n \"default\": \"./dist/ingest/schema-entry.js\"\n },\n \"require\": {\n \"types\": \"./dist/schema.d.cts\",\n \"default\": \"./dist/ingest/schema-entry.cjs\"\n }\n },\n \"./search-async\": {\n \"import\": {\n \"types\": \"./dist/search-async.d.ts\",\n \"default\": \"./dist/features/search/search-async-entry.js\"\n },\n \"require\": {\n \"types\": \"./dist/search-async.d.cts\",\n \"default\": \"./dist/features/search/search-async-entry.cjs\"\n }\n },\n \"./server\": {\n \"import\": {\n \"types\": \"./dist/server.d.ts\",\n \"default\": \"./dist/source/server-entry.js\"\n },\n \"require\": {\n \"types\": \"./dist/server.d.cts\",\n \"default\": \"./dist/source/server-entry.cjs\"\n }\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"build\": \"tsup && node scripts/postbuild.mjs\",\n \"dev\": \"tsup --watch\",\n \"typecheck\": \"tsc -p tsconfig.json\",\n \"check:pkg\": \"publint --strict && attw --pack . --profile node16 && node scripts/check-catalog.mjs\",\n \"check:catalog\": \"node scripts/check-catalog.mjs\"\n },\n \"dependencies\": {\n \"ex-search\": \"1.1.1\",\n \"exsorted\": \"1.2.3\",\n \"kk-debounce\": \"1.1.0\"\n },\n \"devDependencies\": {\n \"esbuild\": \"0.27.7\"\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEE,cAAW;;;ADGN,IAAM,UAAkB;","names":[]}
|
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/version.ts"],"sourcesContent":["{\n \"name\": \"@datakable/core\",\n \"version\": \"1.0.
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/version.ts"],"sourcesContent":["{\n \"name\": \"@datakable/core\",\n \"version\": \"1.0.1\",\n \"description\": \"Headless, framework-agnostic core of DataKable \\u2014 table state, sorting, filtering and types.\",\n \"license\": \"MIT\",\n \"author\": \"Supakit Kitjanabumrungsak\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/Ink01101011/datakable.git\",\n \"directory\": \"packages/core\"\n },\n \"homepage\": \"https://github.com/Ink01101011/datakable#readme\",\n \"bugs\": \"https://github.com/Ink01101011/datakable/issues\",\n \"keywords\": [\n \"react\",\n \"datatable\",\n \"table\",\n \"data-grid\",\n \"typescript\",\n \"type-safe\",\n \"headless\"\n ],\n \"type\": \"module\",\n \"sideEffects\": [\n \"./dist/messages/index.js\",\n \"./dist/messages/index.cjs\"\n ],\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"./column-filters\": {\n \"import\": {\n \"types\": \"./dist/column-filters.d.ts\",\n \"default\": \"./dist/features/column-filters/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/column-filters.d.cts\",\n \"default\": \"./dist/features/column-filters/index.cjs\"\n }\n },\n \"./validity\": {\n \"import\": {\n \"types\": \"./dist/validity.d.ts\",\n \"default\": \"./dist/features/validity/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/validity.d.cts\",\n \"default\": \"./dist/features/validity/index.cjs\"\n }\n },\n \"./search\": {\n \"import\": {\n \"types\": \"./dist/search.d.ts\",\n \"default\": \"./dist/features/search/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/search.d.cts\",\n \"default\": \"./dist/features/search/index.cjs\"\n }\n },\n \"./sorting\": {\n \"import\": {\n \"types\": \"./dist/sorting.d.ts\",\n \"default\": \"./dist/features/sorting/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/sorting.d.cts\",\n \"default\": \"./dist/features/sorting/index.cjs\"\n }\n },\n \"./pagination\": {\n \"import\": {\n \"types\": \"./dist/pagination.d.ts\",\n \"default\": \"./dist/features/pagination/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/pagination.d.cts\",\n \"default\": \"./dist/features/pagination/index.cjs\"\n }\n },\n \"./messages\": {\n \"import\": {\n \"types\": \"./dist/messages.d.ts\",\n \"default\": \"./dist/messages/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/messages.d.cts\",\n \"default\": \"./dist/messages/index.cjs\"\n }\n },\n \"./schema\": {\n \"import\": {\n \"types\": \"./dist/schema.d.ts\",\n \"default\": \"./dist/ingest/schema-entry.js\"\n },\n \"require\": {\n \"types\": \"./dist/schema.d.cts\",\n \"default\": \"./dist/ingest/schema-entry.cjs\"\n }\n },\n \"./search-async\": {\n \"import\": {\n \"types\": \"./dist/search-async.d.ts\",\n \"default\": \"./dist/features/search/search-async-entry.js\"\n },\n \"require\": {\n \"types\": \"./dist/search-async.d.cts\",\n \"default\": \"./dist/features/search/search-async-entry.cjs\"\n }\n },\n \"./server\": {\n \"import\": {\n \"types\": \"./dist/server.d.ts\",\n \"default\": \"./dist/source/server-entry.js\"\n },\n \"require\": {\n \"types\": \"./dist/server.d.cts\",\n \"default\": \"./dist/source/server-entry.cjs\"\n }\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"build\": \"tsup && node scripts/postbuild.mjs\",\n \"dev\": \"tsup --watch\",\n \"typecheck\": \"tsc -p tsconfig.json\",\n \"check:pkg\": \"publint --strict && attw --pack . --profile node16 && node scripts/check-catalog.mjs\",\n \"check:catalog\": \"node scripts/check-catalog.mjs\"\n },\n \"dependencies\": {\n \"ex-search\": \"1.1.1\",\n \"exsorted\": \"1.2.3\",\n \"kk-debounce\": \"1.1.0\"\n },\n \"devDependencies\": {\n \"esbuild\": \"0.27.7\"\n }\n}\n","// Read from package.json at build time (the bundler inlines the one field), so a release never\n// ships a stale hard-coded version.\nimport { version } from '../package.json'\n\n/** The `@datakable/core` version (`context.package`, docs URLs, the global version registry). */\nexport const VERSION: string = version\n"],"mappings":";AAEE,cAAW;;;ACGN,IAAM,UAAkB;","names":[]}
|
package/package.json
CHANGED