@fluidframework/debugger 1.4.0-115997 → 2.0.0-dev-rc.1.0.0.224419

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/.eslintrc.js +9 -10
  2. package/CHANGELOG.md +117 -0
  3. package/README.md +33 -33
  4. package/api-extractor-lint.json +4 -0
  5. package/api-extractor.json +2 -2
  6. package/api-report/debugger.api.md +157 -0
  7. package/dist/debugger-alpha.d.ts +36 -0
  8. package/dist/debugger-beta.d.ts +35 -0
  9. package/dist/debugger-public.d.ts +35 -0
  10. package/dist/debugger-untrimmed.d.ts +193 -0
  11. package/dist/{fluidDebugger.js → fluidDebugger.cjs} +12 -4
  12. package/dist/fluidDebugger.cjs.map +1 -0
  13. package/dist/fluidDebugger.d.ts +8 -2
  14. package/dist/fluidDebugger.d.ts.map +1 -1
  15. package/dist/{fluidDebuggerController.js → fluidDebuggerController.cjs} +29 -56
  16. package/dist/fluidDebuggerController.cjs.map +1 -0
  17. package/dist/fluidDebuggerController.d.ts +6 -2
  18. package/dist/fluidDebuggerController.d.ts.map +1 -1
  19. package/dist/{fluidDebuggerUi.js → fluidDebuggerUi.cjs} +45 -50
  20. package/dist/fluidDebuggerUi.cjs.map +1 -0
  21. package/dist/fluidDebuggerUi.d.ts +9 -0
  22. package/dist/fluidDebuggerUi.d.ts.map +1 -1
  23. package/dist/index.cjs +14 -0
  24. package/dist/index.cjs.map +1 -0
  25. package/dist/index.d.ts +3 -3
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/{messageSchema.js → messageSchema.cjs} +1 -12
  28. package/dist/messageSchema.cjs.map +1 -0
  29. package/dist/messageSchema.d.ts.map +1 -1
  30. package/dist/{sanitize.js → sanitize.cjs} +2 -2
  31. package/dist/sanitize.cjs.map +1 -0
  32. package/dist/{sanitizer.js → sanitizer.cjs} +29 -34
  33. package/dist/sanitizer.cjs.map +1 -0
  34. package/dist/sanitizer.d.ts.map +1 -1
  35. package/dist/tsdoc-metadata.json +11 -0
  36. package/lib/debugger-alpha.d.mts +36 -0
  37. package/lib/debugger-beta.d.mts +35 -0
  38. package/lib/debugger-public.d.mts +35 -0
  39. package/lib/debugger-untrimmed.d.mts +193 -0
  40. package/lib/{fluidDebugger.d.ts → fluidDebugger.d.mts} +8 -2
  41. package/lib/fluidDebugger.d.mts.map +1 -0
  42. package/lib/{fluidDebugger.js → fluidDebugger.mjs} +11 -3
  43. package/lib/fluidDebugger.mjs.map +1 -0
  44. package/lib/{fluidDebuggerController.d.ts → fluidDebuggerController.d.mts} +7 -3
  45. package/lib/fluidDebuggerController.d.mts.map +1 -0
  46. package/lib/{fluidDebuggerController.js → fluidDebuggerController.mjs} +20 -47
  47. package/lib/fluidDebuggerController.mjs.map +1 -0
  48. package/lib/{fluidDebuggerUi.d.ts → fluidDebuggerUi.d.mts} +9 -0
  49. package/lib/fluidDebuggerUi.d.mts.map +1 -0
  50. package/lib/{fluidDebuggerUi.js → fluidDebuggerUi.mjs} +44 -49
  51. package/lib/fluidDebuggerUi.mjs.map +1 -0
  52. package/lib/index.d.mts +8 -0
  53. package/lib/index.d.mts.map +1 -0
  54. package/lib/index.mjs +8 -0
  55. package/lib/index.mjs.map +1 -0
  56. package/lib/messageSchema.d.mts.map +1 -0
  57. package/lib/{messageSchema.js → messageSchema.mjs} +1 -12
  58. package/lib/messageSchema.mjs.map +1 -0
  59. package/lib/{sanitize.js → sanitize.mjs} +2 -16
  60. package/lib/sanitize.mjs.map +1 -0
  61. package/lib/{sanitizer.d.ts → sanitizer.d.mts} +0 -14
  62. package/lib/sanitizer.d.mts.map +1 -0
  63. package/lib/{sanitizer.js → sanitizer.mjs} +19 -42
  64. package/lib/sanitizer.mjs.map +1 -0
  65. package/lib/test/types/validateDebuggerPrevious.generated.d.mts +2 -0
  66. package/lib/test/types/validateDebuggerPrevious.generated.d.mts.map +1 -0
  67. package/lib/test/types/{validateDebuggerPrevious.js → validateDebuggerPrevious.generated.mjs} +5 -5
  68. package/lib/test/types/validateDebuggerPrevious.generated.mjs.map +1 -0
  69. package/package.json +76 -44
  70. package/prettier.config.cjs +8 -0
  71. package/src/fluidDebugger.ts +38 -30
  72. package/src/fluidDebuggerController.ts +353 -323
  73. package/src/fluidDebuggerUi.ts +316 -293
  74. package/src/index.ts +3 -3
  75. package/src/messageSchema.ts +356 -367
  76. package/src/sanitize.ts +29 -29
  77. package/src/sanitizer.ts +702 -651
  78. package/tsconfig.json +13 -15
  79. package/dist/fluidDebugger.js.map +0 -1
  80. package/dist/fluidDebuggerController.js.map +0 -1
  81. package/dist/fluidDebuggerUi.js.map +0 -1
  82. package/dist/index.js +0 -20
  83. package/dist/index.js.map +0 -1
  84. package/dist/messageSchema.js.map +0 -1
  85. package/dist/sanitize.js.map +0 -1
  86. package/dist/sanitizer.js.map +0 -1
  87. package/images/Screenshot1.jpg +0 -0
  88. package/images/Screenshot2.jpg +0 -0
  89. package/lib/fluidDebugger.d.ts.map +0 -1
  90. package/lib/fluidDebugger.js.map +0 -1
  91. package/lib/fluidDebuggerController.d.ts.map +0 -1
  92. package/lib/fluidDebuggerController.js.map +0 -1
  93. package/lib/fluidDebuggerUi.d.ts.map +0 -1
  94. package/lib/fluidDebuggerUi.js.map +0 -1
  95. package/lib/index.d.ts +0 -8
  96. package/lib/index.d.ts.map +0 -1
  97. package/lib/index.js +0 -8
  98. package/lib/index.js.map +0 -1
  99. package/lib/messageSchema.d.ts.map +0 -1
  100. package/lib/messageSchema.js.map +0 -1
  101. package/lib/sanitize.js.map +0 -1
  102. package/lib/sanitizer.d.ts.map +0 -1
  103. package/lib/sanitizer.js.map +0 -1
  104. package/lib/test/types/validateDebuggerPrevious.d.ts +0 -2
  105. package/lib/test/types/validateDebuggerPrevious.d.ts.map +0 -1
  106. package/lib/test/types/validateDebuggerPrevious.js.map +0 -1
  107. package/tsconfig.esnext.json +0 -7
  108. /package/lib/{messageSchema.d.ts → messageSchema.d.mts} +0 -0
  109. /package/lib/{sanitize.d.ts → sanitize.d.mts} +0 -0
  110. /package/lib/{sanitize.d.ts.map → sanitize.d.mts.map} +0 -0
