@zero-transfer/core 0.4.2 → 0.4.6
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 +5 -2
- package/dist/index.cjs +15 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.mjs +14 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
npm install @zero-transfer/core
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
This is the shared foundation used by every other `@zero-transfer/*` package. You usually do **not** install it directly - pick a protocol package (e.g. [`@zero-transfer/ftp`](https://www.npmjs.com/package/@zero-transfer/ftp)) or the umbrella [`@zero-transfer/sdk`](https://www.npmjs.com/package/@zero-transfer/sdk), and core comes along automatically.
|
|
12
|
+
|
|
11
13
|
## Overview
|
|
12
14
|
|
|
13
15
|
The provider-neutral foundation: `TransferClient`, `createTransferClient`, the provider registry, capability sets, transfer engine, queue, planning primitives, profile resolution, secret redaction, structured logging, and typed errors. Every other scoped package builds on this surface.
|
|
@@ -20,7 +22,7 @@ import { createLocalProviderFactory } from "@zero-transfer/core";
|
|
|
20
22
|
|
|
21
23
|
## Public surface
|
|
22
24
|
|
|
23
|
-
This package publishes a narrowed surface of **
|
|
25
|
+
This package publishes a narrowed surface of **93** exports. These symbols are also available from [`@zero-transfer/sdk`](https://www.npmjs.com/package/@zero-transfer/sdk); the table below links into the full API reference:
|
|
24
26
|
|
|
25
27
|
| Symbol | Kind | Notes |
|
|
26
28
|
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------ |
|
|
@@ -30,7 +32,7 @@ This package publishes a narrowed surface of **92** exports. These symbols are a
|
|
|
30
32
|
| [`ProviderRegistry`](https://github.com/tonywied17/zero-transfer/blob/main/docs/api-md/classes/ProviderRegistry.md) | Class | See API reference. |
|
|
31
33
|
| [`TransferSession`](https://github.com/tonywied17/zero-transfer/blob/main/docs/api-md/interfaces/TransferSession.md) | Interface | See API reference. |
|
|
32
34
|
| [`TransferProvider`](https://github.com/tonywied17/zero-transfer/blob/main/docs/api-md/interfaces/TransferProvider.md) | Interface | See API reference. |
|
|
33
|
-
| `ProviderCapabilities` | _unresolved_ |
|
|
35
|
+
| `ProviderCapabilities` | _unresolved_ | - |
|
|
34
36
|
| [`ProviderFactory`](https://github.com/tonywied17/zero-transfer/blob/main/docs/api-md/interfaces/ProviderFactory.md) | Interface | See API reference. |
|
|
35
37
|
| [`ProviderTransferOperations`](https://github.com/tonywied17/zero-transfer/blob/main/docs/api-md/interfaces/ProviderTransferOperations.md) | Interface | See API reference. |
|
|
36
38
|
| [`RemoteFileSystem`](https://github.com/tonywied17/zero-transfer/blob/main/docs/api-md/interfaces/RemoteFileSystem.md) | Interface | See API reference. |
|
|
@@ -116,6 +118,7 @@ This package publishes a narrowed surface of **92** exports. These symbols are a
|
|
|
116
118
|
| [`ZeroTransferLogger`](https://github.com/tonywied17/zero-transfer/blob/main/docs/api-md/interfaces/ZeroTransferLogger.md) | Interface | See API reference. |
|
|
117
119
|
| [`noopLogger`](https://github.com/tonywied17/zero-transfer/blob/main/docs/api-md/variables/noopLogger.md) | Variable | See API reference. |
|
|
118
120
|
| [`emitLog`](https://github.com/tonywied17/zero-transfer/blob/main/docs/api-md/functions/emitLog.md) | Function | See API reference. |
|
|
121
|
+
| [`isMainModule`](https://github.com/tonywied17/zero-transfer/blob/main/docs/api-md/functions/isMainModule.md) | Function | See API reference. |
|
|
119
122
|
|
|
120
123
|
## Examples
|
|
121
124
|
|
package/dist/index.cjs
CHANGED
|
@@ -82,6 +82,7 @@ __export(core_exports, {
|
|
|
82
82
|
importOpenSshConfig: () => importOpenSshConfig,
|
|
83
83
|
importWinScpSessions: () => importWinScpSessions,
|
|
84
84
|
isClassicProviderId: () => isClassicProviderId,
|
|
85
|
+
isMainModule: () => isMainModule,
|
|
85
86
|
isSensitiveKey: () => isSensitiveKey,
|
|
86
87
|
joinRemotePath: () => joinRemotePath,
|
|
87
88
|
matchKnownHosts: () => matchKnownHosts,
|
|
@@ -4889,6 +4890,19 @@ function isModifiedAtDifferent2(source, destination, toleranceMs) {
|
|
|
4889
4890
|
if (Number.isNaN(sourceTime) || Number.isNaN(destinationTime)) return false;
|
|
4890
4891
|
return Math.abs(sourceTime - destinationTime) > toleranceMs;
|
|
4891
4892
|
}
|
|
4893
|
+
|
|
4894
|
+
// src/utils/mainModule.ts
|
|
4895
|
+
var import_node_url = require("url");
|
|
4896
|
+
function isMainModule(importMetaUrl) {
|
|
4897
|
+
if (typeof process === "undefined" || !process.argv || process.argv.length < 2) {
|
|
4898
|
+
return false;
|
|
4899
|
+
}
|
|
4900
|
+
try {
|
|
4901
|
+
return process.argv[1] === (0, import_node_url.fileURLToPath)(importMetaUrl);
|
|
4902
|
+
} catch {
|
|
4903
|
+
return false;
|
|
4904
|
+
}
|
|
4905
|
+
}
|
|
4892
4906
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4893
4907
|
0 && (module.exports = {
|
|
4894
4908
|
AbortError,
|
|
@@ -4943,6 +4957,7 @@ function isModifiedAtDifferent2(source, destination, toleranceMs) {
|
|
|
4943
4957
|
importOpenSshConfig,
|
|
4944
4958
|
importWinScpSessions,
|
|
4945
4959
|
isClassicProviderId,
|
|
4960
|
+
isMainModule,
|
|
4946
4961
|
isSensitiveKey,
|
|
4947
4962
|
joinRemotePath,
|
|
4948
4963
|
matchKnownHosts,
|