@wireapp/api-client 27.0.13 → 27.1.0-hotfix-1.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 (71) hide show
  1. package/lib/APIClient.d.ts +1 -0
  2. package/lib/APIClient.d.ts.map +1 -1
  3. package/lib/APIClient.js +22 -24
  4. package/lib/account/AccountAPI.js +15 -16
  5. package/lib/asset/AssetAPI.d.ts +1 -0
  6. package/lib/asset/AssetAPI.d.ts.map +1 -1
  7. package/lib/asset/AssetAPI.js +4 -5
  8. package/lib/auth/AccessTokenStore.d.ts +1 -0
  9. package/lib/auth/AccessTokenStore.d.ts.map +1 -1
  10. package/lib/auth/AccessTokenStore.js +1 -8
  11. package/lib/auth/AuthAPI.js +27 -22
  12. package/lib/auth/Cookie.js +2 -2
  13. package/lib/auth/CookieStore.d.ts +1 -0
  14. package/lib/auth/CookieStore.d.ts.map +1 -1
  15. package/lib/auth/CookieStore.js +2 -3
  16. package/lib/auth/parseAccessToken.js +3 -3
  17. package/lib/broadcast/BroadcastAPI.js +4 -5
  18. package/lib/client/ClientAPI.d.ts +10 -10
  19. package/lib/client/ClientAPI.d.ts.map +1 -1
  20. package/lib/client/ClientAPI.js +14 -12
  21. package/lib/connection/ConnectionAPI.js +3 -4
  22. package/lib/conversation/Conversation.d.ts +8 -0
  23. package/lib/conversation/Conversation.d.ts.map +1 -1
  24. package/lib/conversation/Conversation.js +8 -1
  25. package/lib/conversation/ConversationAPI/ConversationAPI.d.ts +2 -2
  26. package/lib/conversation/ConversationAPI/ConversationAPI.d.ts.map +1 -1
  27. package/lib/conversation/ConversationAPI/ConversationAPI.js +33 -34
  28. package/lib/conversation/FederatedBackendsError.js +5 -6
  29. package/lib/demo/initClient.js +2 -1
  30. package/lib/generic/GenericAPI.js +0 -1
  31. package/lib/giphy/GiphyAPI.js +7 -8
  32. package/lib/http/BackendError.js +0 -3
  33. package/lib/http/HttpClient.d.ts +1 -0
  34. package/lib/http/HttpClient.d.ts.map +1 -1
  35. package/lib/http/HttpClient.js +24 -49
  36. package/lib/http/NetworkError.js +0 -1
  37. package/lib/notification/NotificationAPI/NotificationAPI.js +11 -11
  38. package/lib/notification/NotificationAPI/NotificationsAPI.mocks.d.ts +1 -1
  39. package/lib/oauth/OAuthAPI.js +7 -8
  40. package/lib/obfuscation/ObfuscationUtil.js +1 -4
  41. package/lib/self/SelfAPI.js +11 -12
  42. package/lib/serviceProvider/ServiceProviderAPI.js +7 -8
  43. package/lib/services/ServicesAPI.js +11 -13
  44. package/lib/shims/browser/cookie.d.ts.map +1 -1
  45. package/lib/shims/browser/websocket.d.ts +1 -1
  46. package/lib/shims/node/buffer.d.ts +1 -0
  47. package/lib/shims/node/buffer.d.ts.map +1 -1
  48. package/lib/shims/node/cookie.d.ts.map +1 -1
  49. package/lib/shims/node/cookie.js +2 -1
  50. package/lib/tcp/ReconnectingWebsocket.js +64 -72
  51. package/lib/tcp/WebSocketClient.d.ts +1 -0
  52. package/lib/tcp/WebSocketClient.d.ts.map +1 -1
  53. package/lib/tcp/WebSocketClient.js +61 -68
  54. package/lib/team/billing/BillingAPI.js +14 -15
  55. package/lib/team/conversation/TeamConversationAPI.js +5 -6
  56. package/lib/team/feature/Feature.d.ts +4 -1
  57. package/lib/team/feature/Feature.d.ts.map +1 -1
  58. package/lib/team/feature/FeatureAPI.js +19 -20
  59. package/lib/team/identityprovider/IdentityProviderAPI.js +5 -6
  60. package/lib/team/invitation/TeamInvitationAPI.js +9 -9
  61. package/lib/team/legalhold/LegalHoldAPI.js +5 -6
  62. package/lib/team/member/MemberAPI.js +7 -8
  63. package/lib/team/payment/PaymentAPI.js +11 -12
  64. package/lib/team/scim/ScimAPI.js +5 -6
  65. package/lib/team/search/TeamSearchAPI.js +5 -9
  66. package/lib/team/service/ServiceAPI.js +7 -8
  67. package/lib/team/team/TeamAPI.js +8 -12
  68. package/lib/user/UserAPI.js +30 -40
  69. package/lib/validation/ValidationError.js +0 -1
  70. package/package.json +12 -12
  71. package/LICENSE +0 -674
@@ -20,21 +20,9 @@
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.PaymentAPI = void 0;
22
22
  class PaymentAPI {
23
- client;
24
- static DEFAULT_INVOICES_CHUNK_SIZE = 10;
25
23
  constructor(client) {
26
24
  this.client = client;
27
25
  }
28
- static URL = {
29
- BILLING: 'billing',
30
- CHARGES: 'charges',
31
- CURRENCIES: 'currencies',
32
- INFO: 'info',
33
- INVOICES: 'invoices',
34
- PLAN: 'plan',
35
- PLANS: 'plans',
36
- TEAMS: '/teams',
37
- };
38
26
  /**
39
27
  * @deprecated Use BillingAPI
40
28
  */
@@ -154,3 +142,14 @@ class PaymentAPI {
154
142
  }
155
143
  }
156
144
  exports.PaymentAPI = PaymentAPI;
145
+ PaymentAPI.DEFAULT_INVOICES_CHUNK_SIZE = 10;
146
+ PaymentAPI.URL = {
147
+ BILLING: 'billing',
148
+ CHARGES: 'charges',
149
+ CURRENCIES: 'currencies',
150
+ INFO: 'info',
151
+ INVOICES: 'invoices',
152
+ PLAN: 'plan',
153
+ PLANS: 'plans',
154
+ TEAMS: '/teams',
155
+ };
@@ -20,14 +20,9 @@
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.ScimAPI = void 0;
22
22
  class ScimAPI {
23
- client;
24
23
  constructor(client) {
25
24
  this.client = client;
26
25
  }
27
- static URL = {
28
- AUTH_TOKENS: 'auth-tokens',
29
- SCIM: '/scim',
30
- };
31
26
  async getTokens() {
32
27
  const config = {
33
28
  method: 'get',
@@ -46,7 +41,7 @@ class ScimAPI {
46
41
  }
47
42
  async postToken(description, password, verificationCode) {
48
43
  const config = {
49
- data: { description, password, ...(verificationCode && { verification_code: verificationCode }) },
44
+ data: Object.assign({ description, password }, (verificationCode && { verification_code: verificationCode })),
50
45
  method: 'post',
51
46
  url: `${ScimAPI.URL.SCIM}/${ScimAPI.URL.AUTH_TOKENS}`,
52
47
  };
@@ -55,3 +50,7 @@ class ScimAPI {
55
50
  }
56
51
  }
57
52
  exports.ScimAPI = ScimAPI;
53
+ ScimAPI.URL = {
54
+ AUTH_TOKENS: 'auth-tokens',
55
+ SCIM: '/scim',
56
+ };
@@ -27,28 +27,21 @@ const http_1 = require("../../http");
27
27
  const user_1 = require("../../user");
28
28
  const team_1 = require("../team");
29
29
  class TeamSearchAPI {
30
- client;
31
30
  constructor(client) {
32
31
  this.client = client;
33
32
  }
34
- static URL = {
35
- SEARCH: 'search',
36
- };
37
33
  /**
38
34
  * Search for team members.
39
35
  * @param query The search query
40
36
  * @param options Search options (sort, order, filter, etc.)
41
37
  */
42
38
  async getSearchMembers(teamId, query, options = {}) {
39
+ var _a;
43
40
  const cancelSource = axios_1.default.CancelToken.source();
44
41
  const config = {
45
42
  cancelToken: cancelSource.token,
46
43
  method: 'get',
47
- params: {
48
- q: query,
49
- ...options,
50
- frole: options.frole?.join(','),
51
- },
44
+ params: Object.assign(Object.assign({ q: query }, options), { frole: (_a = options.frole) === null || _a === void 0 ? void 0 : _a.join(',') }),
52
45
  url: `${team_1.TeamAPI.URL.TEAMS}/${teamId}/${TeamSearchAPI.URL.SEARCH}`,
53
46
  };
54
47
  const handleRequest = async () => {
@@ -70,3 +63,6 @@ class TeamSearchAPI {
70
63
  }
71
64
  }
72
65
  exports.TeamSearchAPI = TeamSearchAPI;
66
+ TeamSearchAPI.URL = {
67
+ SEARCH: 'search',
68
+ };
@@ -20,17 +20,9 @@
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.ServiceAPI = void 0;
22
22
  class ServiceAPI {
23
- client;
24
23
  constructor(client) {
25
24
  this.client = client;
26
25
  }
27
- static URL = {
28
- PROVIDERS: '/providers',
29
- SERVICES: 'services',
30
- TEAMS: '/teams',
31
- WHITELIST: 'whitelist',
32
- WHITELISTED: 'whitelisted',
33
- };
34
26
  async getServices(limit = 100, start, tags) {
35
27
  const config = {
36
28
  method: 'get',
@@ -92,3 +84,10 @@ class ServiceAPI {
92
84
  }
93
85
  }
94
86
  exports.ServiceAPI = ServiceAPI;
87
+ ServiceAPI.URL = {
88
+ PROVIDERS: '/providers',
89
+ SERVICES: 'services',
90
+ TEAMS: '/teams',
91
+ WHITELIST: 'whitelist',
92
+ WHITELISTED: 'whitelisted',
93
+ };
@@ -26,17 +26,9 @@ const axios_1 = __importDefault(require("axios"));
26
26
  const http_1 = require("../../http/");
27
27
  const user_1 = require("../../user");
28
28
  class TeamAPI {
29
- client;
30
29
  constructor(client) {
31
30
  this.client = client;
32
31
  }
33
- static URL = {
34
- SIZE: 'size',
35
- TEAMS: '/teams',
36
- CONSENT: '/consent',
37
- MARKETO: 'marketo',
38
- LEAD: 'lead',
39
- };
40
32
  async postTeam(team) {
41
33
  const config = {
42
34
  data: team,
@@ -73,10 +65,7 @@ class TeamAPI {
73
65
  }
74
66
  async deleteTeam(teamId, password, verificationCode) {
75
67
  const config = {
76
- data: {
77
- password,
78
- ...(verificationCode && { verification_code: verificationCode }),
79
- },
68
+ data: Object.assign({ password }, (verificationCode && { verification_code: verificationCode })),
80
69
  method: 'delete',
81
70
  url: `${TeamAPI.URL.TEAMS}/${teamId}`,
82
71
  };
@@ -126,3 +115,10 @@ class TeamAPI {
126
115
  }
127
116
  }
128
117
  exports.TeamAPI = TeamAPI;
118
+ TeamAPI.URL = {
119
+ SIZE: 'size',
120
+ TEAMS: '/teams',
121
+ CONSENT: '/consent',
122
+ MARKETO: 'marketo',
123
+ LEAD: 'lead',
124
+ };
@@ -33,34 +33,6 @@ function isUsersResponse(object) {
33
33
  return object.found || object.failed || object.not_found;
34
34
  }
35
35
  class UserAPI {
36
- client;
37
- backendFeatures;
38
- static DEFAULT_USERS_CHUNK_SIZE = 50;
39
- static DEFAULT_USERS_PREKEY_BUNDLE_CHUNK_SIZE = 128;
40
- static URL = {
41
- ACTIVATE: '/activate',
42
- BY_HANDLE: 'by-handle',
43
- CALLS: '/calls',
44
- CLIENTS: 'clients',
45
- CONFIG: 'config',
46
- CONTACTS: 'contacts',
47
- DELETE: '/delete',
48
- EMAIL: 'email',
49
- HANDLES: 'handles',
50
- LIST_CLIENTS: 'list-clients',
51
- LIST_PREKEYS: 'list-prekeys',
52
- LIST_USERS: '/list-users',
53
- PASSWORD_RESET: '/password-reset',
54
- PRE_KEYS: 'prekeys',
55
- PROPERTIES: '/properties',
56
- RICH_INFO: 'rich-info',
57
- SEARCH: '/search',
58
- SEND: 'send',
59
- USERS: '/users',
60
- V2: 'v2',
61
- VERIFICATION: '/verification-code',
62
- SUPPORTED_PROTOCOLS: 'supported-protocols',
63
- };
64
36
  constructor(client, backendFeatures) {
65
37
  this.client = client;
66
38
  this.backendFeatures = backendFeatures;
@@ -513,25 +485,17 @@ class UserAPI {
513
485
  const chunksPromises = commons_1.ArrayUtil.chunk(flattenUsers, limit)
514
486
  .map(chunk => {
515
487
  return chunk.reduce((chunkedMap, { userId, clients }) => {
516
- return {
517
- ...chunkedMap,
518
- [userId.domain]: {
519
- ...chunkedMap[userId.domain],
520
- [userId.id]: clients,
521
- },
522
- };
488
+ return Object.assign(Object.assign({}, chunkedMap), { [userId.domain]: Object.assign(Object.assign({}, chunkedMap[userId.domain]), { [userId.id]: clients }) });
523
489
  }, {});
524
490
  })
525
491
  .map(chunkedMap => this.postMultiPreKeyBundlesChunk(chunkedMap));
526
492
  const userPreKeyBundleMapChunks = await Promise.all(chunksPromises);
527
493
  return userPreKeyBundleMapChunks.reduce((response, userPreKeyBundleMapChunk) => {
494
+ var _a, _b;
528
495
  Object.entries(userPreKeyBundleMapChunk.qualified_user_client_prekeys).forEach(([domain, userClientMap]) => {
529
- response.qualified_user_client_prekeys[domain] = {
530
- ...response.qualified_user_client_prekeys[domain],
531
- ...userClientMap,
532
- };
496
+ response.qualified_user_client_prekeys[domain] = Object.assign(Object.assign({}, response.qualified_user_client_prekeys[domain]), userClientMap);
533
497
  });
534
- response.failed_to_list?.push(...(userPreKeyBundleMapChunk.failed_to_list ?? []));
498
+ (_a = response.failed_to_list) === null || _a === void 0 ? void 0 : _a.push(...((_b = userPreKeyBundleMapChunk.failed_to_list) !== null && _b !== void 0 ? _b : []));
535
499
  return response;
536
500
  }, { qualified_user_client_prekeys: {}, failed_to_list: [] });
537
501
  }
@@ -591,3 +555,29 @@ class UserAPI {
591
555
  }
592
556
  }
593
557
  exports.UserAPI = UserAPI;
558
+ UserAPI.DEFAULT_USERS_CHUNK_SIZE = 50;
559
+ UserAPI.DEFAULT_USERS_PREKEY_BUNDLE_CHUNK_SIZE = 128;
560
+ UserAPI.URL = {
561
+ ACTIVATE: '/activate',
562
+ BY_HANDLE: 'by-handle',
563
+ CALLS: '/calls',
564
+ CLIENTS: 'clients',
565
+ CONFIG: 'config',
566
+ CONTACTS: 'contacts',
567
+ DELETE: '/delete',
568
+ EMAIL: 'email',
569
+ HANDLES: 'handles',
570
+ LIST_CLIENTS: 'list-clients',
571
+ LIST_PREKEYS: 'list-prekeys',
572
+ LIST_USERS: '/list-users',
573
+ PASSWORD_RESET: '/password-reset',
574
+ PRE_KEYS: 'prekeys',
575
+ PROPERTIES: '/properties',
576
+ RICH_INFO: 'rich-info',
577
+ SEARCH: '/search',
578
+ SEND: 'send',
579
+ USERS: '/users',
580
+ V2: 'v2',
581
+ VERIFICATION: '/verification-code',
582
+ SUPPORTED_PROTOCOLS: 'supported-protocols',
583
+ };
@@ -20,7 +20,6 @@
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.ValidationError = void 0;
22
22
  class ValidationError extends Error {
23
- message;
24
23
  constructor(message) {
25
24
  super(message);
26
25
  this.message = message;
package/package.json CHANGED
@@ -13,18 +13,18 @@
13
13
  "./lib/shims/node/websocket": "./lib/shims/browser/websocket.js"
14
14
  },
15
15
  "dependencies": {
16
- "@wireapp/commons": "^5.2.10",
17
- "@wireapp/priority-queue": "^2.1.7",
18
- "@wireapp/protocol-messaging": "1.49.0",
16
+ "@wireapp/commons": "workspace:^",
17
+ "@wireapp/priority-queue": "workspace:^",
18
+ "@wireapp/protocol-messaging": "1.48.0",
19
19
  "axios": "1.7.2",
20
- "axios-retry": "4.4.1",
20
+ "axios-retry": "4.4.0",
21
21
  "http-status-codes": "2.3.0",
22
22
  "logdown": "3.3.1",
23
23
  "pako": "2.1.0",
24
24
  "reconnecting-websocket": "4.4.0",
25
25
  "spark-md5": "3.0.2",
26
26
  "tough-cookie": "4.1.4",
27
- "ws": "8.18.0",
27
+ "ws": "8.17.1",
28
28
  "zod": "3.23.8"
29
29
  },
30
30
  "devDependencies": {
@@ -36,9 +36,9 @@
36
36
  "@types/pako": "2",
37
37
  "@types/spark-md5": "3.0.4",
38
38
  "@types/tough-cookie": "4.0.5",
39
- "@types/ws": "8.5.11",
40
- "@wireapp/store-engine": "^5.1.7",
41
- "@wireapp/store-engine-fs": "^3.1.7",
39
+ "@types/ws": "8.5.10",
40
+ "@wireapp/store-engine": "workspace:^",
41
+ "@wireapp/store-engine-fs": "workspace:^",
42
42
  "browser-sync": "3.0.2",
43
43
  "concurrently": "8.2.2",
44
44
  "cross-env": "7.0.3",
@@ -47,11 +47,11 @@
47
47
  "nock": "13.5.4",
48
48
  "react": "18.3.1",
49
49
  "react-dom": "18.3.1",
50
- "rimraf": "6.0.1",
50
+ "rimraf": "5.0.7",
51
51
  "ts-node": "^10.9.1",
52
52
  "typescript": "^5.0.4",
53
53
  "webpack": "^5.74.0",
54
- "ws": "8.18.0"
54
+ "ws": "8.17.1"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "yarn clean && tsc",
@@ -66,6 +66,6 @@
66
66
  "watch": "webpack serve --config webpack.browser.js",
67
67
  "prepare": "yarn dist"
68
68
  },
69
- "version": "27.0.13",
70
- "gitHead": "237dff7f5a0cd30df3c1ec76d49c56cd169e5e4e"
69
+ "version": "27.1.0-hotfix-1.1",
70
+ "gitHead": "5339f01fe01ef0871da8c8bc8662fbe9e604754a"
71
71
  }