@@ -6,213 +6,213 @@
6
6
  import { Schema } from "jsonschema";
7
7
 
8
8
  export const joinContentsSchema = {
9
- type: "null",
9
+ type: "null",
10
10
  };
11
11
 
12
12
  export const joinDataSchema = {
13
- type: "object",
14
- properties: {
15
- clientId: { type: "string" },
16
- detail: {
17
- type: "object",
18
- properties: {
19
- details: { type: "object" },
20
- mode: { type: "string" },
21
- permission: { type: "array" },
22
- scopes: { type: "array" },
23
- type: { type: "string" },
24
- user: {
25
- type: "object",
26
- properties: {
27
- id: { type: "string" },
28
- name: { type: "string" },
29
- email: { type: "string" },
30
- },
31
- required: ["id", "name", "email"],
32
- additionalProperties: false,
33
- },
34
- },
35
- required: ["user"],
36
- additionalProperties: false,
37
- },
38
- },
39
- required: ["clientId", "detail"],
40
- additionalProperties: false,
13
+ type: "object",
14
+ properties: {
15
+ clientId: { type: "string" },
16
+ detail: {
17
+ type: "object",
18
+ properties: {
19
+ details: { type: "object" },
20
+ mode: { type: "string" },
21
+ permission: { type: "array" },
22
+ scopes: { type: "array" },
23
+ type: { type: "string" },
24
+ user: {
25
+ type: "object",
26
+ properties: {
27
+ id: { type: "string" },
28
+ name: { type: "string" },
29
+ email: { type: "string" },
30
+ },
31
+ required: ["id", "name", "email"],
32
+ additionalProperties: false,
33
+ },
34
+ },
35
+ required: ["user"],
36
+ additionalProperties: false,
37
+ },
38
+ },
39
+ required: ["clientId", "detail"],
40
+ additionalProperties: false,
41
41
  };
