@ai-matrx/records 0.8.0 → 0.11.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/CHANGELOG.md +50 -0
- package/dist/core/index.cjs +239 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +150 -3
- package/dist/core/index.d.ts +150 -3
- package/dist/core/index.js +239 -0
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +216 -1
- package/dist/index.d.ts +216 -1
- package/dist/react/index.cjs +310 -0
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +392 -1
- package/dist/react/index.d.ts +392 -1
- package/dist/react/index.js +310 -0
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.d.cts
CHANGED
|
@@ -2599,6 +2599,116 @@ interface FieldPatch {
|
|
|
2599
2599
|
options?: string[];
|
|
2600
2600
|
}
|
|
2601
2601
|
|
|
2602
|
+
/** The seven table types. Only these two carry custom fields (REC-34, DD-011). */
|
|
2603
|
+
type CustomFieldTableType = "entity" | "detail";
|
|
2604
|
+
/** What `custom.entity_table` answers about a registry token. */
|
|
2605
|
+
interface EntityTableFacts {
|
|
2606
|
+
token: string;
|
|
2607
|
+
schema_name: string;
|
|
2608
|
+
table_name: string;
|
|
2609
|
+
type: CustomFieldTableType;
|
|
2610
|
+
title_column: string | null;
|
|
2611
|
+
/** The name a person reads. Never the type word. */
|
|
2612
|
+
label: string;
|
|
2613
|
+
/**
|
|
2614
|
+
* 57 of the 643 have no `organization_id`. They carry the column like every
|
|
2615
|
+
* other one, but a VALUE on them would belong to nobody — the guard finds an
|
|
2616
|
+
* organization's Fields through the row's own `organization_id` — so the
|
|
2617
|
+
* value doors refuse them BY NAME rather than writing something unowned.
|
|
2618
|
+
*/
|
|
2619
|
+
has_organization: boolean;
|
|
2620
|
+
has_deleted_at: boolean;
|
|
2621
|
+
}
|
|
2622
|
+
/** One custom field of a standard row, as the read door hands it back. */
|
|
2623
|
+
interface EntityFieldValue {
|
|
2624
|
+
id: Uuid;
|
|
2625
|
+
key: string;
|
|
2626
|
+
label: string;
|
|
2627
|
+
type: Field["type"];
|
|
2628
|
+
parity_type?: ParityFieldType;
|
|
2629
|
+
format?: string;
|
|
2630
|
+
unit?: string;
|
|
2631
|
+
multi?: boolean;
|
|
2632
|
+
required?: boolean;
|
|
2633
|
+
sort?: number;
|
|
2634
|
+
sensitivity?: Field["sensitivity"];
|
|
2635
|
+
options_table_id?: Uuid;
|
|
2636
|
+
relation_target?: Uuid;
|
|
2637
|
+
/** The value itself, or undefined when this row has none. */
|
|
2638
|
+
value?: unknown;
|
|
2639
|
+
/** VAL-1…VAL-8: who wrote it, when, on whose behalf, in which version. */
|
|
2640
|
+
written?: {
|
|
2641
|
+
ver?: number;
|
|
2642
|
+
actor?: string;
|
|
2643
|
+
on_behalf_of?: string | null;
|
|
2644
|
+
at?: string;
|
|
2645
|
+
src?: unknown;
|
|
2646
|
+
absent?: unknown;
|
|
2647
|
+
alternates?: unknown;
|
|
2648
|
+
dated?: unknown;
|
|
2649
|
+
};
|
|
2650
|
+
}
|
|
2651
|
+
/**
|
|
2652
|
+
* REC-53 IN ONE ANSWER: a standard row is its real columns, plus the base
|
|
2653
|
+
* contract, plus its organization's custom fields — three named blocks, never
|
|
2654
|
+
* one flat bag, so nothing can quietly shadow anything.
|
|
2655
|
+
*/
|
|
2656
|
+
interface EntityRecordRead {
|
|
2657
|
+
token: string;
|
|
2658
|
+
label: string;
|
|
2659
|
+
type: CustomFieldTableType;
|
|
2660
|
+
id: Uuid;
|
|
2661
|
+
organization_id: Uuid;
|
|
2662
|
+
/** The registry's `title_column` of this row, when it has one. */
|
|
2663
|
+
title: string | null;
|
|
2664
|
+
/** The row's own columns, `custom_fields` removed. */
|
|
2665
|
+
columns: Record<string, unknown>;
|
|
2666
|
+
/** The custom values, by key. */
|
|
2667
|
+
custom: Record<string, unknown>;
|
|
2668
|
+
/** Their envelopes, by key. */
|
|
2669
|
+
custom_written: Record<string, EntityFieldValue["written"]>;
|
|
2670
|
+
/** The definitions, in the organization's own sort order, each with its value. */
|
|
2671
|
+
fields: EntityFieldValue[];
|
|
2672
|
+
live: boolean;
|
|
2673
|
+
}
|
|
2674
|
+
/** One row the filter matched. */
|
|
2675
|
+
interface EntityRecordMatch {
|
|
2676
|
+
id: Uuid;
|
|
2677
|
+
title: string | null;
|
|
2678
|
+
value: unknown;
|
|
2679
|
+
}
|
|
2680
|
+
interface EntityRecordsFound {
|
|
2681
|
+
token: string;
|
|
2682
|
+
label: string;
|
|
2683
|
+
key: string;
|
|
2684
|
+
value: unknown;
|
|
2685
|
+
rows: EntityRecordMatch[];
|
|
2686
|
+
count: number;
|
|
2687
|
+
}
|
|
2688
|
+
/**
|
|
2689
|
+
* What a person knows when they add a column. The SAME spec `fieldDeclare`
|
|
2690
|
+
* takes for a custom table — the store turns it into the document its guards
|
|
2691
|
+
* demand, so a standard table gets the whole type vocabulary rather than a
|
|
2692
|
+
* second, poorer one.
|
|
2693
|
+
*/
|
|
2694
|
+
type NewEntityFieldDeclaration = Record<string, unknown> & {
|
|
2695
|
+
label: string;
|
|
2696
|
+
type?: string;
|
|
2697
|
+
options?: string[];
|
|
2698
|
+
};
|
|
2699
|
+
/**
|
|
2700
|
+
* SCR-12. May this person add a column to this standard table, and if not, the
|
|
2701
|
+
* sentence saying why — so the control is ABSENT with a reason rather than dead
|
|
2702
|
+
* when pressed. Filling in the fields that already exist is not admin work.
|
|
2703
|
+
*/
|
|
2704
|
+
interface EntityFieldRights {
|
|
2705
|
+
token: string;
|
|
2706
|
+
label: string;
|
|
2707
|
+
may_declare: boolean;
|
|
2708
|
+
reason: string | null;
|
|
2709
|
+
may_fill_in: boolean;
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2602
2712
|
/**
|
|
2603
2713
|
* A rule expression as `custom.rule_eval` ACTUALLY evaluates it — read off the
|
|
2604
2714
|
* door's own body, not invented here. A leaf is the node's name carrying its
|
|
@@ -3099,6 +3209,111 @@ interface AnonTokenBinding {
|
|
|
3099
3209
|
record_id: Uuid | null;
|
|
3100
3210
|
mode: "read" | "write";
|
|
3101
3211
|
}
|
|
3212
|
+
/** The three things that land in the one inbox. Closed, one word each. */
|
|
3213
|
+
type WorkInboxKind = "assignment" | "approval" | "proposal";
|
|
3214
|
+
/** Who filed it: a colleague, or an agent acting for one. */
|
|
3215
|
+
type WorkOrigin = "person" | "agent";
|
|
3216
|
+
/** Where a due date stands, in the store's own words. */
|
|
3217
|
+
type WorkDueState = "overdue" | "due_today" | "scheduled" | "undated" | "finished";
|
|
3218
|
+
/** One row of `custom.work_inbox` — the SAME shape whichever of the three it is. */
|
|
3219
|
+
interface WorkInboxItem {
|
|
3220
|
+
item_id: Uuid;
|
|
3221
|
+
kind: WorkInboxKind;
|
|
3222
|
+
origin: WorkOrigin;
|
|
3223
|
+
title: string;
|
|
3224
|
+
subject_id: Uuid | null;
|
|
3225
|
+
subject_kind: string;
|
|
3226
|
+
summary: string | null;
|
|
3227
|
+
state: string;
|
|
3228
|
+
due_on: Timestamp | null;
|
|
3229
|
+
due_state: WorkDueState | null;
|
|
3230
|
+
/** False for a decided row a person asked to see. A screen shows it, inert. */
|
|
3231
|
+
actionable: boolean;
|
|
3232
|
+
requested_by: Uuid | null;
|
|
3233
|
+
requested_by_name: string | null;
|
|
3234
|
+
at: Timestamp;
|
|
3235
|
+
}
|
|
3236
|
+
/** Which of the three lists `custom.work_list` answers. */
|
|
3237
|
+
type WorkListFlavour = "mine" | "assigned" | "unassigned";
|
|
3238
|
+
/** One row of `custom.work_list`: a record, whose it is, and where it is up to. */
|
|
3239
|
+
interface WorkListItem {
|
|
3240
|
+
record_id: Uuid;
|
|
3241
|
+
table_id: Uuid;
|
|
3242
|
+
table_name: string | null;
|
|
3243
|
+
title: string | null;
|
|
3244
|
+
assignee_id: Uuid | null;
|
|
3245
|
+
assignee_name: string | null;
|
|
3246
|
+
assignee_user_id: Uuid | null;
|
|
3247
|
+
due_on: Timestamp | null;
|
|
3248
|
+
due_state: WorkDueState;
|
|
3249
|
+
status: string | null;
|
|
3250
|
+
terminal: boolean;
|
|
3251
|
+
assigned_by: Uuid | null;
|
|
3252
|
+
updated_at: Timestamp;
|
|
3253
|
+
}
|
|
3254
|
+
/**
|
|
3255
|
+
* One state a record may be moved to, with the model's own answer about whether
|
|
3256
|
+
* it may — and, when it may not, the sentence saying why. A screen offers what
|
|
3257
|
+
* is allowed and explains what is not; it never renders a dead control.
|
|
3258
|
+
*/
|
|
3259
|
+
interface WorkRecordState {
|
|
3260
|
+
state_id: Uuid;
|
|
3261
|
+
name: string;
|
|
3262
|
+
sort: number;
|
|
3263
|
+
terminal: boolean;
|
|
3264
|
+
is_current: boolean;
|
|
3265
|
+
allowed: boolean;
|
|
3266
|
+
refusal: string | null;
|
|
3267
|
+
}
|
|
3268
|
+
/** The change a pending approval carries. Two kinds, because two can be applied. */
|
|
3269
|
+
type WorkChange = {
|
|
3270
|
+
kind: "record_patch";
|
|
3271
|
+
patch: Record<string, unknown>;
|
|
3272
|
+
} | {
|
|
3273
|
+
kind: "field_add";
|
|
3274
|
+
field: Record<string, unknown>;
|
|
3275
|
+
};
|
|
3276
|
+
/** Somebody who may decide a particular request, and the reason they may. */
|
|
3277
|
+
interface WorkApprover {
|
|
3278
|
+
user_id: Uuid;
|
|
3279
|
+
name: string;
|
|
3280
|
+
why: string;
|
|
3281
|
+
}
|
|
3282
|
+
/** What `custom.work_approval_request` answers: it is filed, and who it waits on. */
|
|
3283
|
+
interface WorkApprovalFiled {
|
|
3284
|
+
approval_id: Uuid;
|
|
3285
|
+
state: "pending";
|
|
3286
|
+
subject_id: Uuid;
|
|
3287
|
+
subject_kind: string;
|
|
3288
|
+
origin: WorkOrigin;
|
|
3289
|
+
approvers: WorkApprover[];
|
|
3290
|
+
message: string;
|
|
3291
|
+
}
|
|
3292
|
+
/** What a decision answers — including whether the change was actually made. */
|
|
3293
|
+
interface WorkApprovalDecision {
|
|
3294
|
+
approval_id: Uuid;
|
|
3295
|
+
state: "approved" | "declined";
|
|
3296
|
+
subject_id: Uuid;
|
|
3297
|
+
/** The whole point: approving APPLIES the change, in the same transaction. */
|
|
3298
|
+
applied: boolean;
|
|
3299
|
+
field_id: Uuid | null;
|
|
3300
|
+
version: number | null;
|
|
3301
|
+
message: string;
|
|
3302
|
+
}
|
|
3303
|
+
/** What `custom.work_assign` answers: the value, the access, and who holds it now. */
|
|
3304
|
+
interface WorkAssignment {
|
|
3305
|
+
record_id: Uuid;
|
|
3306
|
+
assigned: boolean;
|
|
3307
|
+
assignee: Uuid | null;
|
|
3308
|
+
assignee_user_id: Uuid | null;
|
|
3309
|
+
assignee_name: string | null;
|
|
3310
|
+
was: Uuid | null;
|
|
3311
|
+
due_date: Timestamp | null;
|
|
3312
|
+
version: number | null;
|
|
3313
|
+
/** The share sentence, or why nothing was taken away when un-assigning. */
|
|
3314
|
+
access: string;
|
|
3315
|
+
message: string;
|
|
3316
|
+
}
|
|
3102
3317
|
|
|
3103
3318
|
/**
|
|
3104
3319
|
* VIS-31. A signed-in OUTSIDER, with the reason in plain English.
|
|
@@ -3563,6 +3778,51 @@ interface RecordsClient {
|
|
|
3563
3778
|
fieldRetire(args: {
|
|
3564
3779
|
field_id: Uuid;
|
|
3565
3780
|
}): Promise<RecordsResult<boolean>>;
|
|
3781
|
+
/** What the registry says about a token, and whether it can hold a value at all. */
|
|
3782
|
+
entityTable(args: {
|
|
3783
|
+
token: string;
|
|
3784
|
+
}): Promise<RecordsResult<EntityTableFacts>>;
|
|
3785
|
+
/** The fields THIS organization added to that standard table. */
|
|
3786
|
+
entityFields(args: {
|
|
3787
|
+
token: string;
|
|
3788
|
+
}): Promise<RecordsResult<Field[]>>;
|
|
3789
|
+
/** Add a column to a standard table. An organization admin's right - it changes the table for everybody. */
|
|
3790
|
+
entityFieldDeclare(args: {
|
|
3791
|
+
token: string;
|
|
3792
|
+
spec: NewEntityFieldDeclaration;
|
|
3793
|
+
}): Promise<RecordsResult<Uuid>>;
|
|
3794
|
+
/** One field's own settings. A TYPE change is refused here by name, as it is on a custom table. */
|
|
3795
|
+
entityFieldUpdate(args: {
|
|
3796
|
+
field_id: Uuid;
|
|
3797
|
+
patch: Record<string, unknown>;
|
|
3798
|
+
}): Promise<RecordsResult<Uuid>>;
|
|
3799
|
+
/** Take a custom field off a standard table. The values already written stay in each row. */
|
|
3800
|
+
entityFieldRetire(args: {
|
|
3801
|
+
field_id: Uuid;
|
|
3802
|
+
}): Promise<RecordsResult<Uuid>>;
|
|
3803
|
+
/** May this person add a column here - and if not, the store's own sentence saying why. */
|
|
3804
|
+
entityFieldRights(args: {
|
|
3805
|
+
token: string;
|
|
3806
|
+
}): Promise<RecordsResult<EntityFieldRights>>;
|
|
3807
|
+
/** REC-53 in one answer: the row's real columns AND its custom values AND the definitions. */
|
|
3808
|
+
entityRecordRead(args: {
|
|
3809
|
+
token: string;
|
|
3810
|
+
record_id: Uuid;
|
|
3811
|
+
}): Promise<RecordsResult<EntityRecordRead>>;
|
|
3812
|
+
/** A patch: a key left out is left alone, a key set to null is cleared with its envelope. */
|
|
3813
|
+
entityValueWrite(args: {
|
|
3814
|
+
token: string;
|
|
3815
|
+
record_id: Uuid;
|
|
3816
|
+
patch: Record<string, unknown>;
|
|
3817
|
+
}): Promise<RecordsResult<EntityRecordRead>>;
|
|
3818
|
+
/** Rows of that standard table with this custom value. Refuses a field nobody declared. */
|
|
3819
|
+
entityRecordsFind(args: {
|
|
3820
|
+
token: string;
|
|
3821
|
+
key: string;
|
|
3822
|
+
value?: unknown;
|
|
3823
|
+
limit?: number;
|
|
3824
|
+
offset?: number;
|
|
3825
|
+
}): Promise<RecordsResult<EntityRecordsFound>>;
|
|
3566
3826
|
/** The kernel Tables a caller writes a Home, a Field or a Rule into. */
|
|
3567
3827
|
personKernelId(): Promise<RecordsResult<Uuid>>;
|
|
3568
3828
|
fieldKernelId(): Promise<RecordsResult<Uuid>>;
|
|
@@ -3846,6 +4106,86 @@ interface RecordsClient {
|
|
|
3846
4106
|
workSlotExpire(args: {
|
|
3847
4107
|
table_id: Uuid;
|
|
3848
4108
|
}): Promise<RecordsResult<number>>;
|
|
4109
|
+
/**
|
|
4110
|
+
* THE ONE INBOX. Assignments, approvals and the agent's proposals, in one
|
|
4111
|
+
* ordered list with ONE row shape — PRODUCTS.md row 6. A second queue for the
|
|
4112
|
+
* agent's suggestions is the thing this replaces.
|
|
4113
|
+
*/
|
|
4114
|
+
workInbox(args?: {
|
|
4115
|
+
limit?: number;
|
|
4116
|
+
offset?: number;
|
|
4117
|
+
includeDecided?: boolean;
|
|
4118
|
+
}): Promise<RecordsResult<WorkInboxItem[]>>;
|
|
4119
|
+
/** "My work", "work I assigned", "waiting on somebody being chosen". */
|
|
4120
|
+
workList(args?: {
|
|
4121
|
+
flavour?: WorkListFlavour;
|
|
4122
|
+
includeFinished?: boolean;
|
|
4123
|
+
limit?: number;
|
|
4124
|
+
offset?: number;
|
|
4125
|
+
}): Promise<RecordsResult<WorkListItem[]>>;
|
|
4126
|
+
/**
|
|
4127
|
+
* Give one record to one person: the Assignee value AND editor access, in one
|
|
4128
|
+
* transaction. Passing no `user_id` un-assigns and says plainly that nobody's
|
|
4129
|
+
* access was taken away.
|
|
4130
|
+
*/
|
|
4131
|
+
workAssign(args: {
|
|
4132
|
+
record_id: Uuid;
|
|
4133
|
+
user_id?: Uuid | null;
|
|
4134
|
+
dueDate?: string | null;
|
|
4135
|
+
clearDue?: boolean;
|
|
4136
|
+
}): Promise<RecordsResult<WorkAssignment>>;
|
|
4137
|
+
/** The states this record may be moved to, and the sentence for each it may not. */
|
|
4138
|
+
workRecordStates(args: {
|
|
4139
|
+
record_id: Uuid;
|
|
4140
|
+
}): Promise<RecordsResult<WorkRecordState[]>>;
|
|
4141
|
+
/** Move it. The store refuses a move the model forbids, in its own words. */
|
|
4142
|
+
workSetState(args: {
|
|
4143
|
+
record_id: Uuid;
|
|
4144
|
+
state_id: Uuid | null;
|
|
4145
|
+
}): Promise<RecordsResult<unknown>>;
|
|
4146
|
+
/** The person-kernel record standing for a signed-in person here. */
|
|
4147
|
+
workPerson(args: {
|
|
4148
|
+
user_id: Uuid;
|
|
4149
|
+
create?: boolean;
|
|
4150
|
+
}): Promise<RecordsResult<Uuid | null>>;
|
|
4151
|
+
/** The templates this person may run, so a picker has ids to offer. */
|
|
4152
|
+
workTemplates(args?: {
|
|
4153
|
+
limit?: number;
|
|
4154
|
+
}): Promise<RecordsResult<Array<{
|
|
4155
|
+
template_id: Uuid;
|
|
4156
|
+
name: string;
|
|
4157
|
+
nodes: number;
|
|
4158
|
+
relations: number;
|
|
4159
|
+
created_at: string;
|
|
4160
|
+
}>>>;
|
|
4161
|
+
/** Who may decide a change about this subject, and why each of them may. */
|
|
4162
|
+
workApprovalApprovers(args: {
|
|
4163
|
+
subject_id: Uuid | null;
|
|
4164
|
+
approver_id?: Uuid | null;
|
|
4165
|
+
}): Promise<RecordsResult<WorkApprover[]>>;
|
|
4166
|
+
/** Ask for a change instead of making it. Viewer on the subject is enough to ASK. */
|
|
4167
|
+
workApprovalRequest(args: {
|
|
4168
|
+
subject_id: Uuid;
|
|
4169
|
+
change: WorkChange;
|
|
4170
|
+
note?: string | null;
|
|
4171
|
+
approver_id?: Uuid | null;
|
|
4172
|
+
origin?: "person" | "agent";
|
|
4173
|
+
conversation_id?: Uuid | null;
|
|
4174
|
+
}): Promise<RecordsResult<WorkApprovalFiled>>;
|
|
4175
|
+
/** Whether THIS person may decide THIS one — so a screen never draws a dead button. */
|
|
4176
|
+
workApprovalMayDecide(args: {
|
|
4177
|
+
approval_id: Uuid;
|
|
4178
|
+
}): Promise<RecordsResult<boolean>>;
|
|
4179
|
+
/** Approve or decline. Approving APPLIES the change, as the person approving. */
|
|
4180
|
+
workApprovalDecide(args: {
|
|
4181
|
+
approval_id: Uuid;
|
|
4182
|
+
approve: boolean;
|
|
4183
|
+
note?: string | null;
|
|
4184
|
+
}): Promise<RecordsResult<WorkApprovalDecision>>;
|
|
4185
|
+
/** One waiting change in full, for the person deciding it or the one who asked. */
|
|
4186
|
+
workApprovalRead(args: {
|
|
4187
|
+
approval_id: Uuid;
|
|
4188
|
+
}): Promise<RecordsResult<Record<string, unknown>>>;
|
|
3849
4189
|
/** VIS-31. Is this account a signed-in outsider — no NON-personal organization? */
|
|
3850
4190
|
isExternalPrincipal(args?: {
|
|
3851
4191
|
user_id?: Uuid | null;
|
|
@@ -4058,6 +4398,57 @@ interface UseFieldMutation {
|
|
|
4058
4398
|
* has not declared. A screen that reached for the record writer here is the
|
|
4059
4399
|
* screen that spent 19 September refusing every column a person tried to add.
|
|
4060
4400
|
*/
|
|
4401
|
+
/**
|
|
4402
|
+
* A STANDARD BUSINESS TABLE'S CUSTOM FIELDS, by its registry token.
|
|
4403
|
+
*
|
|
4404
|
+
* `useFields(tableId)` is about one of YOUR OWN tables. This is the other half:
|
|
4405
|
+
* the fields an organization added to a CRM contact, a deal, a note - any of the
|
|
4406
|
+
* 643 tables the registry types Entity or Detail - and there is no per-entity
|
|
4407
|
+
* code here or in any screen that uses it.
|
|
4408
|
+
*/
|
|
4409
|
+
declare function useEntityFields(token: string | null): Async<Field[]>;
|
|
4410
|
+
/**
|
|
4411
|
+
* REC-53 in one answer: a standard row's real columns AND its organization's
|
|
4412
|
+
* custom values AND the definitions that describe them. A row the person may
|
|
4413
|
+
* not open comes back as the store's own refusal, because the door reads it AS
|
|
4414
|
+
* them through the table's own row-level security.
|
|
4415
|
+
*/
|
|
4416
|
+
declare function useEntityRecord(token: string | null, recordId: Uuid | null): Async<EntityRecordRead | null>;
|
|
4417
|
+
/** What the registry says about a token - and whether it can hold a value at all. */
|
|
4418
|
+
declare function useEntityTable(token: string | null): Async<EntityTableFacts | null>;
|
|
4419
|
+
/** SCR-12: the answer a screen needs to make "Add field" absent-or-honest. */
|
|
4420
|
+
declare function useEntityFieldRights(token: string | null): Async<EntityFieldRights | null>;
|
|
4421
|
+
interface UseEntityFieldMutation {
|
|
4422
|
+
/** Add a column to a standard table. Refused for anybody but an organization admin. */
|
|
4423
|
+
declare: (args: {
|
|
4424
|
+
token: string;
|
|
4425
|
+
spec: NewEntityFieldDeclaration;
|
|
4426
|
+
}) => Promise<Uuid | null>;
|
|
4427
|
+
update: (args: {
|
|
4428
|
+
field_id: Uuid;
|
|
4429
|
+
patch: Record<string, unknown>;
|
|
4430
|
+
}) => Promise<Uuid | null>;
|
|
4431
|
+
retire: (args: {
|
|
4432
|
+
field_id: Uuid;
|
|
4433
|
+
}) => Promise<Uuid | null>;
|
|
4434
|
+
/** Set custom values on one standard row. A key left out is left alone. */
|
|
4435
|
+
write: (args: {
|
|
4436
|
+
token: string;
|
|
4437
|
+
record_id: Uuid;
|
|
4438
|
+
patch: Record<string, unknown>;
|
|
4439
|
+
}) => Promise<EntityRecordRead | null>;
|
|
4440
|
+
saving: boolean;
|
|
4441
|
+
error: RecordsError | null;
|
|
4442
|
+
clearError: () => void;
|
|
4443
|
+
}
|
|
4444
|
+
/**
|
|
4445
|
+
* Changing a standard table's custom fields, and filling them in. Deliberately
|
|
4446
|
+
* ONE hook for both, because the store keeps them the same way: the definition
|
|
4447
|
+
* is a record in the field kernel and the value is in the row's own
|
|
4448
|
+
* `custom_fields` column, and a screen that had two mutation hooks would have
|
|
4449
|
+
* two places to get the refusal wording from.
|
|
4450
|
+
*/
|
|
4451
|
+
declare function useEntityFieldMutation(): UseEntityFieldMutation;
|
|
4061
4452
|
declare function useFieldMutation(): UseFieldMutation;
|
|
4062
4453
|
/**
|
|
4063
4454
|
* DYN-14 / AGT-N-7. A merge field's value — and while the resolver's server half
|
|
@@ -4066,4 +4457,4 @@ declare function useFieldMutation(): UseFieldMutation;
|
|
|
4066
4457
|
*/
|
|
4067
4458
|
declare function useMergeField(key: string | null, state?: Record<string, unknown>): MergeFieldResolution | null;
|
|
4068
4459
|
|
|
4069
|
-
export { ABSENCE_REASONS, ACTOR_VOCABULARY, type AbsenceReason, type Actor, type AggregateBucket, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AnonTokenBinding, COMPUTE_ON, CONTEXT_POLICIES, type ComputeOn, type ContextPolicy, DELIVERIES, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityToken, type ExternalPrincipalCard, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type ForbiddenEnvelopeWord, type FormSummary, type Freshness, type HiddenFieldNotice, type Home, KERNEL_TABLES, type KernelTableName, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, type MergeField, type MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, type MergeFieldSemanticType, type MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PgError, type PredictedRefusal, type ProvenancePointer, type PublishBinding, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordDocument, type RecordRead, type RecordRevision, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, RecordsProvider, type RecordsProviderProps, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RetiredActorWord, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type Subscription, type SubscriptionBlock, type SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableCapacity, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type Timestamp, type UseFieldMutation, type UseRecordMutation, type UseRecordsOptions, type UseRecordsState, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type WorkAssignmentField, type WorkGraph, type WorkInstantiation, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, asPermissionLevel, atLeast, err, highestLevel, isRecordsErr, measureKey, ok, publicFormPath, useFieldMutation, useFields, useMergeField, useMyLevel, useMyLevels, useOptionalRecordsClient, useRecord, useRecordMutation, useRecords, useRecordsActor, useRecordsClient, useTable, useTables };
|
|
4460
|
+
export { ABSENCE_REASONS, ACTOR_VOCABULARY, type AbsenceReason, type Actor, type AggregateBucket, type AggregateMeasure, type AggregateOperation, type AggregateRow, type AnonTokenBinding, COMPUTE_ON, CONTEXT_POLICIES, type ComputeOn, type ContextPolicy, type CustomFieldTableType, DELIVERIES, type Delivery, type DocRenderRow, type DocSignatureCheck, type DocSignatureRow, type DocTemplateRow, type DocToken, type DocUnresolvedToken, ENTITY_TOKENS, type EntityFieldRights, type EntityFieldValue, type EntityRecordMatch, type EntityRecordRead, type EntityRecordsFound, type EntityTableFacts, type EntityToken, type ExternalPrincipalCard, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, type Field, type FieldBehavior, type FieldPatch, type FieldProposal, type FieldRule, type FieldSensitivity, type FieldSource, type ForbiddenEnvelopeWord, type FormSummary, type Freshness, type HiddenFieldNotice, type Home, KERNEL_TABLES, type KernelTableName, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, type MergeField, type MergeFieldModifier, type MergeFieldProvenance, type MergeFieldResolution, type MergeFieldSemanticType, type MergeFieldSource, type MergeFieldTransform, type MissingBehavior, type MyLevel, type NewEntityFieldDeclaration, type NewFieldDeclaration, ON_DELETE, OVERRIDE_POLICIES, type OnDelete, type OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, type ParityFieldType, type ParityFieldTypeDescriptor, type PerValueAccessWord, type PermissionLevel, type PgError, type PredictedRefusal, type ProvenancePointer, type PublishBinding, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, type ReadRow, type ReadValue, type RecordDocument, type RecordRead, type RecordRevision, type RecordsActor, type RecordsConfig, type RecordsDataSource, type RecordsError, type RecordsErrorCode, type RecordsErrorSink, type RecordsFilter, RecordsProvider, type RecordsProviderProps, type RecordsRealtimePort, type RecordsResolverPort, type RecordsResponse, type RecordsResult, type RecordsTableQuery, type RegisteredTable, type Relation, type RelationBinding, type RelationCardinality, type RelationCarries, type RelationCoordinate, type RelationFlavor, type RelationProperties, type RelationTarget, type ResolutionTriple, type ResolvedPublishBinding, type RetiredActorWord, type Rule, type RuleAnswer, type RuleExpression, type RuleNodeKind, type RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, type StaleWriteDetail, type StorageMode, type StoreDoorName, type StoreRefusalCode, type StoredRecord, type Subscription, type SubscriptionBlock, type SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, type Table, type TableCapacity, type TableDisplay, type TableOrigin, type TableProposal, type TableType, type Timestamp, type UseEntityFieldMutation, type UseFieldMutation, type UseRecordMutation, type UseRecordsOptions, type UseRecordsState, type Uuid, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, type ValueAlternate, type ValueAlternateKey, type ValueEnvelope, type ValueEnvelopeKey, type ValueSource, type WorkApprovalDecision, type WorkApprovalFiled, type WorkApprover, type WorkAssignment, type WorkAssignmentField, type WorkChange, type WorkDueState, type WorkGraph, type WorkInboxItem, type WorkInboxKind, type WorkInstantiation, type WorkListFlavour, type WorkListItem, type WorkOrigin, type WorkRecordState, type WorkSlotHold, type WorkState, type WorkTemplateNode, type WorkTemplateRelation, type WorkTurn, type WriteConflict, asPermissionLevel, atLeast, err, highestLevel, isRecordsErr, measureKey, ok, publicFormPath, useEntityFieldMutation, useEntityFieldRights, useEntityFields, useEntityRecord, useEntityTable, useFieldMutation, useFields, useMergeField, useMyLevel, useMyLevels, useOptionalRecordsClient, useRecord, useRecordMutation, useRecords, useRecordsActor, useRecordsClient, useTable, useTables };
|