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.js
CHANGED
|
@@ -233,6 +233,10 @@ var PageCommentsApi = class {
|
|
|
233
233
|
async create(input) {
|
|
234
234
|
return await this.client.pageComment.create.mutate(input);
|
|
235
235
|
}
|
|
236
|
+
/** Reply to an existing comment. Replies to replies still hang off the root. */
|
|
237
|
+
async reply(input) {
|
|
238
|
+
return await this.client.pageComment.reply.mutate(input);
|
|
239
|
+
}
|
|
236
240
|
async update(input) {
|
|
237
241
|
return await this.client.pageComment.update.mutate(input);
|
|
238
242
|
}
|
|
@@ -241,6 +245,13 @@ var PageCommentsApi = class {
|
|
|
241
245
|
commentId
|
|
242
246
|
});
|
|
243
247
|
}
|
|
248
|
+
/** Mark an anchored thread resolved. Only anchored threads have a threadId. */
|
|
249
|
+
async resolve(input) {
|
|
250
|
+
return await this.client.pageComment.resolve.mutate(input);
|
|
251
|
+
}
|
|
252
|
+
async unresolve(input) {
|
|
253
|
+
return await this.client.pageComment.unresolve.mutate(input);
|
|
254
|
+
}
|
|
244
255
|
};
|
|
245
256
|
|
|
246
257
|
// src/goalComments.ts
|
|
@@ -1137,6 +1148,88 @@ var PagesApi = class {
|
|
|
1137
1148
|
}
|
|
1138
1149
|
};
|
|
1139
1150
|
|
|
1151
|
+
// src/databases.ts
|
|
1152
|
+
var DatabasesApi = class {
|
|
1153
|
+
constructor(client) {
|
|
1154
|
+
this.client = client;
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* Create a database on a page with a title property. Then put its
|
|
1158
|
+
* `marker` into the page body (`pages.update` with the body plus the
|
|
1159
|
+
* marker on its own line) so the page shows it.
|
|
1160
|
+
*/
|
|
1161
|
+
async create(input) {
|
|
1162
|
+
return await this.client.database.create.mutate(input);
|
|
1163
|
+
}
|
|
1164
|
+
/** One database: definition, view, row count and holding page. */
|
|
1165
|
+
async get(id) {
|
|
1166
|
+
return await this.client.database.get.query({ id });
|
|
1167
|
+
}
|
|
1168
|
+
/** The databases a page holds, detached ones included, with row counts. */
|
|
1169
|
+
async list(pageId) {
|
|
1170
|
+
return await this.client.database.list.query({ pageId });
|
|
1171
|
+
}
|
|
1172
|
+
/** Rename, or replace the saved view whole. */
|
|
1173
|
+
async update(input) {
|
|
1174
|
+
return await this.client.database.update.mutate(input);
|
|
1175
|
+
}
|
|
1176
|
+
/** Delete the database and every row with it. Removing the block from the page only detaches; this is the delete. */
|
|
1177
|
+
async delete(id) {
|
|
1178
|
+
return await this.client.database.delete.mutate({ id });
|
|
1179
|
+
}
|
|
1180
|
+
// ── Properties ─────────────────────────────────────────────────────────────
|
|
1181
|
+
/** Add a property. New select options get ids and palette colours; the column goes last in the view. */
|
|
1182
|
+
async addProperty(input) {
|
|
1183
|
+
return await this.client.database.addProperty.mutate(input);
|
|
1184
|
+
}
|
|
1185
|
+
/** Rename, describe, retype or re-option a property. Ids stay; no row is rewritten. */
|
|
1186
|
+
async updateProperty(input) {
|
|
1187
|
+
return await this.client.database.updateProperty.mutate(input);
|
|
1188
|
+
}
|
|
1189
|
+
/** Remove a property (by id or name) from the schema and view. Never the title. */
|
|
1190
|
+
async removeProperty(databaseId, propertyId) {
|
|
1191
|
+
return await this.client.database.removeProperty.mutate({ id: databaseId, propertyId });
|
|
1192
|
+
}
|
|
1193
|
+
/** Set the column order; `propertyIds` must name every property exactly once. */
|
|
1194
|
+
async reorderProperties(databaseId, propertyIds) {
|
|
1195
|
+
return await this.client.database.reorderProperties.mutate({ id: databaseId, propertyIds });
|
|
1196
|
+
}
|
|
1197
|
+
// ── Rows ───────────────────────────────────────────────────────────────────
|
|
1198
|
+
/** The rows through the saved view (or `options.view`), paged by cursor. */
|
|
1199
|
+
async listRows(databaseId, options = {}) {
|
|
1200
|
+
return await this.client.database.listRows.query({ id: databaseId, ...options });
|
|
1201
|
+
}
|
|
1202
|
+
/** Add a row with typed values. Placed where the holding page is. */
|
|
1203
|
+
async createRow(databaseId, values = {}, options = {}) {
|
|
1204
|
+
return await this.client.database.createRow.mutate({ id: databaseId, values, ...options });
|
|
1205
|
+
}
|
|
1206
|
+
/** Write some of a row's values; cells not named are kept, `null` clears one. Records a revision on the row page. */
|
|
1207
|
+
async updateRow(rowId, values, options = {}) {
|
|
1208
|
+
return await this.client.database.updateRow.mutate({ rowId, values, ...options });
|
|
1209
|
+
}
|
|
1210
|
+
/** Delete a row — the page and its search chunks. */
|
|
1211
|
+
async deleteRow(rowId) {
|
|
1212
|
+
return await this.client.database.deleteRow.mutate({ rowId });
|
|
1213
|
+
}
|
|
1214
|
+
// ── CSV import ─────────────────────────────────────────────────────────────
|
|
1215
|
+
/**
|
|
1216
|
+
* Type a CSV against the database before anything is created: columns
|
|
1217
|
+
* resolved through `mapping` (or suggested by header name), every row
|
|
1218
|
+
* checked, each cell that does not fit named. Writes nothing.
|
|
1219
|
+
*/
|
|
1220
|
+
async previewCsv(databaseId, csv, mapping) {
|
|
1221
|
+
return await this.client.database.previewCsv.mutate({ id: databaseId, csv, ...mapping ? { mapping } : {} });
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Import a CSV: new columns become properties, then every row with no
|
|
1225
|
+
* cell error becomes a row with a `create` revision; the rest are reported
|
|
1226
|
+
* and left uncreated. Up to 2,000 rows a time.
|
|
1227
|
+
*/
|
|
1228
|
+
async commitCsv(databaseId, csv, mapping, options = {}) {
|
|
1229
|
+
return await this.client.database.commitCsv.mutate({ id: databaseId, csv, mapping, ...options });
|
|
1230
|
+
}
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1140
1233
|
// src/resources.ts
|
|
1141
1234
|
var ResourcesApi = class {
|
|
1142
1235
|
constructor(client) {
|
|
@@ -1566,6 +1659,7 @@ var ExponentialClient = class {
|
|
|
1566
1659
|
this.areas = new AreasApi(this.client);
|
|
1567
1660
|
this.meetings = new MeetingsApi(this.client);
|
|
1568
1661
|
this.pages = new PagesApi(this.client);
|
|
1662
|
+
this.databases = new DatabasesApi(this.client);
|
|
1569
1663
|
this.resources = new ResourcesApi(this.client);
|
|
1570
1664
|
this.requirements = new RequirementsApi(this.client);
|
|
1571
1665
|
this.scopes = new ScopesApi(this.client);
|
|
@@ -1597,6 +1691,8 @@ var ExponentialClient = class {
|
|
|
1597
1691
|
areas;
|
|
1598
1692
|
meetings;
|
|
1599
1693
|
pages;
|
|
1694
|
+
/** Databases — typed tables inside pages (ADR-0078). */
|
|
1695
|
+
databases;
|
|
1600
1696
|
resources;
|
|
1601
1697
|
requirements;
|
|
1602
1698
|
scopes;
|