@lantharos/pult 0.11.0 → 0.12.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/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { C as traceOrigins, L as findActionDef, M as valuesIn, S as kindOf, _ as normalizeFilter, a as collect, c as guards, d as Transport, h as hasPendingAttachments, i as validate, j as shownValue, k as eachBlock, r as toJsonSchema, x as humanize } from "./schema-DuTVNptF.mjs";
2
+ import { C as traceOrigins, L as findActionDef, M as valuesIn, S as kindOf, _ as normalizeFilter, a as collect, c as guards, d as Transport, h as hasPendingAttachments, i as validate, j as shownValue, k as eachBlock, r as toJsonSchema, x as humanize } from "./schema-D7N0bd_N.mjs";
3
3
  import { basename, dirname, join, relative, resolve } from "node:path";
4
4
  import { parseArgs, styleText } from "node:util";
5
5
  import { Cron } from "croner";
@@ -184,7 +184,7 @@ function actionChanges(prefix) {
184
184
  }
185
185
  //#endregion
186
186
  //#region package.json
187
- var version = "0.11.0";
187
+ var version = "0.12.0";
188
188
  //#endregion
189
189
  //#region ../protocol/src/checks.ts
190
190
  const COLUMNS = [
package/index.d.mts CHANGED
@@ -102,6 +102,8 @@ type FieldValue = string | number | boolean | null | {
102
102
  record: RecordRef;
103
103
  } | {
104
104
  code: string;
105
+ } | {
106
+ link: Link;
105
107
  } | {
106
108
  live: LiveStat;
107
109
  } | {
@@ -115,6 +117,10 @@ interface Editable {
115
117
  record: string | null;
116
118
  field: string | null;
117
119
  }
120
+ interface Link {
121
+ url: string;
122
+ title?: string;
123
+ }
118
124
  interface Sensitive {
119
125
  value?: string;
120
126
  hint?: string;
@@ -184,6 +190,7 @@ type Block = {
184
190
  }[];
185
191
  } | {
186
192
  type: "table";
193
+ title?: string;
187
194
  columns: string[];
188
195
  rows: FieldValue[][];
189
196
  } | {
@@ -796,7 +803,11 @@ export declare const b: {
796
803
  at: Date | number;
797
804
  text: string;
798
805
  }[]) => Block;
799
- table: (rows: Record<string, FieldInput>[], columns?: string[]) => Block;
806
+ link: (url: string, title?: string) => FieldValue;
807
+ table: (rows: Record<string, FieldInput>[], { title, columns }?: {
808
+ title?: string;
809
+ columns?: string[];
810
+ }) => Block;
800
811
  stats: (stats: Record<string, FieldInput | {
801
812
  value: FieldInput;
802
813
  note?: string;
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as mapBlocks, D as sign, E as NonceWindow, F as HOME, I as actionId, L as findActionDef, M as valuesIn, N as DEFAULT_STATES, O as verify, S as kindOf, T as refKey, a as collect, b as captureOrigin, d as Transport, f as b, g as isPendingAttachment, h as hasPendingAttachments, i as validate, k as eachBlock, m as fieldValues, n as reviveDates, o as findAction, p as bindActions, s as flag, t as ValidationError, u as PultError, v as view, w as HEADER, y as KIND } from "./schema-DuTVNptF.mjs";
1
+ import { A as mapBlocks, D as sign, E as NonceWindow, F as HOME, I as actionId, L as findActionDef, M as valuesIn, N as DEFAULT_STATES, O as verify, S as kindOf, T as refKey, a as collect, b as captureOrigin, d as Transport, f as b, g as isPendingAttachment, h as hasPendingAttachments, i as validate, k as eachBlock, m as fieldValues, n as reviveDates, o as findAction, p as bindActions, s as flag, t as ValidationError, u as PultError, v as view, w as HEADER, y as KIND } from "./schema-D7N0bd_N.mjs";
2
2
  //#region ../protocol/src/flags.ts
3
3
  function rampAt(ramp, now = Date.now()) {
4
4
  if (now >= ramp.end) return ramp.to;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lantharos/pult",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "The other side of your app",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -361,8 +361,13 @@ const b = {
361
361
  text
362
362
  }))
363
363
  }),
364
- table: (rows, columns = Object.keys(rows[0] ?? {})) => ({
364
+ link: (url, title) => ({ link: {
365
+ url,
366
+ ...title ? { title } : {}
367
+ } }),
368
+ table: (rows, { title, columns = Object.keys(rows[0] ?? {}) } = {}) => ({
365
369
  type: "table",
370
+ ...title ? { title } : {},
366
371
  columns,
367
372
  rows: rows.map((row) => columns.map((column) => field(row[column])))
368
373
  }),