@storacha/encrypt-upload-client 1.0.0-0 → 1.0.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.js"],"names":[],"mappings":";AAwBA;;;GAAsC;uBAvBf,cAAc"}
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.js"],"names":[],"mappings":";AAwCA;;;GAAsC;uBAxCf,cAAc"}
@@ -1,9 +1,17 @@
1
- import dotenv from 'dotenv';
2
1
  import { Schema } from '@ucanto/core';
3
2
  import { LIT_NETWORK } from '@lit-protocol/constants';
4
- // Only load env variables if running in node
5
- if (typeof window === 'undefined') {
6
- dotenv.config();
3
+ // Only conditionally load dotenv in Node.js environments to prevent browser bundling issues
4
+ if (typeof window === 'undefined' &&
5
+ typeof process !== 'undefined' &&
6
+ process.versions) {
7
+ try {
8
+ // Use eval to prevent webpack from bundling dotenv in browser builds
9
+ const dotenv = eval('require')('dotenv');
10
+ dotenv.config();
11
+ }
12
+ catch (error) {
13
+ // dotenv not available or we're in a browser-like environment, continue with defaults
14
+ }
7
15
  }
8
16
  const envSchema = Schema.struct({
9
17
  LIT_NETWORK: Schema.enum([
@@ -14,9 +22,14 @@ const envSchema = Schema.struct({
14
22
  ]).default(LIT_NETWORK.DatilTest),
15
23
  LIT_DEBUG: Schema.boolean().default(false),
16
24
  });
25
+ // Safe environment variable access
17
26
  const processEnv = {
18
- LIT_DEBUG: process.env.LIT_DEBUG,
19
- LIT_NETWORK: process.env.LIT_NETWORK,
27
+ LIT_DEBUG: typeof process !== 'undefined' && process.env
28
+ ? process.env.LIT_DEBUG
29
+ : undefined,
30
+ LIT_NETWORK: typeof process !== 'undefined' && process.env
31
+ ? process.env.LIT_NETWORK
32
+ : undefined,
20
33
  };
21
34
  const env = envSchema.from(processEnv);
22
35
  export default env;
@@ -7,14 +7,5 @@
7
7
  * @param {string} keyManagerServiceDID
8
8
  */
9
9
  export function createGenericKMSAdapter(keyManagerServiceURL: URL | string, keyManagerServiceDID: string): KMSCryptoAdapter;
10
- /**
11
- * Create a Lit crypto adapter for browser environments
12
- * Uses the generic AES-CTR streaming crypto implementation
13
- * Works in browser and Node.js environments
14
- *
15
- * @param {import('@lit-protocol/lit-node-client').LitNodeClient} litClient
16
- */
17
- export function createGenericLitAdapter(litClient: import("@lit-protocol/lit-node-client").LitNodeClient): LitCryptoAdapter;
18
10
  import { KMSCryptoAdapter } from './adapters/kms-crypto-adapter.js';
19
- import { LitCryptoAdapter } from './adapters/lit-crypto-adapter.js';
20
11
  //# sourceMappingURL=factories.browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"factories.browser.d.ts","sourceRoot":"","sources":["../../src/crypto/factories.browser.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,8DAHW,GAAG,GAAC,MAAM,wBACV,MAAM,oBAYhB;AAED;;;;;;GAMG;AACH,mDAFW,OAAO,+BAA+B,EAAE,aAAa,oBAK/D;iCAhCgC,kCAAkC;iCADlC,kCAAkC"}
1
+ {"version":3,"file":"factories.browser.d.ts","sourceRoot":"","sources":["../../src/crypto/factories.browser.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,8DAHW,GAAG,GAAC,MAAM,wBACV,MAAM,oBAYhB;iCApBgC,kCAAkC"}
@@ -1,5 +1,4 @@
1
1
  import { GenericAesCtrStreamingCrypto } from './symmetric/generic-aes-ctr-streaming-crypto.js';
2
- import { LitCryptoAdapter } from './adapters/lit-crypto-adapter.js';
3
2
  import { KMSCryptoAdapter } from './adapters/kms-crypto-adapter.js';
4
3
  /**
5
4
  * Create a KMS crypto adapter for browser environments
@@ -14,15 +13,4 @@ export function createGenericKMSAdapter(keyManagerServiceURL, keyManagerServiceD
14
13
  return new KMSCryptoAdapter(symmetricCrypto, keyManagerServiceURL,
15
14
  /** @type {`did:${string}:${string}`} */ (keyManagerServiceDID));
16
15
  }
17
- /**
18
- * Create a Lit crypto adapter for browser environments
19
- * Uses the generic AES-CTR streaming crypto implementation
20
- * Works in browser and Node.js environments
21
- *
22
- * @param {import('@lit-protocol/lit-node-client').LitNodeClient} litClient
23
- */
24
- export function createGenericLitAdapter(litClient) {
25
- const symmetricCrypto = new GenericAesCtrStreamingCrypto();
26
- return new LitCryptoAdapter(symmetricCrypto, litClient);
27
- }
28
16
  //# sourceMappingURL=factories.browser.js.map
package/dist/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export { Wallet } from "ethers";
2
1
  export { create } from "./core/client.js";
3
2
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,3 +1,2 @@
1
- export { Wallet } from 'ethers';
2
1
  export { create } from './core/client.js';
3
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@storacha/encrypt-upload-client",
3
3
  "type": "module",
4
- "version": "1.0.0-0",
4
+ "version": "1.0.0",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "description": "Client for upload and download encrypted files",
7
7
  "author": "Storacha",