@wireapp/core 45.2.8 → 45.2.10

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.
@@ -1,4 +1,4 @@
1
- import { E2eiEnrollment, Ciphersuite, CoreCrypto, RotateBundle, WireIdentity, E2eiConversationState, CredentialType } from '@wireapp/core-crypto';
1
+ import { E2eiEnrollment, Ciphersuite, CoreCrypto, RotateBundle, WireIdentity, E2eiConversationState, DeviceStatus, CredentialType } from '@wireapp/core-crypto';
2
2
  /**
3
3
  * Proxy types relevant to the E2EIService from CoreCrypto
4
4
  */
@@ -8,7 +8,7 @@ export type AcmeDirectory = OmitFree<Awaited<ReturnType<E2eiEnrollment['director
8
8
  export type AcmeChallenge = OmitFree<NonNullable<NewAcmeAuthzOriginal['challenge']>>;
9
9
  export type NewAcmeOrder = OmitFree<Awaited<ReturnType<E2eiEnrollment['newOrderResponse']>>>;
10
10
  export type NewAcmeAuthz = Pick<Awaited<ReturnType<E2eiEnrollment['newAuthzResponse']>>, 'identifier' | 'keyauth' | 'challenge'>;
11
- export { E2eiEnrollment, Ciphersuite, CoreCrypto, RotateBundle, WireIdentity, E2eiConversationState, CredentialType };
11
+ export { E2eiEnrollment, Ciphersuite, CoreCrypto, RotateBundle, DeviceStatus, WireIdentity, E2eiConversationState, CredentialType, };
12
12
  export type User = {
13
13
  id: string;
14
14
  domain: string;
@@ -1 +1 @@
1
- {"version":3,"file":"E2EIService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,cAAc,EACd,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,KAAK,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACnC,KAAK,oBAAoB,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9F,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/F,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACrF,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7F,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,EACvD,YAAY,GAAG,SAAS,GAAG,WAAW,CACvC,CAAC;AACF,OAAO,EAAC,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAC,CAAC;AAEpH,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC;AACjC,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAC3B,MAAM,MAAM,OAAO,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"E2EIService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,cAAc,EACd,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,YAAY,EACZ,cA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perty(exports, "__esModule", { value: true });
21
- exports.CredentialType = exports.E2eiConversationState = exports.CoreCrypto = exports.Ciphersuite = exports.E2eiEnrollment = void 0;
21
+ exports.CredentialType = exports.E2eiConversationState = exports.DeviceStatus = exports.CoreCrypto = exports.Ciphersuite = exports.E2eiEnrollment = void 0;
22
22
  const core_crypto_1 = require("@wireapp/core-crypto");
23
23
  Object.defineProperty(exports, "E2eiEnrollment", { enumerable: true, get: function () { return core_crypto_1.E2eiEnrollment; } });
24
24
  Object.defineProperty(exports, "Ciphersuite", { enumerable: true, get: function () { return core_crypto_1.Ciphersuite; } });
25
25
  Object.defineProperty(exports, "CoreCrypto", { enumerable: true, get: function () { return core_crypto_1.CoreCrypto; } });
26
26
  Object.defineProperty(exports, "E2eiConversationState", { enumerable: true, get: function () { return core_crypto_1.E2eiConversationState; } });
27
+ Object.defineProperty(exports, "DeviceStatus", { enumerable: true, get: function () { return core_crypto_1.DeviceStatus; } });
27
28
  Object.defineProperty(exports, "CredentialType", { enumerable: true, get: function () { return core_crypto_1.CredentialType; } });
@@ -1 +1 @@
1
- {"version":3,"file":"E2EIServiceExternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAIzD,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAMnG,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAIrD,OAAO,EAAC,sBAAsB,EAAuB,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAC,sBAAsB,EAAC,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,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;;;OAKG;IACU,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5D,OAAO,KAAK,WAAW,GAKtB;YAEa,+BAA+B;IAK7C;;;;;;;;;;;;OAYG;YACW,0BAA0B;IA6BxC,OAAO,CAAC,4BAA4B;YAStB,+BAA+B;YAQ/B,uBAAuB;YAKvB,0BAA0B;YAI1B,4BAA4B;YAO5B,WAAW;YAkBX,8BAA8B;CAM7C"}
@@ -22,6 +22,7 @@ exports.E2EIServiceExternal = void 0;
22
22
  const TimeUtil_1 = require("@wireapp/commons/lib/util/TimeUtil");
23
23
  const bazinga64_1 = require("bazinga64");
24
24
  const commons_1 = require("@wireapp/commons");
25
+ const core_crypto_1 = require("@wireapp/core-crypto");
25
26
  const Connection_1 = require("./Connection");
26
27
  const Helper_1 = require("./Helper");
27
28
  const E2EIStorage_1 = require("./Storage/E2EIStorage");
@@ -29,6 +30,22 @@ const fullyQualifiedClientIdUtils_1 = require("../../../util/fullyQualifiedClien
29
30
  const LocalStorageStore_1 = require("../../../util/LocalStorageStore");
30
31
  const LowPrecisionTaskScheduler_1 = require("../../../util/LowPrecisionTaskScheduler");
31
32
  const qualifiedIdUtil_1 = require("../../../util/qualifiedIdUtil");
33
+ // TODO coreCrypto types are wrong here. They return a string (the key of the enum) instead of the enum value
34
+ function fixDeviceStatus(value) {
35
+ const fixedValue = core_crypto_1.DeviceStatus[value];
36
+ if (!fixedValue) {
37
+ throw new Error(`Invalid device status: ${value}`);
38
+ }
39
+ return fixedValue;
40
+ }
41
+ // TODO coreCrypto types are wrong here. They return a string (the key of the enum) instead of the enum value
42
+ function fixConversationState(value) {
43
+ const fixedValue = core_crypto_1.E2eiConversationState[value];
44
+ if (!fixedValue) {
45
+ throw new Error(`Invalid conversation status: ${value}`);
46
+ }
47
+ return fixedValue;
48
+ }
32
49
  // This export is meant to be accessible from the outside (e.g the Webapp / UI)
33
50
  class E2EIServiceExternal extends commons_1.TypedEventEmitter {
34
51
  constructor(coreCryptoClient, coreDatabase, recurringTaskScheduler, clientService, mlsService) {
@@ -49,8 +66,9 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
49
66
  clearAllProgress() {
50
67
  return this.enrollmentStorage.deletePendingEnrollmentData();
51
68
  }
52
- getConversationState(conversationId) {
53
- return this.coreCryptoClient.e2eiConversationState(conversationId);
69
+ async getConversationState(conversationId) {
70
+ const state = await this.coreCryptoClient.e2eiConversationState(conversationId);
71
+ return fixConversationState(state);
54
72
  }
55
73
  isE2EIEnabled() {
56
74
  return this.coreCryptoClient.e2eiIsEnabled(this.mlsService.config.cipherSuite);
@@ -84,7 +102,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
84
102
  .map(fullyQualifiedId => (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(fullyQualifiedId));
85
103
  const mappedUserIdentities = new Map();
86
104
  for (const userId of userIds) {
87
- const identities = (userIdentities.get(userId.id) || []).map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, qualifiedUserId: userId })));
105
+ const identities = (userIdentities.get(userId.id) || []).map(identity => (Object.assign(Object.assign({}, identity), { status: fixDeviceStatus(identity.status), deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, qualifiedUserId: userId })));
88
106
  const basicMLSDevices = allUsersMLSDevices
89
107
  .filter(({ user }) => user === userId.id)
90
108
  // filtering devices that have a valid identity
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "@wireapp/api-client": "^26.11.2",
15
15
  "@wireapp/commons": "^5.2.7",
16
- "@wireapp/core-crypto": "1.0.0-rc.49",
16
+ "@wireapp/core-crypto": "1.0.0-rc.51",
17
17
  "@wireapp/cryptobox": "12.8.0",
18
18
  "@wireapp/priority-queue": "^2.1.5",
19
19
  "@wireapp/promise-queue": "^2.3.2",
@@ -61,6 +61,6 @@
61
61
  "test:coverage": "jest --coverage",
62
62
  "watch": "tsc --watch"
63
63
  },
64
- "version": "45.2.8",
65
- "gitHead": "56f1b044d8083758f6ded1702ac290d507fad56e"
64
+ "version": "45.2.10",
65
+ "gitHead": "6d21bfbd0c46ae5f4ca7f44c421ef6dc680e34e5"
66
66
  }