@markless/serializer 0.5.0 → 0.7.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.
- package/dist/index.d.ts +17 -4
- package/dist/index.js +122 -8
- package/dist/{protocol-BbWeZfik.js → protocol-9Mv28nr_.js} +9 -2
- package/dist/{protocol-B3YIo3hD.d.ts → protocol-BNO5JLsK.d.ts} +24 -3
- package/dist/protocol-record-templates-B0Ay3OCd.js +60 -0
- package/dist/protocol-record-templates-pAcSQYqD.d.ts +31 -0
- package/dist/{protocol-validation-storage-C9YES3Zy.d.ts → protocol-validation-storage-B4dATVQ_.d.ts} +1 -1
- package/dist/{protocol-validation-storage-DhyQ9fEO.js → protocol-validation-storage-D9VzvR9i.js} +4 -2
- package/dist/protocol-validation.d.ts +1 -1
- package/dist/protocol-validation.js +1 -1
- package/dist/protocol.d.ts +2 -2
- package/dist/protocol.js +2 -2
- package/dist/record-templates.d.ts +2 -0
- package/dist/record-templates.js +2 -0
- package/package.json +5 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as protocolRowSegment, B as ASYNC_BOUNDARY_ARM, C as PROTOCOL_PAGE_SPACE_ID_PREFIXES, D as protocolInstanceQualifies, E as protocolInstancePath, F as PROTOCOL_CONTAINER_HOST_NODE_ID, I as PROTOCOL_CONTAINER_START_COMMENT, L as PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, M as PROTOCOL_PROP_GRAPH_NODE_PREFIX, N as PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, O as protocolInstanceSegment, P as PROTOCOL_CONTAINER_END_COMMENT, R as PROTOCOL_IDLE_EVENT_NAME, S as PROTOCOL_EVENT_ACTION_KIND, T as STORAGE_PROTOCOL_VERSION, _ as ProtocolViewPayload, a as ProtocolBranchIdrefSite, b as protocolEventDispatchesMarkless, c as ProtocolEventActionKind, d as ProtocolRowTemplateSlotValue, f as ProtocolStatePayload, g as ProtocolSyncPolicyCondition, h as ProtocolSyncPolicyBranch, i as ProtocolBranchContentRead, j as protocolStateVersion, k as protocolProjectionSegment, l as ProtocolEventRecord, m as ProtocolSyncPolicy, n as ProtocolArmRecordSet, o as ProtocolComposedGraphProp, p as ProtocolStreamedArmPatch, r as ProtocolAsyncBoundaryArm, s as ProtocolEventAction, t as ProtocolArmBranchRecord, u as ProtocolPayloadScripts, v as protocolElementHandleReadId, w as PROTOCOL_PROPS_GRAPH_NODE_ID, x as ASYNC_PROTOCOL_VERSION, y as protocolEventActionKind, z as PROTOCOL_VISIBLE_EVENT_NAME } from "./protocol-BNO5JLsK.js";
|
|
2
|
+
import { a as PROTOCOL_TEMPLATED_LISTS, i as expandRecordTemplates, n as ProtocolTemplatedRecords, o as RuntimePayloadType$1, r as decodeProtocolPayloadLists } from "./protocol-record-templates-pAcSQYqD.js";
|
|
2
3
|
import { a as SerializedPrimitive, c as TypedArrayName, d as serializeGraphValue, f as deserializeGraphValue, i as SerializedGraphPayload, l as jsonSourceWithNonFiniteNumbers, n as SerializationDiagnostic, o as SerializedRecord, r as SerializationResult, s as SerializedSlot, t as NonFiniteNumberName, u as nonFiniteName } from "./value-CRkHmkRz.js";
|
|
3
|
-
import { a as RuntimePayloadError, c as assertProtocolStateCellPayload, d as decodePayloadScriptsWithVersion, f as invalidPayloadShapeError, i as RuntimePayloadDiagnostic, l as assertProtocolStatePayload, m as payloadScriptSelector, n as DecodedPayloadScripts, o as RuntimePayloadErrorCode, p as payloadInvalidError, r as EncodedPayloadScripts, s as RuntimePayloadType, t as decodePayloadScripts, u as assertProtocolViewPayload } from "./protocol-validation-storage-
|
|
4
|
+
import { a as RuntimePayloadError, c as assertProtocolStateCellPayload, d as decodePayloadScriptsWithVersion, f as invalidPayloadShapeError, i as RuntimePayloadDiagnostic, l as assertProtocolStatePayload, m as payloadScriptSelector, n as DecodedPayloadScripts, o as RuntimePayloadErrorCode, p as payloadInvalidError, r as EncodedPayloadScripts, s as RuntimePayloadType, t as decodePayloadScripts, u as assertProtocolViewPayload } from "./protocol-validation-storage-B4dATVQ_.js";
|
|
4
5
|
//#region src/payload-scripts.d.ts
|
|
5
6
|
export type RenderPayloadScriptsInput = {
|
|
6
7
|
readonly state: ProtocolStatePayload;
|
|
@@ -12,7 +13,9 @@ export type RenderedPayloadScripts = {
|
|
|
12
13
|
readonly stateScript: string;
|
|
13
14
|
readonly viewScript: string;
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
+
/** How a payload's record lists are written; a served page passes encodeProtocolPayloadLists. */
|
|
17
|
+
export type PayloadListEncoder = <T extends object>(type: RuntimePayloadType$1, payload: T) => T;
|
|
18
|
+
export declare function renderPayloadScripts(input: RenderPayloadScriptsInput, encodeLists?: PayloadListEncoder): RenderedPayloadScripts;
|
|
16
19
|
export declare function escapeScriptJson(value: string): string;
|
|
17
20
|
//#endregion
|
|
18
21
|
//#region src/protocol-state.d.ts
|
|
@@ -71,6 +74,16 @@ export declare function createProtocolStatePayload(input: ProtocolStatePayloadIn
|
|
|
71
74
|
export declare function serializeRuntimeStateCells(cells: ProtocolStatePayload['cells']): ProtocolStatePayload['cells'];
|
|
72
75
|
export declare function serializeRuntimeAsyncSnapshots(computed: ProtocolStatePayload['computed']): ProtocolStatePayload['computed'];
|
|
73
76
|
//#endregion
|
|
77
|
+
//#region src/protocol-record-templates-encode.d.ts
|
|
78
|
+
/**
|
|
79
|
+
* Serves a record list as templates when that is shorter: records that differ only in their
|
|
80
|
+
* values share one shape, each carries only the values that differ between them, and every field
|
|
81
|
+
* name the list's key table spells becomes its index there.
|
|
82
|
+
*/
|
|
83
|
+
export declare function encodeRecordTemplates<T extends object>(records: ReadonlyArray<T>, keys?: string): ReadonlyArray<T> | ProtocolTemplatedRecords;
|
|
84
|
+
/** The payload with each templated list served in its shorter form, for JSON.stringify. */
|
|
85
|
+
export declare function encodeProtocolPayloadLists<T extends object>(type: RuntimePayloadType$1, payload: T): T;
|
|
86
|
+
//#endregion
|
|
74
87
|
//#region src/resume-record-merge.d.ts
|
|
75
88
|
type ResumeRecordSet = {
|
|
76
89
|
readonly state: ProtocolStatePayload;
|
|
@@ -110,4 +123,4 @@ export declare function storageSlotEntryKeyFromGraphNodeId(graphNodeId: string):
|
|
|
110
123
|
export declare function createStorageSeedMetadata(moduleId: string, driverKey: string, fallback: string): StorageSeedMetadata;
|
|
111
124
|
export declare function createStorageSeedMetadataFromGraphNodeId(graphNodeId: string, driverKey: string, fallback: string): StorageSeedMetadata;
|
|
112
125
|
//#endregion
|
|
113
|
-
export { ASYNC_BOUNDARY_ARM, ASYNC_PROTOCOL_VERSION, DecodedPayloadScripts, EncodedPayloadScripts, NonFiniteNumberName, PROTOCOL_EVENT_ACTION_KIND, PROTOCOL_IDLE_EVENT_NAME, PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, PROTOCOL_PAGE_SPACE_ID_PREFIXES, PROTOCOL_PROPS_GRAPH_NODE_ID, PROTOCOL_PROP_GRAPH_NODE_PREFIX, PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, PROTOCOL_VISIBLE_EVENT_NAME, ProtocolArmBranchRecord, ProtocolArmRecordSet, ProtocolAsyncBoundaryArm, ProtocolBranchContentRead, ProtocolBranchIdrefSite, ProtocolComposedGraphProp, ProtocolEventAction, ProtocolEventActionKind, ProtocolEventRecord, ProtocolPayloadScripts, ProtocolRowTemplateSlotValue, ProtocolStatePayload, ProtocolStreamedArmPatch, ProtocolSyncPolicy, ProtocolSyncPolicyBranch, ProtocolSyncPolicyCondition, ProtocolViewPayload, type ResumeRecordSet, RuntimePayloadDiagnostic, RuntimePayloadError, RuntimePayloadErrorCode, RuntimePayloadType, STORAGE_PROTOCOL_VERSION, SerializationDiagnostic, SerializationResult, SerializedGraphPayload, SerializedPrimitive, SerializedRecord, SerializedSlot, TypedArrayName, assertProtocolStateCellPayload, assertProtocolStatePayload, assertProtocolViewPayload, decodePayloadScripts, decodePayloadScriptsWithVersion, deserializeGraphValue, invalidPayloadShapeError, jsonSourceWithNonFiniteNumbers, nonFiniteName, payloadInvalidError, payloadScriptSelector, protocolElementHandleReadId, protocolEventActionKind, protocolEventDispatchesMarkless, protocolInstancePath, protocolInstanceQualifies, protocolInstanceSegment, protocolProjectionSegment, protocolRowSegment, protocolStateVersion, serializeGraphValue };
|
|
126
|
+
export { ASYNC_BOUNDARY_ARM, ASYNC_PROTOCOL_VERSION, DecodedPayloadScripts, EncodedPayloadScripts, NonFiniteNumberName, PROTOCOL_CONTAINER_END_COMMENT, PROTOCOL_CONTAINER_HOST_NODE_ID, PROTOCOL_CONTAINER_START_COMMENT, PROTOCOL_EVENT_ACTION_KIND, PROTOCOL_IDLE_EVENT_NAME, PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, PROTOCOL_PAGE_SPACE_ID_PREFIXES, PROTOCOL_PROPS_GRAPH_NODE_ID, PROTOCOL_PROP_GRAPH_NODE_PREFIX, PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, PROTOCOL_TEMPLATED_LISTS, PROTOCOL_VISIBLE_EVENT_NAME, ProtocolArmBranchRecord, ProtocolArmRecordSet, ProtocolAsyncBoundaryArm, ProtocolBranchContentRead, ProtocolBranchIdrefSite, ProtocolComposedGraphProp, ProtocolEventAction, ProtocolEventActionKind, ProtocolEventRecord, ProtocolPayloadScripts, ProtocolRowTemplateSlotValue, ProtocolStatePayload, ProtocolStreamedArmPatch, ProtocolSyncPolicy, ProtocolSyncPolicyBranch, ProtocolSyncPolicyCondition, type ProtocolTemplatedRecords, ProtocolViewPayload, type ResumeRecordSet, RuntimePayloadDiagnostic, RuntimePayloadError, RuntimePayloadErrorCode, RuntimePayloadType, STORAGE_PROTOCOL_VERSION, SerializationDiagnostic, SerializationResult, SerializedGraphPayload, SerializedPrimitive, SerializedRecord, SerializedSlot, TypedArrayName, assertProtocolStateCellPayload, assertProtocolStatePayload, assertProtocolViewPayload, decodePayloadScripts, decodePayloadScriptsWithVersion, decodeProtocolPayloadLists, deserializeGraphValue, expandRecordTemplates, invalidPayloadShapeError, jsonSourceWithNonFiniteNumbers, nonFiniteName, payloadInvalidError, payloadScriptSelector, protocolElementHandleReadId, protocolEventActionKind, protocolEventDispatchesMarkless, protocolInstancePath, protocolInstanceQualifies, protocolInstanceSegment, protocolProjectionSegment, protocolRowSegment, protocolStateVersion, serializeGraphValue };
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { _ as PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, a as ASYNC_PROTOCOL_VERSION, b as
|
|
1
|
+
import { C as PROTOCOL_VISIBLE_EVENT_NAME, S as PROTOCOL_IDLE_EVENT_NAME, _ as PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, a as ASYNC_PROTOCOL_VERSION, b as PROTOCOL_CONTAINER_START_COMMENT, c as PROTOCOL_PROPS_GRAPH_NODE_ID, d as protocolInstanceQualifies, f as protocolInstanceSegment, g as PROTOCOL_PROP_GRAPH_NODE_PREFIX, h as protocolStateVersion, i as ASYNC_BOUNDARY_ARM, l as STORAGE_PROTOCOL_VERSION, m as protocolRowSegment, n as protocolEventActionKind, o as PROTOCOL_EVENT_ACTION_KIND, p as protocolProjectionSegment, r as protocolEventDispatchesMarkless, s as PROTOCOL_PAGE_SPACE_ID_PREFIXES, t as protocolElementHandleReadId, u as protocolInstancePath, v as PROTOCOL_CONTAINER_END_COMMENT, x as PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, y as PROTOCOL_CONTAINER_HOST_NODE_ID } from "./protocol-9Mv28nr_.js";
|
|
2
2
|
import { deserializeGraphValue } from "./decode.js";
|
|
3
|
-
import {
|
|
3
|
+
import { i as PROTOCOL_RECORD_KEYS, n as expandRecordTemplates, r as PROTOCOL_TEMPLATED_LISTS, t as decodeProtocolPayloadLists } from "./protocol-record-templates-B0Ay3OCd.js";
|
|
4
|
+
import { a as assertProtocolStatePayload, c as invalidPayloadShapeError, i as assertProtocolStateCellPayload, l as payloadInvalidError, n as isValidStorageKey, o as assertProtocolViewPayload, r as RuntimePayloadError, s as decodePayloadScriptsWithVersion, t as decodePayloadScripts, u as payloadScriptSelector } from "./protocol-validation-storage-D9VzvR9i.js";
|
|
4
5
|
//#region src/payload-scripts.ts
|
|
5
|
-
function renderPayloadScripts(input) {
|
|
6
|
+
function renderPayloadScripts(input, encodeLists) {
|
|
6
7
|
return {
|
|
7
8
|
state: input.state,
|
|
8
9
|
view: input.view,
|
|
9
|
-
stateScript: renderDataScript("markless/state", input.state),
|
|
10
|
-
viewScript: renderDataScript("markless/view", input.view)
|
|
10
|
+
stateScript: renderDataScript("markless/state", input.state, encodeLists),
|
|
11
|
+
viewScript: renderDataScript("markless/view", input.view, encodeLists)
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
|
-
function renderDataScript(type, payload) {
|
|
14
|
-
|
|
14
|
+
function renderDataScript(type, payload, encodeLists) {
|
|
15
|
+
const served = encodeLists ? encodeLists(type, payload) : payload;
|
|
16
|
+
return `<script type="${type}">${escapeScriptJson(JSON.stringify(served))}<\/script>`;
|
|
15
17
|
}
|
|
16
18
|
function escapeScriptJson(value) {
|
|
17
19
|
return value.replace(/<(?=[/!])/g, "\\u003C");
|
|
@@ -437,6 +439,118 @@ function protocolStateSerializationError(cell, diagnostic) {
|
|
|
437
439
|
});
|
|
438
440
|
}
|
|
439
441
|
//#endregion
|
|
442
|
+
//#region src/protocol-record-templates-encode.ts
|
|
443
|
+
const HOLE = /\d+|r:[^:"\\]*:/g;
|
|
444
|
+
const WHOLE_NUMBER = /^(?:0|[1-9]\d{0,14})$/;
|
|
445
|
+
const TEMPLATED_SHARE = .75;
|
|
446
|
+
const keyRefsByTable = /* @__PURE__ */ new Map();
|
|
447
|
+
function keyRefs(keys) {
|
|
448
|
+
let refs = keyRefsByTable.get(keys);
|
|
449
|
+
if (!refs) {
|
|
450
|
+
const names = keys.split(" ");
|
|
451
|
+
const index = new Map(names.map((name, at) => [name, at]));
|
|
452
|
+
const pattern = new RegExp(`"(${names.map((name) => name.replace(/[$]/g, "\\$&")).join("|")})":`, "g");
|
|
453
|
+
refs = (text) => text.replace(pattern, (_, name) => `~${index.get(name)}:`);
|
|
454
|
+
keyRefsByTable.set(keys, refs);
|
|
455
|
+
}
|
|
456
|
+
return refs;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Serves a record list as templates when that is shorter: records that differ only in their
|
|
460
|
+
* values share one shape, each carries only the values that differ between them, and every field
|
|
461
|
+
* name the list's key table spells becomes its index there.
|
|
462
|
+
*/
|
|
463
|
+
function encodeRecordTemplates(records, keys = "") {
|
|
464
|
+
if (records.length < 2) return records;
|
|
465
|
+
const refer = keys ? keyRefs(keys) : (text) => text;
|
|
466
|
+
const groups = /* @__PURE__ */ new Map();
|
|
467
|
+
const texts = [];
|
|
468
|
+
for (let index = 0; index < records.length; index++) {
|
|
469
|
+
let text = JSON.stringify(records[index]);
|
|
470
|
+
if (text.includes("^")) text = text.replaceAll("^", "\\u005e");
|
|
471
|
+
if (text.includes("~")) text = text.replaceAll("~", "\\u007e");
|
|
472
|
+
texts.push(text);
|
|
473
|
+
const values = text.match(HOLE);
|
|
474
|
+
const key = values ? text.replace(HOLE, "^") : text;
|
|
475
|
+
let group = groups.get(key);
|
|
476
|
+
if (!group) groups.set(key, group = {
|
|
477
|
+
key,
|
|
478
|
+
rows: [],
|
|
479
|
+
members: []
|
|
480
|
+
});
|
|
481
|
+
group.rows.push(values);
|
|
482
|
+
group.members.push(index);
|
|
483
|
+
}
|
|
484
|
+
const templates = [];
|
|
485
|
+
const refs = [];
|
|
486
|
+
for (const group of groups.values()) {
|
|
487
|
+
if (group.rows.length === 1) {
|
|
488
|
+
const member = group.members[0];
|
|
489
|
+
const template = refer(texts[member]);
|
|
490
|
+
if (JSON.stringify(template).length < texts[member].length) {
|
|
491
|
+
refs[member] = templates.length;
|
|
492
|
+
templates.push(template);
|
|
493
|
+
} else refs[member] = records[member];
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
const index = templates.length;
|
|
497
|
+
const first = group.rows[0];
|
|
498
|
+
const slots = first ? valueSlots(group.rows) : {
|
|
499
|
+
of: [],
|
|
500
|
+
columns: []
|
|
501
|
+
};
|
|
502
|
+
const parts = group.key.split("^");
|
|
503
|
+
let text = parts[0];
|
|
504
|
+
for (let column = 0; column < parts.length - 1; column++) {
|
|
505
|
+
const slot = slots.of[column];
|
|
506
|
+
text += (slot < 0 ? first[column] : `^${slot}`) + parts[column + 1];
|
|
507
|
+
}
|
|
508
|
+
templates.push(refer(text));
|
|
509
|
+
group.rows.forEach((values, row) => {
|
|
510
|
+
refs[group.members[row]] = slots.columns.length ? [index, ...slots.columns.map((column) => {
|
|
511
|
+
const value = values[column];
|
|
512
|
+
return WHOLE_NUMBER.test(value) ? Number(value) : value;
|
|
513
|
+
})] : index;
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
const encoded = {
|
|
517
|
+
t: templates,
|
|
518
|
+
r: refs
|
|
519
|
+
};
|
|
520
|
+
const plain = texts.reduce((total, text) => total + text.length + 1, 1);
|
|
521
|
+
return JSON.stringify(encoded).length <= plain * TEMPLATED_SHARE ? encoded : records;
|
|
522
|
+
}
|
|
523
|
+
function valueSlots(rows) {
|
|
524
|
+
const width = rows[0].length;
|
|
525
|
+
const of = [];
|
|
526
|
+
const columns = [];
|
|
527
|
+
for (let column = 0; column < width; column++) {
|
|
528
|
+
const value = rows[0][column];
|
|
529
|
+
if (rows.every((row) => row[column] === value)) {
|
|
530
|
+
of.push(-1);
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
const same = columns.findIndex((held) => rows.every((row) => row[held] === row[column]));
|
|
534
|
+
of.push(same >= 0 ? same : columns.push(column) - 1);
|
|
535
|
+
}
|
|
536
|
+
return {
|
|
537
|
+
of,
|
|
538
|
+
columns
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
/** The payload with each templated list served in its shorter form, for JSON.stringify. */
|
|
542
|
+
function encodeProtocolPayloadLists(type, payload) {
|
|
543
|
+
const keys = PROTOCOL_RECORD_KEYS[type];
|
|
544
|
+
let encoded;
|
|
545
|
+
for (const key of PROTOCOL_TEMPLATED_LISTS[type]) {
|
|
546
|
+
const list = payload[key];
|
|
547
|
+
if (!Array.isArray(list)) continue;
|
|
548
|
+
const served = encodeRecordTemplates(list, keys[key]);
|
|
549
|
+
if (served !== list) (encoded ??= { ...payload })[key] = served;
|
|
550
|
+
}
|
|
551
|
+
return encoded ?? payload;
|
|
552
|
+
}
|
|
553
|
+
//#endregion
|
|
440
554
|
//#region src/resume-record-merge.ts
|
|
441
555
|
function mergeResumeRecordDelta(baseline, delta) {
|
|
442
556
|
assertMatchingVersion$1(baseline.state.version, delta.state.version, "state");
|
|
@@ -641,4 +755,4 @@ function createStorageCookieReader(cookieHeader) {
|
|
|
641
755
|
return (driverKey) => values.get(storageCookieName(driverKey));
|
|
642
756
|
}
|
|
643
757
|
//#endregion
|
|
644
|
-
export { ASYNC_BOUNDARY_ARM, ASYNC_PROTOCOL_VERSION, PROTOCOL_EVENT_ACTION_KIND, PROTOCOL_IDLE_EVENT_NAME, PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, PROTOCOL_PAGE_SPACE_ID_PREFIXES, PROTOCOL_PROPS_GRAPH_NODE_ID, PROTOCOL_PROP_GRAPH_NODE_PREFIX, PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, PROTOCOL_VISIBLE_EVENT_NAME, ProtocolStateSerializationError, RuntimePayloadError, STORAGE_PROTOCOL_VERSION, STORAGE_RENDER_CONTEXT_READER, STORAGE_SLOT_SYMBOL_KEY, assertProtocolStateCellPayload, assertProtocolStatePayload, assertProtocolViewPayload, classifyResumeRecordDelta, createProtocolStatePayload, createStorageCookieReader, createStorageSeedMetadata, createStorageSeedMetadataFromGraphNodeId, decodePayloadScripts, decodePayloadScriptsWithVersion, decodeStorageCookieValue, deserializeGraphValue, escapeScriptJson, invalidPayloadShapeError, isValidStorageKey, jsonSourceWithNonFiniteNumbers, mergeResumeRecordDelta, nonFiniteName, payloadInvalidError, payloadScriptSelector, protocolElementHandleReadId, protocolEventActionKind, protocolEventDispatchesMarkless, protocolInstancePath, protocolInstanceQualifies, protocolInstanceSegment, protocolProjectionSegment, protocolRowSegment, protocolStateVersion, renderPayloadScripts, serializeGraphValue, serializeRuntimeAsyncSnapshots, serializeRuntimeStateCells, storageAttributeName, storageCookieAssignment, storageCookieName, storageSlotEntryKey, storageSlotEntryKeyFromGraphNodeId };
|
|
758
|
+
export { ASYNC_BOUNDARY_ARM, ASYNC_PROTOCOL_VERSION, PROTOCOL_CONTAINER_END_COMMENT, PROTOCOL_CONTAINER_HOST_NODE_ID, PROTOCOL_CONTAINER_START_COMMENT, PROTOCOL_EVENT_ACTION_KIND, PROTOCOL_IDLE_EVENT_NAME, PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, PROTOCOL_PAGE_SPACE_ID_PREFIXES, PROTOCOL_PROPS_GRAPH_NODE_ID, PROTOCOL_PROP_GRAPH_NODE_PREFIX, PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, PROTOCOL_TEMPLATED_LISTS, PROTOCOL_VISIBLE_EVENT_NAME, ProtocolStateSerializationError, RuntimePayloadError, STORAGE_PROTOCOL_VERSION, STORAGE_RENDER_CONTEXT_READER, STORAGE_SLOT_SYMBOL_KEY, assertProtocolStateCellPayload, assertProtocolStatePayload, assertProtocolViewPayload, classifyResumeRecordDelta, createProtocolStatePayload, createStorageCookieReader, createStorageSeedMetadata, createStorageSeedMetadataFromGraphNodeId, decodePayloadScripts, decodePayloadScriptsWithVersion, decodeProtocolPayloadLists, decodeStorageCookieValue, deserializeGraphValue, encodeProtocolPayloadLists, encodeRecordTemplates, escapeScriptJson, expandRecordTemplates, invalidPayloadShapeError, isValidStorageKey, jsonSourceWithNonFiniteNumbers, mergeResumeRecordDelta, nonFiniteName, payloadInvalidError, payloadScriptSelector, protocolElementHandleReadId, protocolEventActionKind, protocolEventDispatchesMarkless, protocolInstancePath, protocolInstanceQualifies, protocolInstanceSegment, protocolProjectionSegment, protocolRowSegment, protocolStateVersion, renderPayloadScripts, serializeGraphValue, serializeRuntimeAsyncSnapshots, serializeRuntimeStateCells, storageAttributeName, storageCookieAssignment, storageCookieName, storageSlotEntryKey, storageSlotEntryKeyFromGraphNodeId };
|
|
@@ -10,6 +10,11 @@ const PROTOCOL_IDLE_EVENT_NAME = "idle";
|
|
|
10
10
|
*/
|
|
11
11
|
const PROTOCOL_LOCATOR_PATHS_ATTRIBUTE = "data-markless-paths";
|
|
12
12
|
//#endregion
|
|
13
|
+
//#region src/protocol-page-markers.ts
|
|
14
|
+
const PROTOCOL_CONTAINER_START_COMMENT = "markless:page-start";
|
|
15
|
+
const PROTOCOL_CONTAINER_END_COMMENT = "markless:page-end";
|
|
16
|
+
const PROTOCOL_CONTAINER_HOST_NODE_ID = "container";
|
|
17
|
+
//#endregion
|
|
13
18
|
//#region src/protocol-sync-policy-host.ts
|
|
14
19
|
/**
|
|
15
20
|
* The attribute the server writes on each element whose event record carries a
|
|
@@ -19,6 +24,9 @@ const PROTOCOL_LOCATOR_PATHS_ATTRIBUTE = "data-markless-paths";
|
|
|
19
24
|
*/
|
|
20
25
|
const PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE = "data-markless-sync";
|
|
21
26
|
//#endregion
|
|
27
|
+
//#region src/protocol-prop-prefix.ts
|
|
28
|
+
const PROTOCOL_PROP_GRAPH_NODE_PREFIX = "prop:";
|
|
29
|
+
//#endregion
|
|
22
30
|
//#region src/protocol-constants.ts
|
|
23
31
|
const ASYNC_PROTOCOL_VERSION = 1;
|
|
24
32
|
const STORAGE_PROTOCOL_VERSION = 2;
|
|
@@ -45,7 +53,6 @@ function protocolInstancePath(id) {
|
|
|
45
53
|
return PROTOCOL_INSTANCE_PATH.exec(id)?.[0] ?? "";
|
|
46
54
|
}
|
|
47
55
|
const PROTOCOL_PROPS_GRAPH_NODE_ID = "prop:props";
|
|
48
|
-
const PROTOCOL_PROP_GRAPH_NODE_PREFIX = "prop:";
|
|
49
56
|
const PROTOCOL_INSTANCE_QUALIFIABLE = [
|
|
50
57
|
"prop:",
|
|
51
58
|
"state:",
|
|
@@ -88,4 +95,4 @@ function protocolElementHandleReadId(handleGraphNodeId) {
|
|
|
88
95
|
return `markless:element-handle-id|${handleGraphNodeId}`;
|
|
89
96
|
}
|
|
90
97
|
//#endregion
|
|
91
|
-
export { PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE as _, ASYNC_PROTOCOL_VERSION as a,
|
|
98
|
+
export { PROTOCOL_VISIBLE_EVENT_NAME as C, PROTOCOL_IDLE_EVENT_NAME as S, PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE as _, ASYNC_PROTOCOL_VERSION as a, PROTOCOL_CONTAINER_START_COMMENT as b, PROTOCOL_PROPS_GRAPH_NODE_ID as c, protocolInstanceQualifies as d, protocolInstanceSegment as f, PROTOCOL_PROP_GRAPH_NODE_PREFIX as g, protocolStateVersion as h, ASYNC_BOUNDARY_ARM as i, STORAGE_PROTOCOL_VERSION as l, protocolRowSegment as m, protocolEventActionKind as n, PROTOCOL_EVENT_ACTION_KIND as o, protocolProjectionSegment as p, protocolEventDispatchesMarkless as r, PROTOCOL_PAGE_SPACE_ID_PREFIXES as s, protocolElementHandleReadId as t, protocolInstancePath as u, PROTOCOL_CONTAINER_END_COMMENT as v, PROTOCOL_LOCATOR_PATHS_ATTRIBUTE as x, PROTOCOL_CONTAINER_HOST_NODE_ID as y };
|
|
@@ -17,6 +17,11 @@ declare const PROTOCOL_IDLE_EVENT_NAME = "idle";
|
|
|
17
17
|
*/
|
|
18
18
|
declare const PROTOCOL_LOCATOR_PATHS_ATTRIBUTE = "data-markless-paths";
|
|
19
19
|
//#endregion
|
|
20
|
+
//#region src/protocol-page-markers.d.ts
|
|
21
|
+
declare const PROTOCOL_CONTAINER_START_COMMENT = "markless:page-start";
|
|
22
|
+
declare const PROTOCOL_CONTAINER_END_COMMENT = "markless:page-end";
|
|
23
|
+
declare const PROTOCOL_CONTAINER_HOST_NODE_ID = "container";
|
|
24
|
+
//#endregion
|
|
20
25
|
//#region src/protocol-sync-policy-host.d.ts
|
|
21
26
|
/**
|
|
22
27
|
* The attribute the server writes on each element whose event record carries a
|
|
@@ -26,6 +31,9 @@ declare const PROTOCOL_LOCATOR_PATHS_ATTRIBUTE = "data-markless-paths";
|
|
|
26
31
|
*/
|
|
27
32
|
declare const PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE = "data-markless-sync";
|
|
28
33
|
//#endregion
|
|
34
|
+
//#region src/protocol-prop-prefix.d.ts
|
|
35
|
+
declare const PROTOCOL_PROP_GRAPH_NODE_PREFIX = "prop:";
|
|
36
|
+
//#endregion
|
|
29
37
|
//#region src/protocol-constants.d.ts
|
|
30
38
|
declare const ASYNC_PROTOCOL_VERSION = 1;
|
|
31
39
|
declare const STORAGE_PROTOCOL_VERSION = 2;
|
|
@@ -41,7 +49,6 @@ declare function protocolRowSegment(key: unknown): string;
|
|
|
41
49
|
/** The leading instance path of a composed id, or '' when the id is page-local. */
|
|
42
50
|
declare function protocolInstancePath(id: string): string;
|
|
43
51
|
declare const PROTOCOL_PROPS_GRAPH_NODE_ID = "prop:props";
|
|
44
|
-
declare const PROTOCOL_PROP_GRAPH_NODE_PREFIX = "prop:";
|
|
45
52
|
declare const PROTOCOL_PAGE_SPACE_ID_PREFIXES: string[];
|
|
46
53
|
declare function protocolInstanceQualifies(graphNodeId: string): boolean | undefined;
|
|
47
54
|
//#endregion
|
|
@@ -415,9 +422,23 @@ type ProtocolViewPayload = {
|
|
|
415
422
|
* Element children of the parent that stand before the rows. Rows occupy
|
|
416
423
|
* `[rowStartOffset, rowStartOffset + items.length)` among the parent's child
|
|
417
424
|
* elements; a repeat whose rows begin at 0 omits the field. A repeat whose
|
|
418
|
-
* prefix has no compile-time element count
|
|
425
|
+
* prefix has no compile-time element count says `rowEndOffset` instead, or
|
|
426
|
+
* ships no record at all when its suffix has none either.
|
|
419
427
|
*/
|
|
420
428
|
readonly rowStartOffset?: number;
|
|
429
|
+
/**
|
|
430
|
+
* Element children of the parent that stand after the rows, set only when
|
|
431
|
+
* the prefix has no compile-time element count. Rows then occupy the
|
|
432
|
+
* `items.length` element children ending `rowEndOffset` before the last.
|
|
433
|
+
*/
|
|
434
|
+
readonly rowEndOffset?: number;
|
|
435
|
+
/**
|
|
436
|
+
* The browser can never change these rows: the collection and every value a
|
|
437
|
+
* row shows are fixed once the page is served, so the record carries no row
|
|
438
|
+
* markup and resume neither follows the collection nor loads row-building
|
|
439
|
+
* code. Pay-per-use: a repeat whose rows can change omits the field.
|
|
440
|
+
*/
|
|
441
|
+
readonly fixed?: true;
|
|
421
442
|
/**
|
|
422
443
|
* The `@empty` arm's finished markup, for the mint that raises it when the
|
|
423
444
|
* collection empties after resume and takes it back out when a row returns.
|
|
@@ -644,4 +665,4 @@ type ProtocolPayloadScripts = {
|
|
|
644
665
|
readonly viewScript: string;
|
|
645
666
|
};
|
|
646
667
|
//#endregion
|
|
647
|
-
export {
|
|
668
|
+
export { protocolRowSegment as A, ASYNC_BOUNDARY_ARM as B, PROTOCOL_PAGE_SPACE_ID_PREFIXES as C, protocolInstanceQualifies as D, protocolInstancePath as E, PROTOCOL_CONTAINER_HOST_NODE_ID as F, PROTOCOL_CONTAINER_START_COMMENT as I, PROTOCOL_LOCATOR_PATHS_ATTRIBUTE as L, PROTOCOL_PROP_GRAPH_NODE_PREFIX as M, PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE as N, protocolInstanceSegment as O, PROTOCOL_CONTAINER_END_COMMENT as P, PROTOCOL_IDLE_EVENT_NAME as R, PROTOCOL_EVENT_ACTION_KIND as S, STORAGE_PROTOCOL_VERSION as T, ProtocolViewPayload as _, ProtocolBranchIdrefSite as a, protocolEventDispatchesMarkless as b, ProtocolEventActionKind as c, ProtocolRowTemplateSlotValue as d, ProtocolStatePayload as f, ProtocolSyncPolicyCondition as g, ProtocolSyncPolicyBranch as h, ProtocolBranchContentRead as i, protocolStateVersion as j, protocolProjectionSegment as k, ProtocolEventRecord as l, ProtocolSyncPolicy as m, ProtocolArmRecordSet as n, ProtocolComposedGraphProp as o, ProtocolStreamedArmPatch as p, ProtocolAsyncBoundaryArm as r, ProtocolEventAction as s, ProtocolArmBranchRecord as t, ProtocolPayloadScripts as u, protocolElementHandleReadId as v, PROTOCOL_PROPS_GRAPH_NODE_ID as w, ASYNC_PROTOCOL_VERSION as x, protocolEventActionKind as y, PROTOCOL_VISIBLE_EVENT_NAME as z };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//#region src/protocol-record-keys.ts
|
|
2
|
+
/** The field names each templated record list may spell, in the order its templates index them. */
|
|
3
|
+
const PROTOCOL_RECORD_KEYS = {
|
|
4
|
+
"markless/state": {
|
|
5
|
+
computed: "graphNodeId name async deriveSymbolId value version root $type $ref source flags records id type fields items entries values bytes arrayType buffer byteOffset length byteLength directValue dependencies path snapshot status key error",
|
|
6
|
+
sharedSeeds: "graphNodeId deriveSymbolId dependencies path reads",
|
|
7
|
+
sharedDefinitions: "id name exportedName scope version graphNodeIds projectionIds dependencies definitionId definitionName returnProperties kind graphNodeId path"
|
|
8
|
+
},
|
|
9
|
+
"markless/view": {
|
|
10
|
+
domUpdates: "hostNodeId source graphNodeId path target kind prefix suffix trueValue falseValue textNode name constantClass leadingClass symbolId",
|
|
11
|
+
behaviors: "hostNodeId source functionSource inputSources inputValues inputGraphReads inputIndex graphNodeId path symbolId usesGraph",
|
|
12
|
+
elementHandles: "hostNodeId handleId name plural"
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/protocol-templated-lists.ts
|
|
17
|
+
/**
|
|
18
|
+
* The record lists a payload script may serve as record templates instead of a plain array. The
|
|
19
|
+
* inline resumer reads the others at page load, before any decoder has loaded, so they stay plain.
|
|
20
|
+
*/
|
|
21
|
+
const PROTOCOL_TEMPLATED_LISTS = {
|
|
22
|
+
"markless/state": [
|
|
23
|
+
"computed",
|
|
24
|
+
"sharedSeeds",
|
|
25
|
+
"sharedDefinitions"
|
|
26
|
+
],
|
|
27
|
+
"markless/view": [
|
|
28
|
+
"domUpdates",
|
|
29
|
+
"behaviors",
|
|
30
|
+
"elementHandles"
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/protocol-record-templates.ts
|
|
35
|
+
function expandRecordTemplates(list, keys = "") {
|
|
36
|
+
if (Array.isArray(list)) return list;
|
|
37
|
+
const { t, r } = list;
|
|
38
|
+
const names = keys.split(" ");
|
|
39
|
+
const parts = t.map((text) => text.replace(/~(\d+):/g, (_, at) => `"${names[+at]}":`).split(/\^(\d+)/));
|
|
40
|
+
return r.map((ref) => {
|
|
41
|
+
if (typeof ref === "number") return JSON.parse(parts[ref][0]);
|
|
42
|
+
if (!Array.isArray(ref)) return ref;
|
|
43
|
+
const part = parts[ref[0]];
|
|
44
|
+
let text = part[0];
|
|
45
|
+
for (let at = 1; at < part.length; at += 2) text += ref[+part[at] + 1] + part[at + 1];
|
|
46
|
+
return JSON.parse(text);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/** Expands, in place, every templated list of a freshly parsed payload script. */
|
|
50
|
+
function decodeProtocolPayloadLists(type, payload) {
|
|
51
|
+
const record = payload;
|
|
52
|
+
const keys = PROTOCOL_RECORD_KEYS[type];
|
|
53
|
+
if (record) for (const key of PROTOCOL_TEMPLATED_LISTS[type]) {
|
|
54
|
+
const list = record[key];
|
|
55
|
+
if (list && !Array.isArray(list)) record[key] = expandRecordTemplates(list, keys[key]);
|
|
56
|
+
}
|
|
57
|
+
return payload;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { PROTOCOL_RECORD_KEYS as i, expandRecordTemplates as n, PROTOCOL_TEMPLATED_LISTS as r, decodeProtocolPayloadLists as t };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/protocol-client.d.ts
|
|
2
|
+
type RuntimePayloadType = 'markless/state' | 'markless/view';
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/protocol-templated-lists.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The record lists a payload script may serve as record templates instead of a plain array. The
|
|
7
|
+
* inline resumer reads the others at page load, before any decoder has loaded, so they stay plain.
|
|
8
|
+
*/
|
|
9
|
+
declare const PROTOCOL_TEMPLATED_LISTS: {
|
|
10
|
+
readonly 'markless/state': readonly ["computed", "sharedSeeds", "sharedDefinitions"];
|
|
11
|
+
readonly 'markless/view': readonly ["domUpdates", "behaviors", "elementHandles"];
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/protocol-record-templates.d.ts
|
|
15
|
+
/**
|
|
16
|
+
* A record list served as templates. `t` holds each distinct record shape as JSON text whose
|
|
17
|
+
* per-record values are `^<slot>` holes and whose field names the list's generated key table
|
|
18
|
+
* spells are `~<index>:` references; each `r` entry is a template index (no values), a
|
|
19
|
+
* `[template, ...values]` row filling the holes in order, or a record no other record shares.
|
|
20
|
+
*/
|
|
21
|
+
type ProtocolTemplatedRecords = {
|
|
22
|
+
readonly t: ReadonlyArray<string>;
|
|
23
|
+
readonly r: ReadonlyArray<number | ReadonlyArray<number | string> | object>;
|
|
24
|
+
};
|
|
25
|
+
/** A record list as a payload script serves it: a plain array, or templates. */
|
|
26
|
+
type ProtocolServedRecords = ReadonlyArray<unknown> | ProtocolTemplatedRecords;
|
|
27
|
+
declare function expandRecordTemplates(list: ProtocolServedRecords, keys?: string): unknown[];
|
|
28
|
+
/** Expands, in place, every templated list of a freshly parsed payload script. */
|
|
29
|
+
declare function decodeProtocolPayloadLists<T>(type: RuntimePayloadType, payload: T): T;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { PROTOCOL_TEMPLATED_LISTS as a, expandRecordTemplates as i, ProtocolTemplatedRecords as n, RuntimePayloadType as o, decodeProtocolPayloadLists as r, ProtocolServedRecords as t };
|
package/dist/{protocol-validation-storage-C9YES3Zy.d.ts → protocol-validation-storage-B4dATVQ_.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as ProtocolViewPayload, f as ProtocolStatePayload } from "./protocol-
|
|
1
|
+
import { _ as ProtocolViewPayload, f as ProtocolStatePayload } from "./protocol-BNO5JLsK.js";
|
|
2
2
|
//#region src/protocol-validation.d.ts
|
|
3
3
|
type EncodedPayloadScripts = {
|
|
4
4
|
readonly stateScript: string;
|
package/dist/{protocol-validation-storage-DhyQ9fEO.js → protocol-validation-storage-D9VzvR9i.js}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { i as ASYNC_BOUNDARY_ARM, o as PROTOCOL_EVENT_ACTION_KIND } from "./protocol-
|
|
1
|
+
import { i as ASYNC_BOUNDARY_ARM, o as PROTOCOL_EVENT_ACTION_KIND } from "./protocol-9Mv28nr_.js";
|
|
2
|
+
import { t as decodeProtocolPayloadLists } from "./protocol-record-templates-B0Ay3OCd.js";
|
|
2
3
|
//#region src/protocol-validation.ts
|
|
3
4
|
var RuntimePayloadError = class extends Error {
|
|
4
5
|
constructor(diagnostic) {
|
|
@@ -25,7 +26,7 @@ function parseDataScript(script, type) {
|
|
|
25
26
|
const prefix = `<script type="${type}">`;
|
|
26
27
|
if (!script.startsWith(prefix) || !script.endsWith("<\/script>")) throw payloadInvalidError(type, `Expected ${type} payload script.`, `Browser resume expects the ${type} data to arrive in a canonical ${payloadScriptSelector(type)} script wrapper before decoding the resumability protocol.`, [{ message: `Emit the ${type} payload with renderPayloadScripts or an equivalent canonical script wrapper.` }]);
|
|
27
28
|
try {
|
|
28
|
-
return JSON.parse(script.slice(prefix.length, -9));
|
|
29
|
+
return decodeProtocolPayloadLists(type, JSON.parse(script.slice(prefix.length, -9)));
|
|
29
30
|
} catch {
|
|
30
31
|
throw payloadInvalidError(type, `Invalid ${type} payload JSON.`, `The ${type} payload script must contain valid JSON before the runtime can validate the resumability protocol fields.`, [{ message: `Emit valid JSON inside the ${payloadScriptSelector(type)} script content.` }]);
|
|
31
32
|
}
|
|
@@ -210,6 +211,7 @@ function assertOptionalKeyedRepeats(record) {
|
|
|
210
211
|
assertStringField(repeat, "itemName", context);
|
|
211
212
|
assertNonNegativeIntegerField(repeat, "rowElementCount", context);
|
|
212
213
|
if (repeat.rowStartOffset !== void 0) assertNonNegativeIntegerField(repeat, "rowStartOffset", context);
|
|
214
|
+
if (repeat.rowEndOffset !== void 0) assertNonNegativeIntegerField(repeat, "rowEndOffset", context);
|
|
213
215
|
assertRowEvents(repeat.rowEvents, `${context}.rowEvents`);
|
|
214
216
|
assertOptionalRowElementHandles(repeat, `${context}.rowElementHandles`);
|
|
215
217
|
assertOptionalEmptyArm(repeat, `${context}.emptyArm`);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RuntimePayloadError, c as assertProtocolStateCellPayload, d as decodePayloadScriptsWithVersion, f as invalidPayloadShapeError, i as RuntimePayloadDiagnostic, l as assertProtocolStatePayload, m as payloadScriptSelector, n as DecodedPayloadScripts, o as RuntimePayloadErrorCode, p as payloadInvalidError, r as EncodedPayloadScripts, s as RuntimePayloadType, t as decodePayloadScripts, u as assertProtocolViewPayload } from "./protocol-validation-storage-
|
|
1
|
+
import { a as RuntimePayloadError, c as assertProtocolStateCellPayload, d as decodePayloadScriptsWithVersion, f as invalidPayloadShapeError, i as RuntimePayloadDiagnostic, l as assertProtocolStatePayload, m as payloadScriptSelector, n as DecodedPayloadScripts, o as RuntimePayloadErrorCode, p as payloadInvalidError, r as EncodedPayloadScripts, s as RuntimePayloadType, t as decodePayloadScripts, u as assertProtocolViewPayload } from "./protocol-validation-storage-B4dATVQ_.js";
|
|
2
2
|
export { DecodedPayloadScripts, EncodedPayloadScripts, RuntimePayloadDiagnostic, RuntimePayloadError, RuntimePayloadErrorCode, RuntimePayloadType, assertProtocolStateCellPayload, assertProtocolStatePayload, assertProtocolViewPayload, decodePayloadScripts, decodePayloadScriptsWithVersion, invalidPayloadShapeError, payloadInvalidError, payloadScriptSelector };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as assertProtocolStatePayload, c as invalidPayloadShapeError, i as assertProtocolStateCellPayload, l as payloadInvalidError, o as assertProtocolViewPayload, r as RuntimePayloadError, s as decodePayloadScriptsWithVersion, t as decodePayloadScripts, u as payloadScriptSelector } from "./protocol-validation-storage-
|
|
1
|
+
import { a as assertProtocolStatePayload, c as invalidPayloadShapeError, i as assertProtocolStateCellPayload, l as payloadInvalidError, o as assertProtocolViewPayload, r as RuntimePayloadError, s as decodePayloadScriptsWithVersion, t as decodePayloadScripts, u as payloadScriptSelector } from "./protocol-validation-storage-D9VzvR9i.js";
|
|
2
2
|
export { RuntimePayloadError, assertProtocolStateCellPayload, assertProtocolStatePayload, assertProtocolViewPayload, decodePayloadScripts, decodePayloadScriptsWithVersion, invalidPayloadShapeError, payloadInvalidError, payloadScriptSelector };
|
package/dist/protocol.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { ASYNC_BOUNDARY_ARM, ASYNC_PROTOCOL_VERSION, PROTOCOL_EVENT_ACTION_KIND, PROTOCOL_IDLE_EVENT_NAME, PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, PROTOCOL_PAGE_SPACE_ID_PREFIXES, PROTOCOL_PROPS_GRAPH_NODE_ID, PROTOCOL_PROP_GRAPH_NODE_PREFIX, PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, PROTOCOL_VISIBLE_EVENT_NAME, ProtocolArmBranchRecord, ProtocolArmRecordSet, ProtocolAsyncBoundaryArm, ProtocolBranchContentRead, ProtocolBranchIdrefSite, ProtocolComposedGraphProp, ProtocolEventAction, ProtocolEventActionKind, ProtocolEventRecord, ProtocolPayloadScripts, ProtocolRowTemplateSlotValue, ProtocolStatePayload, ProtocolStreamedArmPatch, ProtocolSyncPolicy, ProtocolSyncPolicyBranch, ProtocolSyncPolicyCondition, ProtocolViewPayload, STORAGE_PROTOCOL_VERSION, protocolElementHandleReadId, protocolEventActionKind, protocolEventDispatchesMarkless, protocolInstancePath, protocolInstanceQualifies, protocolInstanceSegment, protocolProjectionSegment, protocolRowSegment, protocolStateVersion };
|
|
1
|
+
import { A as protocolRowSegment, B as ASYNC_BOUNDARY_ARM, C as PROTOCOL_PAGE_SPACE_ID_PREFIXES, D as protocolInstanceQualifies, E as protocolInstancePath, F as PROTOCOL_CONTAINER_HOST_NODE_ID, I as PROTOCOL_CONTAINER_START_COMMENT, L as PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, M as PROTOCOL_PROP_GRAPH_NODE_PREFIX, N as PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, O as protocolInstanceSegment, P as PROTOCOL_CONTAINER_END_COMMENT, R as PROTOCOL_IDLE_EVENT_NAME, S as PROTOCOL_EVENT_ACTION_KIND, T as STORAGE_PROTOCOL_VERSION, _ as ProtocolViewPayload, a as ProtocolBranchIdrefSite, b as protocolEventDispatchesMarkless, c as ProtocolEventActionKind, d as ProtocolRowTemplateSlotValue, f as ProtocolStatePayload, g as ProtocolSyncPolicyCondition, h as ProtocolSyncPolicyBranch, i as ProtocolBranchContentRead, j as protocolStateVersion, k as protocolProjectionSegment, l as ProtocolEventRecord, m as ProtocolSyncPolicy, n as ProtocolArmRecordSet, o as ProtocolComposedGraphProp, p as ProtocolStreamedArmPatch, r as ProtocolAsyncBoundaryArm, s as ProtocolEventAction, t as ProtocolArmBranchRecord, u as ProtocolPayloadScripts, v as protocolElementHandleReadId, w as PROTOCOL_PROPS_GRAPH_NODE_ID, x as ASYNC_PROTOCOL_VERSION, y as protocolEventActionKind, z as PROTOCOL_VISIBLE_EVENT_NAME } from "./protocol-BNO5JLsK.js";
|
|
2
|
+
export { ASYNC_BOUNDARY_ARM, ASYNC_PROTOCOL_VERSION, PROTOCOL_CONTAINER_END_COMMENT, PROTOCOL_CONTAINER_HOST_NODE_ID, PROTOCOL_CONTAINER_START_COMMENT, PROTOCOL_EVENT_ACTION_KIND, PROTOCOL_IDLE_EVENT_NAME, PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, PROTOCOL_PAGE_SPACE_ID_PREFIXES, PROTOCOL_PROPS_GRAPH_NODE_ID, PROTOCOL_PROP_GRAPH_NODE_PREFIX, PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, PROTOCOL_VISIBLE_EVENT_NAME, ProtocolArmBranchRecord, ProtocolArmRecordSet, ProtocolAsyncBoundaryArm, ProtocolBranchContentRead, ProtocolBranchIdrefSite, ProtocolComposedGraphProp, ProtocolEventAction, ProtocolEventActionKind, ProtocolEventRecord, ProtocolPayloadScripts, ProtocolRowTemplateSlotValue, ProtocolStatePayload, ProtocolStreamedArmPatch, ProtocolSyncPolicy, ProtocolSyncPolicyBranch, ProtocolSyncPolicyCondition, ProtocolViewPayload, STORAGE_PROTOCOL_VERSION, protocolElementHandleReadId, protocolEventActionKind, protocolEventDispatchesMarkless, protocolInstancePath, protocolInstanceQualifies, protocolInstanceSegment, protocolProjectionSegment, protocolRowSegment, protocolStateVersion };
|
package/dist/protocol.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, a as ASYNC_PROTOCOL_VERSION, b as
|
|
2
|
-
export { ASYNC_BOUNDARY_ARM, ASYNC_PROTOCOL_VERSION, PROTOCOL_EVENT_ACTION_KIND, PROTOCOL_IDLE_EVENT_NAME, PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, PROTOCOL_PAGE_SPACE_ID_PREFIXES, PROTOCOL_PROPS_GRAPH_NODE_ID, PROTOCOL_PROP_GRAPH_NODE_PREFIX, PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, PROTOCOL_VISIBLE_EVENT_NAME, STORAGE_PROTOCOL_VERSION, protocolElementHandleReadId, protocolEventActionKind, protocolEventDispatchesMarkless, protocolInstancePath, protocolInstanceQualifies, protocolInstanceSegment, protocolProjectionSegment, protocolRowSegment, protocolStateVersion };
|
|
1
|
+
import { C as PROTOCOL_VISIBLE_EVENT_NAME, S as PROTOCOL_IDLE_EVENT_NAME, _ as PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, a as ASYNC_PROTOCOL_VERSION, b as PROTOCOL_CONTAINER_START_COMMENT, c as PROTOCOL_PROPS_GRAPH_NODE_ID, d as protocolInstanceQualifies, f as protocolInstanceSegment, g as PROTOCOL_PROP_GRAPH_NODE_PREFIX, h as protocolStateVersion, i as ASYNC_BOUNDARY_ARM, l as STORAGE_PROTOCOL_VERSION, m as protocolRowSegment, n as protocolEventActionKind, o as PROTOCOL_EVENT_ACTION_KIND, p as protocolProjectionSegment, r as protocolEventDispatchesMarkless, s as PROTOCOL_PAGE_SPACE_ID_PREFIXES, t as protocolElementHandleReadId, u as protocolInstancePath, v as PROTOCOL_CONTAINER_END_COMMENT, x as PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, y as PROTOCOL_CONTAINER_HOST_NODE_ID } from "./protocol-9Mv28nr_.js";
|
|
2
|
+
export { ASYNC_BOUNDARY_ARM, ASYNC_PROTOCOL_VERSION, PROTOCOL_CONTAINER_END_COMMENT, PROTOCOL_CONTAINER_HOST_NODE_ID, PROTOCOL_CONTAINER_START_COMMENT, PROTOCOL_EVENT_ACTION_KIND, PROTOCOL_IDLE_EVENT_NAME, PROTOCOL_LOCATOR_PATHS_ATTRIBUTE, PROTOCOL_PAGE_SPACE_ID_PREFIXES, PROTOCOL_PROPS_GRAPH_NODE_ID, PROTOCOL_PROP_GRAPH_NODE_PREFIX, PROTOCOL_SYNC_POLICY_HOST_ATTRIBUTE, PROTOCOL_VISIBLE_EVENT_NAME, STORAGE_PROTOCOL_VERSION, protocolElementHandleReadId, protocolEventActionKind, protocolEventDispatchesMarkless, protocolInstancePath, protocolInstanceQualifies, protocolInstanceSegment, protocolProjectionSegment, protocolRowSegment, protocolStateVersion };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as PROTOCOL_TEMPLATED_LISTS, i as expandRecordTemplates, n as ProtocolTemplatedRecords, o as RuntimePayloadType, r as decodeProtocolPayloadLists, t as ProtocolServedRecords } from "./protocol-record-templates-pAcSQYqD.js";
|
|
2
|
+
export { PROTOCOL_TEMPLATED_LISTS, ProtocolServedRecords, ProtocolTemplatedRecords, type RuntimePayloadType, decodeProtocolPayloadLists, expandRecordTemplates };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markless/serializer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Markless serialization tiers and resumability payload protocol.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -42,6 +42,10 @@
|
|
|
42
42
|
"types": "./dist/protocol.d.ts",
|
|
43
43
|
"default": "./dist/protocol.js"
|
|
44
44
|
},
|
|
45
|
+
"./record-templates": {
|
|
46
|
+
"types": "./dist/record-templates.d.ts",
|
|
47
|
+
"default": "./dist/record-templates.js"
|
|
48
|
+
},
|
|
45
49
|
"./protocol-validation": {
|
|
46
50
|
"types": "./dist/protocol-validation.d.ts",
|
|
47
51
|
"default": "./dist/protocol-validation.js"
|