42
42
 
43
43
  export const proposeContentsSchema = {
44
- type: ["string", "object"],
45
- properties: {
46
- key: { type: "string" },
47
- value: { type: "string" },
48
- },
49
- required: ["key"],
50
- additionalProperties: false,
44
+ type: ["string", "object"],
45
+ properties: {
46
+ key: { type: "string" },
47
+ value: { type: "string" },
48
+ },
49
+ required: ["key"],
50
+ additionalProperties: false,
51
51
  };
52
52
 
53
53
  // The parsed json of a propose message's contents value
54
54
  export const proposeCodeSchema = {
55
- type: "object",
56
- properties: {
57
- key: { type: "string" },
58
- value: {
59
- type: "object",
60
- properties: {
61
- package: {
62
- type: "object",
63
- properties: {
64
- name: { type: "string" },
65
- version: { type: "string" },
66
- fluid: { type: "object" },
67
- },
68
- required: ["name"],
69
- },
70
- config: { type: "object" },
71
- },
72
- required: ["package", "config"],
73
- additionalProperties: false,
74
- },
75
- },
76
- required: ["key", "value"],
77
- additionalProperties: false,
55
+ type: "object",
56
+ properties: {
57
+ key: { type: "string" },
58
+ value: {
59
+ type: "object",
60
+ properties: {
61
+ package: {
62
+ type: "object",
63
+ properties: {
64
+ name: { type: "string" },
65
+ version: { type: "string" },
66
+ fluid: { type: "object" },
67
+ },
68
+ required: ["name"],
69
+ },
70
+ config: { type: "object" },
71
+ },
72
+ required: ["package", "config"],
73
+ additionalProperties: false,
74
+ },
75
+ },
76
+ required: ["key", "value"],
77
+ additionalProperties: false,
78
78
  };
79
79
 
80
80
  // This also needs to be in the root "definitions" key as "entries" to be used
