@lotics/app-sdk 0.106.1 → 0.108.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/dist/comments.d.ts +1 -1
- package/dist/index.js +4 -0
- package/dist/queries.d.ts +4 -4
- package/dist/shared_types.d.ts +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -43,7 +43,7 @@ This file is the index. The **exact type** of anything is its shipped declaratio
|
|
|
43
43
|
- **`project` only what you render; filter server-side.** → [queries](./docs/queries.md)
|
|
44
44
|
- **Never hand-roll the serialization contract** — decode cells with the typed readers, and read
|
|
45
45
|
only the columns the alias projects. → [data_fetching](./docs/data_fetching.md)
|
|
46
|
-
- **Narrow `__source_record_id` / `__source_table_id` before use** — a grouped query
|
|
46
|
+
- **Narrow `__source_record_id` / `__source_table_id` before use** — a grouped query answers both as null.
|
|
47
47
|
→ [data_fetching](./docs/data_fetching.md)
|
|
48
48
|
- **A standalone app takes its API address from the page it was served in**, never from a
|
|
49
49
|
constant. → [runtime](./docs/runtime.md)
|
package/dist/comments.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface UseCommentsArgs {
|
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* `record_id` must be a real id — an empty string still fetches. Gate the
|
|
56
|
-
* panel on a row's `__source_record_id`, which a grouped query
|
|
56
|
+
* panel on a row's `__source_record_id`, which a grouped query answers as null.
|
|
57
57
|
*
|
|
58
58
|
* ```tsx
|
|
59
59
|
* // In a record screen, where an id definitionally exists:
|
package/dist/index.js
CHANGED
|
@@ -28316,6 +28316,9 @@ function useAgentRuns(sessionId, opts) {
|
|
|
28316
28316
|
// src/queries.ts
|
|
28317
28317
|
import { useCallback as useCallback5, useMemo as useMemo3, useState as useState3 } from "react";
|
|
28318
28318
|
|
|
28319
|
+
// ../shared/src/schemas/read_row.ts
|
|
28320
|
+
var RECORD_ID_COLUMN = "__source_record_id";
|
|
28321
|
+
|
|
28319
28322
|
// ../shared/src/schemas/app_query_aggregate.ts
|
|
28320
28323
|
var AGGREGATE_COUNT_COLUMN = "__count";
|
|
28321
28324
|
var AGGREGATE_SUM_COLUMN = "__sum";
|
|
@@ -28339,6 +28342,7 @@ function aggregateRows(rows, aggregate) {
|
|
|
28339
28342
|
return typeof value === "number" ? [value] : [];
|
|
28340
28343
|
});
|
|
28341
28344
|
return {
|
|
28345
|
+
[RECORD_ID_COLUMN]: null,
|
|
28342
28346
|
...Object.fromEntries(by.map((column) => [column, first2?.[column] ?? null])),
|
|
28343
28347
|
...day === void 0 ? {} : { [AGGREGATE_DAY_COLUMN]: dayOf(first2?.[day]) },
|
|
28344
28348
|
[AGGREGATE_COUNT_COLUMN]: members2.length,
|
package/dist/queries.d.ts
CHANGED
|
@@ -12,10 +12,10 @@ import type { ReportColumn, ReportReading } from "./shared_types.js";
|
|
|
12
12
|
*/
|
|
13
13
|
export interface QueryRow {
|
|
14
14
|
[column: string]: unknown;
|
|
15
|
-
/** The record this row came from
|
|
16
|
-
__source_record_id?: string;
|
|
17
|
-
/** The table that record lives in
|
|
18
|
-
__source_table_id?: string;
|
|
15
|
+
/** The record this row came from: null on a grouped row, which stands for no one record. */
|
|
16
|
+
__source_record_id?: string | null;
|
|
17
|
+
/** The table that record lives in: null on a grouped row. */
|
|
18
|
+
__source_table_id?: string | null;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* The row type of alias `K`: its projected columns plus the two addressing
|
package/dist/shared_types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* tarball. Written at every build, never edited.
|
|
5
5
|
*/
|
|
6
6
|
export type QueryAggregate = { by?: readonly string[]; day?: string; sum?: string; };
|
|
7
|
-
export type ReportColumn = { key: string; header: string; type: "number" | "text" | "date"; };
|
|
7
|
+
export type ReportColumn = { key: string; header: string; type: "number" | "text" | "date"; labels?: { readonly [x: string]: string; }; };
|
|
8
8
|
export type ReportLanguage = "vi" | "en";
|
|
9
9
|
export type ReportPart = { label: string; value: number; share: number | null; };
|
|
10
10
|
export type ReportPivotColumn = { label: string; total: number | null; };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lotics/app-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.108.0",
|
|
4
4
|
"description": "The SDK a Lotics custom-code app reads and writes through \u2014 typed hooks over the host bridge, cell readers, mount() and AppRouter",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|