logisheets 1.14.1 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/src/api/workbook.d.ts +98 -1
  2. package/dist/src/api/workbook.js +110 -0
  3. package/dist/src/bindings/bind_form_schema.d.ts +13 -19
  4. package/dist/src/bindings/bind_form_schema.js +7 -25
  5. package/dist/src/bindings/block_field_type.d.ts +7 -0
  6. package/dist/src/bindings/block_field_type.js +2 -0
  7. package/dist/src/bindings/block_info.d.ts +4 -0
  8. package/dist/src/bindings/block_op_for_payload.d.ts +5 -0
  9. package/dist/src/bindings/block_op_for_payload.js +2 -0
  10. package/dist/src/bindings/block_op_policy.d.ts +6 -0
  11. package/dist/src/bindings/block_op_policy.js +2 -0
  12. package/dist/src/bindings/block_schema.d.ts +4 -0
  13. package/dist/src/bindings/block_schema_field_entry.d.ts +12 -0
  14. package/dist/src/bindings/create_block.d.ts +9 -0
  15. package/dist/src/bindings/create_block.js +11 -1
  16. package/dist/src/bindings/duplicate_block_key.d.ts +7 -0
  17. package/dist/src/bindings/duplicate_block_key.js +2 -0
  18. package/dist/src/bindings/edit_payload.d.ts +12 -0
  19. package/dist/src/bindings/enum_set_info.d.ts +6 -0
  20. package/dist/src/bindings/enum_set_info.js +2 -0
  21. package/dist/src/bindings/enum_variant_info.d.ts +4 -0
  22. package/dist/src/bindings/enum_variant_info.js +2 -0
  23. package/dist/src/bindings/enum_variant_spec.d.ts +14 -0
  24. package/dist/src/bindings/enum_variant_spec.js +21 -0
  25. package/dist/src/bindings/get_block_op_policies_params.d.ts +4 -0
  26. package/dist/src/bindings/get_block_op_policies_params.js +2 -0
  27. package/dist/src/bindings/index.d.ts +19 -0
  28. package/dist/src/bindings/index.js +19 -0
  29. package/dist/src/bindings/pivot_excel_note.d.ts +4 -0
  30. package/dist/src/bindings/pivot_excel_note.js +2 -0
  31. package/dist/src/bindings/pivot_filter.d.ts +4 -0
  32. package/dist/src/bindings/pivot_filter.js +2 -0
  33. package/dist/src/bindings/pivot_plan.d.ts +12 -0
  34. package/dist/src/bindings/pivot_plan.js +2 -0
  35. package/dist/src/bindings/pivot_spec.d.ts +10 -0
  36. package/dist/src/bindings/pivot_spec.js +2 -0
  37. package/dist/src/bindings/remove_enum_set.d.ts +10 -0
  38. package/dist/src/bindings/remove_enum_set.js +16 -0
  39. package/dist/src/bindings/rpc_pivot_plan_for_params.d.ts +6 -0
  40. package/dist/src/bindings/rpc_pivot_plan_for_params.js +2 -0
  41. package/dist/src/bindings/rpc_pivot_plan_params.d.ts +4 -0
  42. package/dist/src/bindings/rpc_pivot_plan_params.js +2 -0
  43. package/dist/src/bindings/rpc_workbook_methods.d.ts +17 -0
  44. package/dist/src/bindings/schema_field_spec.d.ts +71 -0
  45. package/dist/src/bindings/schema_field_spec.js +93 -0
  46. package/dist/src/bindings/set_block_analyzes.d.ts +23 -0
  47. package/dist/src/bindings/set_block_analyzes.js +33 -0
  48. package/dist/src/bindings/unique_together_group.d.ts +3 -0
  49. package/dist/src/bindings/unique_together_group.js +2 -0
  50. package/dist/src/bindings/upsert_enum_set.d.ts +19 -0
  51. package/dist/src/bindings/upsert_enum_set.js +28 -0
  52. package/dist/wasm/logisheets_wasm_server.d.ts +6 -6
  53. package/dist/wasm/logisheets_wasm_server.js +28 -28
  54. package/dist/wasm/logisheets_wasm_server_bg.wasm +0 -0
  55. package/dist/wasm/package.json +1 -1
  56. package/package.json +1 -1
  57. package/wasm/logisheets_wasm_server.d.ts +6 -6
  58. package/wasm/logisheets_wasm_server.js +28 -28
  59. package/wasm/logisheets_wasm_server_bg.wasm +0 -0
  60. package/wasm/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { ActionEffect, BlockField, BlockInfo, BlockSortOrder, GetBlockSortOrderParams, MayModifyBlockParams, CheckFieldValidationParams, FieldValidationVerdict, GetBlockModifyInfoParams, BlockModifyInfo, FormulaDisplayInfo, ShadowCellInfo, SheetCellId, SheetInfo, SaveFileResult, AppData, CellInfo, CellCoordinateWithSheet, Transaction, GetBlockValuesParams, GetCellIdParams, GetShadowCellIdParams, GetShadowCellIdsParams, GetAvailableBlockIdParams, TempStatusDiff, BlockDataRow, CommentMention } from '../bindings';