81
81
  const attachSnapshotEntriesSchema = {
82
- type: "object",
83
- properties: {
84
- mode: { type: "string" },
85
- path: { type: "string" },
86
- type: { enum: ["Blob", "Tree"] },
87
- value: {
88
- type: "object",
89
- oneOf: [
90
- // type Blob
91
- {
92
- properties: {
93
- contents: { type: "string" },
94
- encoding: { type: "string" },
95
- // Verify this
96
- id: { type: "null" },
97
- },
98
- required: ["contents", "encoding"],
99
- additionalProperties: false,
100
- },
101
- // type Tree
102
- {
103
- properties: {
104
- entries: {
105
- type: "array",
106
- items: { $ref: "#/definitions/entries" },
107
- },
108
- // Verify this
109
- id: { type: "null" },
110
- },
111
- required: ["entries"],
112
- additionalProperties: false,
113
- },
114
- ],
115
- },
116
- },
117
- required: ["mode", "path", "type", "value"],
118
- additionalProperties: false,
82
+ type: "object",
83
+ properties: {
84
+ mode: { type: "string" },
85
+ path: { type: "string" },
86
+ type: { enum: ["Blob", "Tree"] },
87
+ value: {
88
+ type: "object",
89
+ oneOf: [
90
+ // type Blob
91
+ {
92
+ properties: {
93
+ contents: { type: "string" },
94
+ encoding: { type: "string" },
95
+ // Verify this
96
+ id: { type: "null" },
97
+ },
98
+ required: ["contents", "encoding"],
99
+ additionalProperties: false,
100
+ },
101
+ // type Tree
102
+ {
103
+ properties: {
104
+ entries: {
105
+ type: "array",
106
+ items: { $ref: "#/definitions/entries" },
107
+ },
108
+ // Verify this
109
+ id: { type: "null" },
110
+ },
111
+ required: ["entries"],
112
+ additionalProperties: false,
113
+ },
114
+ ],
115
+ },
116
+ },
117
+ required: ["mode", "path", "type", "value"],
118
+ additionalProperties: false,
119
119
  };
120
120
 
121
121
  export const attachContentsSchema = {
122
- definitions: {
123
- entries: attachSnapshotEntriesSchema,
124
- },
125
- type: "object",
126
- properties: {
127
- id: { type: "string" },
128
- snapshot: {
129
- type: "object",
130
- properties: {
131
- entries: {
132
- type: "array",
133
- items: { $ref: "#/definitions/entries" },
134
- },
135
- // Verify this
136
- id: { type: "null" },
137
- },
138
- required: ["entries"],
139
- additionalProperties: false,
140
- },
141
- type: { type: "string" },
142
- },
143
- required: ["id", "snapshot", "type"],
144
- additionalProperties: false,
122
+ definitions: {
123
+ entries: attachSnapshotEntriesSchema,
124
+ },
125
+ type: "object",
126
+ properties: {
127
+ id: { type: "string" },
128
+ snapshot: {
129
+ type: "object",
130
+ properties: {
131
+ entries: {
132
+ type: "array",
133
+ items: { $ref: "#/definitions/entries" },
134
+ },
135
+ // Verify this
136
+ id: { type: "null" },
137
+ },
138
+ required: ["entries"],
139
+ additionalProperties: false,
140
+ },
141
+ type: { type: "string" },
142
+ },
143
+ required: ["id", "snapshot", "type"],
144
+ additionalProperties: false,
145
145
  };
146
146
 
147
147
  // can exist at the root level or within an op
148
148
  export const chunkedOpContentsSchema = {
149
- type: "object",
150
- properties: {
151
- chunkId: { type: "number" },
152
- contents: { type: "string" },
153
- originalType: { type: "string" },
154
- totalChunks: { type: "number" },
155
- },
156
- required: ["chunkId", "contents", "originalType", "totalChunks"],
157
- additionalProperties: false,
149
+ type: "object",
150
+ properties: {
151
+ chunkId: { type: "number" },
152
+ contents: { type: "string" },
153
+ originalType: { type: "string" },
154
+ totalChunks: { type: "number" },
155
+ },
156
+ required: ["chunkId", "contents", "originalType", "totalChunks"],
157
+ additionalProperties: false,
158
158
  };
