core-3nweb-client-lib 0.36.0 → 0.37.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.
- package/build/api-defs/asmail.d.ts +1 -1
- package/build/api-defs/common-caps.d.ts +2 -1
- package/build/core/asmail/index.d.ts +1 -0
- package/build/core/asmail/index.js +11 -0
- package/build/core/index.js +8 -3
- package/build/lib-client/cryptor/cryptor-wasm.js +1 -1
- package/build/lib-client/cryptor/cryptor.wasm +0 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright (C) 2017 - 2018, 2020 - 2022 3NSoft Inc.
|
|
2
|
+
Copyright (C) 2017 - 2018, 2020 - 2022, 2025 3NSoft Inc.
|
|
3
3
|
|
|
4
4
|
This program is free software: you can redistribute it and/or modify it under
|
|
5
5
|
the terms of the GNU General Public License as published by the Free Software
|
|
@@ -62,6 +62,7 @@ declare namespace web3n.caps.common {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
interface MailCAPSetting {
|
|
65
|
+
preflightsTo?: 'all' | { whitelist: string[]; };
|
|
65
66
|
sendingTo?: 'all' | { whitelist: string[]; };
|
|
66
67
|
receivingFrom?: 'all' | { whitelist: string[]; };
|
|
67
68
|
config?: 'all';
|
|
@@ -112,6 +112,17 @@ class ASMail {
|
|
|
112
112
|
return Object.freeze(w);
|
|
113
113
|
}
|
|
114
114
|
;
|
|
115
|
+
makePreflightOnlyASMailCAP() {
|
|
116
|
+
const { preFlight } = this.delivery.makeCAP();
|
|
117
|
+
const w = {
|
|
118
|
+
getUserId: async () => this.address,
|
|
119
|
+
delivery: {
|
|
120
|
+
preFlight
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return Object.freeze(w);
|
|
124
|
+
}
|
|
125
|
+
;
|
|
115
126
|
async close() {
|
|
116
127
|
await this.inbox.close();
|
|
117
128
|
await this.delivery.close();
|
package/build/core/index.js
CHANGED
|
@@ -150,11 +150,16 @@ class Core {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
makeMailCAP(requestedCAPs) {
|
|
153
|
-
if (requestedCAPs.mail
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
if (!requestedCAPs.mail) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const { sendingTo, receivingFrom, preflightsTo } = requestedCAPs.mail;
|
|
157
|
+
if ((receivingFrom === 'all') && (sendingTo === 'all')) {
|
|
156
158
|
return this.asmail.makeASMailCAP();
|
|
157
159
|
}
|
|
160
|
+
else if (preflightsTo === 'all') {
|
|
161
|
+
return this.asmail.makePreflightOnlyASMailCAP();
|
|
162
|
+
}
|
|
158
163
|
else {
|
|
159
164
|
return undefined;
|
|
160
165
|
}
|