@devrev/airsync-sdk 2.0.0-beta.7 → 2.0.0-beta.8
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/docs/MIGRATION.md +20 -6
- package/package.json +1 -1
package/docs/MIGRATION.md
CHANGED
|
@@ -53,10 +53,13 @@ v2; templates are copied into new connectors, so stale comments spread.
|
|
|
53
53
|
6. **Sweep.** This must return nothing except legitimate hits (an
|
|
54
54
|
`EventEmitter.emit`, the connector's own `axiosClient` from §9):
|
|
55
55
|
```bash
|
|
56
|
-
grep -rnE "@devrev/ts-adaas|airsync-sdk/dist|\bprocessTask\b|WorkerAdapter|\.emit\(|hasWorkerEmitted|Airdrop(Event|Message)|axiosClient|(format|serialize)AxiosError|workerPath:|overridenOptions|skipConfirmation|isLocalDevelopment|--local|(Extractor|Loader)EventType|ExtractionCommonError|ERROR_CODE=|sdkState|onUpload|uploadedArtifacts|currentEventDataLength|EXTRACTION_(DATA|METADATA|ATTACHMENTS|EXTERNAL_SYNC_UNITS)_" \
|
|
56
|
+
grep -rnE "@devrev/ts-adaas|airsync-sdk/dist|\bprocessTask\b|WorkerAdapter|\.emit\(|hasWorkerEmitted|Airdrop(Event|Message)|axiosClient|(format|serialize)AxiosError|workerPath:|overridenOptions|skipConfirmation|isLocalDevelopment|--local|@devrev/typescript-sdk|(Extractor|Loader)EventType|ExtractionCommonError|ERROR_CODE=|sdkState|onUpload|uploadedArtifacts|currentEventDataLength|EXTRACTION_(DATA|METADATA|ATTACHMENTS|EXTERNAL_SYNC_UNITS)_" \
|
|
57
57
|
--include='*.ts' --include='*.js' --include='*.json' --include='*.yml' --include='*.yaml' --include='*.md' --include='*.mdc' . \
|
|
58
58
|
| grep -vE 'node_modules|/dist/|/coverage/|package-lock.json|MIGRATION_REVIEW.md'
|
|
59
59
|
```
|
|
60
|
+
The sweep covers `test/` and other folders that tsc, lint and jest often
|
|
61
|
+
exclude. A hit there is real: `@devrev/typescript-sdk` must be in
|
|
62
|
+
`package.json` (§1), and a `local` argv must become the env var (§3).
|
|
60
63
|
Also grep `getByExternalId|getByTargetId` and check each call against §10:
|
|
61
64
|
existence checks there compile but silently invert.
|
|
62
65
|
Then rewrite any connector docs (`README`, `AGENTS.md`, `CLAUDE.md`, `docs/`)
|
|
@@ -101,7 +104,13 @@ v2; templates are copied into new connectors, so stale comments spread.
|
|
|
101
104
|
- `ts-node` and `@devrev/typescript-sdk` are no longer SDK dependencies. A
|
|
102
105
|
connector that runs `.ts` workers directly needs `ts-node` in its own
|
|
103
106
|
`devDependencies`. A connector that uses `@devrev/typescript-sdk` must list
|
|
104
|
-
it.
|
|
107
|
+
it. The template's local test server (`code/test/runner.ts`, and the copy
|
|
108
|
+
`airsync start-worker` writes to `code/.snapin-test/`) imports
|
|
109
|
+
`@devrev/typescript-sdk/dist/snap-ins`, so template connectors add it to
|
|
110
|
+
`devDependencies`. Most connectors exclude `test/` from tsc, lint and jest,
|
|
111
|
+
so the gates pass and the local worker then fails with
|
|
112
|
+
`Cannot find module '@devrev/typescript-sdk/dist/snap-ins'`.
|
|
113
|
+
`InputData` (the type of `event.input_data`) is now exported from the
|
|
105
114
|
root.
|
|
106
115
|
|
|
107
116
|
## 2. Event types
|
|
@@ -140,7 +149,7 @@ leave connector logic that uses them alone.
|
|
|
140
149
|
| `baseWorkerPath?` | **required**, the directory containing `workers/` (usually `__dirname`) |
|
|
141
150
|
| `options.workerPathOverrides` | top-level `workerPathOverrides` |
|
|
142
151
|
| `options: WorkerAdapterOptions` | `options?: SpawnOptions` (`{ timeout?, batchSize? }`) |
|
|
143
|
-
| `options.isLocalDevelopment`, `--local` argv | removed; set `AIRSYNC_LOCAL_DEVELOPMENT=1` |
|
|
152
|
+
| `options.isLocalDevelopment`, `local` / `--local` argv | removed; set `AIRSYNC_LOCAL_DEVELOPMENT=1` |
|
|
144
153
|
|
|
145
154
|
```ts
|
|
146
155
|
// v1
|
|
@@ -171,9 +180,14 @@ spawn({
|
|
|
171
180
|
`START_DELETING_EXTRACTOR_STATE` and `START_EXTRACTING_ATTACHMENTS` /
|
|
172
181
|
`CONTINUE_EXTRACTING_ATTACHMENTS` / `START_DELETING_EXTRACTOR_ATTACHMENTS_STATE`.
|
|
173
182
|
- **Local mode** comes only from the `AIRSYNC_LOCAL_DEVELOPMENT=1` environment
|
|
174
|
-
variable, and is ignored on Lambda.
|
|
175
|
-
`
|
|
176
|
-
`
|
|
183
|
+
variable, and is ignored on Lambda. v1 also enabled it from a bare `local`
|
|
184
|
+
argument, which the template test server receives (`main.ts local --port …`,
|
|
185
|
+
also used by `airsync start-worker`). v2 ignores both `local` and `--local`
|
|
186
|
+
without an error: logs come out as production JSON and no copies land in
|
|
187
|
+
`extracted_files/`. A local runner that did `process.argv.push('--local')`
|
|
188
|
+
or relied on the `local` argument sets
|
|
189
|
+
`process.env.AIRSYNC_LOCAL_DEVELOPMENT = '1'` before calling `spawn` instead,
|
|
190
|
+
or documents running the worker with `AIRSYNC_LOCAL_DEVELOPMENT=1`.
|
|
177
191
|
|
|
178
192
|
## 4. Workers return a `TaskResult` instead of emitting
|
|
179
193
|
|