@lotics/app-sdk 0.133.36 → 0.133.38
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/{chunk-BJG44AKC.js → chunk-YBX23O23.js} +1 -0
- package/dist/index.js +140 -40
- package/dist/router.js +1 -1
- package/dist/rpc.d.ts +4 -0
- package/dist/shared_types.d.ts +3 -2
- package/dist/viewer.d.ts +3 -0
- package/dist/written.d.ts +3 -0
- package/docs/members_and_options.md +1 -1
- package/docs/runtime.md +4 -4
- package/package.json +1 -1
|
@@ -2176,6 +2176,7 @@ async function standaloneContext() {
|
|
|
2176
2176
|
member_id: null,
|
|
2177
2177
|
comments_enabled: info.comments_enabled,
|
|
2178
2178
|
timezone: info.timezone,
|
|
2179
|
+
language: info.language,
|
|
2179
2180
|
default_currency: info.default_currency,
|
|
2180
2181
|
recording_enabled: false
|
|
2181
2182
|
};
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
subtractDecimal,
|
|
63
63
|
sumDecimal,
|
|
64
64
|
urlParam
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-YBX23O23.js";
|
|
66
66
|
|
|
67
67
|
// src/mount.tsx
|
|
68
68
|
import { createRoot } from "react-dom/client";
|
|
@@ -6394,6 +6394,85 @@ function datesOn(from, until, days) {
|
|
|
6394
6394
|
return Array.from({ length: length2 }, (_, at2) => first2 + at2 * MS_PER_DAY).filter((ms) => days.includes(weekdayOf(ms))).map(dayOf);
|
|
6395
6395
|
}
|
|
6396
6396
|
|
|
6397
|
+
// ../shared/src/format_date.ts
|
|
6398
|
+
var ISO_YEAR = /^(\d{4})$/;
|
|
6399
|
+
var ISO_YEAR_MONTH = /^(\d{4})-(\d{2})$/;
|
|
6400
|
+
var ISO_DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/;
|
|
6401
|
+
var ISO_INSTANT = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)$/i;
|
|
6402
|
+
function writtenParts(s) {
|
|
6403
|
+
const y = ISO_YEAR.exec(s);
|
|
6404
|
+
if (y) return { year: Number(y[1]), month: 0, day: 1, hour: 0, minute: 0, second: 0, precision: "year" };
|
|
6405
|
+
const ym = ISO_YEAR_MONTH.exec(s);
|
|
6406
|
+
if (ym) return { year: Number(ym[1]), month: Number(ym[2]) - 1, day: 1, hour: 0, minute: 0, second: 0, precision: "month" };
|
|
6407
|
+
const m = ISO_DATE_TIME.exec(s);
|
|
6408
|
+
if (!m) return null;
|
|
6409
|
+
return {
|
|
6410
|
+
year: Number(m[1]),
|
|
6411
|
+
month: Number(m[2]) - 1,
|
|
6412
|
+
day: Number(m[3]),
|
|
6413
|
+
hour: Number(m[4] ?? 0),
|
|
6414
|
+
minute: Number(m[5] ?? 0),
|
|
6415
|
+
second: Number(m[6] ?? 0),
|
|
6416
|
+
precision: "day"
|
|
6417
|
+
};
|
|
6418
|
+
}
|
|
6419
|
+
function localParts(date2) {
|
|
6420
|
+
return {
|
|
6421
|
+
year: date2.getFullYear(),
|
|
6422
|
+
month: date2.getMonth(),
|
|
6423
|
+
day: date2.getDate(),
|
|
6424
|
+
hour: date2.getHours(),
|
|
6425
|
+
minute: date2.getMinutes(),
|
|
6426
|
+
second: date2.getSeconds(),
|
|
6427
|
+
precision: "day"
|
|
6428
|
+
};
|
|
6429
|
+
}
|
|
6430
|
+
function zoneClock(zone) {
|
|
6431
|
+
let clock2 = zoneClocks.get(zone);
|
|
6432
|
+
if (clock2 === void 0) {
|
|
6433
|
+
clock2 = new Intl.DateTimeFormat("en-US", {
|
|
6434
|
+
timeZone: zone,
|
|
6435
|
+
hourCycle: "h23",
|
|
6436
|
+
year: "numeric",
|
|
6437
|
+
month: "numeric",
|
|
6438
|
+
day: "numeric",
|
|
6439
|
+
hour: "numeric",
|
|
6440
|
+
minute: "numeric",
|
|
6441
|
+
second: "numeric"
|
|
6442
|
+
});
|
|
6443
|
+
zoneClocks.set(zone, clock2);
|
|
6444
|
+
}
|
|
6445
|
+
return clock2;
|
|
6446
|
+
}
|
|
6447
|
+
var zoneClocks = /* @__PURE__ */ new Map();
|
|
6448
|
+
function zonedParts(instant, zone) {
|
|
6449
|
+
const parts = zoneClock(zone).formatToParts(instant);
|
|
6450
|
+
const part = (type) => Number(parts.find((p) => p.type === type)?.value);
|
|
6451
|
+
return {
|
|
6452
|
+
year: part("year"),
|
|
6453
|
+
month: part("month") - 1,
|
|
6454
|
+
day: part("day"),
|
|
6455
|
+
hour: part("hour"),
|
|
6456
|
+
minute: part("minute"),
|
|
6457
|
+
second: part("second"),
|
|
6458
|
+
precision: "day"
|
|
6459
|
+
};
|
|
6460
|
+
}
|
|
6461
|
+
function readWallClock(value, zone) {
|
|
6462
|
+
if (value == null) return null;
|
|
6463
|
+
if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : localParts(value);
|
|
6464
|
+
const s = value.trim();
|
|
6465
|
+
if (!s) return null;
|
|
6466
|
+
const written = writtenParts(s);
|
|
6467
|
+
if (written) return written;
|
|
6468
|
+
const native = new Date(s);
|
|
6469
|
+
if (Number.isNaN(native.getTime())) return null;
|
|
6470
|
+
return zone !== void 0 && ISO_INSTANT.test(s) ? zonedParts(native, zone) : localParts(native);
|
|
6471
|
+
}
|
|
6472
|
+
function datePrecision(value) {
|
|
6473
|
+
return readWallClock(value, void 0)?.precision ?? null;
|
|
6474
|
+
}
|
|
6475
|
+
|
|
6397
6476
|
// ../shared/src/date_string_helpers.ts
|
|
6398
6477
|
function parseDate2(dateStr) {
|
|
6399
6478
|
if (dateStr.includes("T")) {
|
|
@@ -7024,12 +7103,12 @@ function isDateInput(value) {
|
|
|
7024
7103
|
}
|
|
7025
7104
|
function validateDateInput(value, paramName, funcName) {
|
|
7026
7105
|
if (!(value instanceof Date) && typeof value !== "string") {
|
|
7027
|
-
throw new
|
|
7106
|
+
throw new ExpressionArgumentError(`${funcName}: ${paramName} must be a Date or string`);
|
|
7028
7107
|
}
|
|
7029
7108
|
}
|
|
7030
7109
|
function validateNumber(value, paramName, funcName) {
|
|
7031
7110
|
if (typeof value !== "number") {
|
|
7032
|
-
throw new
|
|
7111
|
+
throw new ExpressionArgumentError(`${funcName}: ${paramName} must be a number`);
|
|
7033
7112
|
}
|
|
7034
7113
|
}
|
|
7035
7114
|
function boundaryOf(edge, input, tz) {
|
|
@@ -7037,18 +7116,30 @@ function boundaryOf(edge, input, tz) {
|
|
|
7037
7116
|
}
|
|
7038
7117
|
function validateOptionalTimezone(value, funcName) {
|
|
7039
7118
|
if (value != null && typeof value !== "string") {
|
|
7040
|
-
throw new
|
|
7119
|
+
throw new ExpressionArgumentError(`${funcName}: timezone must be a string`);
|
|
7041
7120
|
}
|
|
7042
7121
|
}
|
|
7043
7122
|
function normalizeDateWithValidation(date2, timezone, funcName) {
|
|
7044
7123
|
const normalized = normalizeDate(date2, timezone);
|
|
7045
7124
|
if (isNaN(normalized.getTime())) {
|
|
7046
|
-
throw new
|
|
7125
|
+
throw new ExpressionArgumentError(`${funcName}: invalid date`);
|
|
7047
7126
|
}
|
|
7048
7127
|
return normalized;
|
|
7049
7128
|
}
|
|
7050
|
-
|
|
7129
|
+
var BUSINESS_DATE_PATTERN = {
|
|
7130
|
+
vi: { day: "dd/MM/yyyy", month: "MM/yyyy", year: "yyyy" },
|
|
7131
|
+
en: { day: "d MMM yyyy", month: "MMM yyyy", year: "yyyy" }
|
|
7132
|
+
};
|
|
7133
|
+
function businessDatePattern(language, value) {
|
|
7134
|
+
const precision = typeof value === "string" ? datePrecision(value.trim()) : null;
|
|
7135
|
+
return BUSINESS_DATE_PATTERN[language][precision ?? "day"];
|
|
7136
|
+
}
|
|
7137
|
+
function getDateExpressionFunctions(defaultTimezone, language) {
|
|
7051
7138
|
const getTimezone = (explicit) => explicit ?? defaultTimezone;
|
|
7139
|
+
const businessPatternOf = (date2) => {
|
|
7140
|
+
if (language === void 0) throw new ExpressionArgumentError(`formatDate: the business's date form is not known here, so name a pattern such as "dd/MM/yyyy"`);
|
|
7141
|
+
return businessDatePattern(language, date2);
|
|
7142
|
+
};
|
|
7052
7143
|
return {
|
|
7053
7144
|
// ========================================================================
|
|
7054
7145
|
// CURRENT TIME
|
|
@@ -7069,36 +7160,38 @@ function getDateExpressionFunctions(defaultTimezone) {
|
|
|
7069
7160
|
// FORMATTING
|
|
7070
7161
|
// ========================================================================
|
|
7071
7162
|
/**
|
|
7072
|
-
* Format a date using date-fns format tokens
|
|
7163
|
+
* Format a date using date-fns format tokens; with none (left out, null or ""), the business's own form
|
|
7164
|
+
* (`businessDatePattern`), the day only.
|
|
7073
7165
|
* Returns "" for null/undefined input.
|
|
7074
7166
|
* For timezone-less strings, formats as-is (preserves the literal value).
|
|
7075
7167
|
* For Date objects or strings with timezone, converts to workspace timezone first.
|
|
7076
7168
|
*/
|
|
7077
|
-
formatDate: (date2,
|
|
7169
|
+
formatDate: (date2, pattern, timezone) => {
|
|
7078
7170
|
if (date2 == null || date2 === "") return "";
|
|
7079
7171
|
if (!isDateInput(date2)) {
|
|
7080
|
-
throw new
|
|
7172
|
+
throw new ExpressionArgumentError("formatDate: date must be a Date or string");
|
|
7081
7173
|
}
|
|
7082
|
-
if (typeof
|
|
7083
|
-
throw new
|
|
7174
|
+
if (pattern !== void 0 && pattern !== null && typeof pattern !== "string") {
|
|
7175
|
+
throw new ExpressionArgumentError("formatDate: pattern must be a string");
|
|
7084
7176
|
}
|
|
7177
|
+
const formatStr = pattern === void 0 || pattern === null || pattern === "" ? businessPatternOf(date2) : pattern;
|
|
7085
7178
|
validateOptionalTimezone(timezone, "formatDate");
|
|
7086
7179
|
const problem = datePatternProblem(formatStr);
|
|
7087
7180
|
if (problem !== void 0) {
|
|
7088
|
-
throw new
|
|
7181
|
+
throw new ExpressionArgumentError(`formatDate: ${problem}`);
|
|
7089
7182
|
}
|
|
7090
7183
|
const tz = getTimezone(timezone);
|
|
7091
7184
|
if (typeof date2 === "string" && !hasTimezone(date2)) {
|
|
7092
7185
|
const testDate = new Date(date2);
|
|
7093
7186
|
if (isNaN(testDate.getTime())) {
|
|
7094
|
-
throw new
|
|
7187
|
+
throw new ExpressionArgumentError("formatDate: invalid date");
|
|
7095
7188
|
}
|
|
7096
7189
|
const iso = parseISO(date2);
|
|
7097
7190
|
return format(isNaN(iso.getTime()) ? testDate : iso, formatStr);
|
|
7098
7191
|
}
|
|
7099
7192
|
const dateObj = date2 instanceof Date ? date2 : new Date(date2);
|
|
7100
7193
|
if (isNaN(dateObj.getTime())) {
|
|
7101
|
-
throw new
|
|
7194
|
+
throw new ExpressionArgumentError("formatDate: invalid date");
|
|
7102
7195
|
}
|
|
7103
7196
|
if (tz) {
|
|
7104
7197
|
const zonedDate = new TZDate(dateObj, tz);
|
|
@@ -7439,10 +7532,10 @@ function getDateExpressionFunctions(defaultTimezone) {
|
|
|
7439
7532
|
*/
|
|
7440
7533
|
meetsBounds: (cell, kind, bounds, timezone) => {
|
|
7441
7534
|
if (kind !== "number" && kind !== "date" && kind !== "datetime") {
|
|
7442
|
-
throw new
|
|
7535
|
+
throw new ExpressionArgumentError("meetsBounds: kind must be 'number', 'date' or 'datetime'");
|
|
7443
7536
|
}
|
|
7444
7537
|
if (typeof bounds !== "object" || bounds === null || Object.keys(bounds).some((key) => !COMPARE_KEYS.includes(key))) {
|
|
7445
|
-
throw new
|
|
7538
|
+
throw new ExpressionArgumentError("meetsBounds: bounds must be an object of gt, gte, lt, lte");
|
|
7446
7539
|
}
|
|
7447
7540
|
validateOptionalTimezone(timezone, "meetsBounds");
|
|
7448
7541
|
return comparisonHolds(bounds, kind, cell, momentAt(getTimezone(timezone), /* @__PURE__ */ new Date()));
|
|
@@ -7788,11 +7881,11 @@ function parseWholeExpression(expression, astFactory2) {
|
|
|
7788
7881
|
function parseExpression(expression) {
|
|
7789
7882
|
return parseWholeExpression(expression, astFactory);
|
|
7790
7883
|
}
|
|
7791
|
-
function evaluateJsExpression(expression, data, additionalFunctions, defaultTimezone) {
|
|
7884
|
+
function evaluateJsExpression(expression, data, additionalFunctions, defaultTimezone, language) {
|
|
7792
7885
|
const expr2 = parseWholeExpression(expression, astFactory);
|
|
7793
7886
|
const result = expr2?.evaluate({
|
|
7794
7887
|
...data,
|
|
7795
|
-
...timezoneAwareFunctions(defaultTimezone),
|
|
7888
|
+
...timezoneAwareFunctions(defaultTimezone, language),
|
|
7796
7889
|
...additionalFunctions
|
|
7797
7890
|
});
|
|
7798
7891
|
return result;
|
|
@@ -7974,7 +8067,7 @@ function helperCost(name) {
|
|
|
7974
8067
|
return HELPER_COST_BY_NAME.get(name) ?? "builds";
|
|
7975
8068
|
}
|
|
7976
8069
|
var HELPER_COST_BY_NAME = new Map(Object.entries(HELPER_COST));
|
|
7977
|
-
function createTimezoneAwareFunctions(defaultTimezone) {
|
|
8070
|
+
function createTimezoneAwareFunctions(defaultTimezone, language) {
|
|
7978
8071
|
return {
|
|
7979
8072
|
// Number functions
|
|
7980
8073
|
formatCurrency: (amount, locale, currency) => {
|
|
@@ -7999,7 +8092,7 @@ function createTimezoneAwareFunctions(defaultTimezone) {
|
|
|
7999
8092
|
// Array functions
|
|
8000
8093
|
sample,
|
|
8001
8094
|
// Date functions with timezone awareness
|
|
8002
|
-
...getDateExpressionFunctions(defaultTimezone),
|
|
8095
|
+
...getDateExpressionFunctions(defaultTimezone, language),
|
|
8003
8096
|
// Spread all utility functions
|
|
8004
8097
|
...expression_array_exports,
|
|
8005
8098
|
...expression_string_exports,
|
|
@@ -8046,12 +8139,13 @@ function asList(value) {
|
|
|
8046
8139
|
}
|
|
8047
8140
|
var MAX_HELD_TIMEZONES = 512;
|
|
8048
8141
|
var functionsByTimezone = /* @__PURE__ */ new Map();
|
|
8049
|
-
function timezoneAwareFunctions(defaultTimezone) {
|
|
8050
|
-
const
|
|
8142
|
+
function timezoneAwareFunctions(defaultTimezone, language) {
|
|
8143
|
+
const key = `${defaultTimezone ?? ""}|${language ?? ""}`;
|
|
8144
|
+
const held2 = functionsByTimezone.get(key);
|
|
8051
8145
|
if (held2 !== void 0) return held2;
|
|
8052
8146
|
if (functionsByTimezone.size >= MAX_HELD_TIMEZONES) functionsByTimezone.clear();
|
|
8053
|
-
const built = Object.freeze({ ...createTimezoneAwareFunctions(defaultTimezone), [SCOPE_TIMEZONE]: defaultTimezone });
|
|
8054
|
-
functionsByTimezone.set(
|
|
8147
|
+
const built = Object.freeze({ ...createTimezoneAwareFunctions(defaultTimezone, language), [SCOPE_TIMEZONE]: defaultTimezone });
|
|
8148
|
+
functionsByTimezone.set(key, built);
|
|
8055
8149
|
return built;
|
|
8056
8150
|
}
|
|
8057
8151
|
var numericAlphabet = customAlphabet("0123456789");
|
|
@@ -10837,6 +10931,7 @@ function clientTrigger(input) {
|
|
|
10837
10931
|
function clientRuntime(input) {
|
|
10838
10932
|
return {
|
|
10839
10933
|
timezone: input.timezone,
|
|
10934
|
+
language: input.language,
|
|
10840
10935
|
now: input.now,
|
|
10841
10936
|
triggered_by_member_id: input.member_id,
|
|
10842
10937
|
get workflow_id() {
|
|
@@ -10878,7 +10973,7 @@ function inBodyAliases(input) {
|
|
|
10878
10973
|
async function predictWorkflowEffects(given) {
|
|
10879
10974
|
const input = inBodyAliases(given);
|
|
10880
10975
|
const helpers = {
|
|
10881
|
-
...createTimezoneAwareFunctions(input.timezone),
|
|
10976
|
+
...createTimezoneAwareFunctions(input.timezone, input.language),
|
|
10882
10977
|
// Group membership and whom the caller stands in for are the server's to answer.
|
|
10883
10978
|
current_member_in_any_group: () => unread("current_member_in_any_group"),
|
|
10884
10979
|
member_of: () => unread("member_of"),
|
|
@@ -11002,6 +11097,7 @@ function useAppContext() {
|
|
|
11002
11097
|
commentsEnabled: data?.comments_enabled ?? false,
|
|
11003
11098
|
recordingEnabled: data?.recording_enabled === true,
|
|
11004
11099
|
timezone: data?.timezone,
|
|
11100
|
+
language: data?.language,
|
|
11005
11101
|
currency: data?.default_currency,
|
|
11006
11102
|
resolved: data !== void 0,
|
|
11007
11103
|
settled: data !== void 0 || error !== null,
|
|
@@ -11189,6 +11285,8 @@ async function stageWrite(workflow, inputs) {
|
|
|
11189
11285
|
const described = model.model.workflows[workflow];
|
|
11190
11286
|
const plan = described?.plan;
|
|
11191
11287
|
if (described === void 0 || plan === void 0 || plan.length === 0) return null;
|
|
11288
|
+
const { language, timezone } = model.context;
|
|
11289
|
+
if (language === void 0 || timezone === void 0) return null;
|
|
11192
11290
|
const minted = [];
|
|
11193
11291
|
let prediction;
|
|
11194
11292
|
try {
|
|
@@ -11198,7 +11296,8 @@ async function stageWrite(workflow, inputs) {
|
|
|
11198
11296
|
select_inputs: described.inputs ?? {},
|
|
11199
11297
|
tables: model.tables,
|
|
11200
11298
|
known: knownRecord,
|
|
11201
|
-
|
|
11299
|
+
language,
|
|
11300
|
+
timezone,
|
|
11202
11301
|
now: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11203
11302
|
member_id: model.context.member_id,
|
|
11204
11303
|
mintId: () => {
|
|
@@ -11381,6 +11480,7 @@ function writesOver(tables, askedAt) {
|
|
|
11381
11480
|
member: (id) => members.get(id),
|
|
11382
11481
|
memberId: model.context.member_id ?? null,
|
|
11383
11482
|
timezone: model.context.timezone,
|
|
11483
|
+
language: model.context.language,
|
|
11384
11484
|
staged: mine.flatMap((entry) => entry.staged),
|
|
11385
11485
|
kept: new Set(mine.flatMap((entry) => entry.settledAt === null ? [] : entry.staged.map((one) => one.record_id))),
|
|
11386
11486
|
pending: mine.some((entry) => entry.settledAt === null || [...entry.unknown].some((table) => table === null || tables.has(table)))
|
|
@@ -14049,7 +14149,7 @@ var FileFactsUnloadedError = class extends Error {
|
|
|
14049
14149
|
this.name = "FileFactsUnloadedError";
|
|
14050
14150
|
}
|
|
14051
14151
|
};
|
|
14052
|
-
function computeFormulaFieldsWithContext(row2, fields, context, linkedTableRecords = NO_LINKED_ROWS, linkedTableFields = /* @__PURE__ */ new Map(),
|
|
14152
|
+
function computeFormulaFieldsWithContext(row2, fields, context, linkedTableRecords = NO_LINKED_ROWS, linkedTableFields = /* @__PURE__ */ new Map(), dates = {}, loadedLinkKeys, linkExpandedTableIds, fileFacts, memberNames) {
|
|
14053
14153
|
const result = { ...row2 };
|
|
14054
14154
|
if (context.photoPlaceFields.size > 0 && fileFacts === void 0) throw new FileFactsUnloadedError(context.photoPlaceFields);
|
|
14055
14155
|
const places = {};
|
|
@@ -14177,7 +14277,7 @@ function computeFormulaFieldsWithContext(row2, fields, context, linkedTableRecor
|
|
|
14177
14277
|
const evaluated2 = evaluateFormulaWithJS(
|
|
14178
14278
|
prepared.parsed,
|
|
14179
14279
|
{ data: evaluationContext, names: context.names, places },
|
|
14180
|
-
|
|
14280
|
+
dates,
|
|
14181
14281
|
everyReferenceEmpty
|
|
14182
14282
|
);
|
|
14183
14283
|
const formulaResult = formulaField.formula.options === void 0 ? evaluated2 : selectResult(formulaField.formula.options, evaluated2);
|
|
@@ -14188,13 +14288,13 @@ function computeFormulaFieldsWithContext(row2, fields, context, linkedTableRecor
|
|
|
14188
14288
|
const computedValue = getFormulaValue(formulaResult);
|
|
14189
14289
|
const outputFormat = computedDateOutputFormat(formulaField);
|
|
14190
14290
|
evaluationContext[formulaField.key] = normalizeEmptyToNull(
|
|
14191
|
-
outputFormat ? canonicalizeComputedDateValue(computedValue, outputFormat, timezone) : computedValue
|
|
14291
|
+
outputFormat ? canonicalizeComputedDateValue(computedValue, outputFormat, dates.timezone) : computedValue
|
|
14192
14292
|
);
|
|
14193
14293
|
}
|
|
14194
14294
|
for (const field of fields) {
|
|
14195
14295
|
const dateFormat = computedDateOutputFormat(field);
|
|
14196
14296
|
if (dateFormat) {
|
|
14197
|
-
result[field.key] = canonicalizeComputedDateValue(result[field.key], dateFormat, timezone);
|
|
14297
|
+
result[field.key] = canonicalizeComputedDateValue(result[field.key], dateFormat, dates.timezone);
|
|
14198
14298
|
}
|
|
14199
14299
|
}
|
|
14200
14300
|
return result;
|
|
@@ -14251,7 +14351,7 @@ function canonicalizeComputedDateValue(value, format2, timezone) {
|
|
|
14251
14351
|
return value;
|
|
14252
14352
|
}
|
|
14253
14353
|
}
|
|
14254
|
-
function computeFormulaFields(row2, fields, linkedTableRecords = /* @__PURE__ */ new Map(), linkedTableFields = /* @__PURE__ */ new Map(),
|
|
14354
|
+
function computeFormulaFields(row2, fields, linkedTableRecords = /* @__PURE__ */ new Map(), linkedTableFields = /* @__PURE__ */ new Map(), dates = {}, fileFacts) {
|
|
14255
14355
|
const context = prepareFormulaContext(fields);
|
|
14256
14356
|
return computeFormulaFieldsWithContext(
|
|
14257
14357
|
row2,
|
|
@@ -14259,7 +14359,7 @@ function computeFormulaFields(row2, fields, linkedTableRecords = /* @__PURE__ */
|
|
|
14259
14359
|
context,
|
|
14260
14360
|
prepareLinkedRows(linkedTableRecords),
|
|
14261
14361
|
linkedTableFields,
|
|
14262
|
-
|
|
14362
|
+
dates,
|
|
14263
14363
|
void 0,
|
|
14264
14364
|
void 0,
|
|
14265
14365
|
fileFacts
|
|
@@ -14354,10 +14454,10 @@ function readsFieldsOnlyThroughEmptinessPredicates(node, taken) {
|
|
|
14354
14454
|
function isFieldRead(node) {
|
|
14355
14455
|
return node !== void 0 && node.type === "Index" && node.receiver.type === "ID" && node.receiver.value === "data";
|
|
14356
14456
|
}
|
|
14357
|
-
function evaluateFormulaWithJS(parsed, data,
|
|
14457
|
+
function evaluateFormulaWithJS(parsed, data, dates, everyReferenceEmpty) {
|
|
14358
14458
|
try {
|
|
14359
14459
|
if (parsed.kind === "unparsable") throw parsed.error;
|
|
14360
|
-
const scope = { ...timezoneAwareFunctions(timezone), ...formulaOnlyFunctions, data: data.data, names: data.names, [LOWERED_PLACES]: data.places ?? {} };
|
|
14460
|
+
const scope = { ...timezoneAwareFunctions(dates.timezone, dates.language), ...formulaOnlyFunctions, data: data.data, names: data.names, [LOWERED_PLACES]: data.places ?? {} };
|
|
14361
14461
|
if (everyReferenceEmpty) {
|
|
14362
14462
|
const taken = (condition2) => {
|
|
14363
14463
|
const answer = condition2.evaluate(scope);
|
|
@@ -14539,7 +14639,7 @@ function findInterpolations(text2) {
|
|
|
14539
14639
|
expression: match2[0].slice(2, -2).trim()
|
|
14540
14640
|
}));
|
|
14541
14641
|
}
|
|
14542
|
-
function interpolateObject(obj, context) {
|
|
14642
|
+
function interpolateObject(obj, context, dates = {}) {
|
|
14543
14643
|
if (obj === null || obj === void 0) {
|
|
14544
14644
|
return obj;
|
|
14545
14645
|
}
|
|
@@ -14548,12 +14648,12 @@ function interpolateObject(obj, context) {
|
|
|
14548
14648
|
const [only] = interpolations;
|
|
14549
14649
|
if (only) {
|
|
14550
14650
|
if (interpolations.length === 1 && obj === only.source) {
|
|
14551
|
-
return evaluateJsExpression(only.expression, context);
|
|
14651
|
+
return evaluateJsExpression(only.expression, context, void 0, dates.timezone, dates.language);
|
|
14552
14652
|
}
|
|
14553
14653
|
let out = "";
|
|
14554
14654
|
let cursor = 0;
|
|
14555
14655
|
for (const interpolation of interpolations) {
|
|
14556
|
-
const result = evaluateJsExpression(interpolation.expression, context);
|
|
14656
|
+
const result = evaluateJsExpression(interpolation.expression, context, void 0, dates.timezone, dates.language);
|
|
14557
14657
|
out += obj.slice(cursor, interpolation.start) + (result != null ? String(result) : "");
|
|
14558
14658
|
cursor = interpolation.end;
|
|
14559
14659
|
}
|
|
@@ -14562,12 +14662,12 @@ function interpolateObject(obj, context) {
|
|
|
14562
14662
|
return obj;
|
|
14563
14663
|
}
|
|
14564
14664
|
if (Array.isArray(obj)) {
|
|
14565
|
-
return obj.map((item) => interpolateObject(item, context));
|
|
14665
|
+
return obj.map((item) => interpolateObject(item, context, dates));
|
|
14566
14666
|
}
|
|
14567
14667
|
if (typeof obj === "object") {
|
|
14568
14668
|
const result = {};
|
|
14569
14669
|
for (const [key, value] of Object.entries(obj)) {
|
|
14570
|
-
result[key] = interpolateObject(value, context);
|
|
14670
|
+
result[key] = interpolateObject(value, context, dates);
|
|
14571
14671
|
}
|
|
14572
14672
|
return result;
|
|
14573
14673
|
}
|
|
@@ -14682,7 +14782,7 @@ function withFormulas(over, tableId, cells, changed2) {
|
|
|
14682
14782
|
const computable = formulas.filter((field) => !waiting.has(field.key) && field.reads.every((key) => cells.has(key)));
|
|
14683
14783
|
const stale = new Set(formulas.filter((field) => !computable.includes(field)).map((field) => field.key));
|
|
14684
14784
|
if (computable.length === 0) return { cells, stale };
|
|
14685
|
-
const computed = computeFormulaFields(Object.fromEntries(cells), table.fields, /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map(), over.timezone, /* @__PURE__ */ new Map());
|
|
14785
|
+
const computed = computeFormulaFields(Object.fromEntries(cells), table.fields, /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map(), { timezone: over.timezone, language: over.language }, /* @__PURE__ */ new Map());
|
|
14686
14786
|
const out = new Map(cells);
|
|
14687
14787
|
for (const field of computable) out.set(field.key, computed[field.key]);
|
|
14688
14788
|
return { cells: out, stale };
|
package/dist/router.js
CHANGED
package/dist/rpc.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AppAbsence } from "./shared_types.js";
|
|
2
2
|
import type { AppSpec } from "./shared_types.js";
|
|
3
|
+
import type { DocumentTemplateLocale } from "./shared_types.js";
|
|
3
4
|
import type { AskUserChoiceOutput } from "./agent_stream.js";
|
|
4
5
|
import { type UrlParams, type UrlParamsPatch } from "./url_params.js";
|
|
5
6
|
/**
|
|
@@ -78,6 +79,9 @@ export interface AppContext {
|
|
|
78
79
|
/** The IANA zone every instant is dated in; absent from an older host, which
|
|
79
80
|
* reads in the viewer's zone. */
|
|
80
81
|
timezone?: string;
|
|
82
|
+
/** The language a date prints in where a formula states no pattern: the organization's; absent from an older host, which
|
|
83
|
+
* leaves such a formula unpredicted. */
|
|
84
|
+
language?: DocumentTemplateLocale;
|
|
81
85
|
/** The ISO 4217 code uncoded money is counted in; absent from an older host,
|
|
82
86
|
* which refuses such money rather than guess a currency. */
|
|
83
87
|
default_currency?: string;
|
package/dist/shared_types.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export interface AppFile {
|
|
|
27
27
|
place?: PhotoPlace;
|
|
28
28
|
}
|
|
29
29
|
export type AppLoadTiming = { boot_ms?: number | undefined; page_bytes?: number | undefined; page_connect_ms?: number | undefined; page_decoded_bytes?: number | undefined; page_download_ms?: number | undefined; page_ttfb_ms?: number | undefined; };
|
|
30
|
-
export type AppSpec = { version: 59; app: { alias: string; label: string; description: string | null; locale: "en" | "vi"; scope: { entity: string; param: string; counts: { query: string; param: string | null; } | null; list: string | null; } | null; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; } | null; }; entities: Record<string, { alias: string; label: string; singular: string | null; table: string; fields: Record<string, { alias: string; id: string; type: "autonumber" | "boolean" | "date" | "files" | "formula" | "lookup" | "number" | "rollup" | "select" | "select_member" | "select_record_link" | "text"; result: "boolean" | "date" | "files" | "number" | "select" | "select_member" | "select_record_link" | "text" | null; label: string; description: string | null; format: "datetime" | "link" | "markdown" | "month" | "text" | "time" | null; multi: boolean; photo_places: boolean; required: boolean; readonly: boolean; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; rating: number | null; limit: { field: string; } | { value: number; } | null; gate: { field: string; } | { value: number; } | null; due: boolean; frees: boolean; summed: boolean; accumulates: boolean; serial: boolean; whole: boolean; restates: string | null; starts: "me" | "today" | null; default: string | number | boolean | string[] | null; options: { id: string; alias: string; label: string; color: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | null; mark: { kind: string; name: string; } | null; short: string | null; }[] | null; link: string | null; accept: string | null; image: string | null; party: "organization" | "person" | null; pictures: { query: string; param: string; } | null; face: Record<string, string>; default_from: { link: string; field: string; } | null; reads: string[]; reads_through: string[]; counts: { entity: string; back: string | null; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; } | null; through: { link: string; field: string; } | null; pick: { query: string; param: string; same: { field: string; param: string; }[]; } | null; suggest: { query: string; param: string; column: string; } | null; applies: ({ field: string; options: string[]; } | { field: string; value: boolean; })[]; }>; title: string; subtitle: string[]; image: string | null; image_from: "any" | "images"; image_shape: "landscape" | "portrait" | "square" | null; mark: string | null; description: string | null; party: "organization" | "person" | null; lead: string | null; image_order: string[]; mine: string | null; unique: string[][]; status: { field: string; closed: string[]; dropped: string[]; history: string | null; dates: Record<string, string>; stages: { option: string; label: string; owner: { kind: "member"; column: string; label: string; } | { kind: "group"; group: string; label: string; }; within: number | null; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; }[]; maker: string | null; moves: { query: string; param: string; link: string; status: string; at: string; by: string | null; went: Record<string, string>; } | null; } | null; settled: string | null; task: { close: { to: string; act: string | null; } | null; reopen: { to: string; act: string | null; } | null; member: string | null; } | null; progress: { entity: string; via: string; passed: string | null; read: { query: string; param: string; }; }[]; figure: string | null; scan: { read: "iso6346" | "text"; agent: string; } | { read: "code"; } | null; place: { address: string; latitude: string; longitude: string; accuracy: string | null; } | null; pin: { on: string; x: string; y: string; } | null; cadence: { on: { days: ("fri" | "mon" | "sat" | "sun" | "thu" | "tue" | "wed")[]; } | { field: string; }; start: string | null; end: string | null; from: string | null; until: string | null; }[]; nests: { parent: string; children: string; closed: string | null; } | null; filed: Record<string, string>; list: { query: string; param: string | null; }; listed: string[] | null; one: { query: string; param: string; } | null; query: { opens: string[]; } | null; create: { workflow: string; fields: string[]; picker: string[] | null; picker_only: boolean; } | null; update: { workflow: string; fields: string[]; } | null; remove: { workflow: string; with: string[]; } | null; }>; views: ({ kind: "list"; key: string; label: string; entity: string; scope: { field: string; } | null; register: { columns: string[]; columns_stated: boolean; filters: (string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; })[]; source_column: boolean; beside: boolean; search: string[] | null; chips: boolean; checks: boolean; regroup: boolean; sort: { field: string; desc: boolean; }[] | null; group: string | null; tabs: { tab: string; label: string; term: { kind: "in"; field: string; } | { kind: "open"; from: string; to: string; } | null; totals: { via: string; read: { query: string; }; columns: { alias: string; label: string; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; average: boolean; }[]; } | null; where: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; sort: { field: string; desc: boolean; }[] | null; }[] | null; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; }; layout: SpecLayout; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; opens: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; remove: boolean; create: string[] | null; add_label: string | null; export: boolean; readings: ({ entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "progress"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; planned: { start: string; end: string; }; done: string; finished: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; })[]; attention: boolean; }; entities: string[]; sources: { entity: string; fields: Record<string, string>; scope: string | null; register: { columns: string[]; columns_stated: boolean; filters: (string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; })[]; source_column: boolean; beside: boolean; search: string[] | null; chips: boolean; checks: boolean; regroup: boolean; sort: { field: string; desc: boolean; }[] | null; group: string | null; tabs: { tab: string; label: string; term: { kind: "in"; field: string; } | { kind: "open"; from: string; to: string; } | null; totals: { via: string; read: { query: string; }; columns: { alias: string; label: string; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; average: boolean; }[]; } | null; where: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; sort: { field: string; desc: boolean; }[] | null; }[] | null; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; }; layout: SpecLayout; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; opens: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; remove: boolean; create: string[] | null; add_label: string | null; export: boolean; readings: ({ entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "progress"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; planned: { start: string; end: string; }; done: string; finished: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; })[]; attention: boolean; }; }[]; place: { options: Record<string, { id: string; alias: string; label: string; color: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | null; mark: { kind: string; name: string; } | null; short: string | null; }[]>; closed: string[]; } | null; bound: { read: { query: string; param: string; }; listed: string[]; same: { field: string; param: string; } | null; bounds: { field: string; param: string; of: "date" | "number"; lookup: boolean; }[]; via: string; } | null; } | { kind: "sheet"; key: string; label: string; readings: { reading: { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; }; scope: { field: string; } | null; }[]; })[]; pages: Record<string, { door: "drawer" | "page" | null; sections: { title: string | null; description: string | null; at: string[] | null; fields: string[]; groups: { label: string; fields: string[]; acts: string[]; heads: string[] | null; lines: { key: string; label: string | null; cells: ({ kind: "field"; field: string; } | { kind: "blank"; } | { kind: "act"; act: string; } | { kind: "value"; key: string; label: string; compute: { expression: string; reads: Record<string, { from: "row"; field: string; } | { from: "record"; field: string; } | { from: "place"; field: string; } | { from: "formula"; expression: string; }>; }; output: "boolean" | "date" | "datetime" | "number" | "text"; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; })[]; }[] | null; }[]; reads: string[]; blocks: ({ kind: "funnel"; entity: string; read: { query: string; param: string; }; label: string; steps: string[]; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "agenda"; key: string; day: string; time: string | null; part: string | null; start: string | null; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "figures"; fields: string[]; labels: Record<string, string>; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "files"; fields: string[]; title: string; add_label: string | null; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "list"; key: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { key: string; totals: Record<string, string>; narrower: string[]; soonest: string[]; expect: string | null; of: string | null; add_form: { preset: Record<string, { id: string; label: string; }>; among: Record<string, string[]>; } | null; edits: string[]; pick: { read: { query: string; param: string | null; }; back: string; same: { field: string; param: string; }[]; admits: { query: string; param: string | null; } | null; } | null; checklist: { photo: string | null; clause: string | null; words: string[]; failed: string[]; passed: string | null; } | null; gantt: { start: string; end: string; milestones: string[]; planned: { start: string | null; end: string | null; } | null; progress: string | null; after: string | null; } | null; compare: { before: string; after: string; } | null; current: string | null; post: { bodies: string[]; text: string; compute: { expression: string; reads: Record<string, { from: "row"; field: string; } | { from: "record"; field: string; } | { from: "place"; field: string; } | { from: "formula"; expression: string; }>; } | null; media: string; link: string | null; network: string; group: string | null; networks: Record<string, "facebook" | "instagram" | "linkedin" | "threads" | "x">; } | null; under: { field: string; entity: string; via: string; back: string; read: { query: string; param: string; listed: string[]; }; key: string; where: { field: string; options: string[]; }[]; add_form: { preset: Record<string, { id: string; label: string; }>; among: Record<string, string[]>; } | null; } | null; layout: "cards" | "table" | null | undefined; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; kind: "rows"; } | { key: string; totals: Record<string, string>; narrower: string[]; soonest: string[]; expect: string | null; of: string | null; add_form: { preset: Record<string, { id: string; label: string; }>; among: Record<string, string[]>; } | null; edits: string[]; pick: { read: { query: string; param: string | null; }; back: string; same: { field: string; param: string; }[]; admits: { query: string; param: string | null; } | null; } | null; checklist: { photo: string | null; clause: string | null; words: string[]; failed: string[]; passed: string | null; } | null; gantt: { start: string; end: string; milestones: string[]; planned: { start: string | null; end: string | null; } | null; progress: string | null; after: string | null; } | null; compare: { before: string; after: string; } | null; current: string | null; post: { bodies: string[]; text: string; compute: { expression: string; reads: Record<string, { from: "row"; field: string; } | { from: "record"; field: string; } | { from: "place"; field: string; } | { from: "formula"; expression: string; }>; } | null; media: string; link: string | null; network: string; group: string | null; networks: Record<string, "facebook" | "instagram" | "linkedin" | "threads" | "x">; } | null; under: { field: string; entity: string; via: string; back: string; read: { query: string; param: string; listed: string[]; }; key: string; where: { field: string; options: string[]; }[]; add_form: { preset: Record<string, { id: string; label: string; }>; among: Record<string, string[]>; } | null; } | null; layout: "cards" | "table" | null | undefined; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; kind: "outline"; counts: { query: string; param: string; }; } | { kind: "reading"; reading: { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "progress"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; planned: { start: string; end: string; }; done: string; finished: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; }; via: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "statement"; title: string; lines: { field: string; op: "equals" | "minus" | "plus" | "times" | null; rate: string | null; parts: { entity: string; read: { query: string; param: string; listed: string[]; }; same: string; before: { field: string; param: string; } | null; columns: string[]; figure: string; } | null; }[]; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "text"; field: string; title: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "comments"; key: string; title: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "choices"; field: string; title: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "linked"; field: string; title: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "timeline"; key: string; at: string; by: string | null; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; })[]; acts: string[]; entry: string[]; acts_last: boolean; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; side: boolean; }[]; views: { kind: "list"; key: string; label: string; entity: string; scope: { field: string; } | null; register: { columns: string[]; columns_stated: boolean; filters: (string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; })[]; source_column: boolean; beside: boolean; search: string[] | null; chips: boolean; checks: boolean; regroup: boolean; sort: { field: string; desc: boolean; }[] | null; group: string | null; tabs: { tab: string; label: string; term: { kind: "in"; field: string; } | { kind: "open"; from: string; to: string; } | null; totals: { via: string; read: { query: string; }; columns: { alias: string; label: string; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; average: boolean; }[]; } | null; where: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; sort: { field: string; desc: boolean; }[] | null; }[] | null; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; }; layout: SpecLayout; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; opens: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; remove: boolean; create: string[] | null; add_label: string | null; export: boolean; readings: ({ entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "progress"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; planned: { start: string; end: string; }; done: string; finished: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; })[]; attention: boolean; }; entities: string[]; sources: { entity: string; fields: Record<string, string>; scope: string | null; register: { columns: string[]; columns_stated: boolean; filters: (string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; })[]; source_column: boolean; beside: boolean; search: string[] | null; chips: boolean; checks: boolean; regroup: boolean; sort: { field: string; desc: boolean; }[] | null; group: string | null; tabs: { tab: string; label: string; term: { kind: "in"; field: string; } | { kind: "open"; from: string; to: string; } | null; totals: { via: string; read: { query: string; }; columns: { alias: string; label: string; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; average: boolean; }[]; } | null; where: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; sort: { field: string; desc: boolean; }[] | null; }[] | null; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; }; layout: SpecLayout; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; opens: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; remove: boolean; create: string[] | null; add_label: string | null; export: boolean; readings: ({ entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "progress"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; planned: { start: string; end: string; }; done: string; finished: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; })[]; attention: boolean; }; }[]; place: { options: Record<string, { id: string; alias: string; label: string; color: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | null; mark: { kind: string; name: string; } | null; short: string | null; }[]>; closed: string[]; } | null; bound: { read: { query: string; param: string; }; listed: string[]; same: { field: string; param: string; } | null; bounds: { field: string; param: string; of: "date" | "number"; lookup: boolean; }[]; via: string; } | null; }[]; draws: string[]; outside: { key: string; entity: string; at: string[]; one: { query: string; param: string; }; page: { door: "page"; draws: string[]; sections: [{ title: string; description: string | null; fields: string[]; blocks: { kind: "list"; key: string; reading: { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; }; via: string; same: { field: string; param: string; } | null; bounds: { field: string; param: string; of: "date" | "number"; lookup: boolean; }[]; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; after: number; }[]; acts: string[]; }]; }; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; }; }[]; moves: { entity: string; via: string; read: { query: string; param: string; }; title: string; at: string; by: string | null; create: string[] | null; add_label: string | null; } | null; }>; acts: { alias: string; label: string; on: "record" | "rows" | "view"; rowless: boolean; period: boolean; of: string; workflow: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; to: string | null; writes: boolean; into: string | null; paper: { entity: string; option: string; } | null; marks: Record<string, boolean>; requires: string[]; recommends: string[]; asks: (string | { input: string; label: string; type: "date" | "file" | "link" | "long_text" | "member" | "number" | "select" | "text"; options: { alias: string; label: string; color: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | null; mark: { kind: string; name: string; } | null; short: string | null; }[] | null; entity: string | null; required: boolean; default: string | null; starts: "me" | "today" | null; accept: string | null; })[]; asking: Record<string, { alias: string; id: string; type: "autonumber" | "boolean" | "date" | "files" | "formula" | "lookup" | "number" | "rollup" | "select" | "select_member" | "select_record_link" | "text"; result: "boolean" | "date" | "files" | "number" | "select" | "select_member" | "select_record_link" | "text" | null; label: string; description: string | null; format: "datetime" | "link" | "markdown" | "month" | "text" | "time" | null; multi: boolean; photo_places: boolean; required: boolean; readonly: boolean; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; rating: number | null; limit: { field: string; } | { value: number; } | null; gate: { field: string; } | { value: number; } | null; due: boolean; frees: boolean; summed: boolean; accumulates: boolean; serial: boolean; whole: boolean; restates: string | null; starts: "me" | "today" | null; default: string | number | boolean | string[] | null; options: { id: string; alias: string; label: string; color: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | null; mark: { kind: string; name: string; } | null; short: string | null; }[] | null; link: string | null; accept: string | null; image: string | null; party: "organization" | "person" | null; pictures: { query: string; param: string; } | null; face: Record<string, string>; default_from: { link: string; field: string; } | null; reads: string[]; reads_through: string[]; counts: { entity: string; back: string | null; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; } | null; through: { link: string; field: string; } | null; pick: { query: string; param: string; same: { field: string; param: string; }[]; } | null; suggest: { query: string; param: string; column: string; } | null; applies: ({ field: string; options: string[]; } | { field: string; value: boolean; })[]; }>; starts: Record<string, "me" | "today">; makes: string | null; papers: { template: string; label: string; when: ({ field: string; options: string[]; } | { field: string; value: boolean; })[]; }[] | null; archive: string | null; intake: { agent: string; papers: { entity: string; kind: string; files: string; }; fields: string[]; parties: { link: string; fields: string[]; key: string[]; }[]; rows: { entity: string; fields: string[]; key: string[]; }[]; links: { entity: string; table: string; }[]; } | null; recording: { into: string; via: string; audio: string; transcript: string; video: string | null; agent: string | null; } | null; sign: { into: string; by: string; at: string; witness: string | null; } | null; review: boolean; owes: { entity: string; via: string; day: string; end: string | null; planned: string | null; cadence: number; } | null; confirm: string | true | null; danger: boolean; owner: { kind: "member"; column: string; label: string; } | { kind: "group"; group: string; label: string; } | null; corrects: boolean; drafted: boolean; stands: string[]; views: string[]; }[]; checks: { field: string; of: string; blocks: "all" | string[] | null; resolve: string[]; reads: string[]; stands: string[]; }[]; };
|
|
30
|
+
export type AppSpec = { version: 60; app: { alias: string; label: string; description: string | null; locale: DocumentTemplateLocale; scope: { entity: string; param: string; counts: { query: string; param: string | null; } | null; list: string | null; } | null; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; } | null; }; entities: Record<string, { alias: string; label: string; singular: string | null; table: string; fields: Record<string, { alias: string; id: string; type: "autonumber" | "boolean" | "date" | "files" | "formula" | "lookup" | "number" | "rollup" | "select" | "select_member" | "select_record_link" | "text"; result: "boolean" | "date" | "files" | "number" | "select" | "select_member" | "select_record_link" | "text" | null; label: string; description: string | null; format: "datetime" | "link" | "markdown" | "month" | "text" | "time" | null; multi: boolean; photo_places: boolean; required: boolean; readonly: boolean; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; rating: number | null; limit: { field: string; } | { value: number; } | null; gate: { field: string; } | { value: number; } | null; due: boolean; frees: boolean; summed: boolean; accumulates: boolean; serial: boolean; whole: boolean; restates: string | null; starts: "me" | "today" | null; default: string | number | boolean | string[] | null; options: { id: string; alias: string; label: string; color: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | null; mark: { kind: string; name: string; } | null; short: string | null; }[] | null; link: string | null; accept: string | null; image: string | null; party: "organization" | "person" | null; pictures: { query: string; param: string; } | null; face: Record<string, string>; default_from: { link: string; field: string; } | null; reads: string[]; reads_through: string[]; counts: { entity: string; back: string | null; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; } | null; through: { link: string; field: string; } | null; pick: { query: string; param: string; same: { field: string; param: string; }[]; } | null; suggest: { query: string; param: string; column: string; } | null; applies: ({ field: string; options: string[]; } | { field: string; value: boolean; })[]; }>; title: string; subtitle: string[]; image: string | null; image_from: "any" | "images"; image_shape: "landscape" | "portrait" | "square" | null; mark: string | null; description: string | null; party: "organization" | "person" | null; lead: string | null; image_order: string[]; mine: string | null; unique: string[][]; status: { field: string; closed: string[]; dropped: string[]; history: string | null; dates: Record<string, string>; stages: { option: string; label: string; owner: { kind: "member"; column: string; label: string; } | { kind: "group"; group: string; label: string; }; within: number | null; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; }[]; maker: string | null; moves: { query: string; param: string; link: string; status: string; at: string; by: string | null; went: Record<string, string>; } | null; } | null; settled: string | null; task: { close: { to: string; act: string | null; } | null; reopen: { to: string; act: string | null; } | null; member: string | null; } | null; progress: { entity: string; via: string; passed: string | null; read: { query: string; param: string; }; }[]; figure: string | null; scan: { read: "iso6346" | "text"; agent: string; } | { read: "code"; } | null; place: { address: string; latitude: string; longitude: string; accuracy: string | null; } | null; pin: { on: string; x: string; y: string; } | null; cadence: { on: { days: ("fri" | "mon" | "sat" | "sun" | "thu" | "tue" | "wed")[]; } | { field: string; }; start: string | null; end: string | null; from: string | null; until: string | null; }[]; nests: { parent: string; children: string; closed: string | null; } | null; filed: Record<string, string>; list: { query: string; param: string | null; }; listed: string[] | null; one: { query: string; param: string; } | null; query: { opens: string[]; } | null; create: { workflow: string; fields: string[]; picker: string[] | null; picker_only: boolean; } | null; update: { workflow: string; fields: string[]; } | null; remove: { workflow: string; with: string[]; } | null; }>; views: ({ kind: "list"; key: string; label: string; entity: string; scope: { field: string; } | null; register: { columns: string[]; columns_stated: boolean; filters: (string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; })[]; source_column: boolean; beside: boolean; search: string[] | null; chips: boolean; checks: boolean; regroup: boolean; sort: { field: string; desc: boolean; }[] | null; group: string | null; tabs: { tab: string; label: string; term: { kind: "in"; field: string; } | { kind: "open"; from: string; to: string; } | null; totals: { via: string; read: { query: string; }; columns: { alias: string; label: string; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; average: boolean; }[]; } | null; where: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; sort: { field: string; desc: boolean; }[] | null; }[] | null; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; }; layout: SpecLayout; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; opens: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; remove: boolean; create: string[] | null; add_label: string | null; export: boolean; readings: ({ entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "progress"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; planned: { start: string; end: string; }; done: string; finished: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; })[]; attention: boolean; }; entities: string[]; sources: { entity: string; fields: Record<string, string>; scope: string | null; register: { columns: string[]; columns_stated: boolean; filters: (string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; })[]; source_column: boolean; beside: boolean; search: string[] | null; chips: boolean; checks: boolean; regroup: boolean; sort: { field: string; desc: boolean; }[] | null; group: string | null; tabs: { tab: string; label: string; term: { kind: "in"; field: string; } | { kind: "open"; from: string; to: string; } | null; totals: { via: string; read: { query: string; }; columns: { alias: string; label: string; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; average: boolean; }[]; } | null; where: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; sort: { field: string; desc: boolean; }[] | null; }[] | null; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; }; layout: SpecLayout; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; opens: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; remove: boolean; create: string[] | null; add_label: string | null; export: boolean; readings: ({ entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "progress"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; planned: { start: string; end: string; }; done: string; finished: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; })[]; attention: boolean; }; }[]; place: { options: Record<string, { id: string; alias: string; label: string; color: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | null; mark: { kind: string; name: string; } | null; short: string | null; }[]>; closed: string[]; } | null; bound: { read: { query: string; param: string; }; listed: string[]; same: { field: string; param: string; } | null; bounds: { field: string; param: string; of: "date" | "number"; lookup: boolean; }[]; via: string; } | null; } | { kind: "sheet"; key: string; label: string; readings: { reading: { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; }; scope: { field: string; } | null; }[]; })[]; pages: Record<string, { door: "drawer" | "page" | null; facts?: string[] | undefined; checks?: false | undefined; sections: { title: string | null; description: string | null; at: string[] | null; fields: string[]; groups: { label: string; fields: string[]; acts: string[]; heads: string[] | null; lines: { key: string; label: string | null; cells: ({ kind: "field"; field: string; } | { kind: "blank"; } | { kind: "act"; act: string; } | { kind: "value"; key: string; label: string; compute: { expression: string; reads: Record<string, { from: "row"; field: string; } | { from: "record"; field: string; } | { from: "place"; field: string; } | { from: "formula"; expression: string; }>; }; output: "boolean" | "date" | "datetime" | "number" | "text"; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; })[]; }[] | null; }[]; reads: string[]; blocks: ({ kind: "funnel"; entity: string; read: { query: string; param: string; }; label: string; steps: string[]; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "agenda"; key: string; day: string; time: string | null; part: string | null; start: string | null; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "figures"; fields: string[]; labels: Record<string, string>; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "files"; fields: string[]; title: string; add_label: string | null; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "list"; key: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { key: string; totals: Record<string, string>; narrower: string[]; soonest: string[]; expect: string | null; of: string | null; add_form: { preset: Record<string, { id: string; label: string; }>; among: Record<string, string[]>; } | null; edits: string[]; pick: { read: { query: string; param: string | null; }; back: string; same: { field: string; param: string; }[]; admits: { query: string; param: string | null; } | null; } | null; checklist: { photo: string | null; clause: string | null; words: string[]; failed: string[]; passed: string | null; } | null; gantt: { start: string; end: string; milestones: string[]; planned: { start: string | null; end: string | null; } | null; progress: string | null; after: string | null; } | null; compare: { before: string; after: string; } | null; current: string | null; post: { bodies: string[]; text: string; compute: { expression: string; reads: Record<string, { from: "row"; field: string; } | { from: "record"; field: string; } | { from: "place"; field: string; } | { from: "formula"; expression: string; }>; } | null; media: string; link: string | null; network: string; group: string | null; networks: Record<string, "facebook" | "instagram" | "linkedin" | "threads" | "x">; } | null; under: { field: string; entity: string; via: string; back: string; read: { query: string; param: string; listed: string[]; }; key: string; where: { field: string; options: string[]; }[]; add_form: { preset: Record<string, { id: string; label: string; }>; among: Record<string, string[]>; } | null; } | null; layout: "cards" | "table" | null | undefined; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; kind: "rows"; } | { key: string; totals: Record<string, string>; narrower: string[]; soonest: string[]; expect: string | null; of: string | null; add_form: { preset: Record<string, { id: string; label: string; }>; among: Record<string, string[]>; } | null; edits: string[]; pick: { read: { query: string; param: string | null; }; back: string; same: { field: string; param: string; }[]; admits: { query: string; param: string | null; } | null; } | null; checklist: { photo: string | null; clause: string | null; words: string[]; failed: string[]; passed: string | null; } | null; gantt: { start: string; end: string; milestones: string[]; planned: { start: string | null; end: string | null; } | null; progress: string | null; after: string | null; } | null; compare: { before: string; after: string; } | null; current: string | null; post: { bodies: string[]; text: string; compute: { expression: string; reads: Record<string, { from: "row"; field: string; } | { from: "record"; field: string; } | { from: "place"; field: string; } | { from: "formula"; expression: string; }>; } | null; media: string; link: string | null; network: string; group: string | null; networks: Record<string, "facebook" | "instagram" | "linkedin" | "threads" | "x">; } | null; under: { field: string; entity: string; via: string; back: string; read: { query: string; param: string; listed: string[]; }; key: string; where: { field: string; options: string[]; }[]; add_form: { preset: Record<string, { id: string; label: string; }>; among: Record<string, string[]>; } | null; } | null; layout: "cards" | "table" | null | undefined; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; kind: "outline"; counts: { query: string; param: string; }; } | { kind: "reading"; reading: { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "progress"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; planned: { start: string; end: string; }; done: string; finished: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; }; via: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "statement"; title: string; lines: { field: string; op: "equals" | "minus" | "plus" | "times" | null; rate: string | null; parts: { entity: string; read: { query: string; param: string; listed: string[]; }; same: string; before: { field: string; param: string; } | null; columns: string[]; figure: string; } | null; }[]; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "text"; field: string; title: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "comments"; key: string; title: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "choices"; field: string; title: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "linked"; field: string; title: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; } | { kind: "timeline"; key: string; at: string; by: string | null; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; })[]; acts: string[]; entry: string[]; acts_last: boolean; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; side: boolean; }[]; views: { kind: "list"; key: string; label: string; entity: string; scope: { field: string; } | null; register: { columns: string[]; columns_stated: boolean; filters: (string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; })[]; source_column: boolean; beside: boolean; search: string[] | null; chips: boolean; checks: boolean; regroup: boolean; sort: { field: string; desc: boolean; }[] | null; group: string | null; tabs: { tab: string; label: string; term: { kind: "in"; field: string; } | { kind: "open"; from: string; to: string; } | null; totals: { via: string; read: { query: string; }; columns: { alias: string; label: string; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; average: boolean; }[]; } | null; where: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; sort: { field: string; desc: boolean; }[] | null; }[] | null; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; }; layout: SpecLayout; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; opens: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; remove: boolean; create: string[] | null; add_label: string | null; export: boolean; readings: ({ entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "progress"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; planned: { start: string; end: string; }; done: string; finished: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; })[]; attention: boolean; }; entities: string[]; sources: { entity: string; fields: Record<string, string>; scope: string | null; register: { columns: string[]; columns_stated: boolean; filters: (string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; })[]; source_column: boolean; beside: boolean; search: string[] | null; chips: boolean; checks: boolean; regroup: boolean; sort: { field: string; desc: boolean; }[] | null; group: string | null; tabs: { tab: string; label: string; term: { kind: "in"; field: string; } | { kind: "open"; from: string; to: string; } | null; totals: { via: string; read: { query: string; }; columns: { alias: string; label: string; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; average: boolean; }[]; } | null; where: ({ field: string; options: string[]; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; sort: { field: string; desc: boolean; }[] | null; }[] | null; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; }; layout: SpecLayout; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; opens: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; remove: boolean; create: string[] | null; add_label: string | null; export: boolean; readings: ({ entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "breakdown"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; average: boolean; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "metric"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; value: string | null; average: boolean; over: string | null; target: number | null; better: "down" | "up" | null; bound: { value: number; } | { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; } | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "pivot"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; rows: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; columns: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; }; value: string | null; over: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "progress"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; planned: { start: string; end: string; }; done: string; finished: string | null; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "shortfall"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; by: string; across: string | null; value: string | null; on_hand: { entity: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; by: string | null; across: string | null; value: string | null; }; } | { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "trend"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; over: string; value: string | null; average: boolean; ahead: boolean; split: string | { field: string; tiers: number[]; } | { field: string; values: "all" | "held"; } | null; })[]; attention: boolean; }; }[]; place: { options: Record<string, { id: string; alias: string; label: string; color: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | null; mark: { kind: string; name: string; } | null; short: string | null; }[]>; closed: string[]; } | null; bound: { read: { query: string; param: string; }; listed: string[]; same: { field: string; param: string; } | null; bounds: { field: string; param: string; of: "date" | "number"; lookup: boolean; }[]; via: string; } | null; }[]; draws: string[]; outside: { key: string; entity: string; at: string[]; one: { query: string; param: string; }; page: { door: "page"; draws: string[]; sections: [{ title: string; description: string | null; fields: string[]; blocks: { kind: "list"; key: string; reading: { entity: string; label: string; read: { query: string; param: string | null; aggregate: { by: string[] | null; bands: Record<string, number[]> | null; day: string | null; sum: string | null; } | null; }; kind: "list"; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number | RecordBound>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | RecordBound | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; } | { field: string; through: true; })[]; tab: string | null; columns: string[]; }; via: string; same: { field: string; param: string; } | null; bounds: { field: string; param: string; of: "date" | "number"; lookup: boolean; }[]; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; after: number; }[]; acts: string[]; }]; }; opens_on: { days: number; } | { span: "day" | "month" | "quarter" | "week" | "year"; view: "day" | "month" | "week" | null; ahead: boolean; }; }[]; moves: { entity: string; via: string; read: { query: string; param: string; }; title: string; at: string; by: string | null; create: string[] | null; add_label: string | null; } | null; }>; acts: { alias: string; label: string; on: "record" | "rows" | "view"; rowless: boolean; period: boolean; of: string; workflow: string; when: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<Bound>; of: "date" | "datetime" | "number"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; })[]; to: string | null; writes: boolean; into: string | null; paper: { entity: string; option: string; } | null; marks: Record<string, boolean>; requires: string[]; recommends: string[]; asks: (string | { input: string; label: string; type: "date" | "file" | "link" | "long_text" | "member" | "number" | "select" | "text"; options: { alias: string; label: string; color: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | null; mark: { kind: string; name: string; } | null; short: string | null; }[] | null; entity: string | null; required: boolean; default: string | null; starts: "me" | "today" | null; accept: string | null; })[]; asking: Record<string, { alias: string; id: string; type: "autonumber" | "boolean" | "date" | "files" | "formula" | "lookup" | "number" | "rollup" | "select" | "select_member" | "select_record_link" | "text"; result: "boolean" | "date" | "files" | "number" | "select" | "select_member" | "select_record_link" | "text" | null; label: string; description: string | null; format: "datetime" | "link" | "markdown" | "month" | "text" | "time" | null; multi: boolean; photo_places: boolean; required: boolean; readonly: boolean; notation: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | null; rating: number | null; limit: { field: string; } | { value: number; } | null; gate: { field: string; } | { value: number; } | null; due: boolean; frees: boolean; summed: boolean; accumulates: boolean; serial: boolean; whole: boolean; restates: string | null; starts: "me" | "today" | null; default: string | number | boolean | string[] | null; options: { id: string; alias: string; label: string; color: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | null; mark: { kind: string; name: string; } | null; short: string | null; }[] | null; link: string | null; accept: string | null; image: string | null; party: "organization" | "person" | null; pictures: { query: string; param: string; } | null; face: Record<string, string>; default_from: { link: string; field: string; } | null; reads: string[]; reads_through: string[]; counts: { entity: string; back: string | null; where: ({ field: string; options: string[]; } | { field: string; compare: StatedBounds<number>; of: "number"; zone: string | null; } | { field: string; compare: StatedBounds<string | { now: true; }>; of: "date" | "datetime"; zone: string | null; } | { field: string; empty: boolean; } | { field: string; value: boolean; } | { field: string; member: "me"; })[]; } | null; through: { link: string; field: string; } | null; pick: { query: string; param: string; same: { field: string; param: string; }[]; } | null; suggest: { query: string; param: string; column: string; } | null; applies: ({ field: string; options: string[]; } | { field: string; value: boolean; })[]; }>; starts: Record<string, "me" | "today">; makes: string | null; papers: { template: string; label: string; when: ({ field: string; options: string[]; } | { field: string; value: boolean; })[]; }[] | null; archive: string | null; intake: { agent: string; papers: { entity: string; kind: string; files: string; }; fields: string[]; parties: { link: string; fields: string[]; key: string[]; }[]; rows: { entity: string; fields: string[]; key: string[]; }[]; links: { entity: string; table: string; }[]; } | null; recording: { into: string; via: string; audio: string; transcript: string; video: string | null; agent: string | null; } | null; sign: { into: string; by: string; at: string; witness: string | null; } | null; review: boolean; owes: { entity: string; via: string; day: string; end: string | null; planned: string | null; cadence: number; } | null; confirm: string | true | null; danger: boolean; owner: { kind: "member"; column: string; label: string; } | { kind: "group"; group: string; label: string; } | null; corrects: boolean; drafted: boolean; stands: string[]; views: string[]; }[]; checks: { field: string; of: string; blocks: "all" | string[] | null; resolve: string[]; reads: string[]; stands: string[]; }[]; };
|
|
31
31
|
/** What a body read needs of a table: its id, its name for a refusal, and its fields. */
|
|
32
32
|
export type BodyTable = { id: string; name: string; fields: (TableField)[]; title_field_key: string | null; };
|
|
33
33
|
/**
|
|
@@ -40,6 +40,7 @@ export type Bound<R = { record: string; }> = string | number | R | { now: true;
|
|
|
40
40
|
export interface CardsSpec {
|
|
41
41
|
kind: "cards";
|
|
42
42
|
}
|
|
43
|
+
export type DocumentTemplateLocale = "en" | "vi";
|
|
43
44
|
export interface ExportCall {
|
|
44
45
|
params?: { [x: string]: unknown; };
|
|
45
46
|
filter?: QueryFilterGroup<string> | QueryFilterCondition<string>;
|
|
@@ -57,7 +58,7 @@ export interface ExportCall {
|
|
|
57
58
|
/** The file an export makes: the report workbook — its words in `language`, the rows under `columns` on the tab `sheet`. */
|
|
58
59
|
export interface ExportFile {
|
|
59
60
|
kind: "workbook";
|
|
60
|
-
language:
|
|
61
|
+
language: DocumentTemplateLocale;
|
|
61
62
|
sheet: string;
|
|
62
63
|
columns: ReportColumn[];
|
|
63
64
|
}
|
package/dist/viewer.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DocumentTemplateLocale } from "./shared_types.js";
|
|
1
2
|
import type { AppAbsence } from "./shared_types.js";
|
|
2
3
|
import { type AppContext } from "./rpc.js";
|
|
3
4
|
/** The store key the host's context is held under, read by every screen and by the write model alike. */
|
|
@@ -21,6 +22,8 @@ export declare function useAppContext(): {
|
|
|
21
22
|
commentsEnabled: boolean;
|
|
22
23
|
recordingEnabled: boolean;
|
|
23
24
|
timezone: string | undefined;
|
|
25
|
+
/** The language a date prints in where a formula states no pattern: the organization's; `undefined` from an older host. */
|
|
26
|
+
language: DocumentTemplateLocale | undefined;
|
|
24
27
|
currency: string | undefined;
|
|
25
28
|
resolved: boolean;
|
|
26
29
|
settled: boolean;
|
package/dist/written.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type BodyTable } from "./shared_types.js";
|
|
2
2
|
import type { TableField } from "./shared_types.js";
|
|
3
3
|
import type { QueryWriteShape } from "./shared_types.js";
|
|
4
|
+
import type { DocumentTemplateLocale } from "./shared_types.js";
|
|
4
5
|
export type Row = Record<string, unknown>;
|
|
5
6
|
/** A predicted write in the shape rows store it: an option as `["opt_…"]`, a link as `[{ id, display }]`. */
|
|
6
7
|
export type Staged = {
|
|
@@ -60,6 +61,8 @@ export interface Over {
|
|
|
60
61
|
member: (id: string) => unknown;
|
|
61
62
|
memberId: string | null;
|
|
62
63
|
timezone: string | undefined;
|
|
64
|
+
/** Absent from an older host: a formula printing a date with no pattern is refused there, never guessed. */
|
|
65
|
+
language: DocumentTemplateLocale | undefined;
|
|
63
66
|
staged: readonly Staged[];
|
|
64
67
|
/** The rows of writes the server has kept, which open as any other. */
|
|
65
68
|
kept: ReadonlySet<string>;
|
|
@@ -264,7 +264,7 @@ failure is logged to the console.
|
|
|
264
264
|
## `useAppContext()` — the host's context, and whether it could be read
|
|
265
265
|
|
|
266
266
|
`useAppContext()` (`dist/viewer.d.ts`) is the one read every hook above is a view of: the
|
|
267
|
-
signed-in member, whether comments are enabled, the workspace's zone and currency, and three
|
|
267
|
+
signed-in member, whether comments are enabled, the workspace's zone, language and currency, and three
|
|
268
268
|
states — `resolved` once it answered, `settled` once it answered OR failed, and `failure` —
|
|
269
269
|
`{ message, retry }`, `null` unless the read failed. Where it failed every fact is unknown, so a
|
|
270
270
|
surface that dates or counts by them draws the failure rather than guessing the reader's zone.
|
package/docs/runtime.md
CHANGED
|
@@ -299,13 +299,13 @@ The **streaming** agent-run op is *not* reachable through `rpc()` — its
|
|
|
299
299
|
response is a chunk stream, not a single value; it's internal to `useAgentRun`.
|
|
300
300
|
|
|
301
301
|
`rpc("context", {})` resolves the viewer and the workspace:
|
|
302
|
-
`{ member_id, timezone, default_currency, recording_enabled?, recordings? }`. `member_id` is the
|
|
302
|
+
`{ member_id, timezone, language, default_currency, recording_enabled?, recordings? }`. `member_id` is the
|
|
303
303
|
signed-in member when embedded, `null` standalone; `timezone` is the workspace's
|
|
304
|
-
IANA zone and `default_currency` its ISO 4217 code, from the host when embedded
|
|
304
|
+
IANA zone, `language` its organization's (`vi` or `en`: the form `formatDate` prints with no pattern) and `default_currency` its ISO 4217 code, from the host when embedded
|
|
305
305
|
and from `/v1/apps/by-subdomain/{subdomain}` standalone. Read them through
|
|
306
|
-
`useViewer()`, `useWorkspaceTimezone()` and `
|
|
306
|
+
`useViewer()`, `useWorkspaceTimezone()`, `useWorkspaceCurrency()` and `useAppContext()` (the language)
|
|
307
307
|
([members & options](./members_and_options.md)) rather than this op. A host that
|
|
308
|
-
predates
|
|
308
|
+
predates these workspace facts answers without them — with no language, a `formatDate` with no pattern is refused and a press's effects are not predicted; the recording fields are
|
|
309
309
|
`useRecording`'s. **Limitation:** the
|
|
310
310
|
context type is not exported from the package root, so type the result yourself
|
|
311
311
|
via the `rpc<T>` generic.
|
package/package.json
CHANGED