@wireapp/core 42.11.0 → 42.12.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/lib/Account.d.ts +6 -2
- package/lib/Account.d.ts.map +1 -1
- package/lib/Account.js +31 -11
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts +125 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.js +157 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.types.d.ts +17 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.types.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.types.js +20 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/index.d.ts +2 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/index.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/index.js +35 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.d.ts +306 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.js +120 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/index.d.ts +2 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/index.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Connection/index.js +35 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts +43 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.js +25 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts +17 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.js +85 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts +24 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +263 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.d.ts +12 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.js +46 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.d.ts +12 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.js +32 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts +15 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.js +49 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Certificate.d.ts +14 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Certificate.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Certificate.js +33 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.d.ts +12 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.js +63 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.types.d.ts +20 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.types.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.types.js +20 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/index.d.ts +2 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/index.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/index.js +35 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.d.ts +28 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.js +34 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.d.ts +28 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.js +56 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.d.ts +28 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.js +120 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.d.ts +136 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.js +49 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/index.d.ts +4 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/index.d.ts.map +1 -0
- package/lib/messagingProtocols/mls/E2EIdentityService/index.js +37 -0
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +16 -4
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.js +60 -0
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts +4 -0
- package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/types.d.ts +1 -0
- package/lib/messagingProtocols/mls/types.d.ts.map +1 -1
- package/lib/util/LocalStorageStore/index.d.ts +7 -0
- package/lib/util/LocalStorageStore/index.d.ts.map +1 -0
- package/lib/util/LocalStorageStore/index.js +38 -0
- package/lib/util/TaskScheduler/TaskScheduler.store.d.ts +1 -1
- package/lib/util/TaskScheduler/TaskScheduler.store.d.ts.map +1 -1
- package/lib/util/TaskScheduler/TaskScheduler.store.js +3 -13
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -0
- package/package.json +5 -4
|
@@ -46,6 +46,7 @@ const messageSender_1 = require("../../../conversation/message/messageSender");
|
|
|
46
46
|
const fullyQualifiedClientIdUtils_1 = require("../../../util/fullyQualifiedClientIdUtils");
|
|
47
47
|
const numberToHex_1 = require("../../../util/numberToHex");
|
|
48
48
|
const TaskScheduler_1 = require("../../../util/TaskScheduler");
|
|
49
|
+
const E2EIdentityService_1 = require("../E2EIdentityService");
|
|
49
50
|
const events_1 = require("../EventHandler/events");
|
|
50
51
|
//@todo: this function is temporary, we wait for the update from core-crypto side
|
|
51
52
|
//they are returning regular array instead of Uint8Array for commit and welcome messages
|
|
@@ -667,5 +668,64 @@ class MLSService extends commons_1.TypedEventEmitter {
|
|
|
667
668
|
}
|
|
668
669
|
return (0, events_1.handleMLSWelcomeMessage)({ event, mlsService: this });
|
|
669
670
|
}
|
|
671
|
+
async deleteMLSKeyPackages(clientId, keyPackagRefs) {
|
|
672
|
+
return this.apiClient.api.client.deleteMLSKeyPackages(clientId, keyPackagRefs.map(keypackage => btoa(bazinga64_1.Converter.arrayBufferViewToBaselineString(keypackage))));
|
|
673
|
+
}
|
|
674
|
+
// E2E Identity Service related methods below this line
|
|
675
|
+
/**
|
|
676
|
+
*
|
|
677
|
+
* @param discoveryUrl URL of the acme server
|
|
678
|
+
* @param user User object
|
|
679
|
+
* @param clientId The client id of the current device
|
|
680
|
+
* @param nbPrekeys Amount of prekeys to generate
|
|
681
|
+
* @param oAuthIdToken The OAuth id token if the user is already authenticated
|
|
682
|
+
* @returns AcmeChallenge if the user is not authenticated, true if the user is authenticated
|
|
683
|
+
*/
|
|
684
|
+
async enrollE2EI(discoveryUrl, e2eiServiceExternal, user, clientId, nbPrekeys, oAuthIdToken) {
|
|
685
|
+
try {
|
|
686
|
+
const instance = await E2EIdentityService_1.E2EIServiceInternal.getInstance({
|
|
687
|
+
apiClient: this.apiClient,
|
|
688
|
+
coreCryptClient: this.coreCryptoClient,
|
|
689
|
+
e2eiServiceExternal,
|
|
690
|
+
user,
|
|
691
|
+
clientId,
|
|
692
|
+
discoveryUrl,
|
|
693
|
+
keyPackagesAmount: nbPrekeys,
|
|
694
|
+
});
|
|
695
|
+
if (!oAuthIdToken) {
|
|
696
|
+
const challengeData = await instance.startCertificateProcess();
|
|
697
|
+
if (challengeData) {
|
|
698
|
+
return challengeData;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
const rotateBundle = await instance.continueCertificateProcess(oAuthIdToken);
|
|
703
|
+
if (rotateBundle !== undefined) {
|
|
704
|
+
// Remove old key packages
|
|
705
|
+
await this.deleteMLSKeyPackages(clientId, rotateBundle.keyPackageRefsToRemove);
|
|
706
|
+
// Upload new key packages with x509 certificate
|
|
707
|
+
await this.uploadMLSKeyPackages(clientId, rotateBundle.newKeyPackages);
|
|
708
|
+
// Update keying material
|
|
709
|
+
for (const [groupId, commitBundle] of rotateBundle.commits) {
|
|
710
|
+
const groupIdAsBytes = bazinga64_1.Converter.hexStringToArrayBufferView(groupId);
|
|
711
|
+
// manual copy of the commit bundle data because of a problem while cloning it
|
|
712
|
+
const newCommitBundle = {
|
|
713
|
+
commit: commitBundle.commit,
|
|
714
|
+
// @ts-ignore
|
|
715
|
+
groupInfo: (commitBundle === null || commitBundle === void 0 ? void 0 : commitBundle.group_info) || commitBundle.groupInfo,
|
|
716
|
+
welcome: commitBundle === null || commitBundle === void 0 ? void 0 : commitBundle.welcome,
|
|
717
|
+
};
|
|
718
|
+
await this.uploadCommitBundle(groupIdAsBytes, newCommitBundle);
|
|
719
|
+
}
|
|
720
|
+
return true;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
return false;
|
|
724
|
+
}
|
|
725
|
+
catch (error) {
|
|
726
|
+
this.logger.error('E2EI - Failed to enroll', error);
|
|
727
|
+
throw error;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
670
730
|
}
|
|
671
731
|
exports.MLSService = MLSService;
|
|
@@ -26,5 +26,9 @@ export interface MLSServiceConfig {
|
|
|
26
26
|
* default credential type to use for MLS (Basic = 1 by default)
|
|
27
27
|
*/
|
|
28
28
|
defaultCredentialType: CredentialType;
|
|
29
|
+
/**
|
|
30
|
+
* signals if the E2E - Identity process should be used
|
|
31
|
+
*/
|
|
32
|
+
useE2EI?: boolean;
|
|
29
33
|
}
|
|
30
34
|
//# sourceMappingURL=MLSService.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MLSService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAC,WAAW,EAAE,YAAY,EAAE,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAEpF,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IAErD;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,6BAA6B,EAAE,MAAM,CAAC;IACtC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,EAAE,WAAW,CAAC;IAChC;;OAEG;IACH,qBAAqB,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"MLSService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAC,WAAW,EAAE,YAAY,EAAE,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAEpF,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IAErD;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,6BAA6B,EAAE,MAAM,CAAC;IACtC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,EAAE,WAAW,CAAC;IAChC;;OAEG;IACH,qBAAqB,EAAE,cAAc,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
2
2
|
import { CoreCryptoCallbacks } from '@wireapp/core-crypto';
|
|
3
3
|
import { MLSServiceConfig } from './MLSService/MLSService.types';
|
|
4
|
+
export type ClientId = string;
|
|
4
5
|
export type SecretCrypto = {
|
|
5
6
|
encrypt: (value: Uint8Array) => Promise<Uint8Array>;
|
|
6
7
|
decrypt: (payload: Uint8Array) => Promise<Uint8Array>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/messagingProtocols/mls/types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAA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CACtB,GAAG,SAAS,CAAC;AAEd,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAE9B,uEAAuE;IACvE,GAAG,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEhC,oKAAoK;IACpK,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,OAAO,EAAC,WAAW,EAAE,cAAc,EAAC,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/util/LocalStorageStore/index.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,iBAAiB,qBAAsB,MAAM;eAC7C,MAAM;eAUN,MAAM;kBACH,MAAM;eACT,MAAM;CACjB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2023 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.LocalStorageStore = void 0;
|
|
22
|
+
const prependKey = (key, pKey) => `${pKey}_${key}`;
|
|
23
|
+
const LocalStorageStore = (pKey) => ({
|
|
24
|
+
get: (key) => {
|
|
25
|
+
const value = localStorage.getItem(prependKey(key, pKey));
|
|
26
|
+
if (value) {
|
|
27
|
+
if (!Number.isNaN(Number(value))) {
|
|
28
|
+
return Number(value);
|
|
29
|
+
}
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
},
|
|
34
|
+
add: (key, value) => localStorage.setItem(prependKey(key, pKey), String(value)),
|
|
35
|
+
remove: (key) => localStorage.removeItem(prependKey(key, pKey)),
|
|
36
|
+
has: (key) => !!localStorage.getItem(prependKey(key, pKey)),
|
|
37
|
+
});
|
|
38
|
+
exports.LocalStorageStore = LocalStorageStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskScheduler.store.d.ts","sourceRoot":"","sources":["../../../src/util/TaskScheduler/TaskScheduler.store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TaskScheduler.store.d.ts","sourceRoot":"","sources":["../../../src/util/TaskScheduler/TaskScheduler.store.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,kBAAkB;;;;;CAAwC,CAAC"}
|
|
@@ -19,16 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.TaskSchedulerStore = void 0;
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const value = localStorage.getItem(prependKey(key));
|
|
26
|
-
if (value) {
|
|
27
|
-
return Number(value);
|
|
28
|
-
}
|
|
29
|
-
return undefined;
|
|
30
|
-
},
|
|
31
|
-
add: (key, firingDate) => localStorage.setItem(prependKey(key), String(firingDate)),
|
|
32
|
-
remove: (key) => localStorage.removeItem(prependKey(key)),
|
|
33
|
-
has: (key) => !!localStorage.getItem(prependKey(key)),
|
|
34
|
-
};
|
|
22
|
+
const LocalStorageStore_1 = require("../LocalStorageStore");
|
|
23
|
+
const prependKey = `TaskScheduler`;
|
|
24
|
+
exports.TaskSchedulerStore = (0, LocalStorageStore_1.LocalStorageStore)(prependKey);
|
package/lib/util/index.d.ts
CHANGED
package/lib/util/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAmBA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAmBA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
|
package/lib/util/index.js
CHANGED
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": "^26.
|
|
14
|
+
"@wireapp/api-client": "^26.3.0",
|
|
15
15
|
"@wireapp/commons": "^5.2.1",
|
|
16
16
|
"@wireapp/core-crypto": "1.0.0-rc.13",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"idb": "7.1.1",
|
|
28
28
|
"logdown": "3.3.1",
|
|
29
29
|
"long": "^5.2.0",
|
|
30
|
-
"uuidjs": "4.2.13"
|
|
30
|
+
"uuidjs": "4.2.13",
|
|
31
|
+
"zod": "3.21.4"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@faker-js/faker": "^8.0.0",
|
|
@@ -60,6 +61,6 @@
|
|
|
60
61
|
"test:coverage": "jest --coverage",
|
|
61
62
|
"watch": "tsc --watch"
|
|
62
63
|
},
|
|
63
|
-
"version": "42.
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"version": "42.12.0",
|
|
65
|
+
"gitHead": "03058b9323c4afec84e6c85c4614c3b599ebcb71"
|
|
65
66
|
}
|