@syncmatters/script-api 1.0.11 → 1.0.13
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.
|
@@ -24,9 +24,9 @@ AGENTS.md # CLI-generated agent guide (managed block + your notes belo
|
|
|
24
24
|
| `groups/**/group.config.json` | **No** | **No** |
|
|
25
25
|
| `types/**`, `.sm/`, `package.json`, `jsconfig.json` | **No** | **No** |
|
|
26
26
|
|
|
27
|
-
Sync and sync-group **configuration**
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
Sync and sync-group **configuration** is authored in `changes/*.sync-changes.json` and published
|
|
28
|
+
with `sm sync push` after a human reviews `sm sync draft`. Snapshots under `syncs/` and `groups/`
|
|
29
|
+
are **read-only context** — never hand-edit or `sm push` them. Schedules still start in the web UI.
|
|
30
30
|
|
|
31
31
|
Generated sync/group files include a marker:
|
|
32
32
|
|
|
@@ -31,8 +31,8 @@ Each file starts with:
|
|
|
31
31
|
- Do **not** hand-edit snapshots to change mappings, schedules, or wiring.
|
|
32
32
|
- Do **not** `sm push` snapshot paths — there is no push route for them today.
|
|
33
33
|
- Do **not** treat snapshots as the source of truth for writes. Author mapping changes in
|
|
34
|
-
`changes/*.sync-changes.json`, preview with `sm sync draft <file>`, then
|
|
35
|
-
|
|
34
|
+
`changes/*.sync-changes.json`, preview with `sm sync draft <file>`, then `sm sync push <file>`
|
|
35
|
+
only when the human has instructed it. Snapshots stay generated.
|
|
36
36
|
|
|
37
37
|
## Preview drafts (`sm sync draft`)
|
|
38
38
|
|
|
@@ -13,7 +13,8 @@ sm pull sync # optional: refresh sync/group snapshots only
|
|
|
13
13
|
|
|
14
14
|
- **Scripts only:** `sm push` uploads changed files under `files/` (and meta sidecars). It does
|
|
15
15
|
**not** upload `syncs/` or `groups/`.
|
|
16
|
-
- **Sync config changes:**
|
|
16
|
+
- **Sync config changes:** `changes/*.sync-changes.json` → `sm sync draft` → human review →
|
|
17
|
+
`sm sync push` (needs `syncs:write`). Agents push only on human instruction.
|
|
17
18
|
- **Reading snapshots:** use `syncs/` and `groups/` for context before editing the wired module
|
|
18
19
|
in `files/`.
|
|
19
20
|
|
|
@@ -31,6 +32,7 @@ Prefer tokens **without execute scopes** for day-to-day edit/push work:
|
|
|
31
32
|
| `scripts:read` | pull, diff incoming |
|
|
32
33
|
| `scripts:write` | push script files |
|
|
33
34
|
| `syncs:read` | `sm pull sync`, sync snapshots, `sm sync draft` |
|
|
35
|
+
| `syncs:write` | `sm sync push` / `applysyncops` (human-approved publish) |
|
|
34
36
|
| `connections:read` | `sm types`, connection resolution |
|
|
35
37
|
| `scripts:execute` | **Only when running** `sm test` / connector features |
|
|
36
38
|
| `syncs:execute` | Reserved; not needed for authoring |
|
package/lib/connection.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import API from "../index.js";
|
|
2
2
|
import { CodedError } from "./coded-error.js";
|
|
3
3
|
import { FileProvider } from "./utilities/file-provider/file-provider.js";
|
|
4
|
-
import { SyncEndpoint
|
|
4
|
+
import { SyncEndpoint } from "./sync.js";
|
|
5
5
|
export interface Connection {
|
|
6
6
|
/** org unique connection id */
|
|
7
7
|
readonly id: string;
|
|
@@ -64,10 +64,10 @@ export interface Connection {
|
|
|
64
64
|
objectIds?: string[];
|
|
65
65
|
}): Promise<void>;
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
67
|
+
* Constructs an endpoint through which sync(s) can interact with this connection.
|
|
68
|
+
* The endpoint has no active session until {@link SyncEndpoint.sessionBegin} is called.
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
syncEndpoint?(): Promise<SyncEndpoint>;
|
|
71
71
|
}
|
|
72
72
|
export interface Cache {
|
|
73
73
|
count: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncmatters/script-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "TypeScript type definitions for the SyncMatters script API (types only - scripts execute on the SyncMatters platform)",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"author": "SyncMatters",
|
|
30
30
|
"homepage": "https://syncmatters.com",
|
|
31
|
-
"typesContentHash": "
|
|
31
|
+
"typesContentHash": "5cb475fa1240d9fa9964086b867786e024b3d3b555313717aafd586bbec05675",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@types/node": "*"
|
|
34
34
|
}
|