logisheets 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/api/workbook.d.ts +112 -1
- package/dist/src/api/workbook.js +126 -0
- package/dist/src/bindings/bind_form_schema.d.ts +13 -19
- package/dist/src/bindings/bind_form_schema.js +7 -25
- package/dist/src/bindings/block_field_type.d.ts +7 -0
- package/dist/src/bindings/block_field_type.js +2 -0
- package/dist/src/bindings/block_info.d.ts +4 -0
- package/dist/src/bindings/block_op.d.ts +1 -1
- package/dist/src/bindings/block_op_for_payload.d.ts +5 -0
- package/dist/src/bindings/block_op_for_payload.js +2 -0
- package/dist/src/bindings/block_op_policy.d.ts +6 -0
- package/dist/src/bindings/block_op_policy.js +2 -0
- package/dist/src/bindings/block_permissions.d.ts +4 -0
- package/dist/src/bindings/block_permissions.js +6 -1
- package/dist/src/bindings/block_schema.d.ts +3 -0
- package/dist/src/bindings/block_schema_field_entry.d.ts +12 -0
- package/dist/src/bindings/check_field_validation_params.d.ts +6 -0
- package/dist/src/bindings/check_field_validation_params.js +2 -0
- package/dist/src/bindings/create_block.d.ts +9 -0
- package/dist/src/bindings/create_block.js +11 -1
- package/dist/src/bindings/duplicate_block_key.d.ts +7 -0
- package/dist/src/bindings/duplicate_block_key.js +2 -0
- package/dist/src/bindings/edit_payload.d.ts +12 -0
- package/dist/src/bindings/enum_set_info.d.ts +6 -0
- package/dist/src/bindings/enum_set_info.js +2 -0
- package/dist/src/bindings/enum_variant_info.d.ts +4 -0
- package/dist/src/bindings/enum_variant_info.js +2 -0
- package/dist/src/bindings/enum_variant_spec.d.ts +14 -0
- package/dist/src/bindings/enum_variant_spec.js +21 -0
- package/dist/src/bindings/field_validation_verdict.d.ts +5 -0
- package/dist/src/bindings/field_validation_verdict.js +2 -0
- package/dist/src/bindings/get_block_op_policies_params.d.ts +4 -0
- package/dist/src/bindings/get_block_op_policies_params.js +2 -0
- package/dist/src/bindings/index.d.ts +21 -0
- package/dist/src/bindings/index.js +21 -0
- package/dist/src/bindings/pivot_excel_note.d.ts +4 -0
- package/dist/src/bindings/pivot_excel_note.js +2 -0
- package/dist/src/bindings/pivot_filter.d.ts +4 -0
- package/dist/src/bindings/pivot_filter.js +2 -0
- package/dist/src/bindings/pivot_plan.d.ts +12 -0
- package/dist/src/bindings/pivot_plan.js +2 -0
- package/dist/src/bindings/pivot_spec.d.ts +10 -0
- package/dist/src/bindings/pivot_spec.js +2 -0
- package/dist/src/bindings/remove_enum_set.d.ts +10 -0
- package/dist/src/bindings/remove_enum_set.js +16 -0
- package/dist/src/bindings/rpc_pivot_plan_for_params.d.ts +6 -0
- package/dist/src/bindings/rpc_pivot_plan_for_params.js +2 -0
- package/dist/src/bindings/rpc_pivot_plan_params.d.ts +4 -0
- package/dist/src/bindings/rpc_pivot_plan_params.js +2 -0
- package/dist/src/bindings/rpc_workbook_methods.d.ts +20 -0
- package/dist/src/bindings/schema_field_spec.d.ts +71 -0
- package/dist/src/bindings/schema_field_spec.js +93 -0
- package/dist/src/bindings/set_block_analyzes.d.ts +23 -0
- package/dist/src/bindings/set_block_analyzes.js +33 -0
- package/dist/src/bindings/unique_together_group.d.ts +3 -0
- package/dist/src/bindings/unique_together_group.js +2 -0
- package/dist/src/bindings/upsert_enum_set.d.ts +19 -0
- package/dist/src/bindings/upsert_enum_set.js +28 -0
- package/dist/wasm/logisheets_wasm_server.d.ts +8 -8
- package/dist/wasm/logisheets_wasm_server.js +34 -34
- package/dist/wasm/logisheets_wasm_server_bg.wasm +0 -0
- package/dist/wasm/logisheets_wasm_server_bg.wasm.d.ts +1 -1
- package/dist/wasm/package.json +1 -1
- package/package.json +1 -1
- package/wasm/logisheets_wasm_server.d.ts +8 -8
- package/wasm/logisheets_wasm_server.js +34 -34
- package/wasm/logisheets_wasm_server_bg.wasm +0 -0
- package/wasm/logisheets_wasm_server_bg.wasm.d.ts +1 -1
- package/wasm/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionEffect, BlockField, BlockInfo, BlockSortOrder, GetBlockSortOrderParams, MayModifyBlockParams, 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
|
*
|
|
@@ -184,6 +225,20 @@ export declare class Workbook {
|
|
|
184
225
|
* come back on `getBlockInfo` if you need to explain the refusal.
|
|
185
226
|
*/
|
|
186
227
|
mayModifyBlock(params: MayModifyBlockParams): Result<boolean>;
|
|
228
|
+
/**
|
|
229
|
+
* Whether writing `proposed` into this cell would break its field's
|
|
230
|
+
* validation rule.
|
|
231
|
+
*
|
|
232
|
+
* The companion to {@link mayModifyBlock} for `overrideValidation`: that
|
|
233
|
+
* answers whether this actor may write a violating value, this answers
|
|
234
|
+
* whether the value in hand is a violating one. A host gating a write
|
|
235
|
+
* needs both, and needs them BEFORE the write — the marker on the cell
|
|
236
|
+
* only ever judges a value the cell already holds.
|
|
237
|
+
*
|
|
238
|
+
* Reads nothing into the workbook: the rule is evaluated against the
|
|
239
|
+
* proposed value and the cell is left exactly as it was.
|
|
240
|
+
*/
|
|
241
|
+
checkFieldValidation(params: CheckFieldValidationParams): Result<FieldValidationVerdict>;
|
|
187
242
|
/**
|
|
188
243
|
* A block's governance metadata on its own — owner, default policy,
|
|
189
244
|
* per-operation overrides, description. `getBlockInfo` carries the same
|
|
@@ -206,6 +261,62 @@ export declare class Workbook {
|
|
|
206
261
|
}): Result<ShadowCellInfo>;
|
|
207
262
|
getCellId(params: GetCellIdParams): Result<SheetCellId>;
|
|
208
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[]>;
|
|
209
320
|
/**
|
|
210
321
|
* Enumerate blocks across the workbook.
|
|
211
322
|
*
|
package/dist/src/api/workbook.js
CHANGED
|
@@ -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
|
*
|
|
@@ -439,6 +488,22 @@ class Workbook {
|
|
|
439
488
|
mayModifyBlock(params) {
|
|
440
489
|
return rpc('mayModifyBlock', params, this._id);
|
|
441
490
|
}
|
|
491
|
+
/**
|
|
492
|
+
* Whether writing `proposed` into this cell would break its field's
|
|
493
|
+
* validation rule.
|
|
494
|
+
*
|
|
495
|
+
* The companion to {@link mayModifyBlock} for `overrideValidation`: that
|
|
496
|
+
* answers whether this actor may write a violating value, this answers
|
|
497
|
+
* whether the value in hand is a violating one. A host gating a write
|
|
498
|
+
* needs both, and needs them BEFORE the write — the marker on the cell
|
|
499
|
+
* only ever judges a value the cell already holds.
|
|
500
|
+
*
|
|
501
|
+
* Reads nothing into the workbook: the rule is evaluated against the
|
|
502
|
+
* proposed value and the cell is left exactly as it was.
|
|
503
|
+
*/
|
|
504
|
+
checkFieldValidation(params) {
|
|
505
|
+
return rpc('checkFieldValidation', params, this._id);
|
|
506
|
+
}
|
|
442
507
|
/**
|
|
443
508
|
* A block's governance metadata on its own — owner, default policy,
|
|
444
509
|
* per-operation overrides, description. `getBlockInfo` carries the same
|
|
@@ -494,6 +559,67 @@ class Workbook {
|
|
|
494
559
|
getAllBlockFields() {
|
|
495
560
|
return rpc('getAllBlockFields', undefined, this._id);
|
|
496
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
|
+
}
|
|
497
623
|
/**
|
|
498
624
|
* Enumerate blocks across the workbook.
|
|
499
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
|
|
8
|
-
renderIds: readonly string[];
|
|
9
|
+
fields: readonly SchemaFieldSpec[];
|
|
9
10
|
row: boolean;
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
24
|
-
private
|
|
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
|
|
32
|
-
renderIds(value: readonly string[]): this;
|
|
29
|
+
fields(value: readonly SchemaFieldSpec[]): this;
|
|
33
30
|
row(value: boolean): this;
|
|
34
|
-
|
|
35
|
-
|
|
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
|
|
44
|
-
renderIds: readonly string[];
|
|
39
|
+
fields: readonly SchemaFieldSpec[];
|
|
45
40
|
row: boolean;
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
14
|
-
|
|
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
|
-
|
|
49
|
-
this.
|
|
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
|
-
|
|
57
|
-
this.
|
|
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
|
-
|
|
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;
|
|
@@ -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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type BlockOp = 'insertDeleteLines' | 'removeBlock' | 'modifySchema' | 'cellInput' | 'sortByField' | 'modifyDescription';
|
|
1
|
+
export type BlockOp = 'insertDeleteLines' | 'removeBlock' | 'modifySchema' | 'cellInput' | 'sortByField' | 'modifyDescription' | 'overrideValidation';
|
|
@@ -6,6 +6,7 @@ export interface BlockPermissions {
|
|
|
6
6
|
cellInput?: ModifyPolicy;
|
|
7
7
|
sortByField?: ModifyPolicy;
|
|
8
8
|
modifyDescription?: ModifyPolicy;
|
|
9
|
+
overrideValidation?: ModifyPolicy;
|
|
9
10
|
}
|
|
10
11
|
export declare class BlockPermissionsBuilder {
|
|
11
12
|
private _insertDeleteLines?;
|
|
@@ -14,12 +15,14 @@ export declare class BlockPermissionsBuilder {
|
|
|
14
15
|
private _cellInput?;
|
|
15
16
|
private _sortByField?;
|
|
16
17
|
private _modifyDescription?;
|
|
18
|
+
private _overrideValidation?;
|
|
17
19
|
insertDeleteLines(value: ModifyPolicy): this;
|
|
18
20
|
removeBlock(value: ModifyPolicy): this;
|
|
19
21
|
modifySchema(value: ModifyPolicy): this;
|
|
20
22
|
cellInput(value: ModifyPolicy): this;
|
|
21
23
|
sortByField(value: ModifyPolicy): this;
|
|
22
24
|
modifyDescription(value: ModifyPolicy): this;
|
|
25
|
+
overrideValidation(value: ModifyPolicy): this;
|
|
23
26
|
build(): {
|
|
24
27
|
insertDeleteLines: ModifyPolicy | undefined;
|
|
25
28
|
removeBlock: ModifyPolicy | undefined;
|
|
@@ -27,5 +30,6 @@ export declare class BlockPermissionsBuilder {
|
|
|
27
30
|
cellInput: ModifyPolicy | undefined;
|
|
28
31
|
sortByField: ModifyPolicy | undefined;
|
|
29
32
|
modifyDescription: ModifyPolicy | undefined;
|
|
33
|
+
overrideValidation: ModifyPolicy | undefined;
|
|
30
34
|
};
|
|
31
35
|
}
|
|
@@ -8,6 +8,7 @@ class BlockPermissionsBuilder {
|
|
|
8
8
|
_cellInput;
|
|
9
9
|
_sortByField;
|
|
10
10
|
_modifyDescription;
|
|
11
|
+
_overrideValidation;
|
|
11
12
|
insertDeleteLines(value) {
|
|
12
13
|
this._insertDeleteLines = value;
|
|
13
14
|
return this;
|
|
@@ -32,8 +33,12 @@ class BlockPermissionsBuilder {
|
|
|
32
33
|
this._modifyDescription = value;
|
|
33
34
|
return this;
|
|
34
35
|
}
|
|
36
|
+
overrideValidation(value) {
|
|
37
|
+
this._overrideValidation = value;
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
35
40
|
build() {
|
|
36
|
-
return { insertDeleteLines: this._insertDeleteLines, removeBlock: this._removeBlock, modifySchema: this._modifySchema, cellInput: this._cellInput, sortByField: this._sortByField, modifyDescription: this._modifyDescription };
|
|
41
|
+
return { insertDeleteLines: this._insertDeleteLines, removeBlock: this._removeBlock, modifySchema: this._modifySchema, cellInput: this._cellInput, sortByField: this._sortByField, modifyDescription: this._modifyDescription, overrideValidation: this._overrideValidation };
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
44
|
exports.BlockPermissionsBuilder = BlockPermissionsBuilder;
|
|
@@ -2,10 +2,13 @@ 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
|
+
uniqueTogether: readonly UniqueTogetherGroup[];
|
|
11
14
|
}
|
|
@@ -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;
|