159
159
 
160
160
  const contentsSchema = {
161
- type: "object",
162
- properties: {
163
- address: { type: "string" },
164
- contents: {
165
- type: "object",
166
- properties: {
167
- content: { type: "object" },
168
- type: { type: "string" },
169
- },
170
- required: ["content", "type"],
171
- additionalProperties: false,
172
- },
173
- },
174
- required: ["address", "contents"],
175
- additionalProperties: false,
161
+ type: "object",
162
+ properties: {
163
+ address: { type: "string" },
164
+ contents: {
165
+ type: "object",
166
+ properties: {
167
+ content: { type: "object" },
168
+ type: { type: "string" },
169
+ },
170
+ required: ["content", "type"],
171
+ additionalProperties: false,
172
+ },
173
+ },
174
+ required: ["address", "contents"],
175
+ additionalProperties: false,
176
176
  };
177
177
 
178
178
  // special contents formats from containerRuntime.ts's ContainerMessageType
179
179
  export const opContentsSchema = {
180
- definitions: {
181
- content: contentsSchema,
182
- entries: attachSnapshotEntriesSchema,
183
- attachContents: attachContentsSchema,
184
- chunkedOpContents: chunkedOpContentsSchema,
185
- },
186
- type: "object",
187
- oneOf: [
188
- {
189
- properties: {
190
- type: { enum: ["component"] },
191
- contents: { $ref: "#/definitions/content" },
192
- },
193
- required: ["type", "contents"],
194
- additionalProperties: false,
195
- },
196
- {
197
- properties: {
198
- type: { enum: ["attach"] },
199
- contents: { $ref: "#/definitions/attachContents" },
200
- },
201
- required: ["type", "contents"],
202
- additionalProperties: false,
203
- },
204
- {
205
- properties: {
206
- type: { enum: ["chunkedOp"] },
207
- contents: { $ref: "#/definitions/chunkedOpContents" },
208
- },
209
- required: ["type", "contents"],
210
- additionalProperties: false,
211
- },
212
- {
213
- $ref: "#/definitions/content",
214
- },
215
- ],
180
+ definitions: {
181
+ content: contentsSchema,
182
+ entries: attachSnapshotEntriesSchema,
183
+ attachContents: attachContentsSchema,
184
+ chunkedOpContents: chunkedOpContentsSchema,
185
+ },
186
+ type: "object",
187
+ oneOf: [
188
+ {
189
+ properties: {
190
+ type: { enum: ["component"] },
191
+ contents: { $ref: "#/definitions/content" },
192
+ },
193
+ required: ["type", "contents"],
194
+ additionalProperties: false,
195
+ },
196
+ {
197
+ properties: {
198
+ type: { enum: ["attach"] },
199
+ contents: { $ref: "#/definitions/attachContents" },
200
+ },
201
+ required: ["type", "contents"],
202
+ additionalProperties: false,
203
+ },
204
+ {
205
+ properties: {
206
+ type: { enum: ["chunkedOp"] },
207
+ contents: { $ref: "#/definitions/chunkedOpContents" },
208
+ },
209
+ required: ["type", "contents"],
210
+ additionalProperties: false,
211
+ },
212
+ {
213
+ $ref: "#/definitions/content",
214
+ },
215
+ ],
216
216
  };
217
217
 
218
218
  // "op" message's contents.contents.content schemas
@@ -221,98 +221,98 @@ export const opContentsAttachSchema = attachContentsSchema;
221
221
 
222
222
  // Ops from dds/register-collection's consensusRegisterCollection
