@morseai/sdk 0.1.0-beta.5 → 0.1.0-beta.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/LICENSE +22 -0
- package/README.md +5 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 MORSE Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
# MORSE SDK
|
|
2
2
|
|
|
3
|
+
[](https://badge.fury.io/js/%40morseai%2Fsdk)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
|
|
3
7
|
TypeScript SDK for creating and accessing encrypted signals in the MORSE platform.
|
|
4
8
|
|
|
5
|
-
**Version:** 0.1.0-beta.
|
|
9
|
+
**Version:** 0.1.0-beta.6 (Beta Release)
|
|
6
10
|
|
|
7
11
|
> ⚠️ **Beta Notice**: This is a beta release. The API is stable but may have minor changes before the 1.0.0 release. Please report any issues you encounter.
|
|
8
12
|
|
package/dist/index.d.mts
CHANGED
|
@@ -103,7 +103,7 @@ interface CreateSignalResponse {
|
|
|
103
103
|
expiresAt: string;
|
|
104
104
|
}
|
|
105
105
|
interface CreateSignalResponseEncrypted extends CreateSignalResponse {
|
|
106
|
-
keyBase64
|
|
106
|
+
keyBase64?: string;
|
|
107
107
|
shareableLink: string;
|
|
108
108
|
}
|
|
109
109
|
interface OpenSignalResponse {
|
|
@@ -378,7 +378,7 @@ declare function getSignalUrl(baseUrl: string, signalId: string, keyBase64?: str
|
|
|
378
378
|
declare function extractSignalIdFromUrl(url: string): string | null;
|
|
379
379
|
|
|
380
380
|
declare function getCipherVersion(): string;
|
|
381
|
-
declare function generateShareableLink(baseUrl: string, signalId: string, keyBase64
|
|
381
|
+
declare function generateShareableLink(baseUrl: string, signalId: string, keyBase64?: string): string;
|
|
382
382
|
|
|
383
383
|
/**
|
|
384
384
|
* MORSE SDK - X25519 + XChaCha20-Poly1305 Encryption
|
package/dist/index.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ interface CreateSignalResponse {
|
|
|
103
103
|
expiresAt: string;
|
|
104
104
|
}
|
|
105
105
|
interface CreateSignalResponseEncrypted extends CreateSignalResponse {
|
|
106
|
-
keyBase64
|
|
106
|
+
keyBase64?: string;
|
|
107
107
|
shareableLink: string;
|
|
108
108
|
}
|
|
109
109
|
interface OpenSignalResponse {
|
|
@@ -378,7 +378,7 @@ declare function getSignalUrl(baseUrl: string, signalId: string, keyBase64?: str
|
|
|
378
378
|
declare function extractSignalIdFromUrl(url: string): string | null;
|
|
379
379
|
|
|
380
380
|
declare function getCipherVersion(): string;
|
|
381
|
-
declare function generateShareableLink(baseUrl: string, signalId: string, keyBase64
|
|
381
|
+
declare function generateShareableLink(baseUrl: string, signalId: string, keyBase64?: string): string;
|
|
382
382
|
|
|
383
383
|
/**
|
|
384
384
|
* MORSE SDK - X25519 + XChaCha20-Poly1305 Encryption
|
package/dist/index.js
CHANGED
|
@@ -628,7 +628,7 @@ async function decryptFile(encryptedData, ivBase64, key) {
|
|
|
628
628
|
return decrypted;
|
|
629
629
|
}
|
|
630
630
|
function generateShareableLink(baseUrl, signalId, keyBase64) {
|
|
631
|
-
return `${baseUrl}/view/${signalId}
|
|
631
|
+
return `${baseUrl}/view/${signalId}`;
|
|
632
632
|
}
|
|
633
633
|
|
|
634
634
|
// src/implementations/v1/MorseSDKV1.ts
|
|
@@ -1249,7 +1249,7 @@ var MorseSDKV1 = class {
|
|
|
1249
1249
|
}
|
|
1250
1250
|
async createPrivateSignalEncrypted(wallet, options) {
|
|
1251
1251
|
const key = await generateKey();
|
|
1252
|
-
|
|
1252
|
+
await exportKey(key);
|
|
1253
1253
|
let encryptedText;
|
|
1254
1254
|
let payloadNonce;
|
|
1255
1255
|
let fileOptions;
|
|
@@ -1290,10 +1290,9 @@ var MorseSDKV1 = class {
|
|
|
1290
1290
|
expiresIn: options.expiresIn
|
|
1291
1291
|
};
|
|
1292
1292
|
const result = await this.createSignal(wallet, signalOptions);
|
|
1293
|
-
const shareableLink = generateShareableLink(FRONTEND_BASE_URL, result.signalId
|
|
1293
|
+
const shareableLink = generateShareableLink(FRONTEND_BASE_URL, result.signalId);
|
|
1294
1294
|
return {
|
|
1295
1295
|
...result,
|
|
1296
|
-
keyBase64,
|
|
1297
1296
|
shareableLink
|
|
1298
1297
|
};
|
|
1299
1298
|
}
|
|
@@ -1391,8 +1390,6 @@ var MorseSDKV1 = class {
|
|
|
1391
1390
|
const shareableLink = `${FRONTEND_BASE_URL}/view/${result.signalId}`;
|
|
1392
1391
|
return {
|
|
1393
1392
|
...result,
|
|
1394
|
-
keyBase64: "",
|
|
1395
|
-
// No key needed for X25519 signals
|
|
1396
1393
|
shareableLink
|
|
1397
1394
|
};
|
|
1398
1395
|
}
|