@wireapp/core 39.3.0 → 39.3.2
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/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.d.ts +6 -0
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.d.ts.map +1 -1
- package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.js +25 -1
- package/package.json +3 -3
|
@@ -43,6 +43,12 @@ export declare class CoreCryptoWrapper implements CryptoClient {
|
|
|
43
43
|
debugBreakSession(sessionId: string): Promise<void>;
|
|
44
44
|
debugResetIdentity(): Promise<void>;
|
|
45
45
|
migrateFromCryptobox(dbName: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Will call the callback once corecrypto is ready.
|
|
48
|
+
* @param callback - Function to be called once corecrypto is ready.
|
|
49
|
+
* @see https://github.com/wireapp/wire-web-packages/pull/4972
|
|
50
|
+
*/
|
|
51
|
+
private onReady;
|
|
46
52
|
wipe(): Promise<void>;
|
|
47
53
|
}
|
|
48
54
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreCryptoWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAIpD,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAKtD,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAEnD,KAAK,MAAM,GAAG;IACZ,YAAY,CAAC,EAA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IAUnC,kBAAkB;IAIlB,oBAAoB,CAAC,MAAM,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"CoreCryptoWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAIpD,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAKtD,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAEnD,KAAK,MAAM,GAAG;IACZ,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,KAAK,YAAY,GAAG,MAAM,GAAG;IAC3B,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B,CAAC;AAEF,wBAAsB,WAAW,CAC/B,WAAW,EAAE,UAAU,EACvB,sBAAsB,EAAE,MAAM,EAC9B,EAAC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAC,EAAE,MAAM,GAC9C,OAAO,CAAC,iBAAiB,CAAC,CA4B5B;AAED,qBAAa,iBAAkB,YAAW,YAAY;IAGxC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAAc,OAAO,CAAC,QAAQ,CAAC,MAAM;IAF5E,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;gBAEjB,UAAU,EAAE,UAAU,EAAmB,MAAM,EAAE,YAAY;IAI1F,eAAe;IAIf,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU;IAIjD,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;IAI9C,IAAI,CAAC,gBAAgB,CAAC,EAAE,MAAM;IAOxB,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU;;;;;;;IAqBpD,cAAc;IAId,oBAAoB,CAAC,SAAS,EAAE,MAAM;IAIhC,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;IAK/D,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;IAIvD,aAAa,CAAC,SAAS,EAAE,MAAM;IAI/B,WAAW,CAAC,SAAS,EAAE,MAAM;IAI7B,aAAa,CAAC,SAAS,EAAE,MAAM;IAI/B,aAAa;IAIP,SAAS;;;;IAKT,iBAAiB,CAAC,SAAS,EAAE,MAAM;IAUnC,kBAAkB;IAIlB,oBAAoB,CAAC,MAAM,EAAE,MAAM;IAIzC;;;;OAIG;IACH,OAAO,CAAC,OAAO;IAsBT,IAAI;CAIX"}
|
|
@@ -138,9 +138,33 @@ class CoreCryptoWrapper {
|
|
|
138
138
|
async migrateFromCryptobox(dbName) {
|
|
139
139
|
return this.coreCrypto.proteusCryptoboxMigrate(dbName);
|
|
140
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Will call the callback once corecrypto is ready.
|
|
143
|
+
* @param callback - Function to be called once corecrypto is ready.
|
|
144
|
+
* @see https://github.com/wireapp/wire-web-packages/pull/4972
|
|
145
|
+
*/
|
|
146
|
+
onReady(callback) {
|
|
147
|
+
const isCoreCryptoReady = () => {
|
|
148
|
+
const strongRefCount = this.coreCrypto.strongRefCount();
|
|
149
|
+
const isCoreCryptoReady = strongRefCount <= 1;
|
|
150
|
+
return isCoreCryptoReady;
|
|
151
|
+
};
|
|
152
|
+
if (isCoreCryptoReady()) {
|
|
153
|
+
return callback();
|
|
154
|
+
}
|
|
155
|
+
return new Promise(resolve => {
|
|
156
|
+
const intervalId = setInterval(async () => {
|
|
157
|
+
if (isCoreCryptoReady()) {
|
|
158
|
+
clearInterval(intervalId);
|
|
159
|
+
await callback();
|
|
160
|
+
return resolve();
|
|
161
|
+
}
|
|
162
|
+
}, 100);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
141
165
|
async wipe() {
|
|
142
166
|
await this.config.onWipe();
|
|
143
|
-
|
|
167
|
+
await this.onReady(() => this.coreCrypto.wipe());
|
|
144
168
|
}
|
|
145
169
|
}
|
|
146
170
|
exports.CoreCryptoWrapper = CoreCryptoWrapper;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@wireapp/api-client": "^23.
|
|
14
|
+
"@wireapp/api-client": "^23.3.0",
|
|
15
15
|
"@wireapp/commons": "^5.0.4",
|
|
16
16
|
"@wireapp/core-crypto": "0.7.0-rc.3",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
"test:coverage": "jest --coverage",
|
|
61
61
|
"watch": "tsc --watch"
|
|
62
62
|
},
|
|
63
|
-
"version": "39.3.
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"version": "39.3.2",
|
|
64
|
+
"gitHead": "077806f5acc5486c949a6186e743bd940abeff67"
|
|
65
65
|
}
|