@zero-transfer/http 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 CHANGED
@@ -8,6 +8,8 @@
8
8
  npm install @zero-transfer/http
9
9
  ```
10
10
 
11
+ Installing this package automatically pulls in [`@zero-transfer/core`](https://www.npmjs.com/package/@zero-transfer/core) as a transitive dependency. The full core surface (`createTransferClient`, `uploadFile`, `downloadFile`, profiles, errors, sync planner, …) is re-exported from this package, so a single `import { … } from "@zero-transfer/http"` is all you need. If your app uses multiple protocols, install the umbrella [`@zero-transfer/sdk`](https://www.npmjs.com/package/@zero-transfer/sdk) instead of multiple scoped packages.
12
+
11
13
  ## Overview
12
14
 
13
15
  Read-only HTTP(S) provider with HEAD-based metadata, ranged GET resume, Basic auth, Bearer-token auth via secret sources, and ETag exposed as both `uniqueId` and read-result `checksum`. Useful for signed-URL downloads and CDN ingest.
@@ -15,7 +17,12 @@ Read-only HTTP(S) provider with HEAD-based metadata, ranged GET resume, Basic au
15
17
  ## Usage
16
18
 
17
19
  ```ts
18
- import { createHttpProviderFactory } from "@zero-transfer/http";
20
+ import {
21
+ createTransferClient,
22
+ uploadFile,
23
+ downloadFile,
24
+ createHttpProviderFactory,
25
+ } from "@zero-transfer/http";
19
26
  ```
20
27
 
21
28
  ## Public surface
package/dist/index.cjs CHANGED
@@ -83,6 +83,7 @@ __export(http_exports, {
83
83
  importOpenSshConfig: () => importOpenSshConfig,
84
84
  importWinScpSessions: () => importWinScpSessions,
85
85
  isClassicProviderId: () => isClassicProviderId,
86
+ isMainModule: () => isMainModule,
86
87
  isSensitiveKey: () => isSensitiveKey,
87
88
  joinRemotePath: () => joinRemotePath,
88
89
  matchKnownHosts: () => matchKnownHosts,
@@ -4891,6 +4892,19 @@ function isModifiedAtDifferent2(source, destination, toleranceMs) {
4891
4892
  return Math.abs(sourceTime - destinationTime) > toleranceMs;
4892
4893
  }
4893
4894
 
4895
+ // src/utils/mainModule.ts
4896
+ var import_node_url = require("url");
4897
+ function isMainModule(importMetaUrl) {
4898
+ if (typeof process === "undefined" || !process.argv || process.argv.length < 2) {
4899
+ return false;
4900
+ }
4901
+ try {
4902
+ return process.argv[1] === (0, import_node_url.fileURLToPath)(importMetaUrl);
4903
+ } catch {
4904
+ return false;
4905
+ }
4906
+ }
4907
+
4894
4908
  // src/providers/web/HttpProvider.ts
4895
4909
  var import_node_buffer7 = require("buffer");
4896
4910
 
@@ -5283,6 +5297,7 @@ function responseToStat(response, normalizedPath) {
5283
5297
  importOpenSshConfig,
5284
5298
  importWinScpSessions,
5285
5299
  isClassicProviderId,
5300
+ isMainModule,
5286
5301
  isSensitiveKey,
5287
5302
  joinRemotePath,
5288
5303
  matchKnownHosts,