@simplito/privmx-webendpoint 2.2.9 → 2.5.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/FinalizationHelper.d.ts +18 -0
- package/FinalizationHelper.js +49 -0
- package/Types.d.ts +178 -21
- package/Types.js +7 -0
- package/api/ApiStatic.d.ts +16 -0
- package/api/ApiStatic.js +26 -0
- package/api/ConnectionNative.d.ts +9 -3
- package/api/ConnectionNative.js +24 -0
- package/api/CryptoApiNative.d.ts +14 -0
- package/api/CryptoApiNative.js +30 -0
- package/api/EventApiNative.d.ts +20 -0
- package/api/EventApiNative.js +36 -0
- package/api/ExtKeyNative.d.ts +23 -0
- package/api/ExtKeyNative.js +66 -0
- package/api/KvdbApiNative.d.ts +33 -0
- package/api/KvdbApiNative.js +75 -0
- package/assets/driver-web-context.js +1 -1
- package/assets/endpoint-wasm-module.js +1 -1
- package/assets/endpoint-wasm-module.wasm +0 -0
- package/bundle/privmx-endpoint-web.js +1 -1
- package/extra/PrivmxClient.d.ts +139 -0
- package/extra/PrivmxClient.js +285 -0
- package/extra/PublicConnection.d.ts +70 -0
- package/extra/PublicConnection.js +118 -0
- package/extra/events.d.ts +2 -2
- package/extra/inbox.d.ts +3 -3
- package/extra/inbox.js +1 -1
- package/extra/index.d.ts +10 -8
- package/extra/index.js +6 -1
- package/index.d.ts +2 -2
- package/index.js +3 -1
- package/package.json +5 -1
- package/service/Connection.d.ts +29 -3
- package/service/Connection.js +31 -2
- package/service/CryptoApi.d.ts +48 -1
- package/service/CryptoApi.js +59 -1
- package/service/EndpointFactory.d.ts +24 -3
- package/service/EndpointFactory.js +56 -5
- package/service/EventApi.d.ts +40 -0
- package/service/EventApi.js +60 -0
- package/service/ExtKey.d.ts +103 -0
- package/service/ExtKey.js +167 -0
- package/service/InboxApi.d.ts +9 -9
- package/service/InboxApi.js +9 -9
- package/service/KvdbApi.d.ts +142 -0
- package/service/KvdbApi.js +208 -0
- package/service/StoreApi.d.ts +6 -6
- package/service/StoreApi.js +6 -6
- package/service/ThreadApi.d.ts +6 -6
- package/service/ThreadApi.js +6 -6
- package/service/UserVerifierInterface.d.ts +18 -0
- package/service/UserVerifierInterface.js +2 -0
- package/service/index.d.ts +3 -1
- package/service/index.js +5 -1
- package/assets/privmx-endpoint-web.js +0 -2
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtKeyNative = void 0;
|
|
4
|
+
const ApiStatic_1 = require("./ApiStatic");
|
|
5
|
+
const BaseNative_1 = require("./BaseNative");
|
|
6
|
+
class ExtKeyNative extends BaseNative_1.BaseNative {
|
|
7
|
+
async newApi() {
|
|
8
|
+
throw new Error("Use the specialized version of method instead.");
|
|
9
|
+
}
|
|
10
|
+
async deleteApi(ptr) {
|
|
11
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_deleteExtKey(taskId, ptr));
|
|
12
|
+
}
|
|
13
|
+
async deleteExtKey(ptr) {
|
|
14
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_deleteExtKey(taskId, ptr));
|
|
15
|
+
}
|
|
16
|
+
static async fromSeed(args) {
|
|
17
|
+
const api = ApiStatic_1.ApiStatic.getInstance();
|
|
18
|
+
return api.runAsync((taskId) => api.lib.ExtKey_fromSeed(taskId, args));
|
|
19
|
+
}
|
|
20
|
+
static async fromBase58(args) {
|
|
21
|
+
// base58: string
|
|
22
|
+
const api = ApiStatic_1.ApiStatic.getInstance();
|
|
23
|
+
return api.runAsync((taskId) => api.lib.ExtKey_fromBase58(taskId, args));
|
|
24
|
+
}
|
|
25
|
+
static async generateRandom(args) {
|
|
26
|
+
const api = ApiStatic_1.ApiStatic.getInstance();
|
|
27
|
+
return api.runAsync((taskId) => api.lib.ExtKey_generateRandom(taskId, args));
|
|
28
|
+
}
|
|
29
|
+
async derive(ptr, args) {
|
|
30
|
+
// index: number
|
|
31
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_derive(taskId, ptr, args));
|
|
32
|
+
}
|
|
33
|
+
async deriveHardened(ptr, args) {
|
|
34
|
+
// index: number
|
|
35
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_deriveHardened(taskId, ptr, args));
|
|
36
|
+
}
|
|
37
|
+
getPrivatePartAsBase58(ptr, args) {
|
|
38
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_getPrivatePartAsBase58(taskId, ptr, args));
|
|
39
|
+
}
|
|
40
|
+
getPublicPartAsBase58(ptr, args) {
|
|
41
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_getPublicPartAsBase58(taskId, ptr, args));
|
|
42
|
+
}
|
|
43
|
+
getPrivateKey(ptr, args) {
|
|
44
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_getPrivateKey(taskId, ptr, args));
|
|
45
|
+
}
|
|
46
|
+
getPublicKey(ptr, args) {
|
|
47
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_getPublicKey(taskId, ptr, args));
|
|
48
|
+
}
|
|
49
|
+
getPrivateEncKey(ptr, args) {
|
|
50
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_getPrivateEncKey(taskId, ptr, args));
|
|
51
|
+
}
|
|
52
|
+
getPublicKeyAsBase58Address(ptr, args) {
|
|
53
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_getPublicKeyAsBase58Address(taskId, ptr, args));
|
|
54
|
+
}
|
|
55
|
+
getChainCode(ptr, args) {
|
|
56
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_getChainCode(taskId, ptr, args));
|
|
57
|
+
}
|
|
58
|
+
verifyCompactSignatureWithHash(ptr, args) {
|
|
59
|
+
// message: Uint8Array, signature: Uint8Array
|
|
60
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_verifyCompactSignatureWithHash(taskId, ptr, args));
|
|
61
|
+
}
|
|
62
|
+
isPrivate(ptr, args) {
|
|
63
|
+
return this.runAsync((taskId) => this.api.lib.ExtKey_isPrivate(taskId, ptr, args));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.ExtKeyNative = ExtKeyNative;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
PrivMX Web Endpoint.
|
|
3
|
+
Copyright © 2024 Simplito sp. z o.o.
|
|
4
|
+
|
|
5
|
+
This file is part of the PrivMX Platform (https://privmx.dev).
|
|
6
|
+
This software is Licensed under the PrivMX Free License.
|
|
7
|
+
|
|
8
|
+
See the License for the specific language governing permissions and
|
|
9
|
+
limitations under the License.
|
|
10
|
+
*/
|
|
11
|
+
import { PagingQuery, PagingList, UserWithPubKey, Kvdb, KvdbEntry, ContainerPolicy, DeleteEntriesResult } from "../Types";
|
|
12
|
+
import { BaseNative } from "./BaseNative";
|
|
13
|
+
export declare class KvdbApiNative extends BaseNative {
|
|
14
|
+
newApi(connectionPtr: number): Promise<number>;
|
|
15
|
+
deleteApi(ptr: number): Promise<void>;
|
|
16
|
+
create(ptr: number, args: []): Promise<void>;
|
|
17
|
+
createKvdb(ptr: number, args: [string, UserWithPubKey[], UserWithPubKey[], Uint8Array, Uint8Array, ContainerPolicy | undefined]): Promise<string>;
|
|
18
|
+
updateKvdb(ptr: number, args: [string, UserWithPubKey[], UserWithPubKey[], Uint8Array, Uint8Array, number, boolean, boolean, ContainerPolicy | undefined]): Promise<void>;
|
|
19
|
+
deleteKvdb(ptr: number, args: [string]): Promise<void>;
|
|
20
|
+
getKvdb(ptr: number, args: [string]): Promise<Kvdb>;
|
|
21
|
+
listKvdbs(ptr: number, args: [string, PagingQuery]): Promise<PagingList<Kvdb>>;
|
|
22
|
+
hasEntry(ptr: number, args: [string, string]): Promise<boolean>;
|
|
23
|
+
getEntry(ptr: number, args: [string, string]): Promise<KvdbEntry>;
|
|
24
|
+
listEntriesKeys(ptr: number, args: [string, PagingQuery]): Promise<PagingList<string>>;
|
|
25
|
+
listEntries(ptr: number, args: [string, PagingQuery]): Promise<PagingList<KvdbEntry>>;
|
|
26
|
+
setEntry(ptr: number, args: [string, string, Uint8Array, Uint8Array, Uint8Array, number]): Promise<void>;
|
|
27
|
+
deleteEntry(ptr: number, args: [string, string]): Promise<void>;
|
|
28
|
+
deleteEntries(ptr: number, args: [string, string[]]): Promise<DeleteEntriesResult>;
|
|
29
|
+
subscribeForKvdbEvents(ptr: number, args: []): Promise<void>;
|
|
30
|
+
unsubscribeFromKvdbEvents(ptr: number, args: []): Promise<void>;
|
|
31
|
+
subscribeForEntryEvents(ptr: number, args: [string]): Promise<void>;
|
|
32
|
+
unsubscribeFromEntryEvents(ptr: number, args: [string]): Promise<void>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
PrivMX Web Endpoint.
|
|
4
|
+
Copyright © 2024 Simplito sp. z o.o.
|
|
5
|
+
|
|
6
|
+
This file is part of the PrivMX Platform (https://privmx.dev).
|
|
7
|
+
This software is Licensed under the PrivMX Free License.
|
|
8
|
+
|
|
9
|
+
See the License for the specific language governing permissions and
|
|
10
|
+
limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.KvdbApiNative = void 0;
|
|
14
|
+
const BaseNative_1 = require("./BaseNative");
|
|
15
|
+
class KvdbApiNative extends BaseNative_1.BaseNative {
|
|
16
|
+
async newApi(connectionPtr) {
|
|
17
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_newKvdbApi(taskId, connectionPtr));
|
|
18
|
+
}
|
|
19
|
+
async deleteApi(ptr) {
|
|
20
|
+
await this.runAsync((taskId) => this.api.lib.KvdbApi_deleteKvdbApi(taskId, ptr));
|
|
21
|
+
this.deleteApiRef();
|
|
22
|
+
}
|
|
23
|
+
async create(ptr, args) {
|
|
24
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_create(taskId, ptr, args));
|
|
25
|
+
}
|
|
26
|
+
async createKvdb(ptr, args) {
|
|
27
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_createKvdb(taskId, ptr, args));
|
|
28
|
+
}
|
|
29
|
+
async updateKvdb(ptr, args) {
|
|
30
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_updateKvdb(taskId, ptr, args));
|
|
31
|
+
}
|
|
32
|
+
async deleteKvdb(ptr, args) {
|
|
33
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_deleteKvdb(taskId, ptr, args));
|
|
34
|
+
}
|
|
35
|
+
async getKvdb(ptr, args) {
|
|
36
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_getKvdb(taskId, ptr, args));
|
|
37
|
+
}
|
|
38
|
+
async listKvdbs(ptr, args) {
|
|
39
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_listKvdbs(taskId, ptr, args));
|
|
40
|
+
}
|
|
41
|
+
async hasEntry(ptr, args) {
|
|
42
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_hasEntry(taskId, ptr, args));
|
|
43
|
+
}
|
|
44
|
+
async getEntry(ptr, args) {
|
|
45
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_getEntry(taskId, ptr, args));
|
|
46
|
+
}
|
|
47
|
+
async listEntriesKeys(ptr, args) {
|
|
48
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_listEntriesKeys(taskId, ptr, args));
|
|
49
|
+
}
|
|
50
|
+
async listEntries(ptr, args) {
|
|
51
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_listEntries(taskId, ptr, args));
|
|
52
|
+
}
|
|
53
|
+
async setEntry(ptr, args) {
|
|
54
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_setEntry(taskId, ptr, args));
|
|
55
|
+
}
|
|
56
|
+
async deleteEntry(ptr, args) {
|
|
57
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_deleteEntry(taskId, ptr, args));
|
|
58
|
+
}
|
|
59
|
+
async deleteEntries(ptr, args) {
|
|
60
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_deleteEntries(taskId, ptr, args));
|
|
61
|
+
}
|
|
62
|
+
async subscribeForKvdbEvents(ptr, args) {
|
|
63
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_subscribeForKvdbEvents(taskId, ptr, args));
|
|
64
|
+
}
|
|
65
|
+
async unsubscribeFromKvdbEvents(ptr, args) {
|
|
66
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_unsubscribeFromKvdbEvents(taskId, ptr, args));
|
|
67
|
+
}
|
|
68
|
+
async subscribeForEntryEvents(ptr, args) {
|
|
69
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_subscribeForEntryEvents(taskId, ptr, args));
|
|
70
|
+
}
|
|
71
|
+
async unsubscribeFromEntryEvents(ptr, args) {
|
|
72
|
+
return this.runAsync((taskId) => this.api.lib.KvdbApi_unsubscribeFromEntryEvents(taskId, ptr, args));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.KvdbApiNative = KvdbApiNative;
|