diff --git a/lib/cjs/generated/browserSessionReplay.d.ts b/lib/cjs/generated/browserSessionReplay.d.ts index d0dc164c..30ed198c 100644 --- a/lib/cjs/generated/browserSessionReplay.d.ts +++ b/lib/cjs/generated/browserSessionReplay.d.ts @@ -27,7 +27,7 @@ export declare type CreationReason = 'init' | 'segment_duration_limit' | 'segmen /** * Browser-specific. Schema of a Session Replay Record. */ -export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord; +export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord | BrowserChangeRecord; /** * Browser-specific. Schema of a Record type which contains the full snapshot of a screen. */ @@ -303,6 +303,184 @@ export declare type FrustrationRecord = SlotSupportedCommonRecordSchema & { recordIds: number[]; }; }; +/** + * Browser-specific. Schema of a Record type which represents changes and mutations using a compact encoding. (Experimental.) + */ +export declare type BrowserChangeRecord = SlotSupportedCommonRecordSchema & { + /** + * The type of this Record. + */ + readonly type: 12; + data: BrowserChangeData; + id?: number; +}; +/** + * Browser-specific. Schema of a Session Replay BrowserChangeData type. + */ +export declare type BrowserChangeData = { + /** + * Changes to the `adoptedStyleSheets` list of a Document, DocumentFragment, or ShadowRoot node. + */ + adoptedStyleSheetsChanges?: AdoptedStyleSheetsChange[]; + /** + * Changes to the attributes of a node. + */ + attributeChanges?: AttributeChange[]; + /** + * Newly added nodes. + */ + nodesAdded?: AddNodeChange[]; + /** + * Newly removed nodes. + */ + nodesRemoved?: NodeId[]; + /** + * Changes to the scroll position of a node. + */ + scrollChanges?: ScrollPositionChange[]; + /** + * Newly added strings. + */ + stringsAdded?: AddStringChange[]; + /** + * Changes to the text content of a node. + */ + textChanges?: TextChange[]; +}; +/** + * Browser-specific. Schema representing a change to the adopted stylesheets of a document or shadow DOM subtree. + * + * @minItems 1 + */ +export declare type AdoptedStyleSheetsChange = [NodeId, ...StyleSheet[]]; +/** + * Browser-specific. Schema representing the ID of a DOM node. + */ +export declare type NodeId = number; +/** + * Browser-specific. Schema representing a change to an node's attributes. + * + * @minItems 1 + */ +export declare type AttributeChange = [NodeId, ...AttributeAssignmentOrDeletion[]]; +/** + * Browser-specific. Schema representing a change to an attribute, either by assignment of a new value or by deletion of the attribute. + * + * @minItems 2 + */ +export declare type AttributeAssignmentOrDeletion = [string, string | null]; +/** + * Browser-specific. Schema representing the addition of a new node to the document. + */ +export declare type AddNodeChange = AddCDataSectionNodeChange | AddDocTypeNodeChange | AddDocumentNodeChange | AddDocumentFragmentNodeChange | AddElementNodeChange | AddTextNodeChange | AddShadowRootNodeChange; +/** + * Browser-specific. Schema representing the addition of a new #cdata-section node to the document. + * + * @minItems 2 + */ +export declare type AddCDataSectionNodeChange = [InsertionPoint, CDataSectionNodeName]; +/** + * Browser-specific. Schema representing the insertion point of a node which is being added to the document. + */ +export declare type InsertionPoint = RootInsertionPoint | LastChildInsertionPoint | NextSiblingInsertionPoint; +/** + * A null insertion point, indicating that the node should be inserted at the root of the document. + */ +export declare type RootInsertionPoint = null; +/** + * A positive integer insertion point. Inserting a node at positive integer N indicates that the node should be inserted as the last child of the node with an id N lower than the new node. + */ +export declare type LastChildInsertionPoint = number; +/** + * A negative integer insertion point. Inserting a node at negative integer -N indicates that the node should be inserted as the next sibling of the node with an id N lower than the new node. + */ +export declare type NextSiblingInsertionPoint = number; +/** + * Browser-specific. Schema representing the node name for a #cdata-section node, expressed as either a reference to the string table or a literal string. + */ +export declare type CDataSectionNodeName = number | '#cdata-section'; +/** + * Browser-specific. Schema representing the addition of a new #doctype node to the document. + * + * @minItems 5 + */ +export declare type AddDocTypeNodeChange = [InsertionPoint, DocTypeNodeName, string, string, string]; +/** + * Browser-specific. Schema representing the node name for a #doctype node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocTypeNodeName = number | '#doctype'; +/** + * Browser-specific. Schema representing the addition of a new #document node to the document. + * + * @minItems 2 + */ +export declare type AddDocumentNodeChange = [InsertionPoint, DocumentNodeName]; +/** + * Browser-specific. Schema representing the node name for a #document node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocumentNodeName = number | '#document'; +/** + * Browser-specific. Schema representing the addition of a new #document-fragment node to the document. + * + * @minItems 2 + */ +export declare type AddDocumentFragmentNodeChange = [InsertionPoint, DocumentFragmentNodeName]; +/** + * Browser-specific. Schema representing the node name for a #document-fragment node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocumentFragmentNodeName = number | '#document-fragment'; +/** + * Browser-specific. Schema representing the addition of a new element node to the document. + * + * @minItems 2 + */ +export declare type AddElementNodeChange = [InsertionPoint, NodeName, ...AttributeAssignment[]]; +/** + * Browser-specific. Schema representing a node name (i.e., Node#nodeName), expressed as either a reference to the string table or a literal string. + */ +export declare type NodeName = number | string; +/** + * Browser-specific. Schema representing an assignment of a value to an attribute. + * + * @minItems 2 + */ +export declare type AttributeAssignment = [string, string]; +/** + * Browser-specific. Schema representing the addition of a new #text node to the document. + * + * @minItems 3 + */ +export declare type AddTextNodeChange = [InsertionPoint, TextNodeName, string]; +/** + * Browser-specific. Schema representing the node name for a #text node, expressed as either a reference to the string table or a literal string. + */ +export declare type TextNodeName = number | '#text'; +/** + * Browser-specific. Schema representing the addition of a new #shadow-root node to the document. + * + * @minItems 2 + */ +export declare type AddShadowRootNodeChange = [InsertionPoint, ShadowRootNodeName]; +/** + * Browser-specific. Schema representing the node name for a #shadow-root node, expressed as either a reference to the string table or a literal string. + */ +export declare type ShadowRootNodeName = number | '#shadow-root'; +/** + * Browser-specific. Schema representing a scroll position change. + * + * @minItems 3 + */ +export declare type ScrollPositionChange = [NodeId, number, number]; +/** + * Browser-specific. Schema representing the addition of a string to the string table. + */ +export declare type AddStringChange = string; +/** + * Browser-specific. Schema representing a change to the text content of a #text node. + * + * @minItems 2 + */ +export declare type TextChange = [NodeId, string]; /** * Schema of a Session Replay Segment context. */ diff --git a/lib/cjs/generated/sessionReplay.d.ts b/lib/cjs/generated/sessionReplay.d.ts index 52844e42..7e075c68 100644 --- a/lib/cjs/generated/sessionReplay.d.ts +++ b/lib/cjs/generated/sessionReplay.d.ts @@ -35,7 +35,7 @@ export declare type CreationReason = 'init' | 'segment_duration_limit' | 'segmen /** * Browser-specific. Schema of a Session Replay Record. */ -export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord; +export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord | BrowserChangeRecord; /** * Browser-specific. Schema of a Record type which contains the full snapshot of a screen. */ @@ -311,6 +311,184 @@ export declare type FrustrationRecord = SlotSupportedCommonRecordSchema & { recordIds: number[]; }; }; +/** + * Browser-specific. Schema of a Record type which represents changes and mutations using a compact encoding. (Experimental.) + */ +export declare type BrowserChangeRecord = SlotSupportedCommonRecordSchema & { + /** + * The type of this Record. + */ + readonly type: 12; + data: BrowserChangeData; + id?: number; +}; +/** + * Browser-specific. Schema of a Session Replay BrowserChangeData type. + */ +export declare type BrowserChangeData = { + /** + * Changes to the `adoptedStyleSheets` list of a Document, DocumentFragment, or ShadowRoot node. + */ + adoptedStyleSheetsChanges?: AdoptedStyleSheetsChange[]; + /** + * Changes to the attributes of a node. + */ + attributeChanges?: AttributeChange[]; + /** + * Newly added nodes. + */ + nodesAdded?: AddNodeChange[]; + /** + * Newly removed nodes. + */ + nodesRemoved?: NodeId[]; + /** + * Changes to the scroll position of a node. + */ + scrollChanges?: ScrollPositionChange[]; + /** + * Newly added strings. + */ + stringsAdded?: AddStringChange[]; + /** + * Changes to the text content of a node. + */ + textChanges?: TextChange[]; +}; +/** + * Browser-specific. Schema representing a change to the adopted stylesheets of a document or shadow DOM subtree. + * + * @minItems 1 + */ +export declare type AdoptedStyleSheetsChange = [NodeId, ...StyleSheet[]]; +/** + * Browser-specific. Schema representing the ID of a DOM node. + */ +export declare type NodeId = number; +/** + * Browser-specific. Schema representing a change to an node's attributes. + * + * @minItems 1 + */ +export declare type AttributeChange = [NodeId, ...AttributeAssignmentOrDeletion[]]; +/** + * Browser-specific. Schema representing a change to an attribute, either by assignment of a new value or by deletion of the attribute. + * + * @minItems 2 + */ +export declare type AttributeAssignmentOrDeletion = [string, string | null]; +/** + * Browser-specific. Schema representing the addition of a new node to the document. + */ +export declare type AddNodeChange = AddCDataSectionNodeChange | AddDocTypeNodeChange | AddDocumentNodeChange | AddDocumentFragmentNodeChange | AddElementNodeChange | AddTextNodeChange | AddShadowRootNodeChange; +/** + * Browser-specific. Schema representing the addition of a new #cdata-section node to the document. + * + * @minItems 2 + */ +export declare type AddCDataSectionNodeChange = [InsertionPoint, CDataSectionNodeName]; +/** + * Browser-specific. Schema representing the insertion point of a node which is being added to the document. + */ +export declare type InsertionPoint = RootInsertionPoint | LastChildInsertionPoint | NextSiblingInsertionPoint; +/** + * A null insertion point, indicating that the node should be inserted at the root of the document. + */ +export declare type RootInsertionPoint = null; +/** + * A positive integer insertion point. Inserting a node at positive integer N indicates that the node should be inserted as the last child of the node with an id N lower than the new node. + */ +export declare type LastChildInsertionPoint = number; +/** + * A negative integer insertion point. Inserting a node at negative integer -N indicates that the node should be inserted as the next sibling of the node with an id N lower than the new node. + */ +export declare type NextSiblingInsertionPoint = number; +/** + * Browser-specific. Schema representing the node name for a #cdata-section node, expressed as either a reference to the string table or a literal string. + */ +export declare type CDataSectionNodeName = number | '#cdata-section'; +/** + * Browser-specific. Schema representing the addition of a new #doctype node to the document. + * + * @minItems 5 + */ +export declare type AddDocTypeNodeChange = [InsertionPoint, DocTypeNodeName, string, string, string]; +/** + * Browser-specific. Schema representing the node name for a #doctype node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocTypeNodeName = number | '#doctype'; +/** + * Browser-specific. Schema representing the addition of a new #document node to the document. + * + * @minItems 2 + */ +export declare type AddDocumentNodeChange = [InsertionPoint, DocumentNodeName]; +/** + * Browser-specific. Schema representing the node name for a #document node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocumentNodeName = number | '#document'; +/** + * Browser-specific. Schema representing the addition of a new #document-fragment node to the document. + * + * @minItems 2 + */ +export declare type AddDocumentFragmentNodeChange = [InsertionPoint, DocumentFragmentNodeName]; +/** + * Browser-specific. Schema representing the node name for a #document-fragment node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocumentFragmentNodeName = number | '#document-fragment'; +/** + * Browser-specific. Schema representing the addition of a new element node to the document. + * + * @minItems 2 + */ +export declare type AddElementNodeChange = [InsertionPoint, NodeName, ...AttributeAssignment[]]; +/** + * Browser-specific. Schema representing a node name (i.e., Node#nodeName), expressed as either a reference to the string table or a literal string. + */ +export declare type NodeName = number | string; +/** + * Browser-specific. Schema representing an assignment of a value to an attribute. + * + * @minItems 2 + */ +export declare type AttributeAssignment = [string, string]; +/** + * Browser-specific. Schema representing the addition of a new #text node to the document. + * + * @minItems 3 + */ +export declare type AddTextNodeChange = [InsertionPoint, TextNodeName, string]; +/** + * Browser-specific. Schema representing the node name for a #text node, expressed as either a reference to the string table or a literal string. + */ +export declare type TextNodeName = number | '#text'; +/** + * Browser-specific. Schema representing the addition of a new #shadow-root node to the document. + * + * @minItems 2 + */ +export declare type AddShadowRootNodeChange = [InsertionPoint, ShadowRootNodeName]; +/** + * Browser-specific. Schema representing the node name for a #shadow-root node, expressed as either a reference to the string table or a literal string. + */ +export declare type ShadowRootNodeName = number | '#shadow-root'; +/** + * Browser-specific. Schema representing a scroll position change. + * + * @minItems 3 + */ +export declare type ScrollPositionChange = [NodeId, number, number]; +/** + * Browser-specific. Schema representing the addition of a string to the string table. + */ +export declare type AddStringChange = string; +/** + * Browser-specific. Schema representing a change to the text content of a #text node. + * + * @minItems 2 + */ +export declare type TextChange = [NodeId, string]; /** * Mobile-specific. Schema of a Session Replay data Segment. */ diff --git a/lib/esm/generated/browserSessionReplay.d.ts b/lib/esm/generated/browserSessionReplay.d.ts index d0dc164c..30ed198c 100644 --- a/lib/esm/generated/browserSessionReplay.d.ts +++ b/lib/esm/generated/browserSessionReplay.d.ts @@ -27,7 +27,7 @@ export declare type CreationReason = 'init' | 'segment_duration_limit' | 'segmen /** * Browser-specific. Schema of a Session Replay Record. */ -export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord; +export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord | BrowserChangeRecord; /** * Browser-specific. Schema of a Record type which contains the full snapshot of a screen. */ @@ -303,6 +303,184 @@ export declare type FrustrationRecord = SlotSupportedCommonRecordSchema & { recordIds: number[]; }; }; +/** + * Browser-specific. Schema of a Record type which represents changes and mutations using a compact encoding. (Experimental.) + */ +export declare type BrowserChangeRecord = SlotSupportedCommonRecordSchema & { + /** + * The type of this Record. + */ + readonly type: 12; + data: BrowserChangeData; + id?: number; +}; +/** + * Browser-specific. Schema of a Session Replay BrowserChangeData type. + */ +export declare type BrowserChangeData = { + /** + * Changes to the `adoptedStyleSheets` list of a Document, DocumentFragment, or ShadowRoot node. + */ + adoptedStyleSheetsChanges?: AdoptedStyleSheetsChange[]; + /** + * Changes to the attributes of a node. + */ + attributeChanges?: AttributeChange[]; + /** + * Newly added nodes. + */ + nodesAdded?: AddNodeChange[]; + /** + * Newly removed nodes. + */ + nodesRemoved?: NodeId[]; + /** + * Changes to the scroll position of a node. + */ + scrollChanges?: ScrollPositionChange[]; + /** + * Newly added strings. + */ + stringsAdded?: AddStringChange[]; + /** + * Changes to the text content of a node. + */ + textChanges?: TextChange[]; +}; +/** + * Browser-specific. Schema representing a change to the adopted stylesheets of a document or shadow DOM subtree. + * + * @minItems 1 + */ +export declare type AdoptedStyleSheetsChange = [NodeId, ...StyleSheet[]]; +/** + * Browser-specific. Schema representing the ID of a DOM node. + */ +export declare type NodeId = number; +/** + * Browser-specific. Schema representing a change to an node's attributes. + * + * @minItems 1 + */ +export declare type AttributeChange = [NodeId, ...AttributeAssignmentOrDeletion[]]; +/** + * Browser-specific. Schema representing a change to an attribute, either by assignment of a new value or by deletion of the attribute. + * + * @minItems 2 + */ +export declare type AttributeAssignmentOrDeletion = [string, string | null]; +/** + * Browser-specific. Schema representing the addition of a new node to the document. + */ +export declare type AddNodeChange = AddCDataSectionNodeChange | AddDocTypeNodeChange | AddDocumentNodeChange | AddDocumentFragmentNodeChange | AddElementNodeChange | AddTextNodeChange | AddShadowRootNodeChange; +/** + * Browser-specific. Schema representing the addition of a new #cdata-section node to the document. + * + * @minItems 2 + */ +export declare type AddCDataSectionNodeChange = [InsertionPoint, CDataSectionNodeName]; +/** + * Browser-specific. Schema representing the insertion point of a node which is being added to the document. + */ +export declare type InsertionPoint = RootInsertionPoint | LastChildInsertionPoint | NextSiblingInsertionPoint; +/** + * A null insertion point, indicating that the node should be inserted at the root of the document. + */ +export declare type RootInsertionPoint = null; +/** + * A positive integer insertion point. Inserting a node at positive integer N indicates that the node should be inserted as the last child of the node with an id N lower than the new node. + */ +export declare type LastChildInsertionPoint = number; +/** + * A negative integer insertion point. Inserting a node at negative integer -N indicates that the node should be inserted as the next sibling of the node with an id N lower than the new node. + */ +export declare type NextSiblingInsertionPoint = number; +/** + * Browser-specific. Schema representing the node name for a #cdata-section node, expressed as either a reference to the string table or a literal string. + */ +export declare type CDataSectionNodeName = number | '#cdata-section'; +/** + * Browser-specific. Schema representing the addition of a new #doctype node to the document. + * + * @minItems 5 + */ +export declare type AddDocTypeNodeChange = [InsertionPoint, DocTypeNodeName, string, string, string]; +/** + * Browser-specific. Schema representing the node name for a #doctype node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocTypeNodeName = number | '#doctype'; +/** + * Browser-specific. Schema representing the addition of a new #document node to the document. + * + * @minItems 2 + */ +export declare type AddDocumentNodeChange = [InsertionPoint, DocumentNodeName]; +/** + * Browser-specific. Schema representing the node name for a #document node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocumentNodeName = number | '#document'; +/** + * Browser-specific. Schema representing the addition of a new #document-fragment node to the document. + * + * @minItems 2 + */ +export declare type AddDocumentFragmentNodeChange = [InsertionPoint, DocumentFragmentNodeName]; +/** + * Browser-specific. Schema representing the node name for a #document-fragment node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocumentFragmentNodeName = number | '#document-fragment'; +/** + * Browser-specific. Schema representing the addition of a new element node to the document. + * + * @minItems 2 + */ +export declare type AddElementNodeChange = [InsertionPoint, NodeName, ...AttributeAssignment[]]; +/** + * Browser-specific. Schema representing a node name (i.e., Node#nodeName), expressed as either a reference to the string table or a literal string. + */ +export declare type NodeName = number | string; +/** + * Browser-specific. Schema representing an assignment of a value to an attribute. + * + * @minItems 2 + */ +export declare type AttributeAssignment = [string, string]; +/** + * Browser-specific. Schema representing the addition of a new #text node to the document. + * + * @minItems 3 + */ +export declare type AddTextNodeChange = [InsertionPoint, TextNodeName, string]; +/** + * Browser-specific. Schema representing the node name for a #text node, expressed as either a reference to the string table or a literal string. + */ +export declare type TextNodeName = number | '#text'; +/** + * Browser-specific. Schema representing the addition of a new #shadow-root node to the document. + * + * @minItems 2 + */ +export declare type AddShadowRootNodeChange = [InsertionPoint, ShadowRootNodeName]; +/** + * Browser-specific. Schema representing the node name for a #shadow-root node, expressed as either a reference to the string table or a literal string. + */ +export declare type ShadowRootNodeName = number | '#shadow-root'; +/** + * Browser-specific. Schema representing a scroll position change. + * + * @minItems 3 + */ +export declare type ScrollPositionChange = [NodeId, number, number]; +/** + * Browser-specific. Schema representing the addition of a string to the string table. + */ +export declare type AddStringChange = string; +/** + * Browser-specific. Schema representing a change to the text content of a #text node. + * + * @minItems 2 + */ +export declare type TextChange = [NodeId, string]; /** * Schema of a Session Replay Segment context. */ diff --git a/lib/esm/generated/sessionReplay.d.ts b/lib/esm/generated/sessionReplay.d.ts index 52844e42..7e075c68 100644 --- a/lib/esm/generated/sessionReplay.d.ts +++ b/lib/esm/generated/sessionReplay.d.ts @@ -35,7 +35,7 @@ export declare type CreationReason = 'init' | 'segment_duration_limit' | 'segmen /** * Browser-specific. Schema of a Session Replay Record. */ -export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord; +export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord | BrowserChangeRecord; /** * Browser-specific. Schema of a Record type which contains the full snapshot of a screen. */ @@ -311,6 +311,184 @@ export declare type FrustrationRecord = SlotSupportedCommonRecordSchema & { recordIds: number[]; }; }; +/** + * Browser-specific. Schema of a Record type which represents changes and mutations using a compact encoding. (Experimental.) + */ +export declare type BrowserChangeRecord = SlotSupportedCommonRecordSchema & { + /** + * The type of this Record. + */ + readonly type: 12; + data: BrowserChangeData; + id?: number; +}; +/** + * Browser-specific. Schema of a Session Replay BrowserChangeData type. + */ +export declare type BrowserChangeData = { + /** + * Changes to the `adoptedStyleSheets` list of a Document, DocumentFragment, or ShadowRoot node. + */ + adoptedStyleSheetsChanges?: AdoptedStyleSheetsChange[]; + /** + * Changes to the attributes of a node. + */ + attributeChanges?: AttributeChange[]; + /** + * Newly added nodes. + */ + nodesAdded?: AddNodeChange[]; + /** + * Newly removed nodes. + */ + nodesRemoved?: NodeId[]; + /** + * Changes to the scroll position of a node. + */ + scrollChanges?: ScrollPositionChange[]; + /** + * Newly added strings. + */ + stringsAdded?: AddStringChange[]; + /** + * Changes to the text content of a node. + */ + textChanges?: TextChange[]; +}; +/** + * Browser-specific. Schema representing a change to the adopted stylesheets of a document or shadow DOM subtree. + * + * @minItems 1 + */ +export declare type AdoptedStyleSheetsChange = [NodeId, ...StyleSheet[]]; +/** + * Browser-specific. Schema representing the ID of a DOM node. + */ +export declare type NodeId = number; +/** + * Browser-specific. Schema representing a change to an node's attributes. + * + * @minItems 1 + */ +export declare type AttributeChange = [NodeId, ...AttributeAssignmentOrDeletion[]]; +/** + * Browser-specific. Schema representing a change to an attribute, either by assignment of a new value or by deletion of the attribute. + * + * @minItems 2 + */ +export declare type AttributeAssignmentOrDeletion = [string, string | null]; +/** + * Browser-specific. Schema representing the addition of a new node to the document. + */ +export declare type AddNodeChange = AddCDataSectionNodeChange | AddDocTypeNodeChange | AddDocumentNodeChange | AddDocumentFragmentNodeChange | AddElementNodeChange | AddTextNodeChange | AddShadowRootNodeChange; +/** + * Browser-specific. Schema representing the addition of a new #cdata-section node to the document. + * + * @minItems 2 + */ +export declare type AddCDataSectionNodeChange = [InsertionPoint, CDataSectionNodeName]; +/** + * Browser-specific. Schema representing the insertion point of a node which is being added to the document. + */ +export declare type InsertionPoint = RootInsertionPoint | LastChildInsertionPoint | NextSiblingInsertionPoint; +/** + * A null insertion point, indicating that the node should be inserted at the root of the document. + */ +export declare type RootInsertionPoint = null; +/** + * A positive integer insertion point. Inserting a node at positive integer N indicates that the node should be inserted as the last child of the node with an id N lower than the new node. + */ +export declare type LastChildInsertionPoint = number; +/** + * A negative integer insertion point. Inserting a node at negative integer -N indicates that the node should be inserted as the next sibling of the node with an id N lower than the new node. + */ +export declare type NextSiblingInsertionPoint = number; +/** + * Browser-specific. Schema representing the node name for a #cdata-section node, expressed as either a reference to the string table or a literal string. + */ +export declare type CDataSectionNodeName = number | '#cdata-section'; +/** + * Browser-specific. Schema representing the addition of a new #doctype node to the document. + * + * @minItems 5 + */ +export declare type AddDocTypeNodeChange = [InsertionPoint, DocTypeNodeName, string, string, string]; +/** + * Browser-specific. Schema representing the node name for a #doctype node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocTypeNodeName = number | '#doctype'; +/** + * Browser-specific. Schema representing the addition of a new #document node to the document. + * + * @minItems 2 + */ +export declare type AddDocumentNodeChange = [InsertionPoint, DocumentNodeName]; +/** + * Browser-specific. Schema representing the node name for a #document node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocumentNodeName = number | '#document'; +/** + * Browser-specific. Schema representing the addition of a new #document-fragment node to the document. + * + * @minItems 2 + */ +export declare type AddDocumentFragmentNodeChange = [InsertionPoint, DocumentFragmentNodeName]; +/** + * Browser-specific. Schema representing the node name for a #document-fragment node, expressed as either a reference to the string table or a literal string. + */ +export declare type DocumentFragmentNodeName = number | '#document-fragment'; +/** + * Browser-specific. Schema representing the addition of a new element node to the document. + * + * @minItems 2 + */ +export declare type AddElementNodeChange = [InsertionPoint, NodeName, ...AttributeAssignment[]]; +/** + * Browser-specific. Schema representing a node name (i.e., Node#nodeName), expressed as either a reference to the string table or a literal string. + */ +export declare type NodeName = number | string; +/** + * Browser-specific. Schema representing an assignment of a value to an attribute. + * + * @minItems 2 + */ +export declare type AttributeAssignment = [string, string]; +/** + * Browser-specific. Schema representing the addition of a new #text node to the document. + * + * @minItems 3 + */ +export declare type AddTextNodeChange = [InsertionPoint, TextNodeName, string]; +/** + * Browser-specific. Schema representing the node name for a #text node, expressed as either a reference to the string table or a literal string. + */ +export declare type TextNodeName = number | '#text'; +/** + * Browser-specific. Schema representing the addition of a new #shadow-root node to the document. + * + * @minItems 2 + */ +export declare type AddShadowRootNodeChange = [InsertionPoint, ShadowRootNodeName]; +/** + * Browser-specific. Schema representing the node name for a #shadow-root node, expressed as either a reference to the string table or a literal string. + */ +export declare type ShadowRootNodeName = number | '#shadow-root'; +/** + * Browser-specific. Schema representing a scroll position change. + * + * @minItems 3 + */ +export declare type ScrollPositionChange = [NodeId, number, number]; +/** + * Browser-specific. Schema representing the addition of a string to the string table. + */ +export declare type AddStringChange = string; +/** + * Browser-specific. Schema representing a change to the text content of a #text node. + * + * @minItems 2 + */ +export declare type TextChange = [NodeId, string]; /** * Mobile-specific. Schema of a Session Replay data Segment. */ diff --git a/schemas/session-replay/browser/change-data-schema.json b/schemas/session-replay/browser/change-data-schema.json new file mode 100644 index 00000000..4c07ff56 --- /dev/null +++ b/schemas/session-replay/browser/change-data-schema.json @@ -0,0 +1,62 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/change-data-schema.json", + "title": "BrowserChangeData", + "type": "object", + "description": "Browser-specific. Schema of a Session Replay BrowserChangeData type.", + "allOf": [ + { + "properties": { + "adoptedStyleSheetsChanges": { + "type": "array", + "items": { + "$ref": "changes/adopted-stylesheets-change-schema.json" + }, + "description": "Changes to the `adoptedStyleSheets` list of a Document, DocumentFragment, or ShadowRoot node." + }, + "attributeChanges": { + "type": "array", + "items": { + "$ref": "changes/attribute-change-schema.json" + }, + "description": "Changes to the attributes of a node." + }, + "nodesAdded": { + "type": "array", + "items": { + "$ref": "changes/add-node-change-schema.json" + }, + "description": "Newly added nodes." + }, + "nodesRemoved": { + "type": "array", + "items": { + "$ref": "changes/node-references/node-id-schema.json" + }, + "description": "Newly removed nodes." + }, + "scrollChanges": { + "type": "array", + "items": { + "$ref": "changes/scroll-position-change-schema.json" + }, + "description": "Changes to the scroll position of a node." + }, + "stringsAdded": { + "type": "array", + "items": { + "$ref": "changes/add-string-change-schema.json" + }, + "description": "Newly added strings." + }, + "textChanges": { + "type": "array", + "items": { + "$ref": "changes/text-change-schema.json" + }, + "description": "Changes to the text content of a node." + } + } + } + ] +} diff --git a/schemas/session-replay/browser/change-record-schema.json b/schemas/session-replay/browser/change-record-schema.json new file mode 100644 index 00000000..7ae0413c --- /dev/null +++ b/schemas/session-replay/browser/change-record-schema.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/change-record-schema.json", + "title": "BrowserChangeRecord", + "type": "object", + "description": "Browser-specific. Schema of a Record type which represents changes and mutations using a compact encoding. (Experimental.)", + "allOf": [ + { + "$ref": "../common/_slot-supported-common-record-schema.json" + }, + { + "required": ["type", "data"], + "properties": { + "type": { + "type": "integer", + "description": "The type of this Record.", + "const": 12, + "readOnly": true + }, + "data": { + "$ref": "change-data-schema.json" + }, + "id": { + "type": "integer" + } + } + } + ] +} diff --git a/schemas/session-replay/browser/changes/add-cdata-section-node-change-schema.json b/schemas/session-replay/browser/changes/add-cdata-section-node-change-schema.json new file mode 100644 index 00000000..b8139352 --- /dev/null +++ b/schemas/session-replay/browser/changes/add-cdata-section-node-change-schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/add-cdata-section-node-change-schema.json", + "title": "AddCDataSectionNodeChange", + "type": "array", + "description": "Browser-specific. Schema representing the addition of a new #cdata-section node to the document.", + "minItems": 2, + "items": [ + { "$ref": "node-references/insertion-point-schema.json" }, + { "$ref": "node-names/cdata-section-node-name-schema.json" } + ], + "additionalItems": false +} diff --git a/schemas/session-replay/browser/changes/add-doctype-node-change-schema.json b/schemas/session-replay/browser/changes/add-doctype-node-change-schema.json new file mode 100644 index 00000000..fdef2fb3 --- /dev/null +++ b/schemas/session-replay/browser/changes/add-doctype-node-change-schema.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/add-doctype-node-change-schema.json", + "title": "AddDocTypeNodeChange", + "type": "array", + "description": "Browser-specific. Schema representing the addition of a new #doctype node to the document.", + "minItems": 5, + "items": [ + { "$ref": "node-references/insertion-point-schema.json" }, + { "$ref": "node-names/doctype-node-name-schema.json" }, + { + "type": "string", + "description": "The doctype's name." + }, + { + "type": "string", + "description": "The doctype's public ID." + }, + { + "type": "string", + "description": "The doctype's system ID." + } + ], + "additionalItems": false +} diff --git a/schemas/session-replay/browser/changes/add-document-fragment-node-change-schema.json b/schemas/session-replay/browser/changes/add-document-fragment-node-change-schema.json new file mode 100644 index 00000000..01263550 --- /dev/null +++ b/schemas/session-replay/browser/changes/add-document-fragment-node-change-schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/add-document-fragment-node-change-schema.json", + "title": "AddDocumentFragmentNodeChange", + "type": "array", + "description": "Browser-specific. Schema representing the addition of a new #document-fragment node to the document.", + "minItems": 2, + "items": [ + { "$ref": "node-references/insertion-point-schema.json" }, + { "$ref": "node-names/document-fragment-node-name-schema.json" } + ], + "additionalItems": false +} diff --git a/schemas/session-replay/browser/changes/add-document-node-change-schema.json b/schemas/session-replay/browser/changes/add-document-node-change-schema.json new file mode 100644 index 00000000..0f7c7348 --- /dev/null +++ b/schemas/session-replay/browser/changes/add-document-node-change-schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/add-document-node-change-schema.json", + "title": "AddDocumentNodeChange", + "type": "array", + "description": "Browser-specific. Schema representing the addition of a new #document node to the document.", + "minItems": 2, + "items": [ + { "$ref": "node-references/insertion-point-schema.json" }, + { "$ref": "node-names/document-node-name-schema.json" } + ], + "additionalItems": false +} diff --git a/schemas/session-replay/browser/changes/add-element-node-change-schema.json b/schemas/session-replay/browser/changes/add-element-node-change-schema.json new file mode 100644 index 00000000..3cecef1e --- /dev/null +++ b/schemas/session-replay/browser/changes/add-element-node-change-schema.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/add-element-node-change-schema.json", + "title": "AddElementNodeChange", + "type": "array", + "description": "Browser-specific. Schema representing the addition of a new element node to the document.", + "minItems": 2, + "items": [{ "$ref": "node-references/insertion-point-schema.json" }, { "$ref": "node-names/node-name-schema.json" }], + "additionalItems": { "$ref": "attribute-assignment-schema.json" } +} diff --git a/schemas/session-replay/browser/changes/add-node-change-schema.json b/schemas/session-replay/browser/changes/add-node-change-schema.json new file mode 100644 index 00000000..89cbc99b --- /dev/null +++ b/schemas/session-replay/browser/changes/add-node-change-schema.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/add-node-change-schema.json", + "title": "AddNodeChange", + "description": "Browser-specific. Schema representing the addition of a new node to the document.", + "oneOf": [ + { "$ref": "add-cdata-section-node-change-schema.json" }, + { "$ref": "add-doctype-node-change-schema.json" }, + { "$ref": "add-document-node-change-schema.json" }, + { "$ref": "add-document-fragment-node-change-schema.json" }, + { "$ref": "add-element-node-change-schema.json" }, + { "$ref": "add-text-node-change-schema.json" }, + { "$ref": "add-shadow-root-node-change-schema.json" } + ] +} diff --git a/schemas/session-replay/browser/changes/add-shadow-root-node-change-schema.json b/schemas/session-replay/browser/changes/add-shadow-root-node-change-schema.json new file mode 100644 index 00000000..7aef60db --- /dev/null +++ b/schemas/session-replay/browser/changes/add-shadow-root-node-change-schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/add-shadow-root-node-change-schema.json", + "title": "AddShadowRootNodeChange", + "type": "array", + "description": "Browser-specific. Schema representing the addition of a new #shadow-root node to the document.", + "minItems": 2, + "items": [ + { "$ref": "node-references/insertion-point-schema.json" }, + { "$ref": "node-names/shadow-root-node-name-schema.json" } + ], + "additionalItems": false +} diff --git a/schemas/session-replay/browser/changes/add-string-change-schema.json b/schemas/session-replay/browser/changes/add-string-change-schema.json new file mode 100644 index 00000000..aee272a3 --- /dev/null +++ b/schemas/session-replay/browser/changes/add-string-change-schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/add-string-change-schema.json", + "title": "AddStringChange", + "description": "Browser-specific. Schema representing the addition of a string to the string table.", + "type": "string", + "minimum": 0 +} diff --git a/schemas/session-replay/browser/changes/add-text-node-change-schema.json b/schemas/session-replay/browser/changes/add-text-node-change-schema.json new file mode 100644 index 00000000..ad914bda --- /dev/null +++ b/schemas/session-replay/browser/changes/add-text-node-change-schema.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/add-text-node-change-schema.json", + "title": "AddTextNodeChange", + "type": "array", + "description": "Browser-specific. Schema representing the addition of a new #text node to the document.", + "minItems": 3, + "items": [ + { "$ref": "node-references/insertion-point-schema.json" }, + { "$ref": "node-names/text-node-name-schema.json" }, + { + "type": "string", + "description": "The text node's content." + } + ], + "additionalItems": false +} diff --git a/schemas/session-replay/browser/changes/adopted-stylesheets-change-schema.json b/schemas/session-replay/browser/changes/adopted-stylesheets-change-schema.json new file mode 100644 index 00000000..324de1c6 --- /dev/null +++ b/schemas/session-replay/browser/changes/adopted-stylesheets-change-schema.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/adopted-stylesheets-change-schema.json", + "title": "AdoptedStyleSheetsChange", + "type": "array", + "description": "Browser-specific. Schema representing a change to the adopted stylesheets of a document or shadow DOM subtree.", + "minItems": 1, + "items": [{ "$ref": "node-references/node-id-schema.json" }], + "additionalItems": { + "$ref": "../stylesheet-schema.json" + } +} diff --git a/schemas/session-replay/browser/changes/attribute-assignment-or-deletion-schema.json b/schemas/session-replay/browser/changes/attribute-assignment-or-deletion-schema.json new file mode 100644 index 00000000..6303d35c --- /dev/null +++ b/schemas/session-replay/browser/changes/attribute-assignment-or-deletion-schema.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/attribute-assignment-or-deletion-schema.json", + "title": "AttributeAssignmentOrDeletion", + "type": "array", + "description": "Browser-specific. Schema representing a change to an attribute, either by assignment of a new value or by deletion of the attribute.", + "minItems": 2, + "items": [ + { + "type": "string", + "description": "The name of the attribute to change or delete." + }, + { + "oneOf": [ + { + "type": "string", + "description": "The new value for the attribute." + }, + { + "type": "null", + "description": "Indicates that the attribute should be deleted." + } + ] + } + ], + "additionalItems": false +} diff --git a/schemas/session-replay/browser/changes/attribute-assignment-schema.json b/schemas/session-replay/browser/changes/attribute-assignment-schema.json new file mode 100644 index 00000000..0d21efe0 --- /dev/null +++ b/schemas/session-replay/browser/changes/attribute-assignment-schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/attribute-assignment-schema.json", + "title": "AttributeAssignment", + "type": "array", + "description": "Browser-specific. Schema representing an assignment of a value to an attribute.", + "minItems": 2, + "items": [ + { + "type": "string", + "description": "The name of the attribute." + }, + { + "type": "string", + "description": "The value for the attribute." + } + ], + "additionalItems": false +} diff --git a/schemas/session-replay/browser/changes/attribute-change-schema.json b/schemas/session-replay/browser/changes/attribute-change-schema.json new file mode 100644 index 00000000..66ac2d07 --- /dev/null +++ b/schemas/session-replay/browser/changes/attribute-change-schema.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/attribute-change-schema.json", + "title": "AttributeChange", + "type": "array", + "description": "Browser-specific. Schema representing a change to an node's attributes.", + "minItems": 1, + "items": [{ "$ref": "node-references/node-id-schema.json" }], + "additionalItems": { + "$ref": "attribute-assignment-or-deletion-schema.json" + } +} diff --git a/schemas/session-replay/browser/changes/node-names/cdata-section-node-name-schema.json b/schemas/session-replay/browser/changes/node-names/cdata-section-node-name-schema.json new file mode 100644 index 00000000..c62b4a54 --- /dev/null +++ b/schemas/session-replay/browser/changes/node-names/cdata-section-node-name-schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-names/cdata-section-node-name-schema.json", + "title": "CDataSectionNodeName", + "description": "Browser-specific. Schema representing the node name for a #cdata-section node, expressed as either a reference to the string table or a literal string.", + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "description": "A reference to the node name in the string table at the given index." + }, + { + "const": "#cdata-section" + } + ] +} diff --git a/schemas/session-replay/browser/changes/node-names/doctype-node-name-schema.json b/schemas/session-replay/browser/changes/node-names/doctype-node-name-schema.json new file mode 100644 index 00000000..8a3671e0 --- /dev/null +++ b/schemas/session-replay/browser/changes/node-names/doctype-node-name-schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-names/doctype-node-name-schema.json", + "title": "DocTypeNodeName", + "description": "Browser-specific. Schema representing the node name for a #doctype node, expressed as either a reference to the string table or a literal string.", + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "description": "A reference to the node name in the string table at the given index." + }, + { + "const": "#doctype" + } + ] +} diff --git a/schemas/session-replay/browser/changes/node-names/document-fragment-node-name-schema.json b/schemas/session-replay/browser/changes/node-names/document-fragment-node-name-schema.json new file mode 100644 index 00000000..3b71a968 --- /dev/null +++ b/schemas/session-replay/browser/changes/node-names/document-fragment-node-name-schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-names/document-fragment-node-name-schema.json", + "title": "DocumentFragmentNodeName", + "description": "Browser-specific. Schema representing the node name for a #document-fragment node, expressed as either a reference to the string table or a literal string.", + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "description": "A reference to the node name in the string table at the given index." + }, + { + "const": "#document-fragment" + } + ] +} diff --git a/schemas/session-replay/browser/changes/node-names/document-node-name-schema.json b/schemas/session-replay/browser/changes/node-names/document-node-name-schema.json new file mode 100644 index 00000000..a91d62ee --- /dev/null +++ b/schemas/session-replay/browser/changes/node-names/document-node-name-schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-names/document-node-name-schema.json", + "title": "DocumentNodeName", + "description": "Browser-specific. Schema representing the node name for a #document node, expressed as either a reference to the string table or a literal string.", + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "description": "A reference to the node name in the string table at the given index." + }, + { + "const": "#document" + } + ] +} diff --git a/schemas/session-replay/browser/changes/node-names/node-name-schema.json b/schemas/session-replay/browser/changes/node-names/node-name-schema.json new file mode 100644 index 00000000..e74fa39e --- /dev/null +++ b/schemas/session-replay/browser/changes/node-names/node-name-schema.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-names/node-name-schema.json", + "title": "NodeName", + "description": "Browser-specific. Schema representing a node name (i.e., Node#nodeName), expressed as either a reference to the string table or a literal string.", + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "description": "A reference to the node name in the string table at the given index." + }, + { + "type": "string", + "description": "The node name expressed as a literal string." + } + ] +} diff --git a/schemas/session-replay/browser/changes/node-names/shadow-root-node-name-schema.json b/schemas/session-replay/browser/changes/node-names/shadow-root-node-name-schema.json new file mode 100644 index 00000000..dee24dc5 --- /dev/null +++ b/schemas/session-replay/browser/changes/node-names/shadow-root-node-name-schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-names/shadow-root-node-name-schema.json", + "title": "ShadowRootNodeName", + "description": "Browser-specific. Schema representing the node name for a #shadow-root node, expressed as either a reference to the string table or a literal string.", + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "description": "A reference to the node name in the string table at the given index." + }, + { + "const": "#shadow-root" + } + ] +} diff --git a/schemas/session-replay/browser/changes/node-names/text-node-name-schema.json b/schemas/session-replay/browser/changes/node-names/text-node-name-schema.json new file mode 100644 index 00000000..65e8a27d --- /dev/null +++ b/schemas/session-replay/browser/changes/node-names/text-node-name-schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-names/text-node-name-schema.json", + "title": "TextNodeName", + "description": "Browser-specific. Schema representing the node name for a #text node, expressed as either a reference to the string table or a literal string.", + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "description": "A reference to the node name in the string table at the given index." + }, + { + "const": "#text" + } + ] +} diff --git a/schemas/session-replay/browser/changes/node-references/insertion-point-schema.json b/schemas/session-replay/browser/changes/node-references/insertion-point-schema.json new file mode 100644 index 00000000..998a7c5d --- /dev/null +++ b/schemas/session-replay/browser/changes/node-references/insertion-point-schema.json @@ -0,0 +1,11 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-references/insertion-point-schema.json", + "title": "InsertionPoint", + "description": "Browser-specific. Schema representing the insertion point of a node which is being added to the document.", + "oneOf": [ + { "$ref": "root-insertion-point-schema.json" }, + { "$ref": "last-child-insertion-point-schema.json" }, + { "$ref": "next-sibling-insertion-point-schema.json" } + ] +} diff --git a/schemas/session-replay/browser/changes/node-references/last-child-insertion-point-schema.json b/schemas/session-replay/browser/changes/node-references/last-child-insertion-point-schema.json new file mode 100644 index 00000000..2ee93e7f --- /dev/null +++ b/schemas/session-replay/browser/changes/node-references/last-child-insertion-point-schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-references/last-child-insertion-point-schema.json", + "title": "LastChildInsertionPoint", + "description": "A positive integer insertion point. Inserting a node at positive integer N indicates that the node should be inserted as the last child of the node with an id N lower than the new node.", + "type": "integer", + "minimum": 1 +} diff --git a/schemas/session-replay/browser/changes/node-references/next-sibling-insertion-point-schema.json b/schemas/session-replay/browser/changes/node-references/next-sibling-insertion-point-schema.json new file mode 100644 index 00000000..eaa19274 --- /dev/null +++ b/schemas/session-replay/browser/changes/node-references/next-sibling-insertion-point-schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-references/next-sibling-insertion-point-schema.json", + "title": "NextSiblingInsertionPoint", + "description": "A negative integer insertion point. Inserting a node at negative integer -N indicates that the node should be inserted as the next sibling of the node with an id N lower than the new node.", + "type": "integer", + "maximum": -1 +} diff --git a/schemas/session-replay/browser/changes/node-references/node-id-schema.json b/schemas/session-replay/browser/changes/node-references/node-id-schema.json new file mode 100644 index 00000000..1b24e098 --- /dev/null +++ b/schemas/session-replay/browser/changes/node-references/node-id-schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-references/node-id-schema.json", + "title": "NodeId", + "description": "Browser-specific. Schema representing the ID of a DOM node.", + "type": "integer", + "minimum": 0 +} diff --git a/schemas/session-replay/browser/changes/node-references/root-insertion-point-schema.json b/schemas/session-replay/browser/changes/node-references/root-insertion-point-schema.json new file mode 100644 index 00000000..91d6ddac --- /dev/null +++ b/schemas/session-replay/browser/changes/node-references/root-insertion-point-schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/node-references/root-insertion-point-schema.json", + "title": "RootInsertionPoint", + "description": "A null insertion point, indicating that the node should be inserted at the root of the document.", + "type": "null" +} diff --git a/schemas/session-replay/browser/changes/scroll-position-change-schema.json b/schemas/session-replay/browser/changes/scroll-position-change-schema.json new file mode 100644 index 00000000..a65f75ac --- /dev/null +++ b/schemas/session-replay/browser/changes/scroll-position-change-schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/scroll-position-change-schema.json", + "title": "ScrollPositionChange", + "type": "array", + "description": "Browser-specific. Schema representing a scroll position change.", + "minItems": 3, + "items": [ + { "$ref": "node-references/node-id-schema.json" }, + { + "type": "number", + "description": "X-axis coordinate for this scroll position change." + }, + { + "type": "number", + "description": "Y-axis coordinate for this scroll position change." + } + ], + "additionalItems": false +} diff --git a/schemas/session-replay/browser/changes/text-change-schema.json b/schemas/session-replay/browser/changes/text-change-schema.json new file mode 100644 index 00000000..61bd0454 --- /dev/null +++ b/schemas/session-replay/browser/changes/text-change-schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/text-change-schema.json", + "title": "TextChange", + "type": "array", + "description": "Browser-specific. Schema representing a change to the text content of a #text node.", + "minItems": 2, + "items": [ + { "$ref": "node-references/node-id-schema.json" }, + { + "type": "string", + "description": "The new text content." + } + ], + "additionalItems": false +} diff --git a/schemas/session-replay/browser/record-schema.json b/schemas/session-replay/browser/record-schema.json index dda42223..116d5e8f 100644 --- a/schemas/session-replay/browser/record-schema.json +++ b/schemas/session-replay/browser/record-schema.json @@ -25,6 +25,9 @@ }, { "$ref": "frustration-record-schema.json" + }, + { + "$ref": "change-record-schema.json" } ] }