1
+ import { ActionEffect, BlockField, BlockInfo, BlockSortOrder, GetBlockSortOrderParams, PivotPlan, PivotPlanParams, PivotExcelNote, PivotPlanForParams, MayModifyBlockParams, CheckFieldValidationParams, FieldValidationVerdict, DuplicateBlockKey, EnumSetInfo, BlockOpForPayload, BlockOpPolicy, GetBlockModifyInfoParams, BlockModifyInfo, FormulaDisplayInfo, ShadowCellInfo, SheetCellId, SheetInfo, SaveFileResult, AppData, CellInfo, CellCoordinateWithSheet, Transaction, GetBlockValuesParams, GetCellIdParams, GetShadowCellIdParams, GetShadowCellIdsParams, GetAvailableBlockIdParams, TempStatusDiff, BlockDataRow, CommentMention } from '../bindings';
2
2
  import { ColId, RowId } from '../types';
3
3
  import { Worksheet } from './worksheet';
4
4
  import { CustomFunc } from './calculator';
@@ -110,6 +110,13 @@ export declare class Workbook {
110
110
  * drive its overlay without needing JS-side snapshot/compare.
111
111
  */
112
112
  getTempStatusChanges(): Result<TempStatusDiff>;
113
+ /**
114
+ * Whether a temp branch is currently open on this workbook. There is only
115
+ * one branch per workbook and `cleanupTempStatus` discards all of it, so a
116
+ * caller that wants a scratch branch of its own must check this first
117
+ * rather than assume the slot is free.
118
+ */
119
+ isInTempMode(): Result<boolean>;
113
120
  getSheetId(sheetIdx: number): Result<number>;
114
121
  getBlockRowId(sheetId: number, blockId: number, rowIdx: number): Result<RowId>;
115
122
  getBlockColId(sheetId: number, blockId: number, colIdx: number): Result<ColId>;
@@ -171,6 +178,40 @@ export declare class Workbook {
171
178
  * a sort order. Fails for random-schema blocks (no fields).
172
179
  */
173
180
  getBlockSortOrder(params: GetBlockSortOrderParams): Result<BlockSortOrder>;
181
+ /**
182
+ * Read-only: the shape a PIVOT block should have, what it has now, and the
183
+ * difference.
184
+ *
185
+ * A pivot's rows and columns are the source's distinct dimension values,
186
+ * so its shape is data and no formula can produce it. The engine computes
187
+ * the plan; a host applies it as one transaction in the order
188
+ * `design/block-pivot.md` §6 pins.
189
+ *
190
+ * Read `isStale` before trusting a pivot's totals: a stale pivot's numbers
191
+ * are each correct while a whole group is absent, which is the one way a
192
+ * block can mislead without being wrong. `missingKeys` /
193
+ * `unassignedRecords` say what is not being shown.
194
+ */
195
+ pivotPlan(params: PivotPlanParams): Result<PivotPlan>;
196
+ /**
197
+ * Read-only: why this pivot could NOT be saved as a real Excel pivot
198
+ * table, or `null` when it can.
199
+ *
200
+ * The saver decides this on every write. Asking it here means a recipe can
201
+ * be chosen knowing whether it survives the trip, instead of the file
202
+ * quietly degrading to a grid of numbers Excel cannot recompute.
203
+ */
204
+ pivotExcelNote(params: PivotPlanParams): Result<PivotExcelNote>;
205
+ /**
206
+ * Read-only: the shape a pivot over `sourceBlock` WOULD have, for a recipe
207
+ * no block carries yet.
208
+ *
209
+ * This is what lets a host create a pivot at its right size in ONE
210
+ * transaction — and therefore one undo. Without it, creating would mean
211
+ * making the block, asking what shape it should be, and reshaping it,
212
+ * leaving an empty declared pivot as an intermediate state.
213
+ */
214
+ pivotPlanFor(params: PivotPlanForParams): Result<PivotPlan>;
174
215
  /**
175
216
  * Whether `actor` may perform `op` on this block.
176
217
  *
@@ -220,6 +261,62 @@ export declare class Workbook {
220
261
  }): Result<ShadowCellInfo>;
221
262
  getCellId(params: GetCellIdParams): Result<SheetCellId>;
222
263
  getAllBlockFields(): Result<readonly BlockField[]>;
264
+ /**
265
+ * Which block operation each payload counts as, keyed by the payload's
266
+ * `type`. Static — fetch once and cache.
267
+ *
268
+ * The engine defines the operations, so it answers this. Every host that
269
+ * enforces a policy needs the mapping, and each keeping its own table is
270
+ * how the same payload comes to be governed differently in different
271
+ * hosts. A payload absent from the table is not unguarded: the caller
272
+ * falls back to its own owner check.
273
+ */
274
+ getBlockOpForPayloads(): Result<readonly BlockOpForPayload[]>;
275
+ /**
276
+ * What a block declares for each operation — the policy in force, and
277
+ * whether the block says anything about that operation at all.
278
+ *
279
+ * `stated` is the half a host cannot compute for itself: "anyone may,
280
+ * because nobody said" and "anyone may, because someone said so" are
281
+ * different facts, and only the first leaves room for the host's own owner
282
+ * check. Whether a given ACTOR is allowed is `mayModifyBlock`.
283
+ */
284
+ getBlockOpPolicies(params: {
285
+ sheetIdx: number;
286
+ blockId: number;
287
+ }): Result<readonly BlockOpPolicy[]>;
288
+ /**
289
+ * The workbook's enum sets — the option lists `enum` / `multiSelect` fields
290
+ * draw from.
291
+ *
292
+ * A field's declaration names a set by id and does not carry it, so without
293
+ * this a host can read the declaration and still not know what is allowed.
294
+ * That was every headless host's position while the sets lived in the
295
+ * browser's AppData blob.
296
+ *
297
+ * Ids and labels only: a variant's colour is presentation and stays in the
298
+ * host, keyed by variant id.
299
+ */
300
+ getEnumSets(): Result<readonly EnumSetInfo[]>;
301
+ /**
302
+ * Every duplicated block row key in the workbook.
303
+ *
304
+ * The engine refuses to CREATE a duplicate: a transaction that would leave
305
+ * two records of one block sharing a key is rejected whole. That guard
306
+ * judges only the keys the transaction itself wrote, so a block that
307
+ * arrived already broken — from an .xlsx written elsewhere, or by an older
308
+ * build — stays editable rather than being locked out of its own repair.
309
+ *
310
+ * This is the other half. Nothing surfaces those on its own: `BLOCKREF`
311
+ * resolves a repeated key to its first match and reports no error, so one
312
+ * record is unreachable and every aggregate over the block counts the
313
+ * reachable one twice, silently. Poll it at a decision point (opening a
314
+ * file, before trusting a total) and filter by sheet or block yourself.
315
+ *
316
+ * An empty key is not a duplicate — that is what an inserted row starts
317
+ * life with, and it is unaddressable rather than wrong.
318
+ */
319
+ duplicateBlockKeys(): Result<readonly DuplicateBlockKey[]>;
223
320
  /**
224
321
  * Enumerate blocks across the workbook.
225
322
  *
@@ -246,6 +246,15 @@ class Workbook {
246
246
  getTempStatusChanges() {
247
247
  return rpc('getTempStatusChanges', undefined, this._id);
248
248
  }
249
+ /**
250
+ * Whether a temp branch is currently open on this workbook. There is only
251
+ * one branch per workbook and `cleanupTempStatus` discards all of it, so a
252
+ * caller that wants a scratch branch of its own must check this first
253
+ * rather than assume the slot is free.
254
+ */
255
+ isInTempMode() {
256
+ return rpc('isInTempMode', undefined, this._id);
257
+ }
249
258
  getSheetId(sheetIdx) {
250
259
  return rpc('getSheetId', { sheetIdx }, this._id);
251
260
  }
@@ -424,6 +433,46 @@ class Workbook {
424
433
  getBlockSortOrder(params) {
425
434
  return rpc('getBlockSortOrder', params, this._id);
426
435
  }
436
+ /**
437
+ * Read-only: the shape a PIVOT block should have, what it has now, and the
438
+ * difference.
439
+ *
440
+ * A pivot's rows and columns are the source's distinct dimension values,
441
+ * so its shape is data and no formula can produce it. The engine computes
442
+ * the plan; a host applies it as one transaction in the order
443
+ * `design/block-pivot.md` §6 pins.
444
+ *
445
+ * Read `isStale` before trusting a pivot's totals: a stale pivot's numbers
446
+ * are each correct while a whole group is absent, which is the one way a
447
+ * block can mislead without being wrong. `missingKeys` /
448
+ * `unassignedRecords` say what is not being shown.
449
+ */
450
+ pivotPlan(params) {
451
+ return rpc('pivotPlan', params, this._id);
452
+ }
453
+ /**
454
+ * Read-only: why this pivot could NOT be saved as a real Excel pivot
455
+ * table, or `null` when it can.
456
+ *
457
+ * The saver decides this on every write. Asking it here means a recipe can
458
+ * be chosen knowing whether it survives the trip, instead of the file
459
+ * quietly degrading to a grid of numbers Excel cannot recompute.
460
+ */
461
+ pivotExcelNote(params) {
462
+ return rpc('pivotExcelNote', params, this._id);
463
+ }
464
+ /**
465
+ * Read-only: the shape a pivot over `sourceBlock` WOULD have, for a recipe
466
+ * no block carries yet.
467
+ *
468
+ * This is what lets a host create a pivot at its right size in ONE
469
+ * transaction — and therefore one undo. Without it, creating would mean
470
+ * making the block, asking what shape it should be, and reshaping it,
471
+ * leaving an empty declared pivot as an intermediate state.
472
+ */
473
+ pivotPlanFor(params) {
474
+ return rpc('pivotPlanFor', params, this._id);
475
+ }
427
476
  /**
428
477
  * Whether `actor` may perform `op` on this block.
429
478
  *
@@ -510,6 +559,67 @@ class Workbook {
510
559
  getAllBlockFields() {
511
560
  return rpc('getAllBlockFields', undefined, this._id);
512
561
  }
562
+ /**
563
+ * Which block operation each payload counts as, keyed by the payload's
564
+ * `type`. Static — fetch once and cache.
565
+ *
566
+ * The engine defines the operations, so it answers this. Every host that
567
+ * enforces a policy needs the mapping, and each keeping its own table is
568
+ * how the same payload comes to be governed differently in different
569
+ * hosts. A payload absent from the table is not unguarded: the caller
570
+ * falls back to its own owner check.
571
+ */
572
+ getBlockOpForPayloads() {
573
+ return rpc('getBlockOpForPayloads', undefined, this._id);
574
+ }
575
+ /**
576
+ * What a block declares for each operation — the policy in force, and
577
+ * whether the block says anything about that operation at all.
578
+ *
579
+ * `stated` is the half a host cannot compute for itself: "anyone may,
580
+ * because nobody said" and "anyone may, because someone said so" are
581
+ * different facts, and only the first leaves room for the host's own owner
582
+ * check. Whether a given ACTOR is allowed is `mayModifyBlock`.
583
+ */
584
+ getBlockOpPolicies(params) {
585
+ return rpc('getBlockOpPolicies', params, this._id);
586
+ }
587
+ /**
588
+ * The workbook's enum sets — the option lists `enum` / `multiSelect` fields
589
+ * draw from.
590
+ *
591
+ * A field's declaration names a set by id and does not carry it, so without
592
+ * this a host can read the declaration and still not know what is allowed.
593
+ * That was every headless host's position while the sets lived in the
594
+ * browser's AppData blob.
595
+ *
596
+ * Ids and labels only: a variant's colour is presentation and stays in the
597
+ * host, keyed by variant id.
598
+ */
599
+ getEnumSets() {
600
+ return rpc('getEnumSets', undefined, this._id);
601
+ }
602
+ /**
603
+ * Every duplicated block row key in the workbook.
604
+ *
605
+ * The engine refuses to CREATE a duplicate: a transaction that would leave
606
+ * two records of one block sharing a key is rejected whole. That guard
607
+ * judges only the keys the transaction itself wrote, so a block that
608
+ * arrived already broken — from an .xlsx written elsewhere, or by an older
609
+ * build — stays editable rather than being locked out of its own repair.
610
+ *
611
+ * This is the other half. Nothing surfaces those on its own: `BLOCKREF`
612
+ * resolves a repeated key to its first match and reports no error, so one
613
+ * record is unreachable and every aggregate over the block counts the
614
+ * reachable one twice, silently. Poll it at a decision point (opening a
615
+ * file, before trusting a total) and filter by sheet or block yourself.
616
+ *
617
+ * An empty key is not a duplicate — that is what an inserted row starts
618
+ * life with, and it is unaddressable rather than wrong.
619
+ */
620
+ duplicateBlockKeys() {
621
+ return rpc('duplicateBlockKeys', undefined, this._id);
622
+ }
513
623
  /**
514
624
  * Enumerate blocks across the workbook.
515
625
  *
@@ -1,15 +1,15 @@
1
+ import { SchemaFieldSpec } from './schema_field_spec';
2
+ import { UniqueTogetherGroup } from './unique_together_group';
1
3
  export interface BindFormSchema {
2
4
  refName: string;
3
5
  sheetIdx: number;
4
6
  blockId: number;
5
7
  fieldFrom: number;
6
8
  keyIdx: number;
7
- fields: readonly string[];
8
- renderIds: readonly string[];
9
+ fields: readonly SchemaFieldSpec[];
9
10
  row: boolean;
10
- fieldFormulas: readonly string[];
11
- validationFormulas: readonly string[];
12
- editabilityFormulas: readonly string[];
11
+ headerIdx?: number;
12
+ uniqueTogether?: readonly UniqueTogetherGroup[];
13
13
  }
14
14
  export declare class BindFormSchemaBuilder {
15
15
  private _refName;
@@ -18,33 +18,27 @@ export declare class BindFormSchemaBuilder {
18
18
  private _fieldFrom;
19
19
  private _keyIdx;
20
20
  private _fields;
21
- private _renderIds;
22
21
  private _row;
23
- private _fieldFormulas;
24
- private _validationFormulas;
25
- private _editabilityFormulas;
22
+ private _headerIdx?;
23
+ private _uniqueTogether?;
26
24
  refName(value: string): this;
27
25
  sheetIdx(value: number): this;
28
26
  blockId(value: number): this;
29
27
  fieldFrom(value: number): this;
30
28
  keyIdx(value: number): this;
31
- fields(value: readonly string[]): this;
32
- renderIds(value: readonly string[]): this;
29
+ fields(value: readonly SchemaFieldSpec[]): this;
33
30
  row(value: boolean): this;
34
- fieldFormulas(value: readonly string[]): this;
35
- validationFormulas(value: readonly string[]): this;
36
- editabilityFormulas(value: readonly string[]): this;
31
+ headerIdx(value: number): this;
32
+ uniqueTogether(value: readonly UniqueTogetherGroup[]): this;
37
33
  build(): {
38
34
  refName: string;
39
35
  sheetIdx: number;
40
36
  blockId: number;
41
37
  fieldFrom: number;
42
38
  keyIdx: number;
43
- fields: readonly string[];
44
- renderIds: readonly string[];
39
+ fields: readonly SchemaFieldSpec[];
45
40
  row: boolean;
46
- fieldFormulas: readonly string[];
47
- validationFormulas: readonly string[];
48
- editabilityFormulas: readonly string[];
41
+ headerIdx: number | undefined;
42
+ uniqueTogether: readonly UniqueTogetherGroup[] | undefined;
49
43
  };
50
44
  }
@@ -8,11 +8,9 @@ class BindFormSchemaBuilder {
8
8
  _fieldFrom;
9
9
  _keyIdx;
10
10
  _fields;
11
- _renderIds;
12
11
  _row;
13
- _fieldFormulas;
14
- _validationFormulas;
15
- _editabilityFormulas;
12
+ _headerIdx;
13
+ _uniqueTogether;
16
14
  refName(value) {
17
15
  this._refName = value;
18
16
  return this;
@@ -37,24 +35,16 @@ class BindFormSchemaBuilder {
37
35
  this._fields = value;
38
36
  return this;
39
37
  }
40
- renderIds(value) {
41
- this._renderIds = value;
42
- return this;
43
- }
44
38
  row(value) {
45
39
  this._row = value;
46
40
  return this;
47
41
  }
48
- fieldFormulas(value) {
49
- this._fieldFormulas = value;
50
- return this;
51
- }
52
- validationFormulas(value) {
53
- this._validationFormulas = value;
42
+ headerIdx(value) {
43
+ this._headerIdx = value;
54
44
  return this;
55
45
  }
56
- editabilityFormulas(value) {
57
- this._editabilityFormulas = value;
46
+ uniqueTogether(value) {
47
+ this._uniqueTogether = value;
58
48
  return this;
59
49
  }
60
50
  build() {
@@ -70,17 +60,9 @@ class BindFormSchemaBuilder {
70
60
  throw new Error('missing keyIdx');
71
61
  if (this._fields === undefined)
72
62
  throw new Error('missing fields');
73
- if (this._renderIds === undefined)
74
- throw new Error('missing renderIds');
75
63
  if (this._row === undefined)
76
64
  throw new Error('missing row');
77
- if (this._fieldFormulas === undefined)
78
- throw new Error('missing fieldFormulas');
79
- if (this._validationFormulas === undefined)
80
- throw new Error('missing validationFormulas');
81
- if (this._editabilityFormulas === undefined)
82
- throw new Error('missing editabilityFormulas');
83
- return { refName: this._refName, sheetIdx: this._sheetIdx, blockId: this._blockId, fieldFrom: this._fieldFrom, keyIdx: this._keyIdx, fields: this._fields, renderIds: this._renderIds, row: this._row, fieldFormulas: this._fieldFormulas, validationFormulas: this._validationFormulas, editabilityFormulas: this._editabilityFormulas };
65
+ return { refName: this._refName, sheetIdx: this._sheetIdx, blockId: this._blockId, fieldFrom: this._fieldFrom, keyIdx: this._keyIdx, fields: this._fields, row: this._row, headerIdx: this._headerIdx, uniqueTogether: this._uniqueTogether };
84
66
  }
85
67
  }
86
68
  exports.BindFormSchemaBuilder = BindFormSchemaBuilder;
@@ -0,0 +1,7 @@
1
+ export interface FieldTypeParts {
2
+ kind?: string;
3
+ enumSetId?: string;
4
+ refSheetId?: number;
5
+ refBlockId?: number;
6
+ refFieldName?: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,6 +3,7 @@ import { BlockPermissions } from './block_permissions';
3
3
  import { BlockSchema } from './block_schema';
4
4
  import { FieldRenderEntry } from './field_render_entry';
5
5
  import { ModifyPolicy } from './modify_policy';
6
+ import { PivotSpecParts } from './pivot_spec';
6
7
  export interface BlockInfo {
7
8
  sheetIdx: number;
8
9
  sheetId: number;
@@ -18,4 +19,7 @@ export interface BlockInfo {
18
19
  owner: string;
19
20
  modifyPolicy: ModifyPolicy;
20
21
  permissions: BlockPermissions;
22
+ analyzes?: number;
23
+ analyzedBy: readonly number[];
24
+ pivot?: PivotSpecParts;
21
25
  }
@@ -0,0 +1,5 @@
1
+ import { BlockOp } from './block_op';
2
+ export interface BlockOpForPayload {
3
+ payloadType: string;
4
+ op: BlockOp;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { BlockOp } from './block_op';
2
+ export interface BlockOpPolicy {
3
+ op: BlockOp;
4
+ policy: string;
5
+ stated: boolean;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,10 +2,14 @@ import { BlockSchemaFieldEntry } from './block_schema_field_entry';
2
2
  import { BlockSchemaKeyEntry } from './block_schema_key_entry';
3
3
  import { BlockSchemaRandomEntry } from './block_schema_random_entry';
4
4
  import { BlockSchemaType } from './block_schema_type';
5
+ import { UniqueTogetherGroup } from './unique_together_group';
5
6
  export interface BlockSchema {
6
7
  name: string;
7
8
  schemaType: BlockSchemaType;
8
9
  keys: readonly BlockSchemaKeyEntry[];
9
10
  fields: readonly BlockSchemaFieldEntry[];
10
11
  randomEntries: readonly BlockSchemaRandomEntry[];
12
+ headerIdx?: number;
13
+ keyIdx?: number;
14
+ uniqueTogether: readonly UniqueTogetherGroup[];
11
15
  }
@@ -1,3 +1,4 @@
1
+ import { FieldTypeParts } from './block_field_type';
1
2
  export interface BlockSchemaFieldEntry {
2
3
  field: string;
3
4
  idx: number;
@@ -5,4 +6,15 @@ export interface BlockSchemaFieldEntry {
5
6
  valueFormula?: string;
6
7
  validationFormula?: string;
7
8
  editabilityFormula?: string;
9
+ fieldType?: FieldTypeParts;
10
+ description?: string;
11
+ required: boolean;
12
+ unique: boolean;
13
+ defaultValue?: string;
14
+ writePolicy: string;
15
+ aggFunc?: string;
16
+ aggField?: string;
17
+ pivotColValue?: string;
18
+ pivotMeasure?: string;
19
+ pivotFunc?: string;
8
20
  }
@@ -1,5 +1,6 @@
1
1
  import { BlockPermissions } from './block_permissions';
2
2
  import { ModifyPolicy } from './modify_policy';
3
+ import { PivotSpecParts } from './pivot_spec';
3
4
  export interface CreateBlock {
4
5
  sheetIdx: number;
5
6
  id: number;
@@ -11,6 +12,8 @@ export interface CreateBlock {
11
12
  modifyPolicy?: ModifyPolicy;
12
13
  permissions?: BlockPermissions;
13
14
  description?: string;
15
+ analyzes?: number;
16
+ pivot?: PivotSpecParts;
14
17
  }
15
18
  export declare class CreateBlockBuilder {
16
19
  private _sheetIdx;
@@ -23,6 +26,8 @@ export declare class CreateBlockBuilder {
23
26
  private _modifyPolicy?;
24
27
  private _permissions?;
25
28
  private _description?;
29
+ private _analyzes?;
30
+ private _pivot?;
26
31
  sheetIdx(value: number): this;
27
32
  id(value: number): this;
28
33
  masterRow(value: number): this;
@@ -33,6 +38,8 @@ export declare class CreateBlockBuilder {
33
38
  modifyPolicy(value: ModifyPolicy): this;
34
39
  permissions(value: BlockPermissions): this;
35
40
  description(value: string): this;
41
+ analyzes(value: number): this;
42
+ pivot(value: PivotSpecParts): this;
36
43
  build(): {
37
44
  sheetIdx: number;
38
45
  id: number;
@@ -44,5 +51,7 @@ export declare class CreateBlockBuilder {
44
51
  modifyPolicy: ModifyPolicy | undefined;
45
52
  permissions: BlockPermissions | undefined;
46
53
  description: string | undefined;
54
+ analyzes: number | undefined;
55
+ pivot: PivotSpecParts | undefined;
47
56
  };
48
57
  }
@@ -12,6 +12,8 @@ class CreateBlockBuilder {
12
12
  _modifyPolicy;
13
13
  _permissions;
14
14
  _description;
15
+ _analyzes;
16
+ _pivot;
15
17
  sheetIdx(value) {
16
18
  this._sheetIdx = value;
17
19
  return this;
@@ -52,6 +54,14 @@ class CreateBlockBuilder {
52
54
  this._description = value;
53
55
  return this;
54
56
  }
57
+ analyzes(value) {
58
+ this._analyzes = value;
59
+ return this;
60
+ }
61
+ pivot(value) {
62
+ this._pivot = value;
63
+ return this;
64
+ }
55
65
  build() {
56
66
  if (this._sheetIdx === undefined)
57
67
  throw new Error('missing sheetIdx');
@@ -65,7 +75,7 @@ class CreateBlockBuilder {
65
75
  throw new Error('missing rowCnt');
66
76
  if (this._colCnt === undefined)
67
77
  throw new Error('missing colCnt');
68
- return { sheetIdx: this._sheetIdx, id: this._id, masterRow: this._masterRow, masterCol: this._masterCol, rowCnt: this._rowCnt, colCnt: this._colCnt, owner: this._owner, modifyPolicy: this._modifyPolicy, permissions: this._permissions, description: this._description };
78
+ return { sheetIdx: this._sheetIdx, id: this._id, masterRow: this._masterRow, masterCol: this._masterCol, rowCnt: this._rowCnt, colCnt: this._colCnt, owner: this._owner, modifyPolicy: this._modifyPolicy, permissions: this._permissions, description: this._description, analyzes: this._analyzes, pivot: this._pivot };
69
79
  }
70
80
  }
71
81
  exports.CreateBlockBuilder = CreateBlockBuilder;
@@ -0,0 +1,7 @@
1
+ export interface DuplicateBlockKey {
2
+ sheetIdx: number;
3
+ blockId: number;
4
+ blockName: string;
5
+ key: string;
6
+ records: readonly number[];
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -46,11 +46,13 @@ import { RemoveAppendix } from './remove_appendix';
46
46
  import { RemoveBlock } from './remove_block';
47
47
  import { RemoveDiyCell } from './remove_diy_cell';
48
48
  import { RemoveDiyCellById } from './remove_diy_cell_by_id';
49
+ import { RemoveEnumSet } from './remove_enum_set';
49
50
  import { ReorderBlockLines } from './reorder_block_lines';
50
51
  import { ReproduceCells } from './reproduce_cells';
51
52
  import { ResizeBlock } from './resize_block';
52
53
  import { ResolveComment } from './resolve_comment';
53
54
  import { RestoreCheckpoint } from './restore_checkpoint';
55
+ import { SetBlockAnalyzes } from './set_block_analyzes';
54
56
  import { SetBlockDescription } from './set_block_description';
55
57
  import { SetBlockPermissions } from './set_block_permissions';
56
58
  import { SetCellImage } from './set_cell_image';
@@ -63,6 +65,7 @@ import { SheetRename } from './sheet_rename';
63
65
  import { SplitMergedCells } from './split_merged_cells';
64
66
  import { UpdateChart } from './update_chart';
65
67
  import { UpdateConditionalFormattingRule } from './update_conditional_formatting_rule';
68
+ import { UpsertEnumSet } from './upsert_enum_set';
66
69
  import { UpsertFieldFormulas } from './upsert_field_formulas';
67
70
  import { UpsertFieldRenderInfo } from './upsert_field_render_info';
68
71
  import { UpsertPerson } from './upsert_person';
@@ -147,6 +150,15 @@ export type EditPayload = {
147
150
  } | {
148
151
  type: 'setBlockPermissions';
149
152
  value: SetBlockPermissions;
153
+ } | {
154
+ type: 'setBlockAnalyzes';
155
+ value: SetBlockAnalyzes;
156
+ } | {
157
+ type: 'upsertEnumSet';
158
+ value: UpsertEnumSet;
159
+ } | {
160
+ type: 'removeEnumSet';
161
+ value: RemoveEnumSet;
150
162
  } | {
151
163
  type: 'cellFormatBrush';
152
164
  value: CellFormatBrush;
@@ -0,0 +1,6 @@
1
+ import { EnumVariantInfo } from './enum_variant_info';
2
+ export interface EnumSetInfo {
3
+ id: string;
4
+ name: string;
5
+ variants: readonly EnumVariantInfo[];
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface EnumVariantInfo {
2
+ id: string;
3
+ label: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ export interface EnumVariantSpec {
2
+ id: string;
3
+ label?: string;
4
+ }
5
+ export declare class EnumVariantSpecBuilder {
6
+ private _id;
7
+ private _label?;
8
+ id(value: string): this;
9
+ label(value: string): this;
10
+ build(): {
11
+ id: string;
12
+ label: string | undefined;
13
+ };
14
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EnumVariantSpecBuilder = void 0;
4
+ class EnumVariantSpecBuilder {
5
+ _id;
6
+ _label;
7
+ id(value) {
8
+ this._id = value;
9
+ return this;
10
+ }
11
+ label(value) {
12
+ this._label = value;
13
+ return this;
14
+ }
15
+ build() {
16
+ if (this._id === undefined)
17
+ throw new Error('missing id');
18
+ return { id: this._id, label: this._label };
19
+ }
20
+ }
21
+ exports.EnumVariantSpecBuilder = EnumVariantSpecBuilder;
@@ -0,0 +1,4 @@
1
+ export interface GetBlockOpPoliciesParams {
2
+ sheetIdx: number;
3
+ blockId: number;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });