@wireapp/core 42.11.0 → 42.12.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.
Files changed (82) hide show
  1. package/lib/Account.d.ts +6 -2
  2. package/lib/Account.d.ts.map +1 -1
  3. package/lib/Account.js +32 -12
  4. package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
  5. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts +125 -0
  6. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.d.ts.map +1 -0
  7. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.js +157 -0
  8. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.types.d.ts +17 -0
  9. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.types.d.ts.map +1 -0
  10. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/AcmeService.types.js +20 -0
  11. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/index.d.ts +2 -0
  12. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/index.d.ts.map +1 -0
  13. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/index.js +35 -0
  14. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.d.ts +306 -0
  15. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.d.ts.map +1 -0
  16. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.js +117 -0
  17. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/index.d.ts +2 -0
  18. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/index.d.ts.map +1 -0
  19. package/lib/messagingProtocols/mls/E2EIdentityService/Connection/index.js +35 -0
  20. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts +43 -0
  21. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts.map +1 -0
  22. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.js +25 -0
  23. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts +17 -0
  24. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts.map +1 -0
  25. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.js +85 -0
  26. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts +24 -0
  27. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts.map +1 -0
  28. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +263 -0
  29. package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.d.ts +12 -0
  30. package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.d.ts.map +1 -0
  31. package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.js +46 -0
  32. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.d.ts +12 -0
  33. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.d.ts.map +1 -0
  34. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Account.js +32 -0
  35. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts +15 -0
  36. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.d.ts.map +1 -0
  37. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Authorization.js +49 -0
  38. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Certificate.d.ts +14 -0
  39. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Certificate.d.ts.map +1 -0
  40. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Certificate.js +33 -0
  41. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.d.ts +12 -0
  42. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.d.ts.map +1 -0
  43. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.js +63 -0
  44. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.types.d.ts +20 -0
  45. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.types.d.ts.map +1 -0
  46. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/DpopChallenge.types.js +20 -0
  47. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/index.d.ts +2 -0
  48. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/index.d.ts.map +1 -0
  49. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/DpopChallenge/index.js +35 -0
  50. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.d.ts +28 -0
  51. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.d.ts.map +1 -0
  52. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/OidcChallenge.js +34 -0
  53. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.d.ts +28 -0
  54. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.d.ts.map +1 -0
  55. package/lib/messagingProtocols/mls/E2EIdentityService/Steps/Order.js +56 -0
  56. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.d.ts +28 -0
  57. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.d.ts.map +1 -0
  58. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.js +120 -0
  59. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.d.ts +136 -0
  60. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.d.ts.map +1 -0
  61. package/lib/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.schema.js +49 -0
  62. package/lib/messagingProtocols/mls/E2EIdentityService/index.d.ts +4 -0
  63. package/lib/messagingProtocols/mls/E2EIdentityService/index.d.ts.map +1 -0
  64. package/lib/messagingProtocols/mls/E2EIdentityService/index.js +37 -0
  65. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +21 -6
  66. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
  67. package/lib/messagingProtocols/mls/MLSService/MLSService.js +81 -11
  68. package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +27 -10
  69. package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts +4 -0
  70. package/lib/messagingProtocols/mls/MLSService/MLSService.types.d.ts.map +1 -1
  71. package/lib/messagingProtocols/mls/types.d.ts +1 -0
  72. package/lib/messagingProtocols/mls/types.d.ts.map +1 -1
  73. package/lib/util/LocalStorageStore/index.d.ts +7 -0
  74. package/lib/util/LocalStorageStore/index.d.ts.map +1 -0
  75. package/lib/util/LocalStorageStore/index.js +38 -0
  76. package/lib/util/TaskScheduler/TaskScheduler.store.d.ts +1 -1
  77. package/lib/util/TaskScheduler/TaskScheduler.store.d.ts.map +1 -1
  78. package/lib/util/TaskScheduler/TaskScheduler.store.js +3 -13
  79. package/lib/util/index.d.ts +1 -0
  80. package/lib/util/index.d.ts.map +1 -1
  81. package/lib/util/index.js +1 -0
  82. package/package.json +5 -4
@@ -0,0 +1,306 @@
1
+ import { z } from 'zod';
2
+ export declare const ResponseHeaderNonceSchema: z.ZodObject<{
3
+ 'replay-nonce': z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ 'replay-nonce': string;
6
+ }, {
7
+ 'replay-nonce': string;
8
+ }>;
9
+ export type ResponseHeaderNonce = z.infer<typeof ResponseHeaderNonceSchema>;
10
+ export declare const ResponseHeaderLocationSchema: z.ZodObject<{
11
+ location: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ location: string;
14
+ }, {
15
+ location: string;
16
+ }>;
17
+ export type ResponseHeaderLocation = z.infer<typeof ResponseHeaderLocationSchema>;
18
+ export declare const DirectoryResponseSchema: z.ZodObject<{
19
+ newAccount: z.ZodString;
20
+ newNonce: z.ZodString;
21
+ newOrder: z.ZodString;
22
+ revokeCert: z.ZodString;
23
+ keyChange: z.ZodString;
24
+ }, "strip", z.ZodTypeAny, {
25
+ newAccount: string;
26
+ newNonce: string;
27
+ newOrder: string;
28
+ revokeCert: string;
29
+ keyChange: string;
30
+ }, {
31
+ newAccount: string;
32
+ newNonce: string;
33
+ newOrder: string;
34
+ revokeCert: string;
35
+ keyChange: string;
36
+ }>;
37
+ export type DirectoryResponseData = z.infer<typeof DirectoryResponseSchema>;
38
+ export declare const NewAccountResponseSchema: z.ZodObject<{
39
+ status: z.ZodString;
40
+ orders: z.ZodString;
41
+ contact: z.ZodArray<z.ZodString, "many">;
42
+ }, "strip", z.ZodTypeAny, {
43
+ status: string;
44
+ orders: string;
45
+ contact: string[];
46
+ }, {
47
+ status: string;
48
+ orders: string;
49
+ contact: string[];
50
+ }>;
51
+ export type NewAccountResponseData = z.infer<typeof NewAccountResponseSchema>;
52
+ export declare const NewOrderResponseSchema: z.ZodObject<{
53
+ status: z.ZodString;
54
+ expires: z.ZodString;
55
+ notBefore: z.ZodString;
56
+ notAfter: z.ZodString;
57
+ identifiers: z.ZodArray<z.ZodObject<{
58
+ type: z.ZodString;
59
+ value: z.ZodString;
60
+ }, "strip", z.ZodTypeAny, {
61
+ type: string;
62
+ value: string;
63
+ }, {
64
+ type: string;
65
+ value: string;
66
+ }>, "many">;
67
+ authorizations: z.ZodArray<z.ZodString, "many">;
68
+ finalize: z.ZodString;
69
+ }, "strip", z.ZodTypeAny, {
70
+ status: string;
71
+ expires: string;
72
+ authorizations: string[];
73
+ notBefore: string;
74
+ notAfter: string;
75
+ identifiers: {
76
+ type: string;
77
+ value: string;
78
+ }[];
79
+ finalize: string;
80
+ }, {
81
+ status: string;
82
+ expires: string;
83
+ authorizations: string[];
84
+ notBefore: string;
85
+ notAfter: string;
86
+ identifiers: {
87
+ type: string;
88
+ value: string;
89
+ }[];
90
+ finalize: string;
91
+ }>;
92
+ export type NewOrderResponseData = z.infer<typeof NewOrderResponseSchema>;
93
+ export declare const AuthorizationResponseSchema: z.ZodObject<{
94
+ status: z.ZodString;
95
+ expires: z.ZodString;
96
+ identifier: z.ZodObject<{
97
+ type: z.ZodString;
98
+ value: z.ZodString;
99
+ }, "strip", z.ZodTypeAny, {
100
+ type: string;
101
+ value: string;
102
+ }, {
103
+ type: string;
104
+ value: string;
105
+ }>;
106
+ challenges: z.ZodArray<z.ZodObject<{
107
+ type: z.ZodString;
108
+ url: z.ZodString;
109
+ status: z.ZodString;
110
+ token: z.ZodString;
111
+ target: z.ZodString;
112
+ }, "strip", z.ZodTypeAny, {
113
+ type: string;
114
+ url: string;
115
+ target: string;
116
+ status: string;
117
+ token: string;
118
+ }, {
119
+ type: string;
120
+ url: string;
121
+ target: string;
122
+ status: string;
123
+ token: string;
124
+ }>, "many">;
125
+ }, "strip", z.ZodTypeAny, {
126
+ status: string;
127
+ expires: string;
128
+ identifier: {
129
+ type: string;
130
+ value: string;
131
+ };
132
+ challenges: {
133
+ type: string;
134
+ url: string;
135
+ target: string;
136
+ status: string;
137
+ token: string;
138
+ }[];
139
+ }, {
140
+ status: string;
141
+ expires: string;
142
+ identifier: {
143
+ type: string;
144
+ value: string;
145
+ };
146
+ challenges: {
147
+ type: string;
148
+ url: string;
149
+ target: string;
150
+ status: string;
151
+ token: string;
152
+ }[];
153
+ }>;
154
+ export type AuthorizationResponseData = z.infer<typeof AuthorizationResponseSchema>;
155
+ export declare const DpopChallengeResponseSchema: z.ZodObject<{
156
+ type: z.ZodString;
157
+ url: z.ZodString;
158
+ status: z.ZodString;
159
+ token: z.ZodString;
160
+ }, "strip", z.ZodTypeAny, {
161
+ type: string;
162
+ url: string;
163
+ status: string;
164
+ token: string;
165
+ }, {
166
+ type: string;
167
+ url: string;
168
+ status: string;
169
+ token: string;
170
+ }>;
171
+ export type DpopChallengeResponseData = z.infer<typeof DpopChallengeResponseSchema>;
172
+ export declare const OidcChallengeResponseSchema: z.ZodObject<{
173
+ type: z.ZodString;
174
+ status: z.ZodString;
175
+ token: z.ZodString;
176
+ validated: z.ZodOptional<z.ZodString>;
177
+ url: z.ZodString;
178
+ target: z.ZodString;
179
+ error: z.ZodOptional<z.ZodObject<{
180
+ type: z.ZodString;
181
+ detail: z.ZodString;
182
+ }, "strip", z.ZodTypeAny, {
183
+ type: string;
184
+ detail: string;
185
+ }, {
186
+ type: string;
187
+ detail: string;
188
+ }>>;
189
+ }, "strip", z.ZodTypeAny, {
190
+ type: string;
191
+ url: string;
192
+ target: string;
193
+ status: string;
194
+ token: string;
195
+ validated?: string | undefined;
196
+ error?: {
197
+ type: string;
198
+ detail: string;
199
+ } | undefined;
200
+ }, {
201
+ type: string;
202
+ url: string;
203
+ target: string;
204
+ status: string;
205
+ token: string;
206
+ validated?: string | undefined;
207
+ error?: {
208
+ type: string;
209
+ detail: string;
210
+ } | undefined;
211
+ }>;
212
+ export type OidcChallengeResponseData = z.infer<typeof OidcChallengeResponseSchema>;
213
+ export declare const CheckStatusOfOrderResponseSchema: z.ZodObject<{
214
+ id: z.ZodString;
215
+ status: z.ZodString;
216
+ finalize: z.ZodString;
217
+ identifiers: z.ZodArray<z.ZodObject<{
218
+ type: z.ZodString;
219
+ value: z.ZodString;
220
+ }, "strip", z.ZodTypeAny, {
221
+ type: string;
222
+ value: string;
223
+ }, {
224
+ type: string;
225
+ value: string;
226
+ }>, "many">;
227
+ authorizations: z.ZodArray<z.ZodString, "many">;
228
+ expires: z.ZodString;
229
+ notBefore: z.ZodString;
230
+ notAfter: z.ZodString;
231
+ }, "strip", z.ZodTypeAny, {
232
+ id: string;
233
+ status: string;
234
+ expires: string;
235
+ authorizations: string[];
236
+ notBefore: string;
237
+ notAfter: string;
238
+ identifiers: {
239
+ type: string;
240
+ value: string;
241
+ }[];
242
+ finalize: string;
243
+ }, {
244
+ id: string;
245
+ status: string;
246
+ expires: string;
247
+ authorizations: string[];
248
+ notBefore: string;
249
+ notAfter: string;
250
+ identifiers: {
251
+ type: string;
252
+ value: string;
253
+ }[];
254
+ finalize: string;
255
+ }>;
256
+ export type CheckStatusOfOrderResponseData = z.infer<typeof CheckStatusOfOrderResponseSchema>;
257
+ export declare const FinalizeOrderResponseSchema: z.ZodObject<{
258
+ id: z.ZodString;
259
+ status: z.ZodString;
260
+ expires: z.ZodString;
261
+ identifiers: z.ZodArray<z.ZodObject<{
262
+ type: z.ZodString;
263
+ value: z.ZodString;
264
+ }, "strip", z.ZodTypeAny, {
265
+ type: string;
266
+ value: string;
267
+ }, {
268
+ type: string;
269
+ value: string;
270
+ }>, "many">;
271
+ notBefore: z.ZodString;
272
+ notAfter: z.ZodString;
273
+ authorizations: z.ZodArray<z.ZodString, "many">;
274
+ finalize: z.ZodString;
275
+ certificate: z.ZodString;
276
+ }, "strip", z.ZodTypeAny, {
277
+ id: string;
278
+ certificate: string;
279
+ status: string;
280
+ expires: string;
281
+ authorizations: string[];
282
+ notBefore: string;
283
+ notAfter: string;
284
+ identifiers: {
285
+ type: string;
286
+ value: string;
287
+ }[];
288
+ finalize: string;
289
+ }, {
290
+ id: string;
291
+ certificate: string;
292
+ status: string;
293
+ expires: string;
294
+ authorizations: string[];
295
+ notBefore: string;
296
+ notAfter: string;
297
+ identifiers: {
298
+ type: string;
299
+ value: string;
300
+ }[];
301
+ finalize: string;
302
+ }>;
303
+ export type FinalizeOrderResponseData = z.infer<typeof FinalizeOrderResponseSchema>;
304
+ export declare const GetCertificateResponseSchema: z.ZodString;
305
+ export type GetCertificateResponseData = z.infer<typeof GetCertificateResponseSchema>;
306
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/E2EIdentityService/Connection/AcmeServer/schema.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAKtB,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;EAMlC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE5E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAInC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE9E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAajC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE1E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBtC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEpF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;EAKtC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEpF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAatC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEpF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc3C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE9F,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAetC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEpF,eAAO,MAAM,4BAA4B,aAAoB,CAAC;AAC9D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,117 @@
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.GetCertificateResponseSchema = exports.FinalizeOrderResponseSchema = exports.CheckStatusOfOrderResponseSchema = exports.OidcChallengeResponseSchema = exports.DpopChallengeResponseSchema = exports.AuthorizationResponseSchema = exports.NewOrderResponseSchema = exports.NewAccountResponseSchema = exports.DirectoryResponseSchema = exports.ResponseHeaderLocationSchema = exports.ResponseHeaderNonceSchema = void 0;
22
+ const zod_1 = require("zod");
23
+ const nonOptionalString = zod_1.z.string().min(1);
24
+ const nonOptionalUrl = zod_1.z.string().url().min(1);
25
+ exports.ResponseHeaderNonceSchema = zod_1.z.object({
26
+ 'replay-nonce': nonOptionalString,
27
+ });
28
+ exports.ResponseHeaderLocationSchema = zod_1.z.object({
29
+ location: nonOptionalUrl,
30
+ });
31
+ exports.DirectoryResponseSchema = zod_1.z.object({
32
+ newAccount: nonOptionalUrl,
33
+ newNonce: nonOptionalUrl,
34
+ newOrder: nonOptionalUrl,
35
+ revokeCert: nonOptionalUrl,
36
+ keyChange: nonOptionalUrl,
37
+ });
38
+ exports.NewAccountResponseSchema = zod_1.z.object({
39
+ status: nonOptionalString,
40
+ orders: nonOptionalUrl,
41
+ contact: zod_1.z.array(zod_1.z.string().email().min(1)),
42
+ });
43
+ exports.NewOrderResponseSchema = zod_1.z.object({
44
+ status: nonOptionalString,
45
+ expires: nonOptionalString,
46
+ notBefore: nonOptionalString,
47
+ notAfter: nonOptionalString,
48
+ identifiers: zod_1.z.array(zod_1.z.object({
49
+ type: nonOptionalString,
50
+ value: nonOptionalString,
51
+ })),
52
+ authorizations: zod_1.z.array(nonOptionalUrl),
53
+ finalize: nonOptionalUrl,
54
+ });
55
+ exports.AuthorizationResponseSchema = zod_1.z.object({
56
+ status: nonOptionalString,
57
+ expires: nonOptionalString,
58
+ identifier: zod_1.z.object({
59
+ type: nonOptionalString,
60
+ value: nonOptionalString,
61
+ }),
62
+ challenges: zod_1.z.array(zod_1.z.object({
63
+ type: nonOptionalString,
64
+ url: nonOptionalUrl,
65
+ status: nonOptionalString,
66
+ token: nonOptionalString,
67
+ target: nonOptionalUrl,
68
+ })),
69
+ });
70
+ exports.DpopChallengeResponseSchema = zod_1.z.object({
71
+ type: nonOptionalString,
72
+ url: nonOptionalUrl,
73
+ status: nonOptionalString,
74
+ token: nonOptionalString,
75
+ });
76
+ exports.OidcChallengeResponseSchema = zod_1.z.object({
77
+ type: nonOptionalString,
78
+ status: nonOptionalString,
79
+ token: nonOptionalString,
80
+ validated: zod_1.z.string().optional(),
81
+ url: nonOptionalUrl,
82
+ target: nonOptionalUrl,
83
+ error: zod_1.z
84
+ .object({
85
+ type: nonOptionalString,
86
+ detail: nonOptionalString,
87
+ })
88
+ .optional(),
89
+ });
90
+ exports.CheckStatusOfOrderResponseSchema = zod_1.z.object({
91
+ id: nonOptionalString,
92
+ status: nonOptionalString,
93
+ finalize: nonOptionalUrl,
94
+ identifiers: zod_1.z.array(zod_1.z.object({
95
+ type: nonOptionalString,
96
+ value: nonOptionalString,
97
+ })),
98
+ authorizations: zod_1.z.array(nonOptionalUrl),
99
+ expires: nonOptionalString,
100
+ notBefore: nonOptionalString,
101
+ notAfter: nonOptionalString,
102
+ });
103
+ exports.FinalizeOrderResponseSchema = zod_1.z.object({
104
+ id: nonOptionalString,
105
+ status: nonOptionalString,
106
+ expires: nonOptionalString,
107
+ identifiers: zod_1.z.array(zod_1.z.object({
108
+ type: nonOptionalString,
109
+ value: nonOptionalString,
110
+ })),
111
+ notBefore: nonOptionalString,
112
+ notAfter: nonOptionalString,
113
+ authorizations: zod_1.z.array(nonOptionalUrl),
114
+ finalize: nonOptionalUrl,
115
+ certificate: nonOptionalUrl,
116
+ });
117
+ exports.GetCertificateResponseSchema = nonOptionalString;
@@ -0,0 +1,2 @@
1
+ export * from './AcmeServer';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Connection/index.ts"],"names":[],"mappings":"AAmBA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,35 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ __exportStar(require("./AcmeServer"), exports);
@@ -0,0 +1,43 @@
1
+ import { APIClient } from '@wireapp/api-client';
2
+ import { E2eiEnrollment, Ciphersuite, CoreCrypto, RotateBundle } from '@wireapp/core-crypto';
3
+ import { E2EIServiceExternal } from './E2EIServiceExternal';
4
+ /**
5
+ * Proxy types relevant to the E2EIService from CoreCrypto
6
+ */
7
+ type OmitFree<T> = Omit<T, 'free'>;
8
+ type NewAcmeAuthzOriginal = OmitFree<ReturnType<E2eiEnrollment['newAuthzResponse']>>;
9
+ export type AcmeDirectory = OmitFree<ReturnType<E2eiEnrollment['directoryResponse']>>;
10
+ export type AcmeChallenge = OmitFree<NonNullable<NewAcmeAuthzOriginal['wireDpopChallenge']>>;
11
+ export type NewAcmeOrder = OmitFree<ReturnType<E2eiEnrollment['newOrderResponse']>>;
12
+ export type NewAcmeAuthz = Pick<ReturnType<E2eiEnrollment['newAuthzResponse']>, 'identifier'> & {
13
+ wireDpopChallenge?: AcmeChallenge;
14
+ wireOidcChallenge?: AcmeChallenge;
15
+ };
16
+ export { E2eiEnrollment, Ciphersuite, CoreCrypto, RotateBundle };
17
+ export type User = {
18
+ id: string;
19
+ domain: string;
20
+ displayName: string;
21
+ handle: string;
22
+ };
23
+ export type Account = Uint8Array;
24
+ export type Nonce = string;
25
+ export interface FinishOidcChallengeParams {
26
+ oidcChallenge: AcmeChallenge;
27
+ nonce: Nonce;
28
+ account: Account;
29
+ }
30
+ export interface GetNewCertificateParams {
31
+ discoveryUrl: string;
32
+ }
33
+ export interface InitParams {
34
+ apiClient: APIClient;
35
+ coreCryptClient: CoreCrypto;
36
+ e2eiServiceExternal: E2EIServiceExternal;
37
+ user?: User;
38
+ clientId?: string;
39
+ skipInit?: boolean;
40
+ discoveryUrl?: string;
41
+ keyPackagesAmount: number;
42
+ }
43
+ //# sourceMappingURL=E2EIService.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"E2EIService.types.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIService.types.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAE3F,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE1D;;GAEG;AACH,KAAK,QAAQ,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACnC,KAAK,oBAAoB,GAAG,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACrF,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;AACtF,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAC7F,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACpF,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG;IAC9F,iBAAiB,CAAC,EAAE,aAAa,CAAC;IAClC,iBAAiB,CAAC,EAAE,aAAa,CAAC;CACnC,CAAC;AACF,OAAO,EAAC,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAC,CAAC;AAE/D,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC;AACjC,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAE3B,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,UAAU,CAAC;IAC5B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;CAC3B"}
@@ -0,0 +1,25 @@
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.CoreCrypto = exports.Ciphersuite = exports.E2eiEnrollment = void 0;
22
+ const core_crypto_1 = require("@wireapp/core-crypto");
23
+ Object.defineProperty(exports, "E2eiEnrollment", { enumerable: true, get: function () { return core_crypto_1.E2eiEnrollment; } });
24
+ Object.defineProperty(exports, "Ciphersuite", { enumerable: true, get: function () { return core_crypto_1.Ciphersuite; } });
25
+ Object.defineProperty(exports, "CoreCrypto", { enumerable: true, get: function () { return core_crypto_1.CoreCrypto; } });
@@ -0,0 +1,17 @@
1
+ import { QualifiedId } from '@wireapp/api-client/lib/user';
2
+ import { Ciphersuite, CoreCrypto, E2eiConversationState, WireIdentity } from '@wireapp/core-crypto';
3
+ export declare class E2EIServiceExternal {
4
+ private static instance;
5
+ private readonly logger;
6
+ private readonly coreCryptoClient;
7
+ private constructor();
8
+ static getInstance(coreCryptoClient: CoreCrypto): Promise<E2EIServiceExternal>;
9
+ hasActiveCertificate(): boolean;
10
+ getCertificateData(): string | undefined;
11
+ isEnrollmentInProgress(): boolean;
12
+ clearAllProgress(): void;
13
+ getConversationState(conversationId: Uint8Array): Promise<E2eiConversationState>;
14
+ isE2EIEnabled(ciphersuite: Ciphersuite): Promise<boolean>;
15
+ getUserDeviceEntities(groupId: string | Uint8Array, clientIdsWithUser: Record<string, QualifiedId>): Promise<WireIdentity[]>;
16
+ }
17
+ //# sourceMappingURL=E2EIServiceExternal.d.ts.map
@@ -0,0 +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,WAAW,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAMlG,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAsB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuD;IAC9E,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAa;IAE9C,OAAO;WAIa,WAAW,CAAC,gBAAgB,EAAE,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAWpF,oBAAoB,IAAI,OAAO;IAK/B,kBAAkB,IAAI,MAAM,GAAG,SAAS;IAUxC,sBAAsB,IAAI,OAAO;IAIjC,gBAAgB,IAAI,IAAI;IAIxB,oBAAoB,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIhF,aAAa,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAKnD,qBAAqB,CAChC,OAAO,EAAE,MAAM,GAAG,UAAU,EAC5B,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAC7C,OAAO,CAAC,YAAY,EAAE,CAAC;CAc3B"}
@@ -0,0 +1,85 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
21
+ return (mod && mod.__esModule) ? mod : { "default": mod };
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.E2EIServiceExternal = void 0;
25
+ const bazinga64_1 = require("bazinga64");
26
+ const logdown_1 = __importDefault(require("logdown"));
27
+ const Helper_1 = require("./Helper");
28
+ const E2EIStorage_1 = require("./Storage/E2EIStorage");
29
+ // This export is meant to be accessible from the outside (e.g the Webapp / UI)
30
+ class E2EIServiceExternal {
31
+ constructor(coreCryptClient) {
32
+ this.logger = (0, logdown_1.default)('@wireapp/core/E2EIdentityServiceExternal');
33
+ this.coreCryptoClient = coreCryptClient;
34
+ }
35
+ static async getInstance(coreCryptoClient) {
36
+ if (!E2EIServiceExternal.instance) {
37
+ if (!coreCryptoClient) {
38
+ throw new Error('E2EIServiceExternal is not initialized. Please call getInstance with params.');
39
+ }
40
+ E2EIServiceExternal.instance = new E2EIServiceExternal(coreCryptoClient);
41
+ }
42
+ return E2EIServiceExternal.instance;
43
+ }
44
+ // Checks if there is a certificate stored in the local storage
45
+ hasActiveCertificate() {
46
+ return E2EIStorage_1.E2EIStorage.has.certificateData();
47
+ }
48
+ // Returns the certificate data stored in the local storage
49
+ getCertificateData() {
50
+ try {
51
+ return E2EIStorage_1.E2EIStorage.get.certificateData();
52
+ }
53
+ catch (error) {
54
+ this.logger.error('ACME: Failed to get stored certificate', error);
55
+ return undefined;
56
+ }
57
+ }
58
+ // If we have a handle in the local storage, we are in the enrollment process (this handle is saved before oauth redirect)
59
+ isEnrollmentInProgress() {
60
+ return E2EIStorage_1.E2EIStorage.has.handle();
61
+ }
62
+ clearAllProgress() {
63
+ E2EIStorage_1.E2EIStorage.remove.temporaryData();
64
+ }
65
+ getConversationState(conversationId) {
66
+ return this.coreCryptoClient.e2eiConversationState(conversationId);
67
+ }
68
+ isE2EIEnabled(ciphersuite) {
69
+ return this.coreCryptoClient.e2eiIsEnabled(ciphersuite);
70
+ }
71
+ // Returns devices e2ei certificates
72
+ async getUserDeviceEntities(groupId, clientIdsWithUser) {
73
+ let groupIdByteArray = groupId;
74
+ if (typeof groupIdByteArray === 'string') {
75
+ groupIdByteArray = bazinga64_1.Decoder.fromBase64(groupIdByteArray).asBytes;
76
+ }
77
+ const clientIds = Object.keys(clientIdsWithUser);
78
+ const e2eClientIdByteArrays = clientIds.map(clientId => {
79
+ const user = clientIdsWithUser[clientId];
80
+ return (0, Helper_1.getE2EIClientId)(clientId, user.id, user.domain).asBytes;
81
+ });
82
+ return this.coreCryptoClient.getUserIdentities(groupIdByteArray, e2eClientIdByteArrays);
83
+ }
84
+ }
85
+ exports.E2EIServiceExternal = E2EIServiceExternal;
@@ -0,0 +1,24 @@
1
+ import { AcmeChallenge, InitParams, RotateBundle } from './E2EIService.types';
2
+ declare class E2EIServiceInternal {
3
+ private static instance;
4
+ private readonly logger;
5
+ private readonly coreCryptoClient;
6
+ private readonly apiClient;
7
+ private readonly e2eServiceExternal;
8
+ private readonly keyPackagesAmount;
9
+ private identity?;
10
+ private acmeService?;
11
+ private isInitialized;
12
+ private constructor();
13
+ static getInstance(params?: InitParams): Promise<E2EIServiceInternal>;
14
+ startCertificateProcess(): Promise<AcmeChallenge | undefined>;
15
+ continueCertificateProcess(oAuthIdToken: string): Promise<RotateBundle | undefined>;
16
+ private exitWithError;
17
+ private init;
18
+ private getDirectory;
19
+ private getInitialNonce;
20
+ private startNewOAuthFlow;
21
+ private continueOAuthFlow;
22
+ }
23
+ export { E2EIServiceInternal };
24
+ //# sourceMappingURL=E2EIServiceInternal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"E2EIServiceInternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.ts"],"names":[],"mappings":"AAyBA,OAAO,EACL,aAAa,EAKb,UAAU,EACV,YAAY,EACb,MAAM,qBAAqB,CAAC;AAW7B,cAAM,mBAAmB;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAsB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuD;IAC9E,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAa;IAC9C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAsB;IACzD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACnC,OAAO,CAAC,QAAQ,CAAC,CAAiB;IAClC,OAAO,CAAC,WAAW,CAAC,CAAc;IAClC,OAAO,CAAC,aAAa,CAAS;IAE9B,OAAO;WAea,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAwBrE,uBAAuB;IAUvB,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAehG,OAAO,CAAC,aAAa;YAKP,IAAI;YAsBJ,YAAY;YAeZ,eAAe;YAaf,iBAAiB;YA8DjB,iBAAiB;CA+EhC;AAED,OAAO,EAAC,mBAAmB,EAAC,CAAC"}