223
223
  export const opContentsRegisterCollectionSchema = {
224
- type: "object",
225
- properties: {
226
- address: { type: "string" },
227
- contents: {
228
- type: "object",
229
- properties: {
230
- key: { type: "string" },
231
- refSeq: { type: "number" },
232
- serializedValue: { type: "string" },
233
- value: {
234
- type: "object",
235
- properties: {
236
- type: { type: "string" },
237
- value: { },
238
- },
239
- required: ["type", "value"],
240
- additionalProperties: false,
241
- },
242
- type: {
243
- type: "string",
244
- enum: ["write"],
245
- },
246
- },
247
- required: ["key", "type"],
248
- additionalProperties: false,
249
- },
250
- },
251
- required: ["address", "contents"],
252
- additionalProperties: false,
224
+ type: "object",
225
+ properties: {
226
+ address: { type: "string" },
227
+ contents: {
228
+ type: "object",
229
+ properties: {
230
+ key: { type: "string" },
231
+ refSeq: { type: "number" },
232
+ serializedValue: { type: "string" },
233
+ value: {
234
+ type: "object",
235
+ properties: {
236
+ type: { type: "string" },
237
+ value: {},
238
+ },
239
+ required: ["type", "value"],
240
+ additionalProperties: false,
241
+ },
242
+ type: {
243
+ type: "string",
244
+ enum: ["write"],
245
+ },
246
+ },
247
+ required: ["key", "type"],
248
+ additionalProperties: false,
249
+ },
250
+ },
251
+ required: ["address", "contents"],
252
+ additionalProperties: false,
253
253
  };
254
254
 
255
255
  // Ops from dds/map's directory.ts
256
256
  export const opContentsMapSchema = {
257
- type: "object",
258
- properties: {
259
- address: { type: "string" },
260
- contents: {
261
- type: "object",
262
- properties: {
263
- key: { type: "string" },
264
- path: { type: "string" },
265
- subdirName: { type: "string" },
266
- value: {
267
- type: "object",
268
- properties: {
269
- type: { type: "string" },
270
- value: { },
271
- },
272
- required: ["type"],
273
- additionalProperties: false,
274
- },
275
- type: {
276
- type: "string",
277
- enum: [
278
- "act",
279
- "set",
280
- "delete",
281
- "clear",
282
- "createSubDirectory",
283
- "deleteSubDirectory",
284
- ],
285
- },
286
- },
287
- required: ["type"],
288
- additionalProperties: false,
289
- // specific property combinations based on type value
290
- oneOf: [
291
- {
292
- properties: { type: { enum: ["act"] } },
293
- required: ["key", "path", "value"],
294
- },
295
- {
296
- properties: { type: { enum: ["set"] } },
297
- required: ["key", "value"],
298
- },
299
- {
300
- properties: { type: { enum: ["delete"] } },
301
- required: ["key"],
302
- },
303
- {
304
- properties: { type: { enum: ["clear"] } },
305
- required: ["path"],
306
- },
307
- {
308
- properties: { type: { enum: ["createSubDirectory", "deleteSubDirectory"] } },
309
- required: ["path", "subdirName"],
310
- },
311
- ],
312
- },
313
- },
314
- required: ["address", "contents"],
315
- additionalProperties: false,
257
+ type: "object",
258
+ properties: {
259
+ address: { type: "string" },
260
+ contents: {
261
+ type: "object",
262
+ properties: {
263
+ key: { type: "string" },
264
+ path: { type: "string" },
265
+ subdirName: { type: "string" },
266
+ value: {
267
+ type: "object",
268
+ properties: {
269
+ type: { type: "string" },
270
+ value: {},
271
+ },
272
+ required: ["type"],
273
+ additionalProperties: false,
274
+ },
275
+ type: {
276
+ type: "string",
277
+ enum: [
278
+ "act",
279
+ "set",
280
+ "delete",
281
+ "clear",
282
+ "createSubDirectory",
283
+ "deleteSubDirectory",
284
+ ],
285
+ },
286
+ },
287
+ required: ["type"],
288
+ additionalProperties: false,
289
+ // specific property combinations based on type value
290
+ oneOf: [
291
+ {
292
+ properties: { type: { enum: ["act"] } },
293
+ required: ["key", "path", "value"],
294
+ },
295
+ {
296
+ properties: { type: { enum: ["set"] } },
297
+ required: ["key", "value"],
298
+ },
299
+ {
300
+ properties: { type: { enum: ["delete"] } },
301
+ required: ["key"],
302
+ },
303
+ {
304
+ properties: { type: { enum: ["clear"] } },
305
+ required: ["path"],
306
+ },
307
+ {
308
+ properties: { type: { enum: ["createSubDirectory", "deleteSubDirectory"] } },
309
+ required: ["path", "subdirName"],
310
+ },
311
+ ],
312
+ },
313
+ },
314
+ required: ["address", "contents"],
315
+ additionalProperties: false,
316
316
  };
