@lotics/app-sdk 0.133.29 → 0.133.31
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/index.js +13 -9
- package/dist/shared_types.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8187,6 +8187,9 @@ var TOOL_INPUT_SEMANTICS = {
|
|
|
8187
8187
|
// carries no field key or record id of its own, so nothing resolves it —
|
|
8188
8188
|
// but it is why `rows` above must stay `dynamic`.
|
|
8189
8189
|
row_op: { kind: "scalar" },
|
|
8190
|
+
// A file's id; a body's save refuses it, since the fields a body writes are judged from its own text.
|
|
8191
|
+
rows_file_id: { kind: "scalar" },
|
|
8192
|
+
as_file: { kind: "scalar" },
|
|
8190
8193
|
dry_run: { kind: "scalar" },
|
|
8191
8194
|
as_member: { kind: "scalar" },
|
|
8192
8195
|
constants: { kind: "record_data", table_from: "table_id", writes: "values" },
|
|
@@ -8204,6 +8207,8 @@ var TOOL_INPUT_SEMANTICS = {
|
|
|
8204
8207
|
// Per-record cells — semantic depends on field_keys[i]; tool resolves.
|
|
8205
8208
|
rows: { kind: "dynamic" },
|
|
8206
8209
|
constants: { kind: "record_data", table_from: "table_id", writes: "initial" },
|
|
8210
|
+
// A file's id; a body's save refuses it, since the fields a body writes are judged from its own text.
|
|
8211
|
+
rows_file_id: { kind: "scalar" },
|
|
8207
8212
|
// Caller-minted ids for records that do NOT exist yet — the only `record_refs`
|
|
8208
8213
|
// position that points forward rather than back. Classified by shape (they are
|
|
8209
8214
|
// `rec_*` identifiers) which is all this kind asserts: normalization passes it
|
|
@@ -8275,6 +8280,7 @@ var TOOL_INPUT_SEMANTICS = {
|
|
|
8275
8280
|
page_size: { kind: "scalar" },
|
|
8276
8281
|
archived_only: { kind: "scalar" },
|
|
8277
8282
|
include_timestamps: { kind: "scalar" },
|
|
8283
|
+
as_file: { kind: "scalar" },
|
|
8278
8284
|
as_member: { kind: "scalar" },
|
|
8279
8285
|
comments: { kind: "scalar" },
|
|
8280
8286
|
record_ids: { kind: "record_refs" },
|
|
@@ -13959,25 +13965,23 @@ function prepareFormulaContext(fields) {
|
|
|
13959
13965
|
photoPlaceFields: new Set(sortedFields.flatMap((prepared) => prepared.refs.photoPlaceKeys).filter((key) => fields.some((field) => field.key === key && field.type === "files" && field.photo_places === true)))
|
|
13960
13966
|
};
|
|
13961
13967
|
}
|
|
13962
|
-
var NO_NAMING = /* @__PURE__ */ new Map();
|
|
13963
13968
|
var FileFactsUnloadedError = class extends Error {
|
|
13964
13969
|
constructor(fieldKeys) {
|
|
13965
13970
|
super(`A formula reads the photo places of files fields ${[...fieldKeys].join(", ")}, and this pass was handed no file facts`);
|
|
13966
13971
|
this.name = "FileFactsUnloadedError";
|
|
13967
13972
|
}
|
|
13968
13973
|
};
|
|
13969
|
-
function computeFormulaFieldsWithContext(row2, fields, context, linkedTableRecords = NO_LINKED_ROWS, linkedTableFields = /* @__PURE__ */ new Map(), timezone, loadedLinkKeys, linkExpandedTableIds, fileFacts, memberNames
|
|
13974
|
+
function computeFormulaFieldsWithContext(row2, fields, context, linkedTableRecords = NO_LINKED_ROWS, linkedTableFields = /* @__PURE__ */ new Map(), timezone, loadedLinkKeys, linkExpandedTableIds, fileFacts, memberNames) {
|
|
13970
13975
|
const result = { ...row2 };
|
|
13971
13976
|
if (context.photoPlaceFields.size > 0 && fileFacts === void 0) throw new FileFactsUnloadedError(context.photoPlaceFields);
|
|
13972
13977
|
const places = {};
|
|
13973
13978
|
for (const key of context.photoPlaceFields) {
|
|
13974
13979
|
places[key] = storedFileIds(Array.isArray(row2[key]) ? row2[key] : []).map((id) => fileFacts?.get(id)?.place ?? null);
|
|
13975
13980
|
}
|
|
13976
|
-
const mayRecompute = (
|
|
13977
|
-
const cellOf = (link2) => link2.filled_pair === true ? (namedBy.get(link2.key) ?? []).map((id) => ({ id, display: "" })) : row2[link2.key];
|
|
13981
|
+
const mayRecompute = (linkKey) => loadedLinkKeys === void 0 || loadedLinkKeys.has(linkKey) || isEmptyFieldValue(row2[linkKey]);
|
|
13978
13982
|
const computes = (key) => context.computedAggregates === void 0 || context.computedAggregates.has(key);
|
|
13979
13983
|
for (const { field, sourceField } of context.rollupFields) {
|
|
13980
|
-
if (!computes(field.key) || !mayRecompute(sourceField)) continue;
|
|
13984
|
+
if (!computes(field.key) || !mayRecompute(sourceField.key)) continue;
|
|
13981
13985
|
if (linkedTableRecords.has(sourceField.table_id) && linkedTableFields.has(sourceField.table_id)) {
|
|
13982
13986
|
const linkedRecords = linkedTableRecords.get(sourceField.table_id);
|
|
13983
13987
|
const linkedTableFieldsArray = linkedTableFields.get(sourceField.table_id) ?? [];
|
|
@@ -14008,7 +14012,7 @@ function computeFormulaFieldsWithContext(row2, fields, context, linkedTableRecor
|
|
|
14008
14012
|
continue;
|
|
14009
14013
|
}
|
|
14010
14014
|
const rollupValue = calculateRollupValue(
|
|
14011
|
-
|
|
14015
|
+
row2[sourceField.key],
|
|
14012
14016
|
linkedFieldType?.type || "text",
|
|
14013
14017
|
linkedRecords,
|
|
14014
14018
|
field.aggregate_option,
|
|
@@ -14023,17 +14027,17 @@ function computeFormulaFieldsWithContext(row2, fields, context, linkedTableRecor
|
|
|
14023
14027
|
);
|
|
14024
14028
|
result[field.key] = rollupValue;
|
|
14025
14029
|
} else {
|
|
14026
|
-
result[field.key] = isEmptyFieldValue(
|
|
14030
|
+
result[field.key] = isEmptyFieldValue(row2[sourceField.key]) ? rollupOverNothing(field.aggregate_option?.operation) : null;
|
|
14027
14031
|
}
|
|
14028
14032
|
}
|
|
14029
14033
|
for (const { field, sourceField } of context.lookupFields) {
|
|
14030
|
-
if (!computes(field.key) || !mayRecompute(sourceField)) continue;
|
|
14034
|
+
if (!computes(field.key) || !mayRecompute(sourceField.key)) continue;
|
|
14031
14035
|
if (linkedTableRecords.has(sourceField.table_id)) {
|
|
14032
14036
|
const linkedRecords = linkedTableRecords.get(sourceField.table_id);
|
|
14033
14037
|
const linkedFieldsArray = linkedTableFields.get(sourceField.table_id);
|
|
14034
14038
|
const linkedField = linkedFieldsArray?.find((f) => f.key === field.lookup_field_key);
|
|
14035
14039
|
const lookupValue = calculateLookupValue(
|
|
14036
|
-
|
|
14040
|
+
row2[sourceField.key],
|
|
14037
14041
|
linkedRecords,
|
|
14038
14042
|
field.lookup_field_key,
|
|
14039
14043
|
linkedField,
|
package/dist/shared_types.d.ts
CHANGED
|
@@ -295,7 +295,7 @@ export interface ResolvedOption {
|
|
|
295
295
|
export type SpecLayout = CardsSpec | TableSpec | { kind: "calendar"; date: string; end: string | null; } | { kind: "lanes"; field: string; group: string | null; start: string; end: string | null; loads: { value: string; against: string; }[]; per: "day" | "week"; read: { query: string; param: string; listed: string[]; } | null; order: string | null; held: boolean; down: { field: string; held: boolean; moves: boolean; } | null; move: string | null; } | { kind: "plan"; at: string; across: string; up: string; fill: string | null; mark: { field: string; option: string; } | null; size: { field: string; options: Record<string, { across: number; along: number; up: number; }>; } | null; place: { entity: string; read: { query: string; param: string | null; listed: string[]; }; kind: string; kinds: { bay: string; area: string | null; landmark: string | null; }; sheet: string | null; scale: string | null; x: string; y: string; width: string | null; depth: string | null; across: string; up: string; reach_from: string | null; stacked: string | null; reaches: { first: string; last: string; both: string; } | null; size: { across: string; along: string; up: string; } | null; }; load: { query: string; param: string | null; } | null; } | { kind: "roster"; entity: string; via: string; day: string | null; end: string | null; expect: string | null; of: string | null; cadence: { on: { days: ("fri" | "mon" | "sat" | "sun" | "thu" | "tue" | "wed")[]; } | { field: string; }; from: string | null; until: string | null; planned: string | null; } | null; read: { query: string; param: string; listed: string[]; }; covers: number | null; create: string[] | null; } | { start: string; end: string; milestones: string[]; planned: { start: string | null; end: string | null; } | null; progress: string | null; after: string | null; kind: "gantt"; };
|
|
296
296
|
/** A comparison as a compiled app states it: every key, `null` where it bounds nothing. */
|
|
297
297
|
export type StatedBounds<V> = { gt: V | null; gte: V | null; lt: V | null; lte: V | null; };
|
|
298
|
-
export type TableField = { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "number"; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; rating?: { max: number; } | null | undefined; format: "currency" | "number" | "percentage"; currency?: string | null | undefined; unit?: string | null | undefined; unit_field?: string | null | undefined; currency_field?: string | null | undefined; default_value?: number | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "text"; unique?: boolean | undefined; format?: "link" | "markdown" | "text" | "time" | undefined; default_value?: string | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "date"; format?: "date" | "date_range" | "datetime" | "datetime_range" | "month" | undefined; timezone?: string | undefined; derive_from?: "created_at" | "updated_at" | undefined; default_value?: string | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "boolean"; default_value?: boolean | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "select"; options: { key: string; alias?: string | undefined; name: string; color?: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | undefined; mark?: { kind: string; name: string; } | undefined; short?: string | undefined; }[]; multi?: boolean | undefined; default_value?: string[] | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "select_member"; multi?: boolean | undefined; default_value?: string[] | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "select_record_link"; table_id: string; paired_field_key?: string | undefined; cardinality?: "many" | "one" | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined;
|
|
298
|
+
export type TableField = { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "number"; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; rating?: { max: number; } | null | undefined; format: "currency" | "number" | "percentage"; currency?: string | null | undefined; unit?: string | null | undefined; unit_field?: string | null | undefined; currency_field?: string | null | undefined; default_value?: number | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "text"; unique?: boolean | undefined; format?: "link" | "markdown" | "text" | "time" | undefined; default_value?: string | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "date"; format?: "date" | "date_range" | "datetime" | "datetime_range" | "month" | undefined; timezone?: string | undefined; derive_from?: "created_at" | "updated_at" | undefined; default_value?: string | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "boolean"; default_value?: boolean | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "select"; options: { key: string; alias?: string | undefined; name: string; color?: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | undefined; mark?: { kind: string; name: string; } | undefined; short?: string | undefined; }[]; multi?: boolean | undefined; default_value?: string[] | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "select_member"; multi?: boolean | undefined; default_value?: string[] | null | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "select_record_link"; table_id: string; paired_field_key?: string | undefined; cardinality?: "many" | "one" | undefined; default_from?: { link_field_key: string; through?: string[] | undefined; field_key: string; options?: Record<string, string> | undefined; } | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "rollup"; source_field_key: string; aggregate_option: { operation: "checked" | "percent_checked" | "percent_unchecked" | "unchecked"; field_key: string; } | { operation: "empty" | "filled" | "percent_empty" | "percent_filled" | "selected"; field_key: string; } | { operation: "empty" | "filled" | "percent_empty" | "percent_filled" | "percent_unique" | "unique"; field_key: string; } | { operation: "empty" | "filled" | "percent_empty" | "percent_filled" | "percent_unique" | "selected" | "unique"; field_key: string; } | { operation: "date_range" | "earliest" | "empty" | "filled" | "latest" | "percent_empty" | "percent_filled" | "percent_unique" | "unique"; field_key: string; } | { operation: "avg" | "empty" | "filled" | "max" | "median" | "min" | "percent_empty" | "percent_filled" | "percent_unique" | "range" | "sum" | "unique"; field_key: string; } | { operation: "avg" | "date_range" | "earliest" | "empty" | "filled" | "latest" | "max" | "median" | "min" | "percent_empty" | "percent_filled" | "percent_unique" | "range" | "sum" | "unique"; field_key: string; } | { operation: "avg" | "checked" | "date_range" | "earliest" | "empty" | "filled" | "latest" | "max" | "median" | "min" | "percent_checked" | "percent_empty" | "percent_filled" | "percent_unchecked" | "percent_unique" | "range" | "sum" | "unchecked" | "unique"; field_key: string; } | { operation: "count"; field_key?: string | undefined; }; filter?: TableRecordFiltersGroupNode | undefined; aggregate_field_type?: "autonumber" | "boolean" | "button" | "date" | "files" | "formula" | "lookup" | "number" | "rollup" | "select" | "select_member" | "select_record_link" | "text" | undefined; aggregate_field_notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; aggregate_field_format?: string | undefined; aggregate_field_currency?: string | undefined; aggregate_field_unit?: string | undefined; aggregate_field_unit_field?: string | undefined; aggregate_field_currency_field?: string | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "lookup"; source_field_key: string; lookup_field_key: string; lookup_field_type?: "autonumber" | "boolean" | "button" | "date" | "files" | "formula" | "lookup" | "number" | "rollup" | "select" | "select_member" | "select_record_link" | "text" | undefined; lookup_field_notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; lookup_field_format?: string | undefined; lookup_field_currency?: string | undefined; lookup_field_unit?: string | undefined; lookup_field_options?: { key: string; alias?: string | undefined; name: string; color?: string | undefined; mark?: { kind: string; name: string; } | undefined; }[] | undefined; lookup_field_autonumber?: boolean | undefined; lookup_field_several?: true | undefined; order_by?: { field_key: string; direction: "asc" | "desc"; } | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "files"; photo_places?: true | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "formula"; formula: { expression: string; notation?: { style: "decimal"; } | { style: "currency"; currency: string | { per_row: string; }; } | { style: "unit"; unit: string | { per_row: string; }; } | undefined; link?: true | undefined; format?: "currency" | "link" | "number" | "percentage" | undefined; currency?: string | undefined; unit?: string | undefined; unit_field?: string | undefined; currency_field?: string | undefined; options?: { key: string; alias?: string | undefined; name: string; color?: "amber" | "blue" | "cyan" | "emerald" | "fuchsia" | "gray" | "green" | "indigo" | "lime" | "neutral" | "orange" | "pink" | "purple" | "red" | "rose" | "sky" | "slate" | "stone" | "teal" | "violet" | "yellow" | "zinc" | undefined; mark?: { kind: string; name: string; } | undefined; short?: string | undefined; }[] | undefined; output_type?: "boolean" | "date" | "datetime" | "number" | "select" | "text" | undefined; volatile?: boolean | undefined; }; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "button"; text: string; workflow_id?: string | null | undefined; } | { key: string; alias?: string | undefined; name: string; description: string; confirm_before_update?: boolean | undefined; required?: boolean | undefined; type: "autonumber"; prefix?: string | undefined; padding?: number | undefined; template?: string | undefined; };
|
|
299
299
|
export type TableRecordFilters = TableRecordFiltersConditionNode | TableRecordFiltersGroupNode | TableRecordFiltersTraversalNode;
|
|
300
300
|
export type TableRecordFiltersConditionNode = { node_type: "condition"; field_key?: string; type?: string; operator: string; value?: unknown; unit_option?: string; ignore_accents?: boolean; whole_words?: boolean; };
|
|
301
301
|
export type TableRecordFiltersGroupNode = { node_type: "group"; logic: "and" | "or"; children: (TableRecordFiltersConditionNode | TableRecordFiltersTraversalNode | TableRecordFiltersGroupNode)[]; };
|
package/package.json
CHANGED