diff --git a/lib/cjs/generated/browserSessionReplay.d.ts b/lib/cjs/generated/browserSessionReplay.d.ts index fbfad6e6..9d6c2da9 100644 --- a/lib/cjs/generated/browserSessionReplay.d.ts +++ b/lib/cjs/generated/browserSessionReplay.d.ts @@ -84,9 +84,9 @@ export type SnapshotFormatChange = 1; /** * Browser-specific. Schema representing an individual change within a BrowserChangeData collection. */ -export type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]]; +export type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]] | [11, ...AddStringNamespaceChange[]] | [12, ...AddNamespacedStringChange[]]; /** - * Browser-specific. Schema representing the addition of a string to the string table. + * Browser-specific. Schema representing the addition of a string to the default string namespace. */ export type AddStringChange = string; /** @@ -136,9 +136,25 @@ export type AddDocTypeNodeChange = [ StringOrStringReference ]; /** - * Browser-specific. Schema representing a string, either expressed as a literal or as an index into the string table. + * Browser-specific. Schema representing a string, either expressed as a literal, as a literal with an associated string namespace, or as an index into the string table. */ -export type StringOrStringReference = string | StringReference; +export type StringOrStringReference = StringLiteral | NamespacedStringLiteral | StringReference; +/** + * Browser-specific. Schema representing a string, expressed as a literal. + */ +export type StringLiteral = string; +/** + * Browser-specific. Schema representing a string namespace, either expressed as a literal name or as a numeric reference. + */ +export type StringNamespaceOrStringNamespaceReference = StringNamespaceName | StringNamespaceReference; +/** + * Browser-specific. Schema representing a string namespace, expressed as a literal name. + */ +export type StringNamespaceName = string; +/** + * Browser-specific. Schema representing a string namespace, expressed as a numeric reference. The reference 0 refers to the default string namespace; higher values refer to each additional string namespace, in the order they were created. + */ +export type StringNamespaceReference = number; /** * Schema representing the addition of a new #document node. * @@ -303,6 +319,16 @@ export type VisualViewportHeight = number; * The pinch-zoom scaling factor applied to the visual viewport. */ export type VisualViewportScale = number; +/** + * Browser-specific. Schema representing the addition of a new string namespace, identified by name. + */ +export type AddStringNamespaceChange = StringNamespaceName; +/** + * Browser-specific. Schema representing the addition of a sequence of strings to a string namespace. + * + * @minItems 1 + */ +export type AddNamespacedStringChange = [StringNamespaceOrStringNamespaceReference, ...StringLiteral[]]; /** * Browser-specific. Schema of a Record type which contains mutations of a screen. */ @@ -764,6 +790,13 @@ export interface CDataNode { readonly type: 4; textContent: ''; } +/** + * Browser-specific. Schema representing a string literal with an associated string namespace. + */ +export interface NamespacedStringLiteral { + namespace: StringNamespaceOrStringNamespaceReference; + string: StringLiteral; +} /** * Schema of an AddedNodeMutation. */ diff --git a/lib/cjs/generated/sessionReplay.d.ts b/lib/cjs/generated/sessionReplay.d.ts index f00c0080..4424cbcd 100644 --- a/lib/cjs/generated/sessionReplay.d.ts +++ b/lib/cjs/generated/sessionReplay.d.ts @@ -92,9 +92,9 @@ export type SnapshotFormatChange = 1; /** * Browser-specific. Schema representing an individual change within a BrowserChangeData collection. */ -export type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]]; +export type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]] | [11, ...AddStringNamespaceChange[]] | [12, ...AddNamespacedStringChange[]]; /** - * Browser-specific. Schema representing the addition of a string to the string table. + * Browser-specific. Schema representing the addition of a string to the default string namespace. */ export type AddStringChange = string; /** @@ -144,9 +144,25 @@ export type AddDocTypeNodeChange = [ StringOrStringReference ]; /** - * Browser-specific. Schema representing a string, either expressed as a literal or as an index into the string table. + * Browser-specific. Schema representing a string, either expressed as a literal, as a literal with an associated string namespace, or as an index into the string table. */ -export type StringOrStringReference = string | StringReference; +export type StringOrStringReference = StringLiteral | NamespacedStringLiteral | StringReference; +/** + * Browser-specific. Schema representing a string, expressed as a literal. + */ +export type StringLiteral = string; +/** + * Browser-specific. Schema representing a string namespace, either expressed as a literal name or as a numeric reference. + */ +export type StringNamespaceOrStringNamespaceReference = StringNamespaceName | StringNamespaceReference; +/** + * Browser-specific. Schema representing a string namespace, expressed as a literal name. + */ +export type StringNamespaceName = string; +/** + * Browser-specific. Schema representing a string namespace, expressed as a numeric reference. The reference 0 refers to the default string namespace; higher values refer to each additional string namespace, in the order they were created. + */ +export type StringNamespaceReference = number; /** * Schema representing the addition of a new #document node. * @@ -311,6 +327,16 @@ export type VisualViewportHeight = number; * The pinch-zoom scaling factor applied to the visual viewport. */ export type VisualViewportScale = number; +/** + * Browser-specific. Schema representing the addition of a new string namespace, identified by name. + */ +export type AddStringNamespaceChange = StringNamespaceName; +/** + * Browser-specific. Schema representing the addition of a sequence of strings to a string namespace. + * + * @minItems 1 + */ +export type AddNamespacedStringChange = [StringNamespaceOrStringNamespaceReference, ...StringLiteral[]]; /** * Browser-specific. Schema of a Record type which contains mutations of a screen. */ @@ -1233,6 +1259,13 @@ export interface CDataNode { readonly type: 4; textContent: ''; } +/** + * Browser-specific. Schema representing a string literal with an associated string namespace. + */ +export interface NamespacedStringLiteral { + namespace: StringNamespaceOrStringNamespaceReference; + string: StringLiteral; +} /** * Schema of an AddedNodeMutation. */ diff --git a/lib/cjs/src/session-replay-browser.d.ts b/lib/cjs/src/session-replay-browser.d.ts index 17e16d4d..aba97abf 100644 --- a/lib/cjs/src/session-replay-browser.d.ts +++ b/lib/cjs/src/session-replay-browser.d.ts @@ -70,6 +70,8 @@ export declare const ChangeType: { AttachedStyleSheets: ChangeTypeId<8, SessionReplay.AttachedStyleSheetsChange>; MediaPlaybackState: ChangeTypeId<9, SessionReplay.MediaPlaybackStateChange>; VisualViewport: ChangeTypeId<10, SessionReplay.VisualViewportChange>; + AddStringNamespace: ChangeTypeId<11, SessionReplay.AddStringNamespaceChange>; + AddNamespacedString: ChangeTypeId<12, SessionReplay.AddNamespacedStringChange>; }; export type ChangeType = (typeof ChangeType)[keyof typeof ChangeType]; export declare const PlaybackState: { diff --git a/lib/cjs/src/session-replay-browser.js b/lib/cjs/src/session-replay-browser.js index 6b067197..f54c429d 100644 --- a/lib/cjs/src/session-replay-browser.js +++ b/lib/cjs/src/session-replay-browser.js @@ -80,6 +80,8 @@ exports.ChangeType = { AttachedStyleSheets: 8, MediaPlaybackState: 9, VisualViewport: 10, + AddStringNamespace: 11, + AddNamespacedString: 12, }; exports.PlaybackState = { Playing: 0, diff --git a/lib/cjs/src/session-replay.d.ts b/lib/cjs/src/session-replay.d.ts index c71d0256..581a2bd1 100644 --- a/lib/cjs/src/session-replay.d.ts +++ b/lib/cjs/src/session-replay.d.ts @@ -35,6 +35,9 @@ export type NodeId = number & { export type StringId = number & { __brand: 'StringId'; }; +export type StringNamespaceId = number & { + __brand: 'StringNamespaceId'; +}; export type StyleSheetId = number & { __brand: 'StyleSheetId'; }; diff --git a/lib/esm/generated/browserSessionReplay.d.ts b/lib/esm/generated/browserSessionReplay.d.ts index fbfad6e6..9d6c2da9 100644 --- a/lib/esm/generated/browserSessionReplay.d.ts +++ b/lib/esm/generated/browserSessionReplay.d.ts @@ -84,9 +84,9 @@ export type SnapshotFormatChange = 1; /** * Browser-specific. Schema representing an individual change within a BrowserChangeData collection. */ -export type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]]; +export type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]] | [11, ...AddStringNamespaceChange[]] | [12, ...AddNamespacedStringChange[]]; /** - * Browser-specific. Schema representing the addition of a string to the string table. + * Browser-specific. Schema representing the addition of a string to the default string namespace. */ export type AddStringChange = string; /** @@ -136,9 +136,25 @@ export type AddDocTypeNodeChange = [ StringOrStringReference ]; /** - * Browser-specific. Schema representing a string, either expressed as a literal or as an index into the string table. + * Browser-specific. Schema representing a string, either expressed as a literal, as a literal with an associated string namespace, or as an index into the string table. */ -export type StringOrStringReference = string | StringReference; +export type StringOrStringReference = StringLiteral | NamespacedStringLiteral | StringReference; +/** + * Browser-specific. Schema representing a string, expressed as a literal. + */ +export type StringLiteral = string; +/** + * Browser-specific. Schema representing a string namespace, either expressed as a literal name or as a numeric reference. + */ +export type StringNamespaceOrStringNamespaceReference = StringNamespaceName | StringNamespaceReference; +/** + * Browser-specific. Schema representing a string namespace, expressed as a literal name. + */ +export type StringNamespaceName = string; +/** + * Browser-specific. Schema representing a string namespace, expressed as a numeric reference. The reference 0 refers to the default string namespace; higher values refer to each additional string namespace, in the order they were created. + */ +export type StringNamespaceReference = number; /** * Schema representing the addition of a new #document node. * @@ -303,6 +319,16 @@ export type VisualViewportHeight = number; * The pinch-zoom scaling factor applied to the visual viewport. */ export type VisualViewportScale = number; +/** + * Browser-specific. Schema representing the addition of a new string namespace, identified by name. + */ +export type AddStringNamespaceChange = StringNamespaceName; +/** + * Browser-specific. Schema representing the addition of a sequence of strings to a string namespace. + * + * @minItems 1 + */ +export type AddNamespacedStringChange = [StringNamespaceOrStringNamespaceReference, ...StringLiteral[]]; /** * Browser-specific. Schema of a Record type which contains mutations of a screen. */ @@ -764,6 +790,13 @@ export interface CDataNode { readonly type: 4; textContent: ''; } +/** + * Browser-specific. Schema representing a string literal with an associated string namespace. + */ +export interface NamespacedStringLiteral { + namespace: StringNamespaceOrStringNamespaceReference; + string: StringLiteral; +} /** * Schema of an AddedNodeMutation. */ diff --git a/lib/esm/generated/sessionReplay.d.ts b/lib/esm/generated/sessionReplay.d.ts index f00c0080..4424cbcd 100644 --- a/lib/esm/generated/sessionReplay.d.ts +++ b/lib/esm/generated/sessionReplay.d.ts @@ -92,9 +92,9 @@ export type SnapshotFormatChange = 1; /** * Browser-specific. Schema representing an individual change within a BrowserChangeData collection. */ -export type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]]; +export type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]] | [11, ...AddStringNamespaceChange[]] | [12, ...AddNamespacedStringChange[]]; /** - * Browser-specific. Schema representing the addition of a string to the string table. + * Browser-specific. Schema representing the addition of a string to the default string namespace. */ export type AddStringChange = string; /** @@ -144,9 +144,25 @@ export type AddDocTypeNodeChange = [ StringOrStringReference ]; /** - * Browser-specific. Schema representing a string, either expressed as a literal or as an index into the string table. + * Browser-specific. Schema representing a string, either expressed as a literal, as a literal with an associated string namespace, or as an index into the string table. */ -export type StringOrStringReference = string | StringReference; +export type StringOrStringReference = StringLiteral | NamespacedStringLiteral | StringReference; +/** + * Browser-specific. Schema representing a string, expressed as a literal. + */ +export type StringLiteral = string; +/** + * Browser-specific. Schema representing a string namespace, either expressed as a literal name or as a numeric reference. + */ +export type StringNamespaceOrStringNamespaceReference = StringNamespaceName | StringNamespaceReference; +/** + * Browser-specific. Schema representing a string namespace, expressed as a literal name. + */ +export type StringNamespaceName = string; +/** + * Browser-specific. Schema representing a string namespace, expressed as a numeric reference. The reference 0 refers to the default string namespace; higher values refer to each additional string namespace, in the order they were created. + */ +export type StringNamespaceReference = number; /** * Schema representing the addition of a new #document node. * @@ -311,6 +327,16 @@ export type VisualViewportHeight = number; * The pinch-zoom scaling factor applied to the visual viewport. */ export type VisualViewportScale = number; +/** + * Browser-specific. Schema representing the addition of a new string namespace, identified by name. + */ +export type AddStringNamespaceChange = StringNamespaceName; +/** + * Browser-specific. Schema representing the addition of a sequence of strings to a string namespace. + * + * @minItems 1 + */ +export type AddNamespacedStringChange = [StringNamespaceOrStringNamespaceReference, ...StringLiteral[]]; /** * Browser-specific. Schema of a Record type which contains mutations of a screen. */ @@ -1233,6 +1259,13 @@ export interface CDataNode { readonly type: 4; textContent: ''; } +/** + * Browser-specific. Schema representing a string literal with an associated string namespace. + */ +export interface NamespacedStringLiteral { + namespace: StringNamespaceOrStringNamespaceReference; + string: StringLiteral; +} /** * Schema of an AddedNodeMutation. */ diff --git a/lib/esm/src/session-replay-browser.d.ts b/lib/esm/src/session-replay-browser.d.ts index 17e16d4d..aba97abf 100644 --- a/lib/esm/src/session-replay-browser.d.ts +++ b/lib/esm/src/session-replay-browser.d.ts @@ -70,6 +70,8 @@ export declare const ChangeType: { AttachedStyleSheets: ChangeTypeId<8, SessionReplay.AttachedStyleSheetsChange>; MediaPlaybackState: ChangeTypeId<9, SessionReplay.MediaPlaybackStateChange>; VisualViewport: ChangeTypeId<10, SessionReplay.VisualViewportChange>; + AddStringNamespace: ChangeTypeId<11, SessionReplay.AddStringNamespaceChange>; + AddNamespacedString: ChangeTypeId<12, SessionReplay.AddNamespacedStringChange>; }; export type ChangeType = (typeof ChangeType)[keyof typeof ChangeType]; export declare const PlaybackState: { diff --git a/lib/esm/src/session-replay-browser.js b/lib/esm/src/session-replay-browser.js index 37725a37..234193f8 100644 --- a/lib/esm/src/session-replay-browser.js +++ b/lib/esm/src/session-replay-browser.js @@ -63,6 +63,8 @@ export var ChangeType = { AttachedStyleSheets: 8, MediaPlaybackState: 9, VisualViewport: 10, + AddStringNamespace: 11, + AddNamespacedString: 12, }; export var PlaybackState = { Playing: 0, diff --git a/lib/esm/src/session-replay.d.ts b/lib/esm/src/session-replay.d.ts index c71d0256..581a2bd1 100644 --- a/lib/esm/src/session-replay.d.ts +++ b/lib/esm/src/session-replay.d.ts @@ -35,6 +35,9 @@ export type NodeId = number & { export type StringId = number & { __brand: 'StringId'; }; +export type StringNamespaceId = number & { + __brand: 'StringNamespaceId'; +}; export type StyleSheetId = number & { __brand: 'StyleSheetId'; }; diff --git a/lib/src/session-replay-browser.ts b/lib/src/session-replay-browser.ts index 95fe8685..97484371 100644 --- a/lib/src/session-replay-browser.ts +++ b/lib/src/session-replay-browser.ts @@ -115,6 +115,8 @@ export const ChangeType: { AttachedStyleSheets: ChangeTypeId<8, SessionReplay.AttachedStyleSheetsChange> MediaPlaybackState: ChangeTypeId<9, SessionReplay.MediaPlaybackStateChange> VisualViewport: ChangeTypeId<10, SessionReplay.VisualViewportChange> + AddStringNamespace: ChangeTypeId<11, SessionReplay.AddStringNamespaceChange> + AddNamespacedString: ChangeTypeId<12, SessionReplay.AddNamespacedStringChange> } = { AddString: 0, AddNode: 1, @@ -127,6 +129,8 @@ export const ChangeType: { AttachedStyleSheets: 8, MediaPlaybackState: 9, VisualViewport: 10, + AddStringNamespace: 11, + AddNamespacedString: 12, } as const export type ChangeType = (typeof ChangeType)[keyof typeof ChangeType] diff --git a/lib/src/session-replay.ts b/lib/src/session-replay.ts index 3de40d89..13d3ef6a 100644 --- a/lib/src/session-replay.ts +++ b/lib/src/session-replay.ts @@ -72,4 +72,5 @@ export type PointerType = (typeof PointerType)[keyof typeof PointerType] export type NodeId = number & { __brand: 'NodeId' } export type StringId = number & { __brand: 'StringId' } +export type StringNamespaceId = number & { __brand: 'StringNamespaceId' } export type StyleSheetId = number & { __brand: 'StyleSheetId' } diff --git a/samples/session-replay/browser/record/change-record.json b/samples/session-replay/browser/record/change-record.json index 24130c78..83a24605 100644 --- a/samples/session-replay/browser/record/change-record.json +++ b/samples/session-replay/browser/record/change-record.json @@ -79,6 +79,13 @@ [8, [11, 0, 1]], [9, [15, 0]], [9, [15, 1]], - [10, [30, 30, 15, 15, 1024, 768, 2]] + [10, [30, 30, 15, 15, 1024, 768, 2]], + [11, "dom", "css", "user-text"], + [11, "svg"], + [12, ["dom", "div", "span"], ["css", "div { color: blue }"], ["user-text", "Hello"]], + [12, [1, "div", "span"], [2, "div { color: blue }"], [3, "Hello"]], + [12, [4, "circle"]], + [4, [6, { "namespace": "user-text", "string": "Goodbye" }]], + [4, [6, { "namespace": 3, "string": "Goodbye" }]] ] } diff --git a/samples/session-replay/browser/record/full-snapshot-change-record.json b/samples/session-replay/browser/record/full-snapshot-change-record.json index a8126141..af509132 100644 --- a/samples/session-replay/browser/record/full-snapshot-change-record.json +++ b/samples/session-replay/browser/record/full-snapshot-change-record.json @@ -80,6 +80,13 @@ [8, [11, 0, 1]], [9, [15, 0]], [9, [15, 1]], - [10, [30, 30, 15, 15, 1024, 768, 2]] + [10, [30, 30, 15, 15, 1024, 768, 2]], + [11, "dom", "css", "user-text"], + [11, "svg"], + [12, ["dom", "div", "span"], ["css", "div { color: blue }"], ["user-text", "Hello"]], + [12, [1, "div", "span"], [2, "div { color: blue }"], [3, "Hello"]], + [12, [4, "circle"]], + [4, [6, { "namespace": "user-text", "string": "Goodbye" }]], + [4, [6, { "namespace": 3, "string": "Goodbye" }]] ] } diff --git a/schemas/session-replay/browser/changes/add-namespaced-string-change-schema.json b/schemas/session-replay/browser/changes/add-namespaced-string-change-schema.json new file mode 100644 index 00000000..749e9fc0 --- /dev/null +++ b/schemas/session-replay/browser/changes/add-namespaced-string-change-schema.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/add-namespaced-string-change-schema.json", + "title": "AddNamespacedStringChange", + "description": "Browser-specific. Schema representing the addition of a sequence of strings to a string namespace.", + "type": "array", + "minItems": 1, + "items": [{ "$ref": "string-references/string-namespace-or-string-namespace-reference-schema.json" }], + "additionalItems": { "$ref": "string-references/string-literal-schema.json" } +} diff --git a/schemas/session-replay/browser/changes/add-string-change-schema.json b/schemas/session-replay/browser/changes/add-string-change-schema.json index 13c88836..103e9c75 100644 --- a/schemas/session-replay/browser/changes/add-string-change-schema.json +++ b/schemas/session-replay/browser/changes/add-string-change-schema.json @@ -2,6 +2,6 @@ "$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.", + "description": "Browser-specific. Schema representing the addition of a string to the default string namespace.", "type": "string" } diff --git a/schemas/session-replay/browser/changes/add-string-namespace-change-schema.json b/schemas/session-replay/browser/changes/add-string-namespace-change-schema.json new file mode 100644 index 00000000..5bce9093 --- /dev/null +++ b/schemas/session-replay/browser/changes/add-string-namespace-change-schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/add-string-namespace-change-schema.json", + "title": "AddStringNamespaceChange", + "description": "Browser-specific. Schema representing the addition of a new string namespace, identified by name.", + "allOf": [{ "$ref": "string-references/string-namespace-name-schema.json" }] +} diff --git a/schemas/session-replay/browser/changes/change-schema.json b/schemas/session-replay/browser/changes/change-schema.json index d9cdc134..dfe96486 100644 --- a/schemas/session-replay/browser/changes/change-schema.json +++ b/schemas/session-replay/browser/changes/change-schema.json @@ -80,6 +80,20 @@ "items": [{ "const": 10 }], "additionalItems": { "$ref": "visual-viewport-change-schema.json" }, "description": "Changes to the visual viewport." + }, + { + "type": "array", + "minItems": 1, + "items": [{ "const": 11 }], + "additionalItems": { "$ref": "add-string-namespace-change-schema.json" }, + "description": "Newly added string namespaces." + }, + { + "type": "array", + "minItems": 1, + "items": [{ "const": 12 }], + "additionalItems": { "$ref": "add-namespaced-string-change-schema.json" }, + "description": "Newly added namespaced strings." } ] } diff --git a/schemas/session-replay/browser/changes/string-references/namespaced-string-literal-schema.json b/schemas/session-replay/browser/changes/string-references/namespaced-string-literal-schema.json new file mode 100644 index 00000000..843db03e --- /dev/null +++ b/schemas/session-replay/browser/changes/string-references/namespaced-string-literal-schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/string-references/namespaced-string-literal-schema.json", + "title": "NamespacedStringLiteral", + "description": "Browser-specific. Schema representing a string literal with an associated string namespace.", + "type": "object", + "required": ["namespace", "string"], + "properties": { + "namespace": { "$ref": "string-namespace-or-string-namespace-reference-schema.json" }, + "string": { "$ref": "string-literal-schema.json" } + }, + "additionalProperties": false +} diff --git a/schemas/session-replay/browser/changes/string-references/string-literal-schema.json b/schemas/session-replay/browser/changes/string-references/string-literal-schema.json new file mode 100644 index 00000000..c520cfbc --- /dev/null +++ b/schemas/session-replay/browser/changes/string-references/string-literal-schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/string-references/string-literal-schema.json", + "title": "StringLiteral", + "description": "Browser-specific. Schema representing a string, expressed as a literal.", + "type": "string" +} diff --git a/schemas/session-replay/browser/changes/string-references/string-namespace-name-schema.json b/schemas/session-replay/browser/changes/string-references/string-namespace-name-schema.json new file mode 100644 index 00000000..14dbdc59 --- /dev/null +++ b/schemas/session-replay/browser/changes/string-references/string-namespace-name-schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/string-references/string-namespace-name-schema.json", + "title": "StringNamespaceName", + "description": "Browser-specific. Schema representing a string namespace, expressed as a literal name.", + "type": "string" +} diff --git a/schemas/session-replay/browser/changes/string-references/string-namespace-or-string-namespace-reference-schema.json b/schemas/session-replay/browser/changes/string-references/string-namespace-or-string-namespace-reference-schema.json new file mode 100644 index 00000000..c97b0b22 --- /dev/null +++ b/schemas/session-replay/browser/changes/string-references/string-namespace-or-string-namespace-reference-schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/string-references/string-namespace-or-string-namespace-reference-schema.json", + "title": "StringNamespaceOrStringNamespaceReference", + "description": "Browser-specific. Schema representing a string namespace, either expressed as a literal name or as a numeric reference.", + "oneOf": [{ "$ref": "string-namespace-name-schema.json" }, { "$ref": "string-namespace-reference-schema.json" }] +} diff --git a/schemas/session-replay/browser/changes/string-references/string-namespace-reference-schema.json b/schemas/session-replay/browser/changes/string-references/string-namespace-reference-schema.json new file mode 100644 index 00000000..1e8b28d8 --- /dev/null +++ b/schemas/session-replay/browser/changes/string-references/string-namespace-reference-schema.json @@ -0,0 +1,8 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "session-replay/browser/changes/string-references/string-namespace-reference-schema.json", + "title": "StringNamespaceReference", + "description": "Browser-specific. Schema representing a string namespace, expressed as a numeric reference. The reference 0 refers to the default string namespace; higher values refer to each additional string namespace, in the order they were created.", + "type": "integer", + "minimum": 0 +} diff --git a/schemas/session-replay/browser/changes/string-references/string-or-string-reference-schema.json b/schemas/session-replay/browser/changes/string-references/string-or-string-reference-schema.json index 89aa9543..7a7b7d16 100644 --- a/schemas/session-replay/browser/changes/string-references/string-or-string-reference-schema.json +++ b/schemas/session-replay/browser/changes/string-references/string-or-string-reference-schema.json @@ -2,12 +2,10 @@ "$schema": "http://json-schema.org/draft-07/schema", "$id": "session-replay/browser/changes/string-references/string-or-string-reference-schema.json", "title": "StringOrStringReference", - "description": "Browser-specific. Schema representing a string, either expressed as a literal or as an index into the string table.", + "description": "Browser-specific. Schema representing a string, either expressed as a literal, as a literal with an associated string namespace, or as an index into the string table.", "oneOf": [ - { - "type": "string", - "description": "A literal string." - }, + { "$ref": "string-literal-schema.json" }, + { "$ref": "namespaced-string-literal-schema.json" }, { "$ref": "string-reference-schema.json" } ] }