317
317
 
318
318
  // from dds/merge-tree's ops.ts and opBuilder.ts
@@ -320,116 +320,105 @@ export const opContentsMapSchema = {
320
320
  // corresponding interface definitions in ops.ts, and the more restrictive
321
321
  // schema are used here
322
322
  const mergeTreeRelativePosSchema = {
323
- type: "object",
324
- properties: {
325
- id: { type: "string" },
326
- before: { type: "boolean" },
327
- offset: { type: "number" },
328
- },
329
- additionalProperties: false,
323
+ type: "object",
324
+ properties: {
325
+ id: { type: "string" },
326
+ before: { type: "boolean" },
327
+ offset: { type: "number" },
328
+ },
329
+ additionalProperties: false,
330
330
  };
331
331
 
332
332
  const mergeTreeDeltaOpSchema = {
333
- type: "object",
334
- properties: {
335
- type: {
336
- type: "number",
337
- minimum: 0 /* MergeTreeDeltaType.INSERT */,
338
- maximum: 2 /* MergeTreeDeltaType.ANNOTATE */,
339
- },
340
- },
341
- required: ["type"],
342
- oneOf: [
343
- {
344
- properties: {
345
- type: { enum: [0] },
346
- seg: { type: ["string", "object"] },
347
- pos1: { type: "number" },
348
- },
349
- required: ["pos1"],
350
- additionalProperties: false,
351
- },
352
- {
353
- properties: {
354
- type: { enum: [1] },
355
- register: { type: "string" },
356
- pos1: { type: "number" },
357
- pos2: { type: "number" },
358
- },
359
- required: ["pos1"],
360
- additionalProperties: false,
361
- },
362
- {
363
- properties: {
364
- type: { enum: [2] },
365
- combiningOp: {
366
- type: "object",
367
- properties: {
368
- defaultValue: { },
369
- maxValue: { },
370
- minValue: { },
371
- name: { type: "string" },
372
- },
373
- required: ["name"],
374
- additionalProperties: false,
375
- },
376
- pos1: { type: "number" },
377
- pos2: { type: "number" },
378
- props: { type: "object" },
379
- register: { type: "string" },
380
- relativePos1: { $ref: "#/definitions/relativePos" },
381
- relativePos2: { $ref: "#/definitions/relativePos" },
382
- },
383
- required: ["props"],
384
- additionalProperties: false,
385
- },
386
- // There's something weird with the typings/settings here where this doesn't get
387
- // recognized as a valid Schema array if more than 1 item has "properties" defined
388
- ] as Schema[],
333
+ type: "object",
334
+ properties: {
335
+ type: {
336
+ type: "number",
337
+ minimum: 0 /* MergeTreeDeltaType.INSERT */,
338
+ maximum: 2 /* MergeTreeDeltaType.ANNOTATE */,
339
+ },
340
+ },
341
+ required: ["type"],
342
+ oneOf: [
343
+ {
344
+ properties: {
345
+ type: { enum: [0] },
346
+ seg: { type: ["string", "object"] },
347
+ pos1: { type: "number" },
348
+ },
349
+ required: ["pos1"],
350
+ additionalProperties: false,
351
+ },
352
+ {
353
+ properties: {
354
+ type: { enum: [1] },
355
+ register: { type: "string" },
356
+ pos1: { type: "number" },
357
+ pos2: { type: "number" },
358
+ },
359
+ required: ["pos1"],
360
+ additionalProperties: false,
361
+ },
362
+ {
363
+ properties: {
364
+ type: { enum: [2] },
365
+ pos1: { type: "number" },
366
+ pos2: { type: "number" },
367
+ props: { type: "object" },
368
+ register: { type: "string" },
369
+ relativePos1: { $ref: "#/definitions/relativePos" },
370
+ relativePos2: { $ref: "#/definitions/relativePos" },
371
+ },
372
+ required: ["props"],
373
+ additionalProperties: false,
374
+ },
375
+ // There's something weird with the typings/settings here where this doesn't get
376
+ // recognized as a valid Schema array if more than 1 item has "properties" defined
377
+ ] as Schema[],
389
378
  };
390
379
 
391
380
  const mergeTreeGroupOpSchema = {
392
- type: "object",
393
- properties: {
394
- ops: {
395
- type: "array",
396
- items: { $ref: "#/definitions/deltaOp" },
397
- },
398
- type: {
399
- type: "number",
400
- minimum: 3 /* MergeTreeDeltaType.GROUP */,
401
- maximum: 3 /* MergeTreeDeltaType.GROUP */,
402
- },
403
- },
404
- required: ["ops", "type"],
405
- additionalProperties: false,
381
+ type: "object",
382
+ properties: {
383
+ ops: {
384
+ type: "array",
385
+ items: { $ref: "#/definitions/deltaOp" },
386
+ },
387
+ type: {
388
+ type: "number",
389
+ minimum: 3 /* MergeTreeDeltaType.GROUP */,
390
+ maximum: 3 /* MergeTreeDeltaType.GROUP */,
391
+ },
392
+ },
393
+ required: ["ops", "type"],
394
+ additionalProperties: false,
406
395
  };
407
396
 
408
397
  export const opContentsMergeTreeDeltaOpSchema = {
409
- definitions: {
410
- relativePos: mergeTreeRelativePosSchema,
411
- deltaOp: mergeTreeDeltaOpSchema,
412
- },
413
- type: "object",
414
- properties: {
415
- address: { type: "string" },
416
- contents: { $ref: "#/definitions/deltaOp" },
417
- },
418
- required: ["address", "contents"],
419
- additionalProperties: false,
398
+ definitions: {
399
+ relativePos: mergeTreeRelativePosSchema,
400
+ deltaOp: mergeTreeDeltaOpSchema,
401
+ },
402
+ type: "object",
403
+ properties: {
404
+ address: { type: "string" },
405
+ contents: { $ref: "#/definitions/deltaOp" },
406
+ },
407
+ required: ["address", "contents"],
408
+ additionalProperties: false,
420
409
  };
421
410
 
422
411
  export const opContentsMergeTreeGroupOpSchema = {
423
- definitions: {
424
- relativePos: mergeTreeRelativePosSchema,
425
- deltaOp: mergeTreeDeltaOpSchema,
426
- groupOp: mergeTreeGroupOpSchema,
427
- },
428
- type: "object",
429
- properties: {
430
- address: { type: "string" },
431
- contents: { $ref: "#/definitions/groupOp" },
432
- },
433
- required: ["address", "contents"],
434
- additionalProperties: false,
412
+ definitions: {
413
+ relativePos: mergeTreeRelativePosSchema,
414
+ deltaOp: mergeTreeDeltaOpSchema,
415
+ groupOp: mergeTreeGroupOpSchema,
416
+ },
417
+ type: "object",
418
+ properties: {
419
+ address: { type: "string" },
420
+ contents: { $ref: "#/definitions/groupOp" },
421
+ },
422
+ required: ["address", "contents"],
423
+ additionalProperties: false,
435
424
  };