v2 refactor: @devrev/airsync-sdk (rename, state/adapter split, emit-from-return) - #208
Draft
radovanjorgic wants to merge 4 commits into
Draft
v2 refactor: @devrev/airsync-sdk (rename, state/adapter split, emit-from-return)#208radovanjorgic wants to merge 4 commits into
radovanjorgic wants to merge 4 commits into
Conversation
radovanjorgic
force-pushed
the
v2
branch
9 times, most recently
from
July 29, 2026 06:57
2260118 to
37c3426
Compare
Drops code that v2 no longer builds on, so the later commits do not have to carry it. Call sites that still reference these modules are reworked in a later commit, which is why the tree does not compile in between. - src/deprecated/* (the pre-WorkerAdapter adapter, demo extractor, legacy http client and uploader) - the legacy event-type translation layer - the old src/http surface (axios-client, constants, index, types) - the log-context layer (logger.constants, logger.context) - REFERENCE.md, superseded by MIGRATION.md and the README Verified unused by both known connectors, asana and template. BREAKING CHANGE: the deprecated exports (Adapter, createAdapter, DemoExtractor, HTTPClient, the legacy uploader) and the axios/axiosClient surface are gone, along with legacy event-type translation. Log records no longer carry is_sdk_log, so Datadog filters on @is_sdk_log stop matching. See MIGRATION.md sections 9, 11 and 12.
Mechanical commit: the package rename, the module layout, and the
tooling that enforces it. No behavior changes.
Package:
- @devrev/ts-adaas -> @devrev/airsync-sdk, description reworded to
AirSync, README install line updated
Module moves (pure renames, contents untouched):
- common/errors.ts -> types/errors.ts
- common/control-protocol.ts -> multithreading/emit.ts
- common/test-utils.ts -> testing/mock-event.ts
- common/time-value-resolver.ts -> state/time-value-resolver.ts
- common/install-initial-domain-mapping.ts -> state/
- mock-server/* -> testing/
- http/axios-client-internal.ts -> http/client.ts
- multithreading/worker-adapter/worker-adapter.helpers.ts
-> multithreading/adapters/loading-adapter.helpers.ts
- mappers/mappers.interface.ts -> mappers/mappers.interfaces.ts
Relative import paths were updated at every call site, and import
blocks are now sorted by the new simple-import-sort rule
(node builtins -> external -> parent-relative -> same-dir). The jest
project globs follow the renamed http client test.
tsconfig.build.json keeps tests out of the published build, so the
build no longer compiles *.test.ts into dist.
BREAKING CHANGE: the package is published as @devrev/airsync-sdk;
@devrev/ts-adaas receives no further releases. Deep imports into
moved modules no longer resolve - import from the package root
instead. See MIGRATION.md sections 1 and 13.
The behavioral half of v2. Everything here can break a connector.
Adapters:
- WorkerAdapter is split into ExtractionAdapter and LoadingAdapter over
a shared BaseAdapter, so each phase only carries the surface it needs
- processTask is split into processExtractionTask and processLoadingTask
Emit contract:
- a worker's task returns a TaskResult
({ status: 'success' | 'progress' | 'delay' | 'error' }) and the SDK
emits from it in emitFromResult
- adapter.emit is now protected; connectors no longer emit by hand, and
double-emitting is no longer possible
State:
- split into base, extraction, and loading state, mirroring the adapters
Public API:
- the root barrel now names every export explicitly instead of
re-exporting whole modules, so the public surface is one reviewable
file and internals stay internal
- formatAxiosError and serializeAxiosError are replaced by a single
serializeError
Carries #224 (pre_extraction_item_counts) over to the new contract.
Since emit is no longer public, the counts are supplied through the
ExtractionAdapter.preExtractionItemCounts setter, mirroring the existing
artifacts accessor, and the SDK attaches them to the metadata-done
event. Covered by a dummy-connector test asserting the emitted body.
Tests are rewritten against the new adapters and state.
BREAKING CHANGE: connectors must migrate to the split adapters and
process functions, return a TaskResult from their task instead of
emitting, and adopt the split state. Symbols that were previously
reachable through `export *` but are not in the new barrel are no
longer importable from the package root. Connectors that reported
pre_extraction_item_counts via adapter.emit must set
adapter.preExtractionItemCounts instead. See MIGRATION.md.
MIGRATION.md is the self-contained v1 -> v2 spec: an execution plan plus sections 1-16 covering the package rename, the split adapters and process functions, the TaskResult emit contract, the state split, the narrowed public barrel, the removed deprecated and http surfaces, and the jest mock updates. It ships in the npm tarball so tooling can read the copy that matches the installed version instead of guessing against the latest docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR is the v2 rebuild of the SDK, delivered as three single-purpose commits
(refactor / test / docs) for commit-by-commit review. Breaking changes are intended.
@devrev/ts-adaas→@devrev/airsync-sdk(2.x);AirdropEvent/AirdropMessage→AirSyncEvent/AirSyncMessage(hard rename).WorkerAdapter→ExtractionAdapter+LoadingAdapter;State→ExtractionState+LoadingState; on-disk state is now a{ connectorState, sdkState }envelope with a v1→v2 read-time migration.emit()is now SDK-internal;task/onTimeoutreturn aTaskResult(success/progress/delay/error) and the SDK emits once.migrateProcessedAttachments/createAdapterStateshims, andsrc/deprecated/**.MIGRATION.md(complete v1→v2 spec, shipped in thenpm tarball) and the
migrate-v2skill that executes it.Connected Issues
Checklist
npm run testOR no tests needed.npm run test:backwards-compatibility.npm run lint.