@ai-matrx/records 0.11.0 → 0.16.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.
@@ -1,5 +1,5 @@
1
- import { Timestamp, Uuid, RelationCoordinate, RecordsConfig, RecordDocument, RecordsResult, RecordRead, ReadRow, Table, Field, StoredRecord, TableCapacity, NewFieldDeclaration, FieldPatch, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, FormSummary, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, DocToken, DocUnresolvedToken, DocTemplateRow, DocRenderRow, DocSignatureRow, RecordRevision, ReadValue, AnonTokenBinding, WorkState, WorkGraph, WorkInstantiation, WorkTurn, WorkAssignmentField, WorkSlotHold, WorkInboxItem, WorkListFlavour, WorkListItem, WorkAssignment, WorkRecordState, WorkApprover, WorkChange, WorkApprovalFiled, WorkApprovalDecision, ExternalPrincipalCard, PublishBinding, ResolvedPublishBinding, FieldProposal, TableProposal, MyLevel, RecordsError, WriteConflict, PgError, RecordsDataSource, StaleWriteDetail, PredictedRefusal } from '../index.cjs';
2
- export { ABSENCE_REASONS, ACTOR_VOCABULARY, AbsenceReason, Actor, AggregateOperation, COMPUTE_ON, CONTEXT_POLICIES, ComputeOn, ContextPolicy, CustomFieldTableType, DELIVERIES, Delivery, DocSignatureCheck, ENTITY_TOKENS, EntityFieldValue, EntityRecordMatch, EntityToken, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, FieldBehavior, FieldRule, FieldSensitivity, FieldSource, ForbiddenEnvelopeWord, Freshness, HiddenFieldNotice, Home, KERNEL_TABLES, KernelTableName, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, MergeField, MergeFieldModifier, MergeFieldProvenance, MergeFieldResolution, MergeFieldSemanticType, MergeFieldSource, MergeFieldTransform, MissingBehavior, ON_DELETE, OVERRIDE_POLICIES, OnDelete, OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, ParityFieldType, ParityFieldTypeDescriptor, PerValueAccessWord, PermissionLevel, ProvenancePointer, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, RecordsActor, RecordsErrorCode, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationBinding, RelationCardinality, RelationCarries, RelationFlavor, RelationProperties, RelationTarget, ResolutionTriple, RetiredActorWord, Rule, RuleAnswer, RuleExpression, RuleNodeKind, RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, StorageMode, StoreDoorName, StoreRefusalCode, SubscriptionBlock, SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, TableDisplay, TableOrigin, TableType, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, ValueAlternate, ValueAlternateKey, ValueEnvelope, ValueEnvelopeKey, ValueSource, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, asPermissionLevel, atLeast, err, highestLevel, isRecordsErr, measureKey, ok, publicFormPath } from '../index.cjs';
1
+ import { Timestamp, Uuid, RelationCoordinate, RecordsConfig, RecordDocument, RecordsResult, RecordRead, ReadRow, Table, Field, StoredRecord, TableCapacity, NewFieldDeclaration, FieldPatch, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, FormSummary, PortalSummary, PortalCard, PortalInvitation, PortalRevocation, PortalPreviewRow, DashboardSummary, DashboardBlock, AggregateFilter, DashboardRunResult, StuckRow, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, MySubscription, DocToken, DocUnresolvedToken, DocTemplateRow, DocRenderRow, DocSignatureRow, RecordRevision, ReadValue, AnonTokenBinding, WorkState, WorkGraph, WorkInstantiation, WorkTurn, WorkAssignmentField, WorkSlotHold, WorkInboxItem, WorkListFlavour, WorkListItem, WorkAssignment, WorkRecordState, WorkApprover, WorkChange, WorkApprovalFiled, WorkApprovalDecision, ExternalPrincipalCard, PublishBinding, ResolvedPublishBinding, FieldProposal, TableProposal, MyLevel, RecordsError, WriteConflict, PgError, RecordsDataSource, StaleWriteDetail, PredictedRefusal } from '../index.cjs';
2
+ export { ABSENCE_REASONS, ACTOR_VOCABULARY, AbsenceReason, Actor, AggregateOperation, AggregateWindow, COMPUTE_ON, CONTEXT_POLICIES, ChoiceOption, ComputeOn, ContextPolicy, CustomFieldTableType, DELIVERIES, DashboardBlockKind, DashboardBlockResult, Delivery, DocSignatureCheck, ENTITY_TOKENS, EntityFieldValue, EntityRecordMatch, EntityToken, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, FieldBehavior, FieldRule, FieldSensitivity, FieldSource, FieldTypeWord, ForbiddenEnvelopeWord, Freshness, HiddenFieldNotice, Home, KERNEL_TABLES, KernelTableName, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, MergeField, MergeFieldModifier, MergeFieldProvenance, MergeFieldResolution, MergeFieldSemanticType, MergeFieldSource, MergeFieldTransform, MissingBehavior, ON_DELETE, OVERRIDE_POLICIES, OnDelete, OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, ParityFieldType, ParityFieldTypeDescriptor, PerValueAccessWord, PermissionLevel, PortalPrincipal, PortalTableExposure, ProvenancePointer, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, RecordsActor, RecordsErrorCode, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationBinding, RelationCardinality, RelationCarries, RelationFlavor, RelationProperties, RelationTarget, ResolutionTriple, RetiredActorWord, Rule, RuleAnswer, RuleExpression, RuleNodeKind, RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, StorageMode, StoreDoorName, StoreRefusalCode, SubscriptionBlock, SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, TableDisplay, TableOrigin, TableType, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, ValueAlternate, ValueAlternateKey, ValueEnvelope, ValueEnvelopeKey, ValueSource, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, asPermissionLevel, atLeast, choiceSlug, choiceValuesOf, choicesOf, err, highestLevel, holdsARetiredChoice, isRecordsErr, isTheChosen, looksLikeAnId, measureKey, ok, optionKey, optionLabel, portalPath, publicFormPath } from '../index.cjs';
3
3
 
4
4
  /**
5
5
  * DOOR-8. As-of on EITHER clock, and they are different questions:
@@ -272,6 +272,99 @@ interface RecordsClient {
272
272
  form_id?: Uuid | null;
273
273
  slug?: string | null;
274
274
  }): Promise<RecordsResult<Uuid>>;
275
+ /** Every portal over this organization the caller may know about, with its numbers. */
276
+ portals(): Promise<RecordsResult<PortalSummary[]>>;
277
+ /** ONE portal in full: what it shows, and who it was opened to. */
278
+ portalCard(args: {
279
+ portal_id: Uuid;
280
+ }): Promise<RecordsResult<PortalCard>>;
281
+ /**
282
+ * Create or RE-STATE one portal. Re-stating REPLACES what it exposes — a
283
+ * Table left out of `tables` stops being exposed in the same act — and leaves
284
+ * the people alone: who is invited is not part of what the portal shows.
285
+ */
286
+ portalDeclare(args: {
287
+ title: string;
288
+ client_table_id: Uuid;
289
+ tables: Array<{
290
+ table_id: Uuid;
291
+ names_via: string;
292
+ visible_fields?: string[];
293
+ editable_fields?: string[];
294
+ comments?: boolean;
295
+ }>;
296
+ portal_id?: Uuid | null;
297
+ slug?: string | null;
298
+ sign_in_method?: string | null;
299
+ }): Promise<RecordsResult<Uuid>>;
300
+ /**
301
+ * Invite one person, as one record of the portal's client Table.
302
+ *
303
+ * `user_id` is deliberately NOT a parameter here. From a screen it is always
304
+ * null: an invitation confers NOTHING until the person follows their sign-in
305
+ * link and the platform gives them an identity, and the door's own `say`
306
+ * sentence states exactly that. A screen that passed an id would be granting
307
+ * access on somebody else's behalf.
308
+ */
309
+ portalInvite(args: {
310
+ portal_id: Uuid;
311
+ client_record_id: Uuid;
312
+ email: string;
313
+ }): Promise<RecordsResult<PortalInvitation>>;
314
+ /** Take one person's way in away. The answer's `say` names the consequence. */
315
+ portalRevoke(args: {
316
+ portal_id: Uuid;
317
+ principal_id: Uuid;
318
+ }): Promise<RecordsResult<PortalRevocation>>;
319
+ /**
320
+ * VIEW AS THIS CLIENT. The door asks `custom.visible_set` for HER user id —
321
+ * the same call `custom.read_records` makes when she opens the page — so this
322
+ * cannot disagree with what she sees. It REFUSES with `02000` and a sentence
323
+ * when she has not signed in yet; show the sentence, never an empty list.
324
+ */
325
+ portalPreview(args: {
326
+ portal_id: Uuid;
327
+ principal_id: Uuid;
328
+ table_id: Uuid;
329
+ }): Promise<RecordsResult<PortalPreviewRow[]>>;
330
+ /** This organization's dashboards, optionally only those whose subject is one Table. */
331
+ dashboards(args?: {
332
+ table_id?: Uuid | null;
333
+ }): Promise<RecordsResult<DashboardSummary[]>>;
334
+ /**
335
+ * Create or re-state one dashboard. Every block is judged on the way IN —
336
+ * a block naming a field this Table does not have is refused BY NAME, with
337
+ * the table's own field list in the hint — so a canvas cannot be saved broken.
338
+ */
339
+ dashboardDeclare(args: {
340
+ table_id: Uuid;
341
+ name: string;
342
+ blocks?: DashboardBlock[];
343
+ presentation?: Record<string, unknown> | null;
344
+ dashboard_id?: Uuid | null;
345
+ }): Promise<RecordsResult<Uuid>>;
346
+ /**
347
+ * Run every block and answer the numbers. `filter` is the ONE filter bar
348
+ * across the canvas: it is merged UNDER each block's own filter, so a block
349
+ * deliberately scoped to one stage stays scoped while the bar moves the rest.
350
+ * A block that refuses carries the store's sentence and the others still answer.
351
+ */
352
+ dashboardRun(args: {
353
+ dashboard_id: Uuid;
354
+ filter?: Record<string, AggregateFilter>;
355
+ }): Promise<RecordsResult<DashboardRunResult>>;
356
+ /** The seventh block kind on its own: records that have sat on the same value too long. */
357
+ dashboardStuck(args: {
358
+ table_id: Uuid;
359
+ state_key: string;
360
+ days?: number;
361
+ filter?: Record<string, AggregateFilter>;
362
+ limit?: number;
363
+ }): Promise<RecordsResult<StuckRow[]>>;
364
+ /** Take a dashboard away. The records it counted are untouched — a canvas owns nothing. */
365
+ dashboardDelete(args: {
366
+ dashboard_id: Uuid;
367
+ }): Promise<RecordsResult<boolean>>;
275
368
  /**
276
369
  * Group, bucket, filter and measure INSIDE `custom.record_aggregate`. The
277
370
  * aggregate node sits above the visibility join, so what a chart draws is
@@ -289,8 +382,11 @@ interface RecordsClient {
289
382
  key: string;
290
383
  by: AggregateBucket;
291
384
  } | null;
292
- /** Equality only, and it lands in the SAME WHERE as visibility. */
293
- filter?: Record<string, string>;
385
+ /**
386
+ * A scalar is an equality and an object is a half-open moment window, and
387
+ * either way it lands in the SAME WHERE as visibility.
388
+ */
389
+ filter?: Record<string, AggregateFilter>;
294
390
  limit?: number;
295
391
  }): Promise<RecordsResult<AggregateRow[]>>;
296
392
  /** The measures the store itself offers. Asked, never hardcoded in a picker. */
@@ -309,6 +405,25 @@ interface RecordsClient {
309
405
  }): Promise<RecordsResult<Subscription[]>>;
310
406
  /** The cadences the store itself offers. Asked, never hardcoded in a picker. */
311
407
  aggSubscriptionCadences(): Promise<RecordsResult<string[]>>;
408
+ /**
409
+ * WHAT THIS PERSON IS BEING TOLD ABOUT, and what they may switch off.
410
+ *
411
+ * Mine, plus anyone's over a Table I hold admin on — narrowed to Tables I can
412
+ * already open, so the list never reveals one. `aggSubscriptions` above is the
413
+ * NOTIFIER's reader and no client can call it; this is the owner's.
414
+ */
415
+ subscriptions(args?: {
416
+ table_id?: Uuid | null;
417
+ }): Promise<RecordsResult<MySubscription[]>>;
418
+ /**
419
+ * Switch one on or off. Muting is honoured in ONE place — the reader every
420
+ * consumer goes through — so a screen can never say a subscription is off
421
+ * while it keeps firing.
422
+ */
423
+ subscriptionMute(args: {
424
+ rule_id: Uuid;
425
+ muted: boolean;
426
+ }): Promise<RecordsResult<boolean>>;
312
427
  docTemplateSave(args: {
313
428
  table_id: Uuid;
314
429
  name: string;
@@ -728,11 +843,24 @@ declare const DOORS: {
728
843
  readonly ruleEval: "rule_eval";
729
844
  readonly forms: "forms";
730
845
  readonly formDeclare: "form_declare";
846
+ readonly portals: "portals";
847
+ readonly portalCard: "portal_card";
848
+ readonly portalDeclare: "portal_declare";
849
+ readonly portalInvite: "portal_invite";
850
+ readonly portalRevoke: "portal_revoke";
851
+ readonly portalPreview: "portal_preview";
852
+ readonly dashboards: "dashboards";
853
+ readonly dashboardDeclare: "dashboard_declare";
854
+ readonly dashboardRun: "dashboard_run";
855
+ readonly dashboardStuck: "dashboard_stuck";
856
+ readonly dashboardDelete: "dashboard_delete";
731
857
  readonly recordAggregate: "record_aggregate";
732
858
  readonly aggOperations: "agg_operations";
733
859
  readonly aggBuckets: "agg_buckets";
734
860
  readonly aggSubscriptions: "agg_subscriptions";
735
861
  readonly aggSubscriptionCadences: "agg_subscription_cadences";
862
+ readonly subscriptions: "subscriptions";
863
+ readonly subscriptionMute: "subscription_mute";
736
864
  readonly docTemplateSave: "doc_template_save";
737
865
  readonly docRenderBody: "doc_render_body";
738
866
  readonly docRenderDocument: "doc_render_document";
@@ -898,4 +1026,4 @@ declare function parseCsv(text: string): string[][];
898
1026
  declare function importCsv(fields: Field[], text: string): ParsedImport;
899
1027
  declare function importXlsx(fields: Field[], bytes: ArrayBuffer | Uint8Array): Promise<ParsedImport>;
900
1028
 
901
- export { AggregateBucket, AggregateMeasure, AggregateRow, AnonTokenBinding, type AsOf, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_PAGE_SIZE, DEFAULT_VALUE_MAX_BYTES, DOORS, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, type ExportRow, ExternalPrincipalCard, Field, FieldPatch, FieldProposal, FormSummary, MAPPED_SQLSTATES, type MirrorLimits, MyLevel, NewEntityFieldDeclaration, NewFieldDeclaration, type ParsedImport, PgError, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, type RecordQuery, RecordRead, RecordRevision, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, ResolvedPublishBinding, StaleWriteDetail, StoredRecord, Subscription, type SupabaseLike, Table, TableCapacity, TableProposal, Timestamp, Uuid, WorkApprovalDecision, WorkApprovalFiled, WorkApprover, WorkAssignment, WorkAssignmentField, WorkChange, WorkGraph, WorkInboxItem, WorkInstantiation, WorkListFlavour, WorkListItem, WorkRecordState, WorkSlotHold, WorkState, WorkTurn, WriteConflict, asWriteConflict, cellText, createRecordsClient, doorAbsent, doorCensus, doorExists, exportCsv, exportXlsx, importCsv, importXlsx, intersectIds, mapPgError, parseCsv, planQuery, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, staleWriteDetail, supabaseDataSource, toAoa };
1029
+ export { AggregateBucket, AggregateFilter, AggregateMeasure, AggregateRow, AnonTokenBinding, type AsOf, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_PAGE_SIZE, DEFAULT_VALUE_MAX_BYTES, DOORS, DashboardBlock, DashboardRunResult, DashboardSummary, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, type ExportRow, ExternalPrincipalCard, Field, FieldPatch, FieldProposal, FormSummary, MAPPED_SQLSTATES, type MirrorLimits, MyLevel, MySubscription, NewEntityFieldDeclaration, NewFieldDeclaration, type ParsedImport, PgError, PortalCard, PortalInvitation, PortalPreviewRow, PortalRevocation, PortalSummary, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, type RecordQuery, RecordRead, RecordRevision, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, ResolvedPublishBinding, StaleWriteDetail, StoredRecord, StuckRow, Subscription, type SupabaseLike, Table, TableCapacity, TableProposal, Timestamp, Uuid, WorkApprovalDecision, WorkApprovalFiled, WorkApprover, WorkAssignment, WorkAssignmentField, WorkChange, WorkGraph, WorkInboxItem, WorkInstantiation, WorkListFlavour, WorkListItem, WorkRecordState, WorkSlotHold, WorkState, WorkTurn, WriteConflict, asWriteConflict, cellText, createRecordsClient, doorAbsent, doorCensus, doorExists, exportCsv, exportXlsx, importCsv, importXlsx, intersectIds, mapPgError, parseCsv, planQuery, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, staleWriteDetail, supabaseDataSource, toAoa };
@@ -1,5 +1,5 @@
1
- import { Timestamp, Uuid, RelationCoordinate, RecordsConfig, RecordDocument, RecordsResult, RecordRead, ReadRow, Table, Field, StoredRecord, TableCapacity, NewFieldDeclaration, FieldPatch, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, FormSummary, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, DocToken, DocUnresolvedToken, DocTemplateRow, DocRenderRow, DocSignatureRow, RecordRevision, ReadValue, AnonTokenBinding, WorkState, WorkGraph, WorkInstantiation, WorkTurn, WorkAssignmentField, WorkSlotHold, WorkInboxItem, WorkListFlavour, WorkListItem, WorkAssignment, WorkRecordState, WorkApprover, WorkChange, WorkApprovalFiled, WorkApprovalDecision, ExternalPrincipalCard, PublishBinding, ResolvedPublishBinding, FieldProposal, TableProposal, MyLevel, RecordsError, WriteConflict, PgError, RecordsDataSource, StaleWriteDetail, PredictedRefusal } from '../index.js';
2
- export { ABSENCE_REASONS, ACTOR_VOCABULARY, AbsenceReason, Actor, AggregateOperation, COMPUTE_ON, CONTEXT_POLICIES, ComputeOn, ContextPolicy, CustomFieldTableType, DELIVERIES, Delivery, DocSignatureCheck, ENTITY_TOKENS, EntityFieldValue, EntityRecordMatch, EntityToken, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, FieldBehavior, FieldRule, FieldSensitivity, FieldSource, ForbiddenEnvelopeWord, Freshness, HiddenFieldNotice, Home, KERNEL_TABLES, KernelTableName, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, MergeField, MergeFieldModifier, MergeFieldProvenance, MergeFieldResolution, MergeFieldSemanticType, MergeFieldSource, MergeFieldTransform, MissingBehavior, ON_DELETE, OVERRIDE_POLICIES, OnDelete, OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, ParityFieldType, ParityFieldTypeDescriptor, PerValueAccessWord, PermissionLevel, ProvenancePointer, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, RecordsActor, RecordsErrorCode, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationBinding, RelationCardinality, RelationCarries, RelationFlavor, RelationProperties, RelationTarget, ResolutionTriple, RetiredActorWord, Rule, RuleAnswer, RuleExpression, RuleNodeKind, RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, StorageMode, StoreDoorName, StoreRefusalCode, SubscriptionBlock, SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, TableDisplay, TableOrigin, TableType, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, ValueAlternate, ValueAlternateKey, ValueEnvelope, ValueEnvelopeKey, ValueSource, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, asPermissionLevel, atLeast, err, highestLevel, isRecordsErr, measureKey, ok, publicFormPath } from '../index.js';
1
+ import { Timestamp, Uuid, RelationCoordinate, RecordsConfig, RecordDocument, RecordsResult, RecordRead, ReadRow, Table, Field, StoredRecord, TableCapacity, NewFieldDeclaration, FieldPatch, EntityTableFacts, NewEntityFieldDeclaration, EntityFieldRights, EntityRecordRead, EntityRecordsFound, FormSummary, PortalSummary, PortalCard, PortalInvitation, PortalRevocation, PortalPreviewRow, DashboardSummary, DashboardBlock, AggregateFilter, DashboardRunResult, StuckRow, AggregateMeasure, AggregateBucket, AggregateRow, Subscription, MySubscription, DocToken, DocUnresolvedToken, DocTemplateRow, DocRenderRow, DocSignatureRow, RecordRevision, ReadValue, AnonTokenBinding, WorkState, WorkGraph, WorkInstantiation, WorkTurn, WorkAssignmentField, WorkSlotHold, WorkInboxItem, WorkListFlavour, WorkListItem, WorkAssignment, WorkRecordState, WorkApprover, WorkChange, WorkApprovalFiled, WorkApprovalDecision, ExternalPrincipalCard, PublishBinding, ResolvedPublishBinding, FieldProposal, TableProposal, MyLevel, RecordsError, WriteConflict, PgError, RecordsDataSource, StaleWriteDetail, PredictedRefusal } from '../index.js';
2
+ export { ABSENCE_REASONS, ACTOR_VOCABULARY, AbsenceReason, Actor, AggregateOperation, AggregateWindow, COMPUTE_ON, CONTEXT_POLICIES, ChoiceOption, ComputeOn, ContextPolicy, CustomFieldTableType, DELIVERIES, DashboardBlockKind, DashboardBlockResult, Delivery, DocSignatureCheck, ENTITY_TOKENS, EntityFieldValue, EntityRecordMatch, EntityToken, FIELD_SENSITIVITIES, FIELD_SOURCES, FRESHNESS, FieldBehavior, FieldRule, FieldSensitivity, FieldSource, FieldTypeWord, ForbiddenEnvelopeWord, Freshness, HiddenFieldNotice, Home, KERNEL_TABLES, KernelTableName, MERGE_FIELD_MODIFIERS, MERGE_FIELD_SEMANTIC_TYPES, MERGE_FIELD_SOURCES, MergeField, MergeFieldModifier, MergeFieldProvenance, MergeFieldResolution, MergeFieldSemanticType, MergeFieldSource, MergeFieldTransform, MissingBehavior, ON_DELETE, OVERRIDE_POLICIES, OnDelete, OverridePolicy, PARITY_FIELD_TYPES, PERMISSION_LEVELS, PER_VALUE_ACCESS_WORDS, ParityFieldType, ParityFieldTypeDescriptor, PerValueAccessWord, PermissionLevel, PortalPrincipal, PortalTableExposure, ProvenancePointer, RELATION_BINDINGS, RELATION_CARDINALITIES, RELATION_FLAVORS, RETIRED_ACTOR_WORDS, RULE_NODE_KINDS, RULE_USES, RecordsActor, RecordsErrorCode, RecordsErrorSink, RecordsFilter, RecordsRealtimePort, RecordsResolverPort, RecordsResponse, RecordsTableQuery, RegisteredTable, Relation, RelationBinding, RelationCardinality, RelationCarries, RelationFlavor, RelationProperties, RelationTarget, ResolutionTriple, RetiredActorWord, Rule, RuleAnswer, RuleExpression, RuleNodeKind, RuleUse, STORAGE_MODES, STORE_DOORS, STORE_KNOBS, STORE_REFUSAL_CODES, StorageMode, StoreDoorName, StoreRefusalCode, SubscriptionBlock, SubscriptionCadence, TABLE_DISPLAYS, TABLE_ORIGINS, TABLE_TYPES, TableDisplay, TableOrigin, TableType, VALUE_ALTERNATE_KEYS, VALUE_ENVELOPE_KEYS, ValueAlternate, ValueAlternateKey, ValueEnvelope, ValueEnvelopeKey, ValueSource, WorkDueState, WorkInboxKind, WorkOrigin, WorkTemplateNode, WorkTemplateRelation, asPermissionLevel, atLeast, choiceSlug, choiceValuesOf, choicesOf, err, highestLevel, holdsARetiredChoice, isRecordsErr, isTheChosen, looksLikeAnId, measureKey, ok, optionKey, optionLabel, portalPath, publicFormPath } from '../index.js';
3
3
 
4
4
  /**
5
5
  * DOOR-8. As-of on EITHER clock, and they are different questions:
@@ -272,6 +272,99 @@ interface RecordsClient {
272
272
  form_id?: Uuid | null;
273
273
  slug?: string | null;
274
274
  }): Promise<RecordsResult<Uuid>>;
275
+ /** Every portal over this organization the caller may know about, with its numbers. */
276
+ portals(): Promise<RecordsResult<PortalSummary[]>>;
277
+ /** ONE portal in full: what it shows, and who it was opened to. */
278
+ portalCard(args: {
279
+ portal_id: Uuid;
280
+ }): Promise<RecordsResult<PortalCard>>;
281
+ /**
282
+ * Create or RE-STATE one portal. Re-stating REPLACES what it exposes — a
283
+ * Table left out of `tables` stops being exposed in the same act — and leaves
284
+ * the people alone: who is invited is not part of what the portal shows.
285
+ */
286
+ portalDeclare(args: {
287
+ title: string;
288
+ client_table_id: Uuid;
289
+ tables: Array<{
290
+ table_id: Uuid;
291
+ names_via: string;
292
+ visible_fields?: string[];
293
+ editable_fields?: string[];
294
+ comments?: boolean;
295
+ }>;
296
+ portal_id?: Uuid | null;
297
+ slug?: string | null;
298
+ sign_in_method?: string | null;
299
+ }): Promise<RecordsResult<Uuid>>;
300
+ /**
301
+ * Invite one person, as one record of the portal's client Table.
302
+ *
303
+ * `user_id` is deliberately NOT a parameter here. From a screen it is always
304
+ * null: an invitation confers NOTHING until the person follows their sign-in
305
+ * link and the platform gives them an identity, and the door's own `say`
306
+ * sentence states exactly that. A screen that passed an id would be granting
307
+ * access on somebody else's behalf.
308
+ */
309
+ portalInvite(args: {
310
+ portal_id: Uuid;
311
+ client_record_id: Uuid;
312
+ email: string;
313
+ }): Promise<RecordsResult<PortalInvitation>>;
314
+ /** Take one person's way in away. The answer's `say` names the consequence. */
315
+ portalRevoke(args: {
316
+ portal_id: Uuid;
317
+ principal_id: Uuid;
318
+ }): Promise<RecordsResult<PortalRevocation>>;
319
+ /**
320
+ * VIEW AS THIS CLIENT. The door asks `custom.visible_set` for HER user id —
321
+ * the same call `custom.read_records` makes when she opens the page — so this
322
+ * cannot disagree with what she sees. It REFUSES with `02000` and a sentence
323
+ * when she has not signed in yet; show the sentence, never an empty list.
324
+ */
325
+ portalPreview(args: {
326
+ portal_id: Uuid;
327
+ principal_id: Uuid;
328
+ table_id: Uuid;
329
+ }): Promise<RecordsResult<PortalPreviewRow[]>>;
330
+ /** This organization's dashboards, optionally only those whose subject is one Table. */
331
+ dashboards(args?: {
332
+ table_id?: Uuid | null;
333
+ }): Promise<RecordsResult<DashboardSummary[]>>;
334
+ /**
335
+ * Create or re-state one dashboard. Every block is judged on the way IN —
336
+ * a block naming a field this Table does not have is refused BY NAME, with
337
+ * the table's own field list in the hint — so a canvas cannot be saved broken.
338
+ */
339
+ dashboardDeclare(args: {
340
+ table_id: Uuid;
341
+ name: string;
342
+ blocks?: DashboardBlock[];
343
+ presentation?: Record<string, unknown> | null;
344
+ dashboard_id?: Uuid | null;
345
+ }): Promise<RecordsResult<Uuid>>;
346
+ /**
347
+ * Run every block and answer the numbers. `filter` is the ONE filter bar
348
+ * across the canvas: it is merged UNDER each block's own filter, so a block
349
+ * deliberately scoped to one stage stays scoped while the bar moves the rest.
350
+ * A block that refuses carries the store's sentence and the others still answer.
351
+ */
352
+ dashboardRun(args: {
353
+ dashboard_id: Uuid;
354
+ filter?: Record<string, AggregateFilter>;
355
+ }): Promise<RecordsResult<DashboardRunResult>>;
356
+ /** The seventh block kind on its own: records that have sat on the same value too long. */
357
+ dashboardStuck(args: {
358
+ table_id: Uuid;
359
+ state_key: string;
360
+ days?: number;
361
+ filter?: Record<string, AggregateFilter>;
362
+ limit?: number;
363
+ }): Promise<RecordsResult<StuckRow[]>>;
364
+ /** Take a dashboard away. The records it counted are untouched — a canvas owns nothing. */
365
+ dashboardDelete(args: {
366
+ dashboard_id: Uuid;
367
+ }): Promise<RecordsResult<boolean>>;
275
368
  /**
276
369
  * Group, bucket, filter and measure INSIDE `custom.record_aggregate`. The
277
370
  * aggregate node sits above the visibility join, so what a chart draws is
@@ -289,8 +382,11 @@ interface RecordsClient {
289
382
  key: string;
290
383
  by: AggregateBucket;
291
384
  } | null;
292
- /** Equality only, and it lands in the SAME WHERE as visibility. */
293
- filter?: Record<string, string>;
385
+ /**
386
+ * A scalar is an equality and an object is a half-open moment window, and
387
+ * either way it lands in the SAME WHERE as visibility.
388
+ */
389
+ filter?: Record<string, AggregateFilter>;
294
390
  limit?: number;
295
391
  }): Promise<RecordsResult<AggregateRow[]>>;
296
392
  /** The measures the store itself offers. Asked, never hardcoded in a picker. */
@@ -309,6 +405,25 @@ interface RecordsClient {
309
405
  }): Promise<RecordsResult<Subscription[]>>;
310
406
  /** The cadences the store itself offers. Asked, never hardcoded in a picker. */
311
407
  aggSubscriptionCadences(): Promise<RecordsResult<string[]>>;
408
+ /**
409
+ * WHAT THIS PERSON IS BEING TOLD ABOUT, and what they may switch off.
410
+ *
411
+ * Mine, plus anyone's over a Table I hold admin on — narrowed to Tables I can
412
+ * already open, so the list never reveals one. `aggSubscriptions` above is the
413
+ * NOTIFIER's reader and no client can call it; this is the owner's.
414
+ */
415
+ subscriptions(args?: {
416
+ table_id?: Uuid | null;
417
+ }): Promise<RecordsResult<MySubscription[]>>;
418
+ /**
419
+ * Switch one on or off. Muting is honoured in ONE place — the reader every
420
+ * consumer goes through — so a screen can never say a subscription is off
421
+ * while it keeps firing.
422
+ */
423
+ subscriptionMute(args: {
424
+ rule_id: Uuid;
425
+ muted: boolean;
426
+ }): Promise<RecordsResult<boolean>>;
312
427
  docTemplateSave(args: {
313
428
  table_id: Uuid;
314
429
  name: string;
@@ -728,11 +843,24 @@ declare const DOORS: {
728
843
  readonly ruleEval: "rule_eval";
729
844
  readonly forms: "forms";
730
845
  readonly formDeclare: "form_declare";
846
+ readonly portals: "portals";
847
+ readonly portalCard: "portal_card";
848
+ readonly portalDeclare: "portal_declare";
849
+ readonly portalInvite: "portal_invite";
850
+ readonly portalRevoke: "portal_revoke";
851
+ readonly portalPreview: "portal_preview";
852
+ readonly dashboards: "dashboards";
853
+ readonly dashboardDeclare: "dashboard_declare";
854
+ readonly dashboardRun: "dashboard_run";
855
+ readonly dashboardStuck: "dashboard_stuck";
856
+ readonly dashboardDelete: "dashboard_delete";
731
857
  readonly recordAggregate: "record_aggregate";
732
858
  readonly aggOperations: "agg_operations";
733
859
  readonly aggBuckets: "agg_buckets";
734
860
  readonly aggSubscriptions: "agg_subscriptions";
735
861
  readonly aggSubscriptionCadences: "agg_subscription_cadences";
862
+ readonly subscriptions: "subscriptions";
863
+ readonly subscriptionMute: "subscription_mute";
736
864
  readonly docTemplateSave: "doc_template_save";
737
865
  readonly docRenderBody: "doc_render_body";
738
866
  readonly docRenderDocument: "doc_render_document";
@@ -898,4 +1026,4 @@ declare function parseCsv(text: string): string[][];
898
1026
  declare function importCsv(fields: Field[], text: string): ParsedImport;
899
1027
  declare function importXlsx(fields: Field[], bytes: ArrayBuffer | Uint8Array): Promise<ParsedImport>;
900
1028
 
901
- export { AggregateBucket, AggregateMeasure, AggregateRow, AnonTokenBinding, type AsOf, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_PAGE_SIZE, DEFAULT_VALUE_MAX_BYTES, DOORS, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, type ExportRow, ExternalPrincipalCard, Field, FieldPatch, FieldProposal, FormSummary, MAPPED_SQLSTATES, type MirrorLimits, MyLevel, NewEntityFieldDeclaration, NewFieldDeclaration, type ParsedImport, PgError, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, type RecordQuery, RecordRead, RecordRevision, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, ResolvedPublishBinding, StaleWriteDetail, StoredRecord, Subscription, type SupabaseLike, Table, TableCapacity, TableProposal, Timestamp, Uuid, WorkApprovalDecision, WorkApprovalFiled, WorkApprover, WorkAssignment, WorkAssignmentField, WorkChange, WorkGraph, WorkInboxItem, WorkInstantiation, WorkListFlavour, WorkListItem, WorkRecordState, WorkSlotHold, WorkState, WorkTurn, WriteConflict, asWriteConflict, cellText, createRecordsClient, doorAbsent, doorCensus, doorExists, exportCsv, exportXlsx, importCsv, importXlsx, intersectIds, mapPgError, parseCsv, planQuery, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, staleWriteDetail, supabaseDataSource, toAoa };
1029
+ export { AggregateBucket, AggregateFilter, AggregateMeasure, AggregateRow, AnonTokenBinding, type AsOf, DEFAULT_DOCUMENT_MAX_BYTES, DEFAULT_PAGE_SIZE, DEFAULT_VALUE_MAX_BYTES, DOORS, DashboardBlock, DashboardRunResult, DashboardSummary, DocRenderRow, DocSignatureRow, DocTemplateRow, DocToken, DocUnresolvedToken, type DoorKey, EntityFieldRights, EntityRecordRead, EntityRecordsFound, EntityTableFacts, type ExportRow, ExternalPrincipalCard, Field, FieldPatch, FieldProposal, FormSummary, MAPPED_SQLSTATES, type MirrorLimits, MyLevel, MySubscription, NewEntityFieldDeclaration, NewFieldDeclaration, type ParsedImport, PgError, PortalCard, PortalInvitation, PortalPreviewRow, PortalRevocation, PortalSummary, PredictedRefusal, type PromotedPredicate, PublishBinding, type QueryPlan, ReadRow, ReadValue, RecordDocument, type RecordQuery, RecordRead, RecordRevision, type RecordsClient, RecordsConfig, RecordsDataSource, RecordsError, RecordsResult, RelationCoordinate, ResolvedPublishBinding, StaleWriteDetail, StoredRecord, StuckRow, Subscription, type SupabaseLike, Table, TableCapacity, TableProposal, Timestamp, Uuid, WorkApprovalDecision, WorkApprovalFiled, WorkApprover, WorkAssignment, WorkAssignmentField, WorkChange, WorkGraph, WorkInboxItem, WorkInstantiation, WorkListFlavour, WorkListItem, WorkRecordState, WorkSlotHold, WorkState, WorkTurn, WriteConflict, asWriteConflict, cellText, createRecordsClient, doorAbsent, doorCensus, doorExists, exportCsv, exportXlsx, importCsv, importXlsx, intersectIds, mapPgError, parseCsv, planQuery, predictEnvelopeRefusal, predictSizeRefusal, predictValueRefusals, predictWriteRefusals, staleWriteDetail, supabaseDataSource, toAoa };