@corto-ai/dexter-integrations 0.1.0-dev.0 → 0.1.1-dev.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 +0 -1
- package/index.js +0 -9
- 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
|
@@ -417,7 +417,6 @@ interface TableAppClient {
|
|
|
417
417
|
sendChanges(changes: TableAppChanges): void;
|
|
418
418
|
handleSaveSuccess(callback: () => void): void;
|
|
419
419
|
handleSaveError(callback: (error: Error) => void): void;
|
|
420
|
-
disconnect(): void;
|
|
421
420
|
}
|
|
422
421
|
type TableAppClientOptions = TransportOptions;
|
|
423
422
|
declare const createTableAppClient: (options?: TableAppClientOptions) => TableAppClient;
|
package/index.js
CHANGED
|
@@ -3919,15 +3919,6 @@ var Client = class {
|
|
|
3919
3919
|
}
|
|
3920
3920
|
this.publishChanges(outgoing);
|
|
3921
3921
|
};
|
|
3922
|
-
disconnect = () => {
|
|
3923
|
-
this.connection.destroy();
|
|
3924
|
-
this.context = void 0;
|
|
3925
|
-
this.pendingChanges = void 0;
|
|
3926
|
-
this.updateHandler = void 0;
|
|
3927
|
-
this.successHandler = void 0;
|
|
3928
|
-
this.errorHandler = void 0;
|
|
3929
|
-
this.lastError = void 0;
|
|
3930
|
-
};
|
|
3931
3922
|
publishChanges = (changes) => {
|
|
3932
3923
|
if (!this.connection.isReady) {
|
|
3933
3924
|
this.pendingChanges = changes;
|