refactor(sync-providers): add tiered package exports

This commit is contained in:
Johannes Millan 2026-05-13 13:51:11 +02:00
parent 32ba4d144c
commit 00098f52fb
57 changed files with 324 additions and 92 deletions

View file

@ -61,7 +61,7 @@ This ensures:
**Files:**
- `src/app/op-log/sync-providers/super-sync/super-sync.model.ts`
- `packages/sync-providers/src/super-sync/super-sync.model.ts`
- `src/app/features/config/global-config.model.ts`
**Changes:**
@ -193,18 +193,18 @@ async getEncryptKey(): Promise<string | undefined> {
## Files to Modify
| File | Changes |
| -------------------------------------------------------------- | -------------------------------------------------- |
| `src/app/op-log/sync-providers/super-sync/super-sync.model.ts` | Add `isAutoEncryptionEnabled`, `autoEncryptionKey` |
| `src/app/op-log/encryption/encryption.ts` | Add `deriveKeyFromHighEntropy()` |
| `src/app/op-log/sync-providers/super-sync/super-sync.ts` | Modify `getEncryptKey()` |
| `src/app/op-log/sync/operation-encryption.service.ts` | Support pre-derived keys |
| `src/app/features/config/form-cfgs/sync-form.const.ts` | Add UI toggle |
| `src/app/features/config/global-config.model.ts` | Add `isAutoEncryptionEnabled` to `SuperSyncConfig` |
| `src/app/imex/sync/auto-encryption-enable.service.ts` | NEW: Enable flow |
| `src/app/imex/sync/auto-encryption-disable.service.ts` | NEW: Disable flow |
| `src/assets/i18n/en.json` | Add translation keys |
| `src/app/t.const.ts` | Add translation constants |
| File | Changes |
| ------------------------------------------------------------ | -------------------------------------------------- |
| `packages/sync-providers/src/super-sync/super-sync.model.ts` | Add `isAutoEncryptionEnabled`, `autoEncryptionKey` |
| `src/app/op-log/encryption/encryption.ts` | Add `deriveKeyFromHighEntropy()` |
| `src/app/op-log/sync-providers/super-sync/super-sync.ts` | Modify `getEncryptKey()` |
| `src/app/op-log/sync/operation-encryption.service.ts` | Support pre-derived keys |
| `src/app/features/config/form-cfgs/sync-form.const.ts` | Add UI toggle |
| `src/app/features/config/global-config.model.ts` | Add `isAutoEncryptionEnabled` to `SuperSyncConfig` |
| `src/app/imex/sync/auto-encryption-enable.service.ts` | NEW: Enable flow |
| `src/app/imex/sync/auto-encryption-disable.service.ts` | NEW: Disable flow |
| `src/assets/i18n/en.json` | Add translation keys |
| `src/app/t.const.ts` | Add translation constants |
---

View file

@ -261,7 +261,7 @@ Relevant files:
- [`src/app/op-log/sync-providers/credential-store.service.ts`](../../src/app/op-log/sync-providers/credential-store.service.ts)
- [`src/app/op-log/core/types/sync.types.ts`](../../src/app/op-log/core/types/sync.types.ts)
- [`src/app/op-log/sync-providers/super-sync/super-sync.model.ts`](../../src/app/op-log/sync-providers/super-sync/super-sync.model.ts)
- [`packages/sync-providers/src/super-sync/super-sync.model.ts`](../../packages/sync-providers/src/super-sync/super-sync.model.ts)
- [`src/app/op-log/sync-providers/file-based/webdav/webdav.model.ts`](../../src/app/op-log/sync-providers/file-based/webdav/webdav.model.ts)
- [`src/app/op-log/sync-providers/file-based/dropbox/dropbox.ts`](../../src/app/op-log/sync-providers/file-based/dropbox/dropbox.ts)

View file

@ -13,8 +13,8 @@
> lint/grep, manifest and public-export audit, a package-boundary architecture
> note, and package build/test verification. PR 7 optional polish is present:
> PKCE is package-owned, the deprecated provider alias is retired, duplicate
> package-boundary lint patterns are trimmed, and WebDAV XML parser subtree
> scans are reduced.**
> package-boundary lint patterns are trimmed, WebDAV XML parser subtree scans
> are reduced, and tiered `@sp/sync-providers/*` exports are present.**
**Goal:** Carve the sync engine out of `src/app/op-log/` into a reusable,
framework-agnostic, **domain-agnostic** `@sp/sync-core` package, plus a sibling
@ -201,9 +201,10 @@ Current extraction state and remaining immediate debt:
- Provider-neutral contracts now live in `@sp/sync-providers`: generic
string-ID provider contracts, operation-sync response types, file provider
response types, a credential-store port, and the local file-adapter port. The
app-side `provider.interface.ts` and local `file-adapter.interface.ts` remain
compatibility shims that specialize those contracts with `SyncProviderId` and
`PrivateCfgByProviderId`.
app-side `provider.interface.ts` remains as the SP-narrowed compatibility
shim that specializes those contracts with `SyncProviderId` and
`PrivateCfgByProviderId`; the unused local `file-adapter.interface.ts` shim
was removed after app adapters switched to `@sp/sync-providers/file-based`.
- File-based sync envelope contracts now live in `@sp/sync-providers` with
generic host-owned state, compact-operation, and archive payload parameters.
The app-side `file-based-sync.types.ts` shim binds those generics to
@ -1319,10 +1320,11 @@ consensus, then tightened by follow-up commits from review findings:
deferred to polish so the Jasmine -> Vitest conversion stays easy to
review.
- **Bundle size.** Package build after the SuperSync slice is roughly
CJS 99.56 KB / ESM 96.76 KB / DTS 47.18 KB. The single barrel is
still acceptable; tiered exports (`@sp/sync-providers/dropbox`,
`/webdav`, `/super-sync`, …) remain deferred to post-provider-lift
polish.
CJS 99.56 KB / ESM 96.76 KB / DTS 47.18 KB. Tiered exports are now present
for provider and helper surfaces (`@sp/sync-providers/dropbox`, `/webdav`,
`/super-sync`, `/local-file`, `/http`, `/errors`, `/file-based`, `/pkce`,
`/platform`, `/provider-types`, and `/credential-store`) while the root
barrel stays available for compatibility.
### Current Eighth Slice
@ -1473,6 +1475,10 @@ retire deprecated aliases after consumers have migrated.
scans instead of repeated `getElementsByTagNameNS()` subtree walks. A package
spec covers mixed-prefix parsing and direct WebDAV child precedence over
nested extension fields.
- Tiered `@sp/sync-providers/*` package exports were added, and frontend app
imports now use focused subpaths instead of the root provider barrel. The
unused app-side SuperSync model and LocalFile file-adapter re-export shims
were removed.
### Verification

View file

@ -101,18 +101,21 @@ Package consumers should import from package barrels only:
```ts
import { compareVectorClocks } from '@sp/sync-core';
import { Dropbox, PROVIDER_ID_DROPBOX } from '@sp/sync-providers';
import { Dropbox, PROVIDER_ID_DROPBOX } from '@sp/sync-providers/dropbox';
```
Do not import from package internals such as `@sp/sync-core/src/*`,
`@sp/sync-providers/src/*`, or `dist/*`. If a host needs a symbol, promote it to
the package barrel deliberately and check that it is not app-owned.
The `@sp/sync-providers` barrel intentionally exports provider classes and
provider-owned string constants, but not app enums such as `SyncProviderId`.
Internal helpers such as WebDAV API/adapter classes stay unexported unless a
second host needs them. Tiered provider exports can be added later if bundle
size or consumer ergonomics justify the extra manifest surface.
The root `@sp/sync-providers` barrel remains available for compatibility, but
new host code should prefer focused subpath barrels such as
`@sp/sync-providers/dropbox`, `/webdav`, `/super-sync`, `/local-file`, `/http`,
`/errors`, `/file-based`, `/pkce`, `/platform`, `/provider-types`, and
`/credential-store`. Provider classes and provider-owned string constants are
exported there, but app enums such as `SyncProviderId` are not. Internal helpers
such as WebDAV API/adapter classes stay unexported unless a second host needs
them.
`@sp/sync-core` still exports deprecated full-state op compatibility defaults
and host-defined `OpType.SyncImport` / `BackupImport` / `Repair` strings for

View file

@ -16,6 +16,116 @@
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./dropbox": {
"import": {
"types": "./dist/dropbox.d.mts",
"default": "./dist/dropbox.mjs"
},
"require": {
"types": "./dist/dropbox.d.ts",
"default": "./dist/dropbox.js"
}
},
"./webdav": {
"import": {
"types": "./dist/webdav.d.mts",
"default": "./dist/webdav.mjs"
},
"require": {
"types": "./dist/webdav.d.ts",
"default": "./dist/webdav.js"
}
},
"./local-file": {
"import": {
"types": "./dist/local-file.d.mts",
"default": "./dist/local-file.mjs"
},
"require": {
"types": "./dist/local-file.d.ts",
"default": "./dist/local-file.js"
}
},
"./super-sync": {
"import": {
"types": "./dist/super-sync.d.mts",
"default": "./dist/super-sync.mjs"
},
"require": {
"types": "./dist/super-sync.d.ts",
"default": "./dist/super-sync.js"
}
},
"./http": {
"import": {
"types": "./dist/http.d.mts",
"default": "./dist/http.mjs"
},
"require": {
"types": "./dist/http.d.ts",
"default": "./dist/http.js"
}
},
"./errors": {
"import": {
"types": "./dist/errors.d.mts",
"default": "./dist/errors.mjs"
},
"require": {
"types": "./dist/errors.d.ts",
"default": "./dist/errors.js"
}
},
"./credential-store": {
"import": {
"types": "./dist/credential-store.d.mts",
"default": "./dist/credential-store.mjs"
},
"require": {
"types": "./dist/credential-store.d.ts",
"default": "./dist/credential-store.js"
}
},
"./file-based": {
"import": {
"types": "./dist/file-based.d.mts",
"default": "./dist/file-based.mjs"
},
"require": {
"types": "./dist/file-based.d.ts",
"default": "./dist/file-based.js"
}
},
"./pkce": {
"import": {
"types": "./dist/pkce.d.mts",
"default": "./dist/pkce.mjs"
},
"require": {
"types": "./dist/pkce.d.ts",
"default": "./dist/pkce.js"
}
},
"./platform": {
"import": {
"types": "./dist/platform.d.mts",
"default": "./dist/platform.mjs"
},
"require": {
"types": "./dist/platform.d.ts",
"default": "./dist/platform.js"
}
},
"./provider-types": {
"import": {
"types": "./dist/provider-types.d.mts",
"default": "./dist/provider-types.mjs"
},
"require": {
"types": "./dist/provider-types.d.ts",
"default": "./dist/provider-types.js"
}
}
},
"dependencies": {

View file

@ -0,0 +1,4 @@
export type {
CredentialChangeHandler,
SyncCredentialStorePort,
} from './credential-store-port';

View file

@ -0,0 +1,8 @@
export {
Dropbox,
PROVIDER_ID_DROPBOX,
type DropboxCfg,
type DropboxDeps,
type DropboxPrivateCfg,
} from './file-based/dropbox/dropbox';
export type { DropboxFileMetadata } from './file-based/dropbox/dropbox.model';

View file

@ -0,0 +1,18 @@
export {
AdditionalLogErrorBase,
AuthFailSPError,
EmptyRemoteBodySPError,
extractErrorMessage,
FileHashCreationAPIError,
HttpNotOkAPIError,
InvalidDataSPError,
MissingCredentialsSPError,
MissingRefreshTokenAPIError,
NetworkUnavailableSPError,
NoRevAPIError,
PotentialCorsError,
RemoteFileChangedUnexpectedly,
RemoteFileNotFoundAPIError,
TooManyRequestsAPIError,
UploadRevToMatchMismatchAPIError,
} from './errors/index';

View file

@ -0,0 +1,3 @@
export { FILE_BASED_SYNC_CONSTANTS } from './file-based-sync-data';
export type { FileBasedSyncData, SyncFileCompactOp } from './file-based-sync-data';
export type { FileAdapter } from './file-adapter';

View file

@ -0,0 +1,11 @@
export {
executeNativeRequestWithRetry,
isTransientNetworkError,
} from './http/native-http-retry';
export type {
ExecuteNativeRequestOptions,
NativeHttpExecutor,
NativeHttpRequestConfig,
NativeHttpResponse,
} from './http/native-http-retry';
export { isRetryableUploadError } from './http/retryable-upload-error';

View file

@ -0,0 +1,16 @@
export {
LocalFileSyncBase,
type LocalFileSyncBaseDeps,
} from './file-based/local-file/local-file-sync-base';
export {
LocalFileSyncElectron,
type LocalFileSyncElectronDeps,
} from './file-based/local-file/local-file-sync-electron';
export {
LocalFileSyncAndroid,
type LocalFileSyncAndroidDeps,
} from './file-based/local-file/local-file-sync-android';
export {
PROVIDER_ID_LOCAL_FILE,
type LocalFileSyncPrivateCfg,
} from './file-based/local-file/local-file.model';

View file

@ -0,0 +1,2 @@
export type { ProviderPlatformInfo } from './platform/provider-platform-info';
export type { WebFetchFactory } from './platform/web-fetch-factory';

View file

@ -0,0 +1,25 @@
export {
isFileSyncProvider,
type FileDownloadResponse,
type FileRevResponse,
type FileSnapshotOpDownloadResponse,
type FileSyncProvider,
type OpDownloadResponse,
type OpDownloadResponseBase,
type OpDownloadResponseForMode,
type OperationSyncCapable,
type OperationSyncProviderMode,
type OpUploadResponse,
type OpUploadResult,
type ProviderId,
type RestoreCapable,
type RestorePoint,
type RestorePointsResponse,
type RestoreSnapshotResponse,
type ServerSyncOperation,
type SnapshotUploadResponse,
type SuperSyncOpDownloadResponse,
type SyncOperation,
type SyncProviderAuthHelper,
type SyncProviderBase,
} from './provider.types';

View file

@ -0,0 +1,8 @@
export {
PROVIDER_ID_SUPER_SYNC,
SUPER_SYNC_DEFAULT_BASE_URL,
type SuperSyncPrivateCfg,
} from './super-sync/super-sync.model';
export { SuperSyncProvider, type SuperSyncDeps } from './super-sync/super-sync';
export type { SuperSyncResponseValidators } from './super-sync/response-validators';
export type { SuperSyncStorage } from './super-sync/storage';

View file

@ -0,0 +1,15 @@
export {
PROVIDER_ID_NEXTCLOUD,
PROVIDER_ID_WEBDAV,
WebdavBaseProvider,
type WebdavBaseDeps,
type WebdavProviderId,
} from './file-based/webdav/webdav-base-provider';
export { Webdav, type WebdavDeps } from './file-based/webdav/webdav';
export { NextcloudProvider, type NextcloudDeps } from './file-based/webdav/nextcloud';
export type { WebdavPrivateCfg } from './file-based/webdav/webdav.model';
export type { NextcloudPrivateCfg } from './file-based/webdav/nextcloud.model';
export {
testWebdavConnection,
type TestWebdavConnectionDeps,
} from './file-based/webdav/test-connection';

View file

@ -1,7 +1,20 @@
import { defineConfig } from 'tsup';
export default defineConfig({
entry: ['src/index.ts'],
entry: [
'src/index.ts',
'src/dropbox.ts',
'src/webdav.ts',
'src/local-file.ts',
'src/super-sync.ts',
'src/http.ts',
'src/errors.ts',
'src/credential-store.ts',
'src/file-based.ts',
'src/pkce.ts',
'src/platform.ts',
'src/provider-types.ts',
],
format: ['esm', 'cjs'],
dts: true,
sourcemap: true,

View file

@ -1,7 +1,7 @@
import { BehaviorSubject } from 'rxjs';
import { SyncProviderId } from '../../../op-log/sync-providers/provider.const';
import { CurrentProviderPrivateCfg } from '../../../op-log/core/types/sync.types';
import { SuperSyncPrivateCfg } from '../../../op-log/sync-providers/super-sync/super-sync.model';
import type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
/**
* Tests for AndroidSyncBridgeEffects credential mirroring logic.

View file

@ -8,7 +8,7 @@ import { SyncProviderId } from '../../../op-log/sync-providers/provider.const';
import {
SUPER_SYNC_DEFAULT_BASE_URL,
SuperSyncPrivateCfg,
} from '../../../op-log/sync-providers/super-sync/super-sync.model';
} from '@sp/sync-providers/super-sync';
import { skipWhileApplyingRemoteOps } from '../../../util/skip-during-sync.operator';
import { DroidLog } from '../../../core/log';
import { CurrentProviderPrivateCfg } from '../../../op-log/core/types/sync.types';

View file

@ -19,7 +19,7 @@ export interface SyncCollapsibleProps extends FormlyFieldProps {
syncRole?: 'advanced';
}
import { IS_NATIVE_PLATFORM } from '../../../util/is-native-platform';
import { SUPER_SYNC_DEFAULT_BASE_URL } from '../../../op-log/sync-providers/super-sync/super-sync.model';
import { SUPER_SYNC_DEFAULT_BASE_URL } from '@sp/sync-providers/super-sync';
import {
closeAllDialogs,
openDisableEncryptionDialogForFileBased,

View file

@ -45,7 +45,7 @@ import {
NextcloudProvider,
type NextcloudPrivateCfg,
type WebdavPrivateCfg,
} from '@sp/sync-providers';
} from '@sp/sync-providers/webdav';
import { testWebdavConnection } from '../../../op-log/sync-providers/file-based/webdav/test-webdav-connection';
@Component({

View file

@ -2,7 +2,7 @@ import { inject, Injectable } from '@angular/core';
import { SyncProviderManager } from '../../op-log/sync-providers/provider-manager.service';
import { isOperationSyncCapable } from '../../op-log/sync/operation-sync.util';
import { SyncProviderId } from '../../op-log/sync-providers/provider.const';
import { SuperSyncPrivateCfg } from '../../op-log/sync-providers/super-sync/super-sync.model';
import type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
import { SyncLog } from '../../core/log';
import { clearSessionKeyCache } from '../../op-log/encryption/encryption';
import { CleanSlateService } from '../../op-log/clean-slate/clean-slate.service';

View file

@ -7,7 +7,7 @@ import {
OperationSyncCapable,
SyncProviderBase,
} from '../../op-log/sync-providers/provider.interface';
import { SuperSyncPrivateCfg } from '../../op-log/sync-providers/super-sync/super-sync.model';
import type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
import { AppDataComplete } from '../../op-log/model/model-config';
describe('ImportEncryptionHandlerService', () => {

View file

@ -1,7 +1,7 @@
import { inject, Injectable } from '@angular/core';
import { SyncProviderManager } from '../../op-log/sync-providers/provider-manager.service';
import { SyncProviderId } from '../../op-log/sync-providers/provider.const';
import { SuperSyncPrivateCfg } from '../../op-log/sync-providers/super-sync/super-sync.model';
import type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
import { SyncLog } from '../../core/log';
import { AppDataComplete } from '../../op-log/model/model-config';
import { SnapshotUploadService } from './snapshot-upload.service';

View file

@ -10,7 +10,7 @@ import {
SyncProviderBase,
} from '../../op-log/sync-providers/provider.interface';
import { OperationEncryptionService } from '../../op-log/sync/operation-encryption.service';
import { SuperSyncPrivateCfg } from '../../op-log/sync-providers/super-sync/super-sync.model';
import type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
describe('SnapshotUploadService', () => {
let service: SnapshotUploadService;

View file

@ -11,7 +11,7 @@ import {
} from '../../op-log/util/client-id.provider';
import { isOperationSyncCapable } from '../../op-log/sync/operation-sync.util';
import { SyncProviderId } from '../../op-log/sync-providers/provider.const';
import { SuperSyncPrivateCfg } from '../../op-log/sync-providers/super-sync/super-sync.model';
import type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
import { CURRENT_SCHEMA_VERSION } from '../../op-log/persistence/schema-migration.service';
import { SyncLog } from '../../core/log';
import { uuidv7 } from '../../util/uuid-v7';

View file

@ -1,7 +1,7 @@
import { inject, Injectable } from '@angular/core';
import { SnackService } from '../../core/snack/snack.service';
import { SyncProviderId } from '../../op-log/sync-providers/provider.const';
import { SuperSyncProvider } from '../../op-log/sync-providers/super-sync/super-sync';
import { SuperSyncProvider } from '@sp/sync-providers/super-sync';
import {
RestoreCapable,
RestorePoint,

View file

@ -7,7 +7,7 @@ import {
OperationSyncCapable,
SyncProviderBase,
} from '../../op-log/sync-providers/provider.interface';
import { SuperSyncPrivateCfg } from '../../op-log/sync-providers/super-sync/super-sync.model';
import type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
describe('SuperSyncEncryptionToggleService', () => {
let service: SuperSyncEncryptionToggleService;

View file

@ -1,5 +1,5 @@
import { inject, Injectable } from '@angular/core';
import { SuperSyncPrivateCfg } from '../../op-log/sync-providers/super-sync/super-sync.model';
import type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
import { SyncLog } from '../../core/log';
import { SnapshotUploadService } from './snapshot-upload.service';
import { SyncProviderManager } from '../../op-log/sync-providers/provider-manager.service';

View file

@ -12,7 +12,7 @@ import {
import { DEFAULT_GLOBAL_CONFIG } from '../../features/config/default-global-config.const';
import { SyncLog } from '../../core/log';
import { clearSessionKeyCache } from '../../op-log/encryption/encryption';
import { SuperSyncPrivateCfg } from '../../op-log/sync-providers/super-sync/super-sync.model';
import type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
import { SyncWrapperService } from './sync-wrapper.service';
// Maps sync providers to their corresponding form field in SyncConfig

View file

@ -76,7 +76,7 @@ import { OperationLogStoreService } from '../../op-log/persistence/operation-log
import { OperationLogSyncService } from '../../op-log/sync/operation-log-sync.service';
import { SyncSessionValidationService } from '../../op-log/sync/sync-session-validation.service';
import { WrappedProviderService } from '../../op-log/sync-providers/wrapped-provider.service';
import { SuperSyncProvider } from '../../op-log/sync-providers/super-sync/super-sync';
import { SuperSyncProvider } from '@sp/sync-providers/super-sync';
import { HydrationStateService } from '../../op-log/apply/hydration-state.service';
/**

View file

@ -13,7 +13,7 @@ import {
RemoteFileNotFoundAPIError as PackageRemoteFileNotFoundAPIError,
TooManyRequestsAPIError as PackageTooManyRequestsAPIError,
UploadRevToMatchMismatchAPIError as PackageUploadRevToMatchMismatchAPIError,
} from '@sp/sync-providers';
} from '@sp/sync-providers/errors';
import {
AuthFailSPError,
EmptyRemoteBodySPError,

View file

@ -4,7 +4,7 @@ import { toSyncLogError } from '@sp/sync-core';
import {
AdditionalLogErrorBase as PackageAdditionalLogErrorBase,
extractErrorMessage as packageExtractErrorMessage,
} from '@sp/sync-providers';
} from '@sp/sync-providers/errors';
import { FILE_BASED_SYNC_CONSTANTS } from '../../sync-providers/file-based/file-based-sync.types';
import { OP_LOG_SYNC_LOGGER } from '../sync-logger.adapter';
@ -27,7 +27,7 @@ export {
RemoteFileNotFoundAPIError,
TooManyRequestsAPIError,
UploadRevToMatchMismatchAPIError,
} from '@sp/sync-providers';
} from '@sp/sync-providers/errors';
export const extractErrorMessage = packageExtractErrorMessage;

View file

@ -77,15 +77,10 @@ export interface SyncProviderPrivateCfgBase {
// Provider-Specific Config Type Mapping
// ============================================================================
// Forward declarations for provider-specific types
// These are imported from their respective modules where used
import type { DropboxPrivateCfg } from '../../sync-providers/file-based/dropbox/dropbox';
import type {
LocalFileSyncPrivateCfg as PackageLocalFileSyncPrivateCfg,
NextcloudPrivateCfg,
WebdavPrivateCfg,
} from '@sp/sync-providers';
import type { SuperSyncPrivateCfg } from '../../sync-providers/super-sync/super-sync.model';
import type { DropboxPrivateCfg } from '@sp/sync-providers/dropbox';
import type { LocalFileSyncPrivateCfg as PackageLocalFileSyncPrivateCfg } from '@sp/sync-providers/local-file';
import type { NextcloudPrivateCfg, WebdavPrivateCfg } from '@sp/sync-providers/webdav';
import type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
export type LocalFileSyncPrivateCfg = PackageLocalFileSyncPrivateCfg;

View file

@ -60,7 +60,7 @@ export {
} from './sync-providers/provider.interface';
// Provider types
export type { DropboxPrivateCfg } from './sync-providers/file-based/dropbox/dropbox';
export type { DropboxPrivateCfg } from '@sp/sync-providers/dropbox';
// VectorClock from core
export { VectorClock } from '../core/util/vector-clock';

View file

@ -2,7 +2,7 @@ import { DBSchema, IDBPDatabase, openDB } from 'idb';
import type {
CredentialChangeHandler,
SyncCredentialStorePort,
} from '@sp/sync-providers';
} from '@sp/sync-providers/credential-store';
import { SyncProviderId, PRIVATE_CFG_PREFIX } from './provider.const';
import { PrivateCfgByProviderId } from '../core/types/sync.types';
import { SyncLog } from '../../core/log';

View file

@ -4,8 +4,8 @@ import {
PROVIDER_ID_DROPBOX,
type DropboxCfg,
type DropboxDeps,
type NativeHttpResponse,
} from '@sp/sync-providers';
} from '@sp/sync-providers/dropbox';
import { type NativeHttpResponse } from '@sp/sync-providers/http';
import { SyncProviderId } from '../../provider.const';
import { SyncCredentialStore } from '../../credential-store.service';
import { OP_LOG_SYNC_LOGGER } from '../../../core/sync-logger.adapter';
@ -22,7 +22,7 @@ type AssertDropboxId = SyncProviderId.Dropbox extends typeof PROVIDER_ID_DROPBOX
const _idCheck: AssertDropboxId = true;
void _idCheck;
export type { DropboxCfg, DropboxPrivateCfg } from '@sp/sync-providers';
export type { DropboxCfg, DropboxPrivateCfg } from '@sp/sync-providers/dropbox';
/**
* App-side factory wiring concrete adapters into the package's Dropbox

View file

@ -2,7 +2,7 @@ import {
FILE_BASED_SYNC_CONSTANTS,
type FileBasedSyncData as GenericFileBasedSyncData,
type SyncFileCompactOp as GenericSyncFileCompactOp,
} from '@sp/sync-providers';
} from '@sp/sync-providers/file-based';
import type { CompactOperation } from '../../../core/persistence/operation-log/compact/compact-operation.types';
import type { ArchiveModel } from '../../../features/time-tracking/time-tracking.model';

View file

@ -1,4 +1,4 @@
import { FileAdapter } from '../file-adapter.interface';
import type { FileAdapter } from '@sp/sync-providers/file-based';
import { SafService } from './saf.service';
import { SyncLog } from '../../../../../core/log';

View file

@ -1,4 +1,4 @@
import { FileAdapter } from './file-adapter.interface';
import type { FileAdapter } from '@sp/sync-providers/file-based';
import { ElectronAPI } from '../../../../../../electron/electronAPI';
export class ElectronFileAdapter implements FileAdapter {

View file

@ -1 +0,0 @@
export type { FileAdapter } from '@sp/sync-providers';

View file

@ -1,7 +1,7 @@
import {
LocalFileSyncAndroid as PackageLocalFileSyncAndroid,
type LocalFileSyncAndroidDeps,
} from '@sp/sync-providers';
} from '@sp/sync-providers/local-file';
import { OP_LOG_SYNC_LOGGER } from '../../../core/sync-logger.adapter';
import { SyncCredentialStore } from '../../credential-store.service';
import { SyncProviderId } from '../../provider.const';

View file

@ -1,7 +1,7 @@
import {
LocalFileSyncElectron as PackageLocalFileSyncElectron,
type LocalFileSyncElectronDeps,
} from '@sp/sync-providers';
} from '@sp/sync-providers/local-file';
import { IS_ELECTRON } from '../../../../app.constants';
import type { ElectronAPI } from '../../../../../../electron/electronAPI';
import { OP_LOG_SYNC_LOGGER } from '../../../core/sync-logger.adapter';

View file

@ -1,4 +1,4 @@
import type { NativeHttpExecutor } from '@sp/sync-providers';
import type { NativeHttpExecutor } from '@sp/sync-providers/http';
import { WebDavHttp } from './index';
/**

View file

@ -2,7 +2,7 @@ import {
NextcloudProvider as PackageNextcloudProvider,
PROVIDER_ID_NEXTCLOUD,
type NextcloudDeps,
} from '@sp/sync-providers';
} from '@sp/sync-providers/webdav';
import { SyncProviderId } from '../../provider.const';
import { SyncCredentialStore } from '../../credential-store.service';
import { OP_LOG_SYNC_LOGGER } from '../../../core/sync-logger.adapter';
@ -18,8 +18,8 @@ type AssertNextcloudId = SyncProviderId.Nextcloud extends typeof PROVIDER_ID_NEX
const _idCheck: AssertNextcloudId = true;
void _idCheck;
export type { NextcloudPrivateCfg } from '@sp/sync-providers';
export { NextcloudProvider } from '@sp/sync-providers';
export type { NextcloudPrivateCfg } from '@sp/sync-providers/webdav';
export { NextcloudProvider } from '@sp/sync-providers/webdav';
/**
* App-side factory wiring concrete adapters into the package's Nextcloud

View file

@ -1,7 +1,7 @@
import {
testWebdavConnection as packageTestWebdavConnection,
type WebdavPrivateCfg,
} from '@sp/sync-providers';
} from '@sp/sync-providers/webdav';
import { OP_LOG_SYNC_LOGGER } from '../../../core/sync-logger.adapter';
import { APP_PROVIDER_PLATFORM_INFO } from '../../platform/app-provider-platform-info';
import { APP_WEB_FETCH } from '../../platform/app-web-fetch';

View file

@ -2,7 +2,7 @@ import {
PROVIDER_ID_WEBDAV,
Webdav as PackageWebdav,
type WebdavDeps,
} from '@sp/sync-providers';
} from '@sp/sync-providers/webdav';
import { SyncProviderId } from '../../provider.const';
import { SyncCredentialStore } from '../../credential-store.service';
import { OP_LOG_SYNC_LOGGER } from '../../../core/sync-logger.adapter';
@ -18,7 +18,7 @@ type AssertWebdavId = SyncProviderId.WebDAV extends typeof PROVIDER_ID_WEBDAV
const _idCheck: AssertWebdavId = true;
void _idCheck;
export type { WebdavPrivateCfg } from '@sp/sync-providers';
export type { WebdavPrivateCfg } from '@sp/sync-providers/webdav';
/**
* App-side factory wiring concrete adapters into the package's WebDAV

View file

@ -5,7 +5,7 @@ import {
type NativeHttpExecutor,
type NativeHttpRequestConfig,
type NativeHttpResponse,
} from '@sp/sync-providers';
} from '@sp/sync-providers/http';
import { OP_LOG_SYNC_LOGGER } from '../core/sync-logger.adapter';
export type NativeRequestConfig = NativeHttpRequestConfig;

View file

@ -1,4 +1,4 @@
import type { ProviderPlatformInfo } from '@sp/sync-providers';
import type { ProviderPlatformInfo } from '@sp/sync-providers/platform';
import { IS_IOS_NATIVE, IS_NATIVE_PLATFORM } from '../../../util/is-native-platform';
import { IS_ANDROID_WEB_VIEW } from '../../../util/is-android-web-view';

View file

@ -1,4 +1,4 @@
import type { WebFetchFactory } from '@sp/sync-providers';
import type { WebFetchFactory } from '@sp/sync-providers/platform';
/**
* Factory shape (rather than a stored reference) so the lookup happens

View file

@ -21,7 +21,7 @@ import {
type SyncOperation as GenericSyncOperation,
type SyncProviderAuthHelper as GenericSyncProviderAuthHelper,
type SyncProviderBase as GenericSyncProviderBase,
} from '@sp/sync-providers';
} from '@sp/sync-providers/provider-types';
import type { SyncProviderId } from './provider.const';
import type { PrivateCfgByProviderId } from '../core/types/sync.types';

View file

@ -1,4 +0,0 @@
export {
SUPER_SYNC_DEFAULT_BASE_URL,
type SuperSyncPrivateCfg,
} from '@sp/sync-providers';

View file

@ -2,9 +2,9 @@ import { CapacitorHttp } from '@capacitor/core';
import {
PROVIDER_ID_SUPER_SYNC,
SuperSyncProvider as PackageSuperSyncProvider,
type NativeHttpResponse,
type SuperSyncDeps,
} from '@sp/sync-providers';
} from '@sp/sync-providers/super-sync';
import type { NativeHttpResponse } from '@sp/sync-providers/http';
import { OP_LOG_SYNC_LOGGER } from '../../core/sync-logger.adapter';
import { SyncCredentialStore } from '../credential-store.service';
import { APP_PROVIDER_PLATFORM_INFO } from '../platform/app-provider-platform-info';
@ -27,9 +27,7 @@ type AssertSuperSyncId = SyncProviderId.SuperSync extends typeof PROVIDER_ID_SUP
const _idCheck: AssertSuperSyncId = true;
void _idCheck;
export type { SuperSyncPrivateCfg } from '@sp/sync-providers';
export { SUPER_SYNC_DEFAULT_BASE_URL, SuperSyncProvider } from '@sp/sync-providers';
export type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
/**
* App-side factory wiring concrete adapters into the package's SuperSync
* provider. Returns the package class directly no shim subclass.

View file

@ -28,7 +28,7 @@ import {
UploadResult,
UploadOptions,
} from '../core/types/sync-results.types';
import { isRetryableUploadError } from '@sp/sync-providers';
import { isRetryableUploadError } from '@sp/sync-providers/http';
import { handleStorageQuotaError } from './sync-error-utils';
import { DecryptNoPasswordError } from '../core/errors/sync-errors';

View file

@ -19,7 +19,7 @@ import {
SyncOperation,
} from '../../sync-providers/provider.interface';
import { SyncProviderId } from '../../sync-providers/provider.const';
import { SuperSyncPrivateCfg } from '../../sync-providers/super-sync/super-sync.model';
import type { SuperSyncPrivateCfg } from '@sp/sync-providers/super-sync';
import { provideMockStore } from '@ngrx/store/testing';
import {
ActionType,

View file

@ -2,7 +2,7 @@ import { Injectable, inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { firstValueFrom, Subject } from 'rxjs';
import { OAuthFlowConfig, OAuthTokenResult } from '@super-productivity/plugin-api';
import { generateCodeChallenge, generateCodeVerifier } from '@sp/sync-providers';
import { generateCodeChallenge, generateCodeVerifier } from '@sp/sync-providers/pkce';
import { PluginOAuthTokens } from './plugin-oauth.model';
import { IS_ELECTRON } from '../../app.constants';
import { IS_NATIVE_PLATFORM, IS_ANDROID_NATIVE } from '../../util/is-native-platform';

View file

@ -8,7 +8,8 @@
"@super-productivity/plugin-api": ["packages/plugin-api/src/index.ts"],
"@sp/shared-schema": ["packages/shared-schema/src/index.ts"],
"@sp/sync-core": ["packages/sync-core/src/index.ts"],
"@sp/sync-providers": ["packages/sync-providers/src/index.ts"]
"@sp/sync-providers": ["packages/sync-providers/src/index.ts"],
"@sp/sync-providers/*": ["packages/sync-providers/src/*"]
}
},
"files": ["test.ts", "polyfills.ts"],

View file

@ -27,7 +27,8 @@
"@super-productivity/plugin-api": ["packages/plugin-api/src/index.ts"],
"@sp/shared-schema": ["packages/shared-schema/src/index.ts"],
"@sp/sync-core": ["packages/sync-core/src/index.ts"],
"@sp/sync-providers": ["packages/sync-providers/src/index.ts"]
"@sp/sync-providers": ["packages/sync-providers/src/index.ts"],
"@sp/sync-providers/*": ["packages/sync-providers/src/*"]
},
"plugins": [
{