@storacha/encrypt-upload-client 1.0.0-0 → 1.0.1
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/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +19 -6
- package/dist/crypto/factories.browser.d.ts +0 -9
- package/dist/crypto/factories.browser.d.ts.map +1 -1
- package/dist/crypto/factories.browser.js +0 -12
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +3 -3
package/dist/config/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.js"],"names":[],"mappings":";AAwCA;;;GAAsC;uBAxCf,cAAc"}
|
package/dist/config/env.js
CHANGED
|
@@ -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
|
|
5
|
-
if (typeof window === 'undefined'
|
|
6
|
-
|
|
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
|
|
19
|
-
|
|
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":"
|
|
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
package/dist/index.js
CHANGED
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.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"description": "Client for upload and download encrypted files",
|
|
7
7
|
"author": "Storacha",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"ipfs-unixfs-exporter": "^10.0.0",
|
|
82
82
|
"multiformats": "^13.3.3",
|
|
83
83
|
"@storacha/capabilities": "^1.8.0",
|
|
84
|
-
"@storacha/client": "^1.
|
|
85
|
-
"@storacha/upload-client": "^1.
|
|
84
|
+
"@storacha/client": "^1.6.0",
|
|
85
|
+
"@storacha/upload-client": "^1.3.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@lit-protocol/types": "^7.0.8",
|