@frontera-sdk/functions 1.52.38 → 1.52.40

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/src/types.ts CHANGED
@@ -412,6 +412,15 @@ export type ActionSubmission = {
412
412
  /**
413
413
  * The Action's inputs by name. An input that attaches a file accepts one of
414
414
  * this run's file inputs as passed in — `{ fileId }`, e.g. `ctx.input.photo`.
415
+ *
416
+ * For an Action that changes an existing record, leave out the input named
417
+ * like the object type's primary key and the `expectedVersion` input: they
418
+ * are filled from `subjectRef` and `expectedSubjectVersion` (`subjectOf`
419
+ * gives both). Sent anyway, they must name the same record and version, or
420
+ * the submission is refused naming the input.
421
+ *
422
+ * An input that references another record takes that record's primary key,
423
+ * as a query row carries it (`'TCH-00026'`, or a UUID).
415
424
  */
416
425
  input: Record<string, unknown>
417
426
  /** Required when the Action's definition says so. */
@@ -736,8 +745,36 @@ export interface BlueprintQueryOptions {
736
745
  nearest?: NearestRequest
737
746
  }
738
747
 
748
+ /**
749
+ * What the platform attaches to a row it can version: `_meta` on each row of
750
+ * an editable object type (one whose properties a governed Action may change).
751
+ */
752
+ export interface BlueprintRecordMeta {
753
+ /**
754
+ * The record's edit version — `0` for a record nobody has edited. Send it,
755
+ * as a string, as an Action's `expectedSubjectVersion`: a submission built
756
+ * from a stale read then loses instead of overwriting. `subjectOf` does both
757
+ * halves for you.
758
+ *
759
+ * Absent when the row changed while it was being read; read it again.
760
+ */
761
+ recordVersion: number
762
+ }
763
+
739
764
  export interface BlueprintQueryResult<T = Record<string, unknown>> {
740
- rows: T[]
765
+ /**
766
+ * Each row of an editable type carries `_meta: { recordVersion }`. A type
767
+ * that defines its own `_meta` column keeps its value, and has no version.
768
+ *
769
+ * A timestamp property is ISO 8601 text in UTC (`'2026-10-17T09:17:00.000Z'`,
770
+ * which `new Date()` reads), a date property `'YYYY-MM-DD'`.
771
+ */
772
+ rows: Array<T & { _meta?: BlueprintRecordMeta }>
773
+ /**
774
+ * The object type's stable id — what `subjectRef.objectTypeId` takes. Present
775
+ * whenever rows came back.
776
+ */
777
+ objectTypeId?: string
741
778
  /** True when the query matched more rows than were returned. */
742
779
  hasMore: boolean
743
780
  /** Present iff `hasMore`. Feed to the next call's `pageToken`.