exponential-sdk 1.25.0 → 1.27.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/README.md +61 -0
- package/dist/index.d.ts +537 -6
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -47,6 +47,20 @@ type ProjectUpdateApiInput = {
|
|
|
47
47
|
startDate?: Date | null;
|
|
48
48
|
endDate?: Date | null;
|
|
49
49
|
};
|
|
50
|
+
/** `database.*` saved view as the server validates it (ADR-0078). */
|
|
51
|
+
type DatabaseViewInput = {
|
|
52
|
+
sort?: {
|
|
53
|
+
propertyId: string;
|
|
54
|
+
direction: 'asc' | 'desc';
|
|
55
|
+
};
|
|
56
|
+
filters: {
|
|
57
|
+
propertyId: string;
|
|
58
|
+
op: string;
|
|
59
|
+
value?: unknown;
|
|
60
|
+
}[];
|
|
61
|
+
hiddenPropertyIds: string[];
|
|
62
|
+
propertyOrder: string[];
|
|
63
|
+
};
|
|
50
64
|
type ActionStatus$1 = 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'DELETED' | 'DRAFT';
|
|
51
65
|
type ActionKanbanStatus = 'BACKLOG' | 'TODO' | 'IN_PROGRESS' | 'IN_REVIEW' | 'DONE' | 'CANCELLED';
|
|
52
66
|
type ActionPriority = 'Quick' | 'Scheduled' | '1st Priority' | '2nd Priority' | '3rd Priority' | '4th Priority' | '5th Priority' | 'Errand' | 'Remember' | 'Watch' | 'Someday Maybe';
|
|
@@ -537,6 +551,17 @@ interface TrpcClient {
|
|
|
537
551
|
mutate: (input: {
|
|
538
552
|
pageId: string;
|
|
539
553
|
body: string;
|
|
554
|
+
quotedText?: string;
|
|
555
|
+
quoteContext?: {
|
|
556
|
+
prefix?: string;
|
|
557
|
+
suffix?: string;
|
|
558
|
+
};
|
|
559
|
+
}) => Promise<unknown>;
|
|
560
|
+
};
|
|
561
|
+
reply: {
|
|
562
|
+
mutate: (input: {
|
|
563
|
+
parentId: string;
|
|
564
|
+
body: string;
|
|
540
565
|
}) => Promise<unknown>;
|
|
541
566
|
};
|
|
542
567
|
update: {
|
|
@@ -550,6 +575,18 @@ interface TrpcClient {
|
|
|
550
575
|
commentId: string;
|
|
551
576
|
}) => Promise<unknown>;
|
|
552
577
|
};
|
|
578
|
+
resolve: {
|
|
579
|
+
mutate: (input: {
|
|
580
|
+
pageId: string;
|
|
581
|
+
threadId: string;
|
|
582
|
+
}) => Promise<unknown>;
|
|
583
|
+
};
|
|
584
|
+
unresolve: {
|
|
585
|
+
mutate: (input: {
|
|
586
|
+
pageId: string;
|
|
587
|
+
threadId: string;
|
|
588
|
+
}) => Promise<unknown>;
|
|
589
|
+
};
|
|
553
590
|
};
|
|
554
591
|
/** Local-runner side of Agent runs (ADR-0067); agent-key principals only. */
|
|
555
592
|
agentRun: {
|
|
@@ -979,6 +1016,117 @@ interface TrpcClient {
|
|
|
979
1016
|
}) => Promise<unknown>;
|
|
980
1017
|
};
|
|
981
1018
|
};
|
|
1019
|
+
database: {
|
|
1020
|
+
create: {
|
|
1021
|
+
mutate: (input: {
|
|
1022
|
+
pageId: string;
|
|
1023
|
+
name: string;
|
|
1024
|
+
}) => Promise<unknown>;
|
|
1025
|
+
};
|
|
1026
|
+
get: {
|
|
1027
|
+
query: (input: {
|
|
1028
|
+
id: string;
|
|
1029
|
+
}) => Promise<unknown>;
|
|
1030
|
+
};
|
|
1031
|
+
list: {
|
|
1032
|
+
query: (input: {
|
|
1033
|
+
pageId: string;
|
|
1034
|
+
}) => Promise<unknown[]>;
|
|
1035
|
+
};
|
|
1036
|
+
update: {
|
|
1037
|
+
mutate: (input: {
|
|
1038
|
+
id: string;
|
|
1039
|
+
name?: string;
|
|
1040
|
+
view?: DatabaseViewInput;
|
|
1041
|
+
}) => Promise<unknown>;
|
|
1042
|
+
};
|
|
1043
|
+
delete: {
|
|
1044
|
+
mutate: (input: {
|
|
1045
|
+
id: string;
|
|
1046
|
+
}) => Promise<unknown>;
|
|
1047
|
+
};
|
|
1048
|
+
addProperty: {
|
|
1049
|
+
mutate: (input: {
|
|
1050
|
+
id: string;
|
|
1051
|
+
name: string;
|
|
1052
|
+
type: string;
|
|
1053
|
+
description?: string;
|
|
1054
|
+
options?: {
|
|
1055
|
+
id?: string;
|
|
1056
|
+
name: string;
|
|
1057
|
+
color?: string;
|
|
1058
|
+
}[];
|
|
1059
|
+
}) => Promise<unknown>;
|
|
1060
|
+
};
|
|
1061
|
+
updateProperty: {
|
|
1062
|
+
mutate: (input: {
|
|
1063
|
+
id: string;
|
|
1064
|
+
propertyId: string;
|
|
1065
|
+
name?: string;
|
|
1066
|
+
description?: string | null;
|
|
1067
|
+
type?: string;
|
|
1068
|
+
options?: {
|
|
1069
|
+
id?: string;
|
|
1070
|
+
name: string;
|
|
1071
|
+
color?: string;
|
|
1072
|
+
}[];
|
|
1073
|
+
}) => Promise<unknown>;
|
|
1074
|
+
};
|
|
1075
|
+
removeProperty: {
|
|
1076
|
+
mutate: (input: {
|
|
1077
|
+
id: string;
|
|
1078
|
+
propertyId: string;
|
|
1079
|
+
}) => Promise<unknown>;
|
|
1080
|
+
};
|
|
1081
|
+
reorderProperties: {
|
|
1082
|
+
mutate: (input: {
|
|
1083
|
+
id: string;
|
|
1084
|
+
propertyIds: string[];
|
|
1085
|
+
}) => Promise<unknown>;
|
|
1086
|
+
};
|
|
1087
|
+
listRows: {
|
|
1088
|
+
query: (input: {
|
|
1089
|
+
id: string;
|
|
1090
|
+
view?: DatabaseViewInput;
|
|
1091
|
+
limit?: number;
|
|
1092
|
+
cursor?: string;
|
|
1093
|
+
}) => Promise<unknown>;
|
|
1094
|
+
};
|
|
1095
|
+
createRow: {
|
|
1096
|
+
mutate: (input: {
|
|
1097
|
+
id: string;
|
|
1098
|
+
values?: Record<string, unknown>;
|
|
1099
|
+
note?: string;
|
|
1100
|
+
}) => Promise<unknown>;
|
|
1101
|
+
};
|
|
1102
|
+
updateRow: {
|
|
1103
|
+
mutate: (input: {
|
|
1104
|
+
rowId: string;
|
|
1105
|
+
values: Record<string, unknown>;
|
|
1106
|
+
note?: string;
|
|
1107
|
+
}) => Promise<unknown>;
|
|
1108
|
+
};
|
|
1109
|
+
deleteRow: {
|
|
1110
|
+
mutate: (input: {
|
|
1111
|
+
rowId: string;
|
|
1112
|
+
}) => Promise<unknown>;
|
|
1113
|
+
};
|
|
1114
|
+
previewCsv: {
|
|
1115
|
+
mutate: (input: {
|
|
1116
|
+
id: string;
|
|
1117
|
+
csv: string;
|
|
1118
|
+
mapping?: Record<string, unknown>;
|
|
1119
|
+
}) => Promise<unknown>;
|
|
1120
|
+
};
|
|
1121
|
+
commitCsv: {
|
|
1122
|
+
mutate: (input: {
|
|
1123
|
+
id: string;
|
|
1124
|
+
csv: string;
|
|
1125
|
+
mapping: Record<string, unknown>;
|
|
1126
|
+
note?: string;
|
|
1127
|
+
}) => Promise<unknown>;
|
|
1128
|
+
};
|
|
1129
|
+
};
|
|
982
1130
|
resource: {
|
|
983
1131
|
list: {
|
|
984
1132
|
query: (input: {
|
|
@@ -1746,16 +1894,37 @@ interface FeatureComment {
|
|
|
1746
1894
|
updatedAt: Date;
|
|
1747
1895
|
createdBy: CommentAuthor;
|
|
1748
1896
|
}
|
|
1749
|
-
/**
|
|
1897
|
+
/**
|
|
1898
|
+
* Comments on a Knowledge Page. `body` is Markdown. A comment is doc-level
|
|
1899
|
+
* (`threadId` null) or part of a thread anchored to a span of the page body
|
|
1900
|
+
* (`threadId` matches a comment mark; `quotedText` snapshots the span so the
|
|
1901
|
+
* thread still reads if the text is later edited away). `parentId` marks a
|
|
1902
|
+
* reply; threads are one level deep.
|
|
1903
|
+
*/
|
|
1750
1904
|
interface PageComment {
|
|
1751
1905
|
id: string;
|
|
1752
1906
|
pageId: string;
|
|
1907
|
+
threadId: string | null;
|
|
1908
|
+
parentId: string | null;
|
|
1753
1909
|
body: string;
|
|
1910
|
+
quotedText: string | null;
|
|
1911
|
+
resolvedAt: Date | null;
|
|
1754
1912
|
createdById: string;
|
|
1755
1913
|
createdAt: Date;
|
|
1756
1914
|
updatedAt: Date;
|
|
1757
1915
|
createdBy: CommentAuthor;
|
|
1758
1916
|
}
|
|
1917
|
+
/** What `pageComments.create` returns: the comment plus how its anchoring went. */
|
|
1918
|
+
interface PageCommentCreated extends PageComment {
|
|
1919
|
+
anchor: {
|
|
1920
|
+
/** The page body now highlights the thread's span. False for doc-level
|
|
1921
|
+
* comments and for a viewer's thread (viewers can't edit the body). */
|
|
1922
|
+
anchored: boolean;
|
|
1923
|
+
/** The page's `docVersion` after the highlight was written. */
|
|
1924
|
+
docVersion?: number;
|
|
1925
|
+
fastForward: boolean;
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1759
1928
|
/** Comments on a Goal/Objective. `content` is Markdown. */
|
|
1760
1929
|
interface GoalComment {
|
|
1761
1930
|
id: string;
|
|
@@ -1839,25 +2008,60 @@ interface PageCommentCreateInput {
|
|
|
1839
2008
|
pageId: string;
|
|
1840
2009
|
/** Markdown. Mention members with `@[Name](userId)` — see `workspaces.listMembers()`. */
|
|
1841
2010
|
body: string;
|
|
2011
|
+
/**
|
|
2012
|
+
* Anchor the comment to this span of the page body, as it reads on the page
|
|
2013
|
+
* (no Markdown syntax). The server mints the thread's `threadId`, finds the
|
|
2014
|
+
* span and highlights it, and refuses the comment when the text matches no
|
|
2015
|
+
* span, or several with nothing to choose between them. Omit for a doc-level
|
|
2016
|
+
* comment.
|
|
2017
|
+
*/
|
|
2018
|
+
quotedText?: string;
|
|
2019
|
+
/**
|
|
2020
|
+
* The text just before and/or after `quotedText`, to pick one occurrence
|
|
2021
|
+
* when it appears more than once. Only with `quotedText`.
|
|
2022
|
+
*/
|
|
2023
|
+
quoteContext?: {
|
|
2024
|
+
prefix?: string;
|
|
2025
|
+
suffix?: string;
|
|
2026
|
+
};
|
|
2027
|
+
}
|
|
2028
|
+
interface PageCommentReplyInput {
|
|
2029
|
+
parentId: string;
|
|
2030
|
+
body: string;
|
|
1842
2031
|
}
|
|
1843
2032
|
interface PageCommentUpdateInput {
|
|
1844
2033
|
commentId: string;
|
|
1845
2034
|
body: string;
|
|
1846
2035
|
}
|
|
2036
|
+
interface PageCommentThreadInput {
|
|
2037
|
+
pageId: string;
|
|
2038
|
+
threadId: string;
|
|
2039
|
+
}
|
|
1847
2040
|
/**
|
|
1848
|
-
* Discussion on a Knowledge Page
|
|
1849
|
-
*
|
|
1850
|
-
* the
|
|
2041
|
+
* Discussion on a Knowledge Page: a doc-level feed under the page body, plus
|
|
2042
|
+
* threads anchored to a span of it (`quotedText` on create). View access is
|
|
2043
|
+
* the commenting gate: anyone the page is shared with can join the thread,
|
|
2044
|
+
* but only an editor's anchored thread highlights the body. Editing and
|
|
2045
|
+
* deleting are author-only.
|
|
1851
2046
|
*/
|
|
1852
2047
|
declare class PageCommentsApi {
|
|
1853
2048
|
private client;
|
|
1854
2049
|
constructor(client: TrpcClient);
|
|
1855
2050
|
list(pageId: string): Promise<PageComment[]>;
|
|
1856
|
-
create(input: PageCommentCreateInput): Promise<
|
|
2051
|
+
create(input: PageCommentCreateInput): Promise<PageCommentCreated>;
|
|
2052
|
+
/** Reply to an existing comment. Replies to replies still hang off the root. */
|
|
2053
|
+
reply(input: PageCommentReplyInput): Promise<PageComment>;
|
|
1857
2054
|
update(input: PageCommentUpdateInput): Promise<PageComment>;
|
|
1858
2055
|
delete(commentId: string): Promise<{
|
|
1859
2056
|
success: boolean;
|
|
1860
2057
|
}>;
|
|
2058
|
+
/** Mark an anchored thread resolved. Only anchored threads have a threadId. */
|
|
2059
|
+
resolve(input: PageCommentThreadInput): Promise<{
|
|
2060
|
+
success: boolean;
|
|
2061
|
+
}>;
|
|
2062
|
+
unresolve(input: PageCommentThreadInput): Promise<{
|
|
2063
|
+
success: boolean;
|
|
2064
|
+
}>;
|
|
1861
2065
|
}
|
|
1862
2066
|
|
|
1863
2067
|
interface GoalCommentAddInput {
|
|
@@ -4380,6 +4584,331 @@ declare class PagesApi {
|
|
|
4380
4584
|
}>;
|
|
4381
4585
|
}
|
|
4382
4586
|
|
|
4587
|
+
type PropertyType = 'title' | 'text' | 'number' | 'select' | 'multiSelect' | 'date' | 'checkbox' | 'url' | 'person' | 'relation' | 'createdTime' | 'lastEditedTime' | 'createdBy';
|
|
4588
|
+
/** Select-option colours are palette names, never hex. */
|
|
4589
|
+
type PillColor = 'gray' | 'red' | 'pink' | 'grape' | 'violet' | 'indigo' | 'blue' | 'cyan' | 'teal' | 'green' | 'lime' | 'yellow' | 'orange';
|
|
4590
|
+
type RelationTargetKind = 'ROW' | 'TICKET' | 'PROJECT' | 'FEATURE' | 'GOAL' | 'KEY_RESULT' | 'PAGE';
|
|
4591
|
+
interface SelectOption {
|
|
4592
|
+
/** Stable: a renamed option keeps its id, so rows never need rewriting. */
|
|
4593
|
+
id: string;
|
|
4594
|
+
name: string;
|
|
4595
|
+
color: PillColor;
|
|
4596
|
+
}
|
|
4597
|
+
interface RelationConfig {
|
|
4598
|
+
targetKind: RelationTargetKind;
|
|
4599
|
+
/** The other database, for `ROW` targets. */
|
|
4600
|
+
targetDatabaseId?: string;
|
|
4601
|
+
/** Set on the auto-created reverse column of a two-way database relation. */
|
|
4602
|
+
inverseOf?: {
|
|
4603
|
+
databaseId: string;
|
|
4604
|
+
propertyId: string;
|
|
4605
|
+
};
|
|
4606
|
+
many: boolean;
|
|
4607
|
+
}
|
|
4608
|
+
/** One column of a database. Ids are stable; names are free to change. */
|
|
4609
|
+
interface PropertyDef {
|
|
4610
|
+
id: string;
|
|
4611
|
+
name: string;
|
|
4612
|
+
type: PropertyType;
|
|
4613
|
+
description?: string;
|
|
4614
|
+
/** `select` / `multiSelect` only. */
|
|
4615
|
+
options?: SelectOption[];
|
|
4616
|
+
/** `relation` only (written from V3). */
|
|
4617
|
+
relation?: RelationConfig;
|
|
4618
|
+
}
|
|
4619
|
+
type FilterOp = 'eq' | 'neq' | 'contains' | 'isEmpty' | 'isNotEmpty' | 'gt' | 'lt' | 'before' | 'after' | 'anyOf';
|
|
4620
|
+
interface DatabaseFilter {
|
|
4621
|
+
propertyId: string;
|
|
4622
|
+
op: FilterOp;
|
|
4623
|
+
/**
|
|
4624
|
+
* Checked against the property like a written value: a select may be
|
|
4625
|
+
* named by option name or id; `anyOf` takes a list (or a comma-separated
|
|
4626
|
+
* string); `gt`/`lt` a number; `before`/`after` an ISO date.
|
|
4627
|
+
*/
|
|
4628
|
+
value?: unknown;
|
|
4629
|
+
}
|
|
4630
|
+
/** The one table view saved on the block: sort, filters, hidden columns, column order. */
|
|
4631
|
+
interface DatabaseView {
|
|
4632
|
+
sort?: {
|
|
4633
|
+
propertyId: string;
|
|
4634
|
+
direction: 'asc' | 'desc';
|
|
4635
|
+
};
|
|
4636
|
+
filters: DatabaseFilter[];
|
|
4637
|
+
hiddenPropertyIds: string[];
|
|
4638
|
+
/** Column order by property id; properties missing here follow in definition order. */
|
|
4639
|
+
propertyOrder: string[];
|
|
4640
|
+
}
|
|
4641
|
+
interface Database {
|
|
4642
|
+
id: string;
|
|
4643
|
+
/** The page whose body holds the block, and which decides access to every row. */
|
|
4644
|
+
pageId: string;
|
|
4645
|
+
workspaceId: string;
|
|
4646
|
+
name: string;
|
|
4647
|
+
properties: PropertyDef[];
|
|
4648
|
+
view: DatabaseView;
|
|
4649
|
+
/** The id of the `title` property; its value is each row page's title. */
|
|
4650
|
+
titlePropertyId: string;
|
|
4651
|
+
/**
|
|
4652
|
+
* Set while the block is out of the page body. A detached database keeps
|
|
4653
|
+
* its rows until it is deleted, its page is deleted, or the daily purge
|
|
4654
|
+
* takes it after 30 days; writing its marker back into the body re-attaches it.
|
|
4655
|
+
*/
|
|
4656
|
+
detachedAt: Date | null;
|
|
4657
|
+
createdById: string;
|
|
4658
|
+
createdAt: Date;
|
|
4659
|
+
updatedAt: Date;
|
|
4660
|
+
page: {
|
|
4661
|
+
id: string;
|
|
4662
|
+
title: string;
|
|
4663
|
+
};
|
|
4664
|
+
/**
|
|
4665
|
+
* The marker line that stands for the block in the page's Markdown body:
|
|
4666
|
+
* `<!-- database:<id> -->`. Append it to the body (through `pages.update`)
|
|
4667
|
+
* to place a database you created; reads expand it into the table.
|
|
4668
|
+
*/
|
|
4669
|
+
marker?: string;
|
|
4670
|
+
/** Present on `get` and `list`. */
|
|
4671
|
+
rowCount?: number;
|
|
4672
|
+
}
|
|
4673
|
+
/**
|
|
4674
|
+
* A stored cell value: `title`/`text`/`url` a string, `number` a number,
|
|
4675
|
+
* `select` an option id, `multiSelect` option ids, `date` an ISO 8601 string,
|
|
4676
|
+
* `checkbox` a boolean, `person` user ids.
|
|
4677
|
+
*/
|
|
4678
|
+
type PropertyValue = string | number | boolean | string[];
|
|
4679
|
+
/** A row: a page of the database with its typed values keyed by property id. */
|
|
4680
|
+
interface DatabaseRow {
|
|
4681
|
+
id: string;
|
|
4682
|
+
/** The title property's value — the row page's title. */
|
|
4683
|
+
title: string;
|
|
4684
|
+
databaseId: string | null;
|
|
4685
|
+
/** Values keyed by **property id** (not name); the title is not among them. */
|
|
4686
|
+
values: Record<string, PropertyValue | null>;
|
|
4687
|
+
createdById: string;
|
|
4688
|
+
createdAt: Date;
|
|
4689
|
+
updatedAt: Date;
|
|
4690
|
+
}
|
|
4691
|
+
interface DatabaseRowsPage {
|
|
4692
|
+
rows: DatabaseRow[];
|
|
4693
|
+
/** Pass back as `cursor` for the next page; null on the last one. */
|
|
4694
|
+
nextCursor: string | null;
|
|
4695
|
+
/** The visible property ids in view order. Rows still carry hidden values. */
|
|
4696
|
+
columns: string[];
|
|
4697
|
+
}
|
|
4698
|
+
/**
|
|
4699
|
+
* Why a write was refused: the property it names and the reason, in plain
|
|
4700
|
+
* words. Arrives as `error.data.property` on a `BAD_REQUEST`.
|
|
4701
|
+
*/
|
|
4702
|
+
interface PropertyRejection {
|
|
4703
|
+
/** Null when the write named a property that does not exist. */
|
|
4704
|
+
propertyId: string | null;
|
|
4705
|
+
propertyName: string;
|
|
4706
|
+
reason: string;
|
|
4707
|
+
}
|
|
4708
|
+
interface DeletedDatabase {
|
|
4709
|
+
id: string;
|
|
4710
|
+
/** Rows deleted with it. */
|
|
4711
|
+
rowCount: number;
|
|
4712
|
+
}
|
|
4713
|
+
/** Where one CSV column lands: skipped, an existing property (by id), or a new property. */
|
|
4714
|
+
type CsvColumnTarget = {
|
|
4715
|
+
kind: 'skip';
|
|
4716
|
+
} | {
|
|
4717
|
+
kind: 'property';
|
|
4718
|
+
propertyId: string;
|
|
4719
|
+
} | {
|
|
4720
|
+
kind: 'new';
|
|
4721
|
+
name: string;
|
|
4722
|
+
type: PropertyType;
|
|
4723
|
+
};
|
|
4724
|
+
/** Column header (as in the file) → target. Headers left out are skipped. */
|
|
4725
|
+
type CsvMapping = Record<string, CsvColumnTarget>;
|
|
4726
|
+
/** A cell the property's type refused: where it sits and why. */
|
|
4727
|
+
interface CsvCellError {
|
|
4728
|
+
header: string;
|
|
4729
|
+
propertyName: string;
|
|
4730
|
+
reason: string;
|
|
4731
|
+
}
|
|
4732
|
+
/** One file row, typed. `values` are keyed by property id, or `new:<name>` for a column not created yet. */
|
|
4733
|
+
interface CsvPreviewRow {
|
|
4734
|
+
/** 0-based among the data rows (the header line is not counted). */
|
|
4735
|
+
index: number;
|
|
4736
|
+
title: string | undefined;
|
|
4737
|
+
values: Record<string, PropertyValue | null>;
|
|
4738
|
+
/** Empty when the row would be created. */
|
|
4739
|
+
errors: CsvCellError[];
|
|
4740
|
+
}
|
|
4741
|
+
interface CsvPreviewColumn {
|
|
4742
|
+
header: string;
|
|
4743
|
+
target: CsvColumnTarget;
|
|
4744
|
+
propertyName: string | null;
|
|
4745
|
+
type: PropertyType | null;
|
|
4746
|
+
}
|
|
4747
|
+
interface CsvPreview {
|
|
4748
|
+
headers: string[];
|
|
4749
|
+
/** The mapping used — the one passed, or the suggestion by header name. Pass it back to `commitCsv`. */
|
|
4750
|
+
mapping: CsvMapping;
|
|
4751
|
+
columns: CsvPreviewColumn[];
|
|
4752
|
+
rows: CsvPreviewRow[];
|
|
4753
|
+
total: number;
|
|
4754
|
+
/** Rows with no cell error — what a commit creates. */
|
|
4755
|
+
importable: number;
|
|
4756
|
+
/**
|
|
4757
|
+
* Select / multi-select option names the file uses that the property
|
|
4758
|
+
* lacks, by column definition id (`new:<name>` for a new column). The
|
|
4759
|
+
* commit creates them; cells naming them hold the name until then.
|
|
4760
|
+
*/
|
|
4761
|
+
newOptions: Record<string, string[]>;
|
|
4762
|
+
}
|
|
4763
|
+
interface CsvCommitResult {
|
|
4764
|
+
/** The new row ids, in file order. */
|
|
4765
|
+
created: string[];
|
|
4766
|
+
/** Rows left uncreated, each with the cells that did not fit. */
|
|
4767
|
+
skipped: {
|
|
4768
|
+
index: number;
|
|
4769
|
+
errors: CsvCellError[];
|
|
4770
|
+
}[];
|
|
4771
|
+
/** Properties the import added (the `new` columns), with their minted ids. */
|
|
4772
|
+
properties: PropertyDef[];
|
|
4773
|
+
total: number;
|
|
4774
|
+
}
|
|
4775
|
+
|
|
4776
|
+
interface DatabaseCreateInput {
|
|
4777
|
+
/** The page whose body will hold the block; you need edit access to it. */
|
|
4778
|
+
pageId: string;
|
|
4779
|
+
name: string;
|
|
4780
|
+
}
|
|
4781
|
+
interface DatabaseUpdateInput {
|
|
4782
|
+
id: string;
|
|
4783
|
+
name?: string;
|
|
4784
|
+
/** Replaces the saved view whole — send the full view, not a patch. */
|
|
4785
|
+
view?: DatabaseView;
|
|
4786
|
+
}
|
|
4787
|
+
/** A select option to add or keep. Pass `id` to rename or recolour an existing one. */
|
|
4788
|
+
interface SelectOptionInput {
|
|
4789
|
+
id?: string;
|
|
4790
|
+
name: string;
|
|
4791
|
+
/** Defaults to the next palette colour. */
|
|
4792
|
+
color?: PillColor;
|
|
4793
|
+
}
|
|
4794
|
+
/** Types a property can be added as or changed to: everything but `title` (one per database) and `relation` (V3). */
|
|
4795
|
+
type AddablePropertyType = Exclude<PropertyType, 'title' | 'relation'>;
|
|
4796
|
+
interface PropertyAddInput {
|
|
4797
|
+
/** The database. */
|
|
4798
|
+
id: string;
|
|
4799
|
+
name: string;
|
|
4800
|
+
type: AddablePropertyType;
|
|
4801
|
+
description?: string;
|
|
4802
|
+
/** `select` / `multiSelect` only. */
|
|
4803
|
+
options?: SelectOptionInput[];
|
|
4804
|
+
}
|
|
4805
|
+
interface PropertyUpdateInput {
|
|
4806
|
+
/** The database. */
|
|
4807
|
+
id: string;
|
|
4808
|
+
/** The property, by id or by (unique, case-insensitive) name. */
|
|
4809
|
+
propertyId: string;
|
|
4810
|
+
name?: string;
|
|
4811
|
+
/** Null clears it. */
|
|
4812
|
+
description?: string | null;
|
|
4813
|
+
type?: AddablePropertyType;
|
|
4814
|
+
/**
|
|
4815
|
+
* The full option list: options left out are removed (rows keep the old
|
|
4816
|
+
* id, which then reads as its raw text). Options with an `id` keep it.
|
|
4817
|
+
*/
|
|
4818
|
+
options?: SelectOptionInput[];
|
|
4819
|
+
}
|
|
4820
|
+
interface RowListOptions {
|
|
4821
|
+
/**
|
|
4822
|
+
* A whole view to read through instead of the saved one — for example a
|
|
4823
|
+
* single filter. Every property it names must exist.
|
|
4824
|
+
*/
|
|
4825
|
+
view?: DatabaseView;
|
|
4826
|
+
/** Rows per page (1–200, server default 50). */
|
|
4827
|
+
limit?: number;
|
|
4828
|
+
/** `nextCursor` from the previous page. */
|
|
4829
|
+
cursor?: string;
|
|
4830
|
+
}
|
|
4831
|
+
/**
|
|
4832
|
+
* Cell values to write, keyed by property **id or name** (the CLI's
|
|
4833
|
+
* `--set Status=Tracked` is a name). Each is checked against the property's
|
|
4834
|
+
* type: a select takes an option name or id, a multiSelect a list (or a
|
|
4835
|
+
* comma-separated string), a date an ISO string, a checkbox a boolean or
|
|
4836
|
+
* "yes"/"no", a person a user id or list of them. `null` clears a cell.
|
|
4837
|
+
* The title property's value becomes the row page's title.
|
|
4838
|
+
*/
|
|
4839
|
+
type RowValuesInput = Record<string, unknown>;
|
|
4840
|
+
interface RowWriteOptions {
|
|
4841
|
+
/** Why — recorded on the row page's revision. Always send one from an agent. */
|
|
4842
|
+
note?: string;
|
|
4843
|
+
}
|
|
4844
|
+
interface DatabasePropertyResult {
|
|
4845
|
+
property: PropertyDef;
|
|
4846
|
+
database: Database;
|
|
4847
|
+
}
|
|
4848
|
+
/**
|
|
4849
|
+
* Databases (ADR-0078): typed tables inside pages. The database is a block in
|
|
4850
|
+
* a page's body, owned by that page; each row is a page of its own, hidden
|
|
4851
|
+
* from the Pages list and reached through the database.
|
|
4852
|
+
*
|
|
4853
|
+
* **Writes are typed.** Values are checked against the property's type and a
|
|
4854
|
+
* bad one is refused naming the property (`error.data.property`). Reads of
|
|
4855
|
+
* the holding page (`pages.get`) show the table; this API is for the writes
|
|
4856
|
+
* and for reading rows as data. Values in responses are keyed by property id;
|
|
4857
|
+
* writes accept names too.
|
|
4858
|
+
*
|
|
4859
|
+
* Not a work tracker: a database may point at a Ticket, Project, Feature,
|
|
4860
|
+
* Goal, Key result or Page (relations, V3) but never stands in for one.
|
|
4861
|
+
*/
|
|
4862
|
+
declare class DatabasesApi {
|
|
4863
|
+
private client;
|
|
4864
|
+
constructor(client: TrpcClient);
|
|
4865
|
+
/**
|
|
4866
|
+
* Create a database on a page with a title property. Then put its
|
|
4867
|
+
* `marker` into the page body (`pages.update` with the body plus the
|
|
4868
|
+
* marker on its own line) so the page shows it.
|
|
4869
|
+
*/
|
|
4870
|
+
create(input: DatabaseCreateInput): Promise<Database>;
|
|
4871
|
+
/** One database: definition, view, row count and holding page. */
|
|
4872
|
+
get(id: string): Promise<Database>;
|
|
4873
|
+
/** The databases a page holds, detached ones included, with row counts. */
|
|
4874
|
+
list(pageId: string): Promise<Database[]>;
|
|
4875
|
+
/** Rename, or replace the saved view whole. */
|
|
4876
|
+
update(input: DatabaseUpdateInput): Promise<Database>;
|
|
4877
|
+
/** Delete the database and every row with it. Removing the block from the page only detaches; this is the delete. */
|
|
4878
|
+
delete(id: string): Promise<DeletedDatabase>;
|
|
4879
|
+
/** Add a property. New select options get ids and palette colours; the column goes last in the view. */
|
|
4880
|
+
addProperty(input: PropertyAddInput): Promise<DatabasePropertyResult>;
|
|
4881
|
+
/** Rename, describe, retype or re-option a property. Ids stay; no row is rewritten. */
|
|
4882
|
+
updateProperty(input: PropertyUpdateInput): Promise<DatabasePropertyResult>;
|
|
4883
|
+
/** Remove a property (by id or name) from the schema and view. Never the title. */
|
|
4884
|
+
removeProperty(databaseId: string, propertyId: string): Promise<Database>;
|
|
4885
|
+
/** Set the column order; `propertyIds` must name every property exactly once. */
|
|
4886
|
+
reorderProperties(databaseId: string, propertyIds: string[]): Promise<Database>;
|
|
4887
|
+
/** The rows through the saved view (or `options.view`), paged by cursor. */
|
|
4888
|
+
listRows(databaseId: string, options?: RowListOptions): Promise<DatabaseRowsPage>;
|
|
4889
|
+
/** Add a row with typed values. Placed where the holding page is. */
|
|
4890
|
+
createRow(databaseId: string, values?: RowValuesInput, options?: RowWriteOptions): Promise<DatabaseRow>;
|
|
4891
|
+
/** Write some of a row's values; cells not named are kept, `null` clears one. Records a revision on the row page. */
|
|
4892
|
+
updateRow(rowId: string, values: RowValuesInput, options?: RowWriteOptions): Promise<DatabaseRow>;
|
|
4893
|
+
/** Delete a row — the page and its search chunks. */
|
|
4894
|
+
deleteRow(rowId: string): Promise<{
|
|
4895
|
+
id: string;
|
|
4896
|
+
databaseId: string;
|
|
4897
|
+
}>;
|
|
4898
|
+
/**
|
|
4899
|
+
* Type a CSV against the database before anything is created: columns
|
|
4900
|
+
* resolved through `mapping` (or suggested by header name), every row
|
|
4901
|
+
* checked, each cell that does not fit named. Writes nothing.
|
|
4902
|
+
*/
|
|
4903
|
+
previewCsv(databaseId: string, csv: string, mapping?: CsvMapping): Promise<CsvPreview>;
|
|
4904
|
+
/**
|
|
4905
|
+
* Import a CSV: new columns become properties, then every row with no
|
|
4906
|
+
* cell error becomes a row with a `create` revision; the rest are reported
|
|
4907
|
+
* and left uncreated. Up to 2,000 rows a time.
|
|
4908
|
+
*/
|
|
4909
|
+
commitCsv(databaseId: string, csv: string, mapping: CsvMapping, options?: RowWriteOptions): Promise<CsvCommitResult>;
|
|
4910
|
+
}
|
|
4911
|
+
|
|
4383
4912
|
type ResourceContentType = 'web_page' | 'document' | 'pdf' | 'bookmark' | 'note';
|
|
4384
4913
|
/** Has the owner consumed this Resource yet? Orthogonal to archiving. */
|
|
4385
4914
|
type ReadStatus = 'to_read' | 'reading' | 'read';
|
|
@@ -5048,6 +5577,8 @@ declare class ExponentialClient {
|
|
|
5048
5577
|
areas: AreasApi;
|
|
5049
5578
|
meetings: MeetingsApi;
|
|
5050
5579
|
pages: PagesApi;
|
|
5580
|
+
/** Databases — typed tables inside pages (ADR-0078). */
|
|
5581
|
+
databases: DatabasesApi;
|
|
5051
5582
|
resources: ResourcesApi;
|
|
5052
5583
|
requirements: RequirementsApi;
|
|
5053
5584
|
scopes: ScopesApi;
|
|
@@ -5062,4 +5593,4 @@ declare class ExponentialClient {
|
|
|
5062
5593
|
});
|
|
5063
5594
|
}
|
|
5064
5595
|
|
|
5065
|
-
export { type Action, type ActionComment, type ActionCommentAddInput, type ActionCommentUpdateInput, type ActionCreateInput, type ActionOutput, type ActionStatus, type ActionUpdateInput, type ActionUpsertBySourceInput, type ActionUpsertBySourceResult, type ActionsListOutput, type AddInteractionInput, type AgentRunStatus, AgentRunsApi, type AppendEventsResult, type Area, type AreaCreateInput, type AreaListOptions, type ClaimedRun, type CommentAuthor, type Contact, type ContactCreateInput, type ContactInteraction, type ContactListOutput, type ContactUpdateInput, type ContactsListOptions, type ConversationMessage, DEFAULT_GAP_MINUTES, type DayReport, type DayReportActionRow, type DayReportEntry, type DayReportProductRow, type Deal, type DealActivity, type DealCreateInput, type DealMoveInput, type DealUpdateInput, type Decision, type DecisionAdrRef, type DecisionChainRef, type DecisionCreateInput, type DecisionDecider, type DecisionDeciderInput, type DecisionEvidenceTurn, type DecisionFeatureRef, type DecisionLink, type DecisionListOptions, type DecisionListRow, type DecisionMeetingRef, type DecisionOccurrenceRef, type DecisionProductRef, type DecisionProjectRef, type DecisionReviewState, type DecisionSetStatusInput, type DecisionSource, type DecisionStatus, type DecisionTicketRef, type DecisionUpdateInput, type DecisionUserRef, type DraftDecisionsResult, type EnrichContactResult, type Epic, type EpicCreateInput, type EpicListOptions, type EpicPriority, type EpicStatus, type EpicUpdateInput, ExponentialClient, type ExponentialConfig, type Feature, type FeatureComment, type FeatureCommentCreateInput, type FeatureCommentReplyInput, type FeatureCommentThreadInput, type FeatureCommentUpdateInput, type FeatureCreateInput, type FeatureKeyResultLink, type FeatureLinkPageInput, type FeatureListOptions, type FeatureScope, type FeatureScopeStatus, type FeatureStatus, type FeatureUpdateInput, type FinishInput, type FinishResult, type GlobalSearchOptions, type GlobalSearchOutput, type Goal, type GoalChildSummary, type GoalComment, type GoalCommentAddInput, type GoalCommentUpdateInput, type GoalCreateInput, type GoalHealth, type GoalKeyResultSummary, type GoalLifeDomain, type GoalListOptions, type GoalPeriod, type GoalProjectSummary, type GoalSetParentInput, type GoalSetStatusInput, type GoalStats, type GoalStatsOptions, type GoalStatus, type GoalTreeNode, type GoalTreeOptions, type GoalUpdateInput, type GoalUserSummary, type GoalWritableStatus, type HeartbeatResult, type InteractionDirection, type InteractionType, type KanbanStatus, type KeyResult, type KeyResultByObjectiveOptions, type KeyResultCheckIn, type KeyResultCheckInInput, type KeyResultCreateInput, type KeyResultFeatureLink, type KeyResultListOptions, type KeyResultProjectLink, type KeyResultStatus, type KeyResultUnit, type KeyResultUpdateInput, type KnowledgePage, type KnowledgeSearchOptions, type KnowledgeSearchOutput, type KnowledgeSearchResult, type KnowledgeSourceType, type LabelCreateInput, type LabelListOptions, type ListForEntityInput, type Meeting, type MeetingActionSummary, type MeetingCreateInput, type MeetingDecisions, type MeetingListOptions, type MeetingParticipant, type MeetingParticipantInput, type MeetingProjectRef, type MeetingSourceIntegration, type MeetingTypeFilter, type MeetingUpdateInput, type MeetingWorkspaceRef, type ObjectiveWithKeyResults, type Organization, type OrganizationCreateInput, type OrganizationListOutput, type OrganizationSize, type OrganizationsListOptions, type OverdueCohort, type OverdueTriage, type OverdueTriageRow, type PageComment, type PageCommentCreateInput, type PageCommentUpdateInput, type PageCreateInput, type PageDiff, type PageDiffOptions, type PageDiffSide, type PageGetFormat, type PageGetOptions, type PageHistory, type PageHistoryOptions, type PageListOptions, type PageOutlineEntry, type PageRestoreOptions, type PageRevision, type PageRevisionAuthor, type PageRevisionDetail, type PageRevisionKind, type PageSearchOptions, type PageSearchOutput, type PageSearchResult, type PageUpdateInput, type Pipeline, type PipelineStage, type Priority, type Product, type ProductCreateInput, type ProductUpdateInput, type Project, type ProjectDetail, type ProjectKeyResultLink, type ProjectOutput, type ProjectPriority, type ProjectStatus, type ProjectUpdateInput, type ProjectsListOptions, type ProjectsListOutput, ROUND_MINUTES, type ReadStatus, type Requirement, type RequirementCreateInput, type RequirementKind, type RequirementListOptions, type Resource, type ResourceContentType, type ResourceCreateInput, type ResourceListOptions, type ResourceListResult, type ResourceReadState, type ResourceUpdateInput, type RunMessage, type RunnerEvent, type RunnerEventKind, type ScopeCreateInput, type ScopeListOptions, type ScopeUpdateInput, type SearchResult, type SearchResultType, type SearchResultWorkspace, type SetEntityTagsInput, type SetEntityTagsResult, type Tag, type TagEntityType, type TagListResult, type Ticket, type TicketAssignee, type TicketComment, type TicketCommentAddInput, type TicketCommentUpdateInput, type TicketCreateInput, type TicketDependencyEdge, type TicketDetail, type TicketListOptions, type TicketSearchOptions, type TicketStatus, type TicketType, type TicketUpdateInput, TimeApi, type TimeConfirmDayResult, type TimeEntry, type TimeEntrySource, type TimeEntryStatus, type TimeLogBatchResult, type TimeLogInput, type TimeLogOutcome, type TimeLogResult, type TodaysActionRow, type TodaysActions, type TodaysActionsGroup, type UserStory, type UserStoryCreateInput, type UserStoryListOptions, type UserStoryUpdateInput, type WorklogSegment, type Workspace, type WorkspaceMember, type WorkspaceOutput, type WorkspacesListOutput, clearConfig, createConfigStore, getConfigPath, isAuthenticated, isTRPCError, loadConfig, saveConfig, segmentConversation };
|
|
5596
|
+
export { type Action, type ActionComment, type ActionCommentAddInput, type ActionCommentUpdateInput, type ActionCreateInput, type ActionOutput, type ActionStatus, type ActionUpdateInput, type ActionUpsertBySourceInput, type ActionUpsertBySourceResult, type ActionsListOutput, type AddInteractionInput, type AddablePropertyType, type AgentRunStatus, AgentRunsApi, type AppendEventsResult, type Area, type AreaCreateInput, type AreaListOptions, type ClaimedRun, type CommentAuthor, type Contact, type ContactCreateInput, type ContactInteraction, type ContactListOutput, type ContactUpdateInput, type ContactsListOptions, type ConversationMessage, type CsvCellError, type CsvColumnTarget, type CsvCommitResult, type CsvMapping, type CsvPreview, type CsvPreviewColumn, type CsvPreviewRow, DEFAULT_GAP_MINUTES, type Database, type DatabaseCreateInput, type DatabaseFilter, type DatabasePropertyResult, type DatabaseRow, type DatabaseRowsPage, type DatabaseUpdateInput, type DatabaseView, type DayReport, type DayReportActionRow, type DayReportEntry, type DayReportProductRow, type Deal, type DealActivity, type DealCreateInput, type DealMoveInput, type DealUpdateInput, type Decision, type DecisionAdrRef, type DecisionChainRef, type DecisionCreateInput, type DecisionDecider, type DecisionDeciderInput, type DecisionEvidenceTurn, type DecisionFeatureRef, type DecisionLink, type DecisionListOptions, type DecisionListRow, type DecisionMeetingRef, type DecisionOccurrenceRef, type DecisionProductRef, type DecisionProjectRef, type DecisionReviewState, type DecisionSetStatusInput, type DecisionSource, type DecisionStatus, type DecisionTicketRef, type DecisionUpdateInput, type DecisionUserRef, type DeletedDatabase, type DraftDecisionsResult, type EnrichContactResult, type Epic, type EpicCreateInput, type EpicListOptions, type EpicPriority, type EpicStatus, type EpicUpdateInput, ExponentialClient, type ExponentialConfig, type Feature, type FeatureComment, type FeatureCommentCreateInput, type FeatureCommentReplyInput, type FeatureCommentThreadInput, type FeatureCommentUpdateInput, type FeatureCreateInput, type FeatureKeyResultLink, type FeatureLinkPageInput, type FeatureListOptions, type FeatureScope, type FeatureScopeStatus, type FeatureStatus, type FeatureUpdateInput, type FilterOp, type FinishInput, type FinishResult, type GlobalSearchOptions, type GlobalSearchOutput, type Goal, type GoalChildSummary, type GoalComment, type GoalCommentAddInput, type GoalCommentUpdateInput, type GoalCreateInput, type GoalHealth, type GoalKeyResultSummary, type GoalLifeDomain, type GoalListOptions, type GoalPeriod, type GoalProjectSummary, type GoalSetParentInput, type GoalSetStatusInput, type GoalStats, type GoalStatsOptions, type GoalStatus, type GoalTreeNode, type GoalTreeOptions, type GoalUpdateInput, type GoalUserSummary, type GoalWritableStatus, type HeartbeatResult, type InteractionDirection, type InteractionType, type KanbanStatus, type KeyResult, type KeyResultByObjectiveOptions, type KeyResultCheckIn, type KeyResultCheckInInput, type KeyResultCreateInput, type KeyResultFeatureLink, type KeyResultListOptions, type KeyResultProjectLink, type KeyResultStatus, type KeyResultUnit, type KeyResultUpdateInput, type KnowledgePage, type KnowledgeSearchOptions, type KnowledgeSearchOutput, type KnowledgeSearchResult, type KnowledgeSourceType, type LabelCreateInput, type LabelListOptions, type ListForEntityInput, type Meeting, type MeetingActionSummary, type MeetingCreateInput, type MeetingDecisions, type MeetingListOptions, type MeetingParticipant, type MeetingParticipantInput, type MeetingProjectRef, type MeetingSourceIntegration, type MeetingTypeFilter, type MeetingUpdateInput, type MeetingWorkspaceRef, type ObjectiveWithKeyResults, type Organization, type OrganizationCreateInput, type OrganizationListOutput, type OrganizationSize, type OrganizationsListOptions, type OverdueCohort, type OverdueTriage, type OverdueTriageRow, type PageComment, type PageCommentCreateInput, type PageCommentCreated, type PageCommentReplyInput, type PageCommentThreadInput, type PageCommentUpdateInput, type PageCreateInput, type PageDiff, type PageDiffOptions, type PageDiffSide, type PageGetFormat, type PageGetOptions, type PageHistory, type PageHistoryOptions, type PageListOptions, type PageOutlineEntry, type PageRestoreOptions, type PageRevision, type PageRevisionAuthor, type PageRevisionDetail, type PageRevisionKind, type PageSearchOptions, type PageSearchOutput, type PageSearchResult, type PageUpdateInput, type PillColor, type Pipeline, type PipelineStage, type Priority, type Product, type ProductCreateInput, type ProductUpdateInput, type Project, type ProjectDetail, type ProjectKeyResultLink, type ProjectOutput, type ProjectPriority, type ProjectStatus, type ProjectUpdateInput, type ProjectsListOptions, type ProjectsListOutput, type PropertyAddInput, type PropertyDef, type PropertyRejection, type PropertyType, type PropertyUpdateInput, type PropertyValue, ROUND_MINUTES, type ReadStatus, type RelationConfig, type RelationTargetKind, type Requirement, type RequirementCreateInput, type RequirementKind, type RequirementListOptions, type Resource, type ResourceContentType, type ResourceCreateInput, type ResourceListOptions, type ResourceListResult, type ResourceReadState, type ResourceUpdateInput, type RowListOptions, type RowValuesInput, type RowWriteOptions, type RunMessage, type RunnerEvent, type RunnerEventKind, type ScopeCreateInput, type ScopeListOptions, type ScopeUpdateInput, type SearchResult, type SearchResultType, type SearchResultWorkspace, type SelectOption, type SelectOptionInput, type SetEntityTagsInput, type SetEntityTagsResult, type Tag, type TagEntityType, type TagListResult, type Ticket, type TicketAssignee, type TicketComment, type TicketCommentAddInput, type TicketCommentUpdateInput, type TicketCreateInput, type TicketDependencyEdge, type TicketDetail, type TicketListOptions, type TicketSearchOptions, type TicketStatus, type TicketType, type TicketUpdateInput, TimeApi, type TimeConfirmDayResult, type TimeEntry, type TimeEntrySource, type TimeEntryStatus, type TimeLogBatchResult, type TimeLogInput, type TimeLogOutcome, type TimeLogResult, type TodaysActionRow, type TodaysActions, type TodaysActionsGroup, type UserStory, type UserStoryCreateInput, type UserStoryListOptions, type UserStoryUpdateInput, type WorklogSegment, type Workspace, type WorkspaceMember, type WorkspaceOutput, type WorkspacesListOutput, clearConfig, createConfigStore, getConfigPath, isAuthenticated, isTRPCError, loadConfig, saveConfig, segmentConversation };
|