@corto-ai/dexter-integrations 0.1.0-dev.0 → 0.1.1-test.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 +14 -10
- package/index.d.ts +4 -1
- package/index.js +1662 -1629
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# @corto-ai/dexter-integrations
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Allows connecting a table editor to Dexter. Dexter supplies matter values and lookups and controls saving.
|
|
4
|
+
Your app edits field values, sends all edits to dexter, receives live matter updates and displays errors.
|
|
4
5
|
|
|
5
6
|
## Install
|
|
6
7
|
|
|
@@ -36,25 +37,28 @@ client.sendChanges({
|
|
|
36
37
|
isValid: true
|
|
37
38
|
});
|
|
38
39
|
|
|
39
|
-
// For an invalid edit, send
|
|
40
|
+
// For an invalid edit, you do not need to send values:
|
|
40
41
|
client.sendChanges({ isValid: false });
|
|
41
|
-
|
|
42
|
-
// On teardown:
|
|
43
|
-
client.disconnect();
|
|
44
42
|
```
|
|
45
43
|
|
|
46
|
-
|
|
44
|
+
The connection starts automatically when you call createTableAppClient(). The initial handshake keeps retrying until Dexter is ready.
|
|
45
|
+
|
|
46
|
+
If any messages are sent in either direction before the connection establishes, the latest payloads will be sent on connection.
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Re-registering a handler will replace previous registrations of that handler.
|
|
49
|
+
|
|
50
|
+
The handleMatterUpdate callback receives `{ matter, lookups, tableId, table, tableLookups }`, using Dexter API DTOs.
|
|
49
51
|
|
|
50
52
|
## Editing
|
|
51
53
|
|
|
52
54
|
Only use field IDs permitted by `tableLookups.fields`. You can populate an allowed field that is not yet present in the table. An empty string clears a value; omitted values also count as empty, so always send the complete draft.
|
|
53
55
|
|
|
54
|
-
Send only `{ isValid: false }` for invalid edits. The SDK discards draft values and blocks Save; invalid edits still count as unsaved for
|
|
56
|
+
Send only `{ isValid: false }` for invalid edits. The SDK discards draft values and blocks Save; invalid edits still count as unsaved for navigation blocking.
|
|
57
|
+
|
|
58
|
+
Dexter independently validates changes, tracks unsaved values and enables Save when appropriate. Your app may continue editing during a save.
|
|
55
59
|
|
|
56
|
-
|
|
60
|
+
All matter updates (provided through handleMatterUpdate) do not merge or replace your draft. If your app adopts updated values, call `sendChanges` again. Reloading the iframe discards the draft.
|
|
57
61
|
|
|
58
|
-
`handleSaveError` also reports invalid changes and connection failures.
|
|
62
|
+
`handleSaveError` also reports invalid changes and connection failures. After 10 seconds it reports a one-time waiting warning and continues trying. The SDK never automatically retries saves.
|
|
59
63
|
|
|
60
64
|
Callback errors are reported through `handleSaveError` without disconnecting. Errors thrown by the error handler itself are logged to the browser console to avoid recursive reporting.
|
package/index.d.ts
CHANGED
|
@@ -240,6 +240,8 @@ interface StaffDto {
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
interface TableDto$1 {
|
|
243
|
+
appDisplayName?: string;
|
|
244
|
+
appUrl?: string;
|
|
243
245
|
description: string;
|
|
244
246
|
fields: Array<FieldV2Dto>;
|
|
245
247
|
id: string;
|
|
@@ -361,6 +363,8 @@ interface StatusLookupDto {
|
|
|
361
363
|
}
|
|
362
364
|
|
|
363
365
|
interface TableLookupDto {
|
|
366
|
+
appDisplayName?: string;
|
|
367
|
+
appUrl?: string;
|
|
364
368
|
description: string;
|
|
365
369
|
fields?: Array<FieldLookupDto>;
|
|
366
370
|
id: string;
|
|
@@ -417,7 +421,6 @@ interface TableAppClient {
|
|
|
417
421
|
sendChanges(changes: TableAppChanges): void;
|
|
418
422
|
handleSaveSuccess(callback: () => void): void;
|
|
419
423
|
handleSaveError(callback: (error: Error) => void): void;
|
|
420
|
-
disconnect(): void;
|
|
421
424
|
}
|
|
422
425
|
type TableAppClientOptions = TransportOptions;
|
|
423
426
|
declare const createTableAppClient: (options?: TableAppClientOptions) => TableAppClient;
|