@or-sdk/users 3.5.3 → 3.5.4

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 (38) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.json +5 -6
  3. package/tsconfig.build.json +9 -0
  4. package/tsconfig.dev.json +0 -1
  5. package/tsconfig.esm.json +1 -2
  6. package/tsconfig.json +2 -3
  7. package/tsconfig.types.json +1 -2
  8. package/{vitest.config.mts → vitest.config.mjs} +2 -1
  9. package/dist/cjs/__tests__/Users.spec.js +0 -235
  10. package/dist/cjs/__tests__/Users.spec.js.map +0 -1
  11. package/dist/cjs/__tests__/mocks/create_user_with_multi.js +0 -16
  12. package/dist/cjs/__tests__/mocks/create_user_with_multi.js.map +0 -1
  13. package/dist/cjs/__tests__/mocks/index.js +0 -20
  14. package/dist/cjs/__tests__/mocks/index.js.map +0 -1
  15. package/dist/cjs/__tests__/mocks/profile.js +0 -28
  16. package/dist/cjs/__tests__/mocks/profile.js.map +0 -1
  17. package/dist/cjs/__tests__/mocks/server.js +0 -19
  18. package/dist/cjs/__tests__/mocks/server.js.map +0 -1
  19. package/dist/esm/__tests__/Users.spec.js +0 -118
  20. package/dist/esm/__tests__/Users.spec.js.map +0 -1
  21. package/dist/esm/__tests__/mocks/create_user_with_multi.js +0 -13
  22. package/dist/esm/__tests__/mocks/create_user_with_multi.js.map +0 -1
  23. package/dist/esm/__tests__/mocks/index.js +0 -4
  24. package/dist/esm/__tests__/mocks/index.js.map +0 -1
  25. package/dist/esm/__tests__/mocks/profile.js +0 -25
  26. package/dist/esm/__tests__/mocks/profile.js.map +0 -1
  27. package/dist/esm/__tests__/mocks/server.js +0 -12
  28. package/dist/esm/__tests__/mocks/server.js.map +0 -1
  29. package/dist/types/__tests__/Users.spec.d.ts +0 -2
  30. package/dist/types/__tests__/Users.spec.d.ts.map +0 -1
  31. package/dist/types/__tests__/mocks/create_user_with_multi.d.ts +0 -13
  32. package/dist/types/__tests__/mocks/create_user_with_multi.d.ts.map +0 -1
  33. package/dist/types/__tests__/mocks/index.d.ts +0 -4
  34. package/dist/types/__tests__/mocks/index.d.ts.map +0 -1
  35. package/dist/types/__tests__/mocks/profile.d.ts +0 -25
  36. package/dist/types/__tests__/mocks/profile.d.ts.map +0 -1
  37. package/dist/types/__tests__/mocks/server.d.ts +0 -7
  38. package/dist/types/__tests__/mocks/server.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.5.4](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/users@3.5.3...@or-sdk/users@3.5.4) (2025-11-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **base:** Fix vitest tests ([3afb8a3](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/commit/3afb8a344fc68e7e3b4ab3203eedea7a7f0b5bab))
12
+
13
+
14
+
6
15
  ## [3.5.3](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/users@3.5.2...@or-sdk/users@3.5.3) (2025-10-14)
7
16
 
8
17
  **Note:** Version bump only for package @or-sdk/users
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@or-sdk/users",
3
- "version": "3.5.3",
3
+ "version": "3.5.4",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -20,8 +20,8 @@
20
20
  "test:watch": "vitest --watch"
21
21
  },
22
22
  "dependencies": {
23
- "@or-sdk/base": "^0.42.3",
24
- "@or-sdk/sdk-api": "^0.26.27",
23
+ "@or-sdk/base": "^0.42.4",
24
+ "@or-sdk/sdk-api": "^0.26.28",
25
25
  "validator": "^13.11.0",
26
26
  "zod": "^3.24.4"
27
27
  },
@@ -29,11 +29,10 @@
29
29
  "@types/validator": "^13.11.8",
30
30
  "concurrently": "9.0.1",
31
31
  "msw": "^2.8.2",
32
- "typescript": "5.6.2",
33
- "vitest": "^3.1.3"
32
+ "typescript": "5.6.2"
34
33
  },
35
34
  "publishConfig": {
36
35
  "access": "public"
37
36
  },
38
- "gitHead": "cd895160bbbafda02a74c09a797cc4d51b0a5b62"
37
+ "gitHead": "9deea9f914551e435336bc856e77b4fdfd7bdd54"
39
38
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "./src"
5
+ },
6
+ "exclude": [
7
+ "./src/__tests__"
8
+ ]
9
+ }
package/tsconfig.dev.json CHANGED
@@ -2,7 +2,6 @@
2
2
  "extends": "./tsconfig.esm.json",
3
3
  "compilerOptions": {
4
4
  "declarationDir": "./dist/types",
5
- "rootDir": "./src",
6
5
  "declaration": true
7
6
  }
8
7
  }
package/tsconfig.esm.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
2
+ "extends": "./tsconfig.build.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "./dist/esm",
5
5
  "declarationDir": "./dist/types",
6
6
  "module": "ES6",
7
7
  "target": "es6",
8
- "rootDir": "./src",
9
8
  "declaration": true,
10
9
  "declarationMap": true
11
10
  }
package/tsconfig.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
2
+ "extends": "./tsconfig.build.json",
3
3
  "compilerOptions": {
4
- "outDir": "./dist/cjs/",
5
- "rootDir": "./src"
4
+ "outDir": "./dist/cjs"
6
5
  }
7
6
  }
@@ -1,8 +1,7 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
2
+ "extends": "./tsconfig.build.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "./dist/types",
5
- "rootDir": "./src",
6
5
  "declaration": true,
7
6
  "declarationMap": true,
8
7
  "emitDeclarationOnly": true
@@ -4,8 +4,9 @@ export default defineConfig({
4
4
  test: {
5
5
  reporters: ['junit', 'default'],
6
6
  outputFile: 'test-results/junit.xml',
7
+ include: ['src/**/*.{test,spec}.ts'],
8
+ exclude: ['dist/**'],
7
9
  coverage: {
8
- all: true,
9
10
  reporter: ['text', 'json', 'html', 'cobertura', 'text-summary'],
10
11
  clean: true,
11
12
  include: [
@@ -1,235 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- var msw_1 = require("msw");
40
- var vitest_1 = require("vitest");
41
- var index_1 = require("../index");
42
- var index_2 = require("./mocks/index");
43
- function buildUsersInstance() {
44
- return new index_1.Users({
45
- token: 'test-token',
46
- usersUrl: index_2.USERS_URL,
47
- sdkUrl: index_2.SDK_URL,
48
- });
49
- }
50
- (0, vitest_1.describe)('Users API', function () {
51
- (0, vitest_1.beforeAll)(function () { return index_2.mockApiServer.listen(); });
52
- (0, vitest_1.afterEach)(function () { return index_2.mockApiServer.resetHandlers(); });
53
- (0, vitest_1.afterAll)(function () { return index_2.mockApiServer.close(); });
54
- (0, vitest_1.describe)('constructor', function () {
55
- (0, vitest_1.it)('initializes properly', function () { return __awaiter(void 0, void 0, void 0, function () {
56
- var api;
57
- return __generator(this, function (_a) {
58
- api = buildUsersInstance();
59
- (0, vitest_1.expect)(api.serviceUrl).toBe(index_2.USERS_URL);
60
- (0, vitest_1.expect)(api.sdkApi.serviceUrl).toBe(index_2.SDK_URL);
61
- return [2];
62
- });
63
- }); });
64
- (0, vitest_1.it)('throws error if usersUrl and discoveryUrl are not provided', function () {
65
- (0, vitest_1.expect)(function () {
66
- new index_1.Users({
67
- token: 'test-token',
68
- sdkUrl: index_2.SDK_URL,
69
- });
70
- }).toThrowErrorMatchingSnapshot();
71
- });
72
- });
73
- (0, vitest_1.describe)('getCurrentMultiUserProfile', function () {
74
- var url = "".concat(index_2.SDK_URL, "/user/multi-user");
75
- (0, vitest_1.it)('should make correct the request via SdkApi', function () { return __awaiter(void 0, void 0, void 0, function () {
76
- var api, res;
77
- return __generator(this, function (_a) {
78
- switch (_a.label) {
79
- case 0:
80
- index_2.mockApiServer.use(msw_1.http.get(url, (0, index_2.okRes)(index_2.profileFixture)));
81
- api = buildUsersInstance();
82
- return [4, api.getCurrentMultiUserProfile()];
83
- case 1:
84
- res = _a.sent();
85
- (0, vitest_1.expect)(res).toEqual(index_2.profileFixture);
86
- return [2];
87
- }
88
- });
89
- }); });
90
- (0, vitest_1.it)('should allow for empty phone number', function () { return __awaiter(void 0, void 0, void 0, function () {
91
- var api, res;
92
- return __generator(this, function (_a) {
93
- switch (_a.label) {
94
- case 0:
95
- index_2.mockApiServer.use(msw_1.http.get(url, (0, index_2.okRes)(index_2.profileNoPhoneFixture)));
96
- api = buildUsersInstance();
97
- return [4, api.getCurrentMultiUserProfile()];
98
- case 1:
99
- res = _a.sent();
100
- (0, vitest_1.expect)(res).toEqual(index_2.profileNoPhoneFixture);
101
- return [2];
102
- }
103
- });
104
- }); });
105
- (0, vitest_1.it)('should return error message if API is not working', function () { return __awaiter(void 0, void 0, void 0, function () {
106
- var testError, api;
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
109
- case 0:
110
- testError = "Test error ".concat(Date.now());
111
- index_2.mockApiServer.use(msw_1.http.get(url, (0, index_2.errorRes)(testError)));
112
- api = buildUsersInstance();
113
- return [4, (0, vitest_1.expect)(api.getCurrentMultiUserProfile()).rejects.toThrow(testError)];
114
- case 1:
115
- _a.sent();
116
- return [2];
117
- }
118
- });
119
- }); });
120
- (0, vitest_1.it)('show throw error on invalid response', function () { return __awaiter(void 0, void 0, void 0, function () {
121
- var api;
122
- return __generator(this, function (_a) {
123
- switch (_a.label) {
124
- case 0:
125
- index_2.mockApiServer.use(msw_1.http.get(url, (0, index_2.okRes)({ wrongResponse: true })));
126
- api = buildUsersInstance();
127
- return [4, (0, vitest_1.expect)(api.getCurrentMultiUserProfile()).rejects.toThrowErrorMatchingSnapshot()];
128
- case 1:
129
- _a.sent();
130
- return [2];
131
- }
132
- });
133
- }); });
134
- (0, vitest_1.it)('show throw error on invalid response if validate = true', function () { return __awaiter(void 0, void 0, void 0, function () {
135
- var api;
136
- return __generator(this, function (_a) {
137
- switch (_a.label) {
138
- case 0:
139
- index_2.mockApiServer.use(msw_1.http.get(url, (0, index_2.okRes)({ wrongResponse: true })));
140
- api = buildUsersInstance();
141
- return [4, (0, vitest_1.expect)(api.getCurrentMultiUserProfile({ validate: true })).rejects.toThrowErrorMatchingSnapshot()];
142
- case 1:
143
- _a.sent();
144
- return [2];
145
- }
146
- });
147
- }); });
148
- (0, vitest_1.it)('show not throw error on invalid response if validate = false', function () { return __awaiter(void 0, void 0, void 0, function () {
149
- var api, res;
150
- return __generator(this, function (_a) {
151
- switch (_a.label) {
152
- case 0:
153
- index_2.mockApiServer.use(msw_1.http.get(url, (0, index_2.okRes)({ wrongResponse: true })));
154
- api = buildUsersInstance();
155
- return [4, api.getCurrentMultiUserProfile({ validate: false })];
156
- case 1:
157
- res = _a.sent();
158
- (0, vitest_1.expect)(res).toEqual({ wrongResponse: true });
159
- return [2];
160
- }
161
- });
162
- }); });
163
- });
164
- (0, vitest_1.describe)('createUserWithMulti', function () {
165
- var url = "".concat(index_2.SDK_URL, "/accounts/undefined/multi-user/create-start");
166
- (0, vitest_1.it)('should make correct the request via SdkApi', function () { return __awaiter(void 0, void 0, void 0, function () {
167
- var userData, api, res;
168
- return __generator(this, function (_a) {
169
- switch (_a.label) {
170
- case 0:
171
- index_2.mockApiServer.use(msw_1.http.post(url, (0, index_2.okRes)(index_2.createUserWithMultiFixture)));
172
- userData = {
173
- role: index_1.UserRole.ADMIN,
174
- email: 'user@example.com',
175
- disableAt: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(),
176
- };
177
- api = buildUsersInstance();
178
- return [4, api.createUserWithMulti(userData)];
179
- case 1:
180
- res = _a.sent();
181
- (0, vitest_1.expect)(res).toEqual(index_2.createUserWithMultiFixture);
182
- return [2];
183
- }
184
- });
185
- }); });
186
- (0, vitest_1.it)('should throw CreateUserConflictError error if backend responds with 409', function () { return __awaiter(void 0, void 0, void 0, function () {
187
- var testError, userData, api, error_1;
188
- return __generator(this, function (_a) {
189
- switch (_a.label) {
190
- case 0:
191
- testError = "Test error ".concat(Date.now());
192
- index_2.mockApiServer.use(msw_1.http.post(url, (0, index_2.errorRes)(testError, 409)));
193
- userData = {
194
- role: index_1.UserRole.ADMIN,
195
- email: 'user@example.com',
196
- disableAt: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(),
197
- };
198
- api = buildUsersInstance();
199
- _a.label = 1;
200
- case 1:
201
- _a.trys.push([1, 3, , 4]);
202
- return [4, api.createUserWithMulti(userData)];
203
- case 2:
204
- _a.sent();
205
- return [3, 4];
206
- case 3:
207
- error_1 = _a.sent();
208
- (0, vitest_1.expect)(error_1).toBeInstanceOf(index_1.CreateUserConflictError);
209
- (0, vitest_1.expect)(error_1.message).toBe(testError);
210
- return [3, 4];
211
- case 4: return [2];
212
- }
213
- });
214
- }); });
215
- (0, vitest_1.it)('should throw error if expire time is in the past', function () { return __awaiter(void 0, void 0, void 0, function () {
216
- var userData, api;
217
- return __generator(this, function (_a) {
218
- switch (_a.label) {
219
- case 0:
220
- userData = {
221
- role: index_1.UserRole.ADMIN,
222
- email: 'user@example.com',
223
- disableAt: new Date(Date.now() - 1000 * 60 * 60 * 24).toISOString(),
224
- };
225
- api = buildUsersInstance();
226
- return [4, (0, vitest_1.expect)(api.createUserWithMulti(userData)).rejects.toThrowErrorMatchingSnapshot()];
227
- case 1:
228
- _a.sent();
229
- return [2];
230
- }
231
- });
232
- }); });
233
- });
234
- });
235
- //# sourceMappingURL=Users.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Users.spec.js","sourceRoot":"","sources":["../../../src/__tests__/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,GAAG,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EAAA;;wBAAvC,SAAuC,CAAC;;;;wBAExC,IAAA,eAAM,EAAC,OAAK,CAAC,CAAC,cAAc,CAAC,+BAAuB,CAAC,CAAC;wBACtD,IAAA,eAAM,EAAE,OAAe,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;;;;;aAEpD,CAAC,CAAC;QAEH,IAAA,WAAE,EAAC,kDAAkD,EAAE;;;;;wBAC/C,QAAQ,GAAG;4BACf,IAAI,EAAE,gBAAQ,CAAC,KAAK;4BACpB,KAAK,EAAE,kBAAkB;4BACzB,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,EAAE;yBACpE,CAAC;wBACI,GAAG,GAAG,kBAAkB,EAAE,CAAC;wBACjC,WAAM,IAAA,eAAM,EAAC,GAAG,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,4BAA4B,EAAE,EAAA;;wBAAtF,SAAsF,CAAC;;;;aACxF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createUserWithMultiFixture = void 0;
4
- exports.createUserWithMultiFixture = {
5
- id: '06ae0b37-13e0-4880-91b7-382d4b56e1fa',
6
- username: 'test.user@example.com',
7
- data: {
8
- profile: {
9
- icon: 'https://cdn.example.com/profile.jpg',
10
- phoneNumber: '+12345678901',
11
- firstName: 'Test',
12
- lastName: 'User',
13
- },
14
- },
15
- };
16
- //# sourceMappingURL=create_user_with_multi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create_user_with_multi.js","sourceRoot":"","sources":["../../../../src/__tests__/mocks/create_user_with_multi.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG;IACxC,EAAE,EAAE,sCAAsC;IAC1C,QAAQ,EAAE,uBAAuB;IACjC,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,IAAI,EAAE,qCAAqC;YAC3C,WAAW,EAAE,cAAc;YAC3B,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,MAAM;SACjB;KACF;CACF,CAAC"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./server"), exports);
18
- __exportStar(require("./profile"), exports);
19
- __exportStar(require("./create_user_with_multi"), exports);
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/__tests__/mocks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,4CAA0B;AAC1B,2DAAyC"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.profileNoPhoneFixture = exports.profileFixture = void 0;
4
- exports.profileFixture = {
5
- id: '06ae0b37-13e0-4880-91b7-382d4b56e1fa',
6
- username: 'test.user@example.com',
7
- data: {
8
- profile: {
9
- icon: 'https://cdn.example.com/profile.jpg',
10
- phoneNumber: '+12345678901',
11
- firstName: 'Test',
12
- lastName: 'User',
13
- },
14
- },
15
- };
16
- exports.profileNoPhoneFixture = {
17
- id: '06ae0b37-13e0-4880-91b7-382d4b56e1fa',
18
- username: 'test.user@example.com',
19
- data: {
20
- profile: {
21
- icon: 'https://cdn.example.com/profile.jpg',
22
- phoneNumber: '',
23
- firstName: 'Test',
24
- lastName: 'User',
25
- },
26
- },
27
- };
28
- //# sourceMappingURL=profile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../../../src/__tests__/mocks/profile.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,EAAE,EAAE,sCAAsC;IAC1C,QAAQ,EAAE,uBAAuB;IACjC,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,IAAI,EAAE,qCAAqC;YAC3C,WAAW,EAAE,cAAc;YAC3B,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,MAAM;SACjB;KACF;CACF,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACnC,EAAE,EAAE,sCAAsC;IAC1C,QAAQ,EAAE,uBAAuB;IACjC,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,IAAI,EAAE,qCAAqC;YAC3C,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,MAAM;SACjB;KACF;CACF,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mockApiServer = exports.USERS_URL = exports.SDK_URL = void 0;
4
- exports.okRes = okRes;
5
- exports.errorRes = errorRes;
6
- var msw_1 = require("msw");
7
- var node_1 = require("msw/node");
8
- exports.SDK_URL = 'https://sdkapi.url';
9
- exports.USERS_URL = 'https://users.url';
10
- exports.mockApiServer = (0, node_1.setupServer)();
11
- function okRes(data, status) {
12
- if (status === void 0) { status = 200; }
13
- return function () { return msw_1.HttpResponse.json(data, { status: status }); };
14
- }
15
- function errorRes(errorMessage, status) {
16
- if (status === void 0) { status = 500; }
17
- return function () { return msw_1.HttpResponse.json({ error: errorMessage }, { status: status }); };
18
- }
19
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../src/__tests__/mocks/server.ts"],"names":[],"mappings":";;;AAQA,sBAEC;AAED,4BAEC;AAdD,2BAAiD;AACjD,iCAAuC;AAE1B,QAAA,OAAO,GAAG,oBAAoB,CAAC;AAC/B,QAAA,SAAS,GAAG,mBAAmB,CAAC;AAEhC,QAAA,aAAa,GAAG,IAAA,kBAAW,GAAE,CAAC;AAE3C,SAAgB,KAAK,CAAC,IAAkB,EAAE,MAAY;IAAZ,uBAAA,EAAA,YAAY;IACpD,OAAO,cAAM,OAAA,kBAAY,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,EAAnC,CAAmC,CAAC;AACnD,CAAC;AAED,SAAgB,QAAQ,CAAC,YAAoB,EAAE,MAAY;IAAZ,uBAAA,EAAA,YAAY;IACzD,OAAO,cAAM,OAAA,kBAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,EAAtD,CAAsD,CAAC;AACtE,CAAC"}
@@ -1,118 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { http } from 'msw';
11
- import { afterAll, afterEach, beforeAll, describe, expect, it } from 'vitest';
12
- import { Users, UserRole, CreateUserConflictError } from '../index';
13
- import { SDK_URL, USERS_URL, mockApiServer, okRes, errorRes, profileFixture, profileNoPhoneFixture, createUserWithMultiFixture, } from './mocks/index';
14
- function buildUsersInstance() {
15
- return new Users({
16
- token: 'test-token',
17
- usersUrl: USERS_URL,
18
- sdkUrl: SDK_URL,
19
- });
20
- }
21
- describe('Users API', () => {
22
- beforeAll(() => mockApiServer.listen());
23
- afterEach(() => mockApiServer.resetHandlers());
24
- afterAll(() => mockApiServer.close());
25
- describe('constructor', () => {
26
- it('initializes properly', () => __awaiter(void 0, void 0, void 0, function* () {
27
- const api = buildUsersInstance();
28
- expect(api.serviceUrl).toBe(USERS_URL);
29
- expect(api.sdkApi.serviceUrl).toBe(SDK_URL);
30
- }));
31
- it('throws error if usersUrl and discoveryUrl are not provided', () => {
32
- expect(() => {
33
- new Users({
34
- token: 'test-token',
35
- sdkUrl: SDK_URL,
36
- });
37
- }).toThrowErrorMatchingSnapshot();
38
- });
39
- });
40
- describe('getCurrentMultiUserProfile', () => {
41
- const url = `${SDK_URL}/user/multi-user`;
42
- it('should make correct the request via SdkApi', () => __awaiter(void 0, void 0, void 0, function* () {
43
- mockApiServer.use(http.get(url, okRes(profileFixture)));
44
- const api = buildUsersInstance();
45
- const res = yield api.getCurrentMultiUserProfile();
46
- expect(res).toEqual(profileFixture);
47
- }));
48
- it('should allow for empty phone number', () => __awaiter(void 0, void 0, void 0, function* () {
49
- mockApiServer.use(http.get(url, okRes(profileNoPhoneFixture)));
50
- const api = buildUsersInstance();
51
- const res = yield api.getCurrentMultiUserProfile();
52
- expect(res).toEqual(profileNoPhoneFixture);
53
- }));
54
- it('should return error message if API is not working', () => __awaiter(void 0, void 0, void 0, function* () {
55
- const testError = `Test error ${Date.now()}`;
56
- mockApiServer.use(http.get(url, errorRes(testError)));
57
- const api = buildUsersInstance();
58
- yield expect(api.getCurrentMultiUserProfile()).rejects.toThrow(testError);
59
- }));
60
- it('show throw error on invalid response', () => __awaiter(void 0, void 0, void 0, function* () {
61
- mockApiServer.use(http.get(url, okRes({ wrongResponse: true })));
62
- const api = buildUsersInstance();
63
- yield expect(api.getCurrentMultiUserProfile()).rejects.toThrowErrorMatchingSnapshot();
64
- }));
65
- it('show throw error on invalid response if validate = true', () => __awaiter(void 0, void 0, void 0, function* () {
66
- mockApiServer.use(http.get(url, okRes({ wrongResponse: true })));
67
- const api = buildUsersInstance();
68
- yield expect(api.getCurrentMultiUserProfile({ validate: true })).rejects.toThrowErrorMatchingSnapshot();
69
- }));
70
- it('show not throw error on invalid response if validate = false', () => __awaiter(void 0, void 0, void 0, function* () {
71
- mockApiServer.use(http.get(url, okRes({ wrongResponse: true })));
72
- const api = buildUsersInstance();
73
- const res = yield api.getCurrentMultiUserProfile({ validate: false });
74
- expect(res).toEqual({ wrongResponse: true });
75
- }));
76
- });
77
- describe('createUserWithMulti', () => {
78
- const url = `${SDK_URL}/accounts/undefined/multi-user/create-start`;
79
- it('should make correct the request via SdkApi', () => __awaiter(void 0, void 0, void 0, function* () {
80
- mockApiServer.use(http.post(url, okRes(createUserWithMultiFixture)));
81
- const userData = {
82
- role: UserRole.ADMIN,
83
- email: 'user@example.com',
84
- disableAt: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(),
85
- };
86
- const api = buildUsersInstance();
87
- const res = yield api.createUserWithMulti(userData);
88
- expect(res).toEqual(createUserWithMultiFixture);
89
- }));
90
- it('should throw CreateUserConflictError error if backend responds with 409', () => __awaiter(void 0, void 0, void 0, function* () {
91
- const testError = `Test error ${Date.now()}`;
92
- mockApiServer.use(http.post(url, errorRes(testError, 409)));
93
- const userData = {
94
- role: UserRole.ADMIN,
95
- email: 'user@example.com',
96
- disableAt: new Date(Date.now() + 1000 * 60 * 60 * 24).toISOString(),
97
- };
98
- const api = buildUsersInstance();
99
- try {
100
- yield api.createUserWithMulti(userData);
101
- }
102
- catch (error) {
103
- expect(error).toBeInstanceOf(CreateUserConflictError);
104
- expect(error.message).toBe(testError);
105
- }
106
- }));
107
- it('should throw error if expire time is in the past', () => __awaiter(void 0, void 0, void 0, function* () {
108
- const userData = {
109
- role: UserRole.ADMIN,
110
- email: 'user@example.com',
111
- disableAt: new Date(Date.now() - 1000 * 60 * 60 * 24).toISOString(),
112
- };
113
- const api = buildUsersInstance();
114
- yield expect(api.createUserWithMulti(userData)).rejects.toThrowErrorMatchingSnapshot();
115
- }));
116
- });
117
- });
118
- //# sourceMappingURL=Users.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Users.spec.js","sourceRoot":"","sources":["../../../src/__tests__/Users.spec.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAG9E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEpE,OAAO,EACL,OAAO,EACP,SAAS,EACT,aAAa,EACb,KAAK,EACL,QAAQ,EACR,cAAc,EACd,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AAEvB,SAAS,kBAAkB;IACzB,OAAO,IAAI,KAAK,CAAC;QACf,KAAK,EAAE,YAAY;QACnB,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,OAAO;KAChB,CAAC,CAAC;AACL,CAAC;AAED,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,SAAS,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC;IACxC,SAAS,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC;IAC/C,QAAQ,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC;IAEtC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QAC3B,EAAE,CAAC,sBAAsB,EAAE,GAAS,EAAE;YACpC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C;AACL,CAAC,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- export const createUserWithMultiFixture = {
2
- id: '06ae0b37-13e0-4880-91b7-382d4b56e1fa',
3
- username: 'test.user@example.com',
4
- data: {
5
- profile: {
6
- icon: 'https://cdn.example.com/profile.jpg',
7
- phoneNumber: '+12345678901',
8
- firstName: 'Test',
9
- lastName: 'User',
10
- },
11
- },
12
- };
13
- //# sourceMappingURL=create_user_with_multi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create_user_with_multi.js","sourceRoot":"","sources":["../../../../src/__tests__/mocks/create_user_with_multi.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,EAAE,EAAE,sCAAsC;IAC1C,QAAQ,EAAE,uBAAuB;IACjC,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,IAAI,EAAE,qCAAqC;YAC3C,WAAW,EAAE,cAAc;YAC3B,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,MAAM;SACjB;KACF;CACF,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './server';
2
- export * from './profile';
3
- export * from './create_user_with_multi';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/__tests__/mocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,0BAA0B,CAAC"}
@@ -1,25 +0,0 @@
1
- export const profileFixture = {
2
- id: '06ae0b37-13e0-4880-91b7-382d4b56e1fa',
3
- username: 'test.user@example.com',
4
- data: {
5
- profile: {
6
- icon: 'https://cdn.example.com/profile.jpg',
7
- phoneNumber: '+12345678901',
8
- firstName: 'Test',
9
- lastName: 'User',
10
- },
11
- },
12
- };
13
- export const profileNoPhoneFixture = {
14
- id: '06ae0b37-13e0-4880-91b7-382d4b56e1fa',
15
- username: 'test.user@example.com',
16
- data: {
17
- profile: {
18
- icon: 'https://cdn.example.com/profile.jpg',
19
- phoneNumber: '',
20
- firstName: 'Test',
21
- lastName: 'User',
22
- },
23
- },
24
- };
25
- //# sourceMappingURL=profile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../../../src/__tests__/mocks/profile.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,EAAE,EAAE,sCAAsC;IAC1C,QAAQ,EAAE,uBAAuB;IACjC,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,IAAI,EAAE,qCAAqC;YAC3C,WAAW,EAAE,cAAc;YAC3B,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,MAAM;SACjB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,EAAE,EAAE,sCAAsC;IAC1C,QAAQ,EAAE,uBAAuB;IACjC,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,IAAI,EAAE,qCAAqC;YAC3C,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,MAAM;SACjB;KACF;CACF,CAAC"}
@@ -1,12 +0,0 @@
1
- import { HttpResponse } from 'msw';
2
- import { setupServer } from 'msw/node';
3
- export const SDK_URL = 'https://sdkapi.url';
4
- export const USERS_URL = 'https://users.url';
5
- export const mockApiServer = setupServer();
6
- export function okRes(data, status = 200) {
7
- return () => HttpResponse.json(data, { status });
8
- }
9
- export function errorRes(errorMessage, status = 500) {
10
- return () => HttpResponse.json({ error: errorMessage }, { status });
11
- }
12
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../src/__tests__/mocks/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,MAAM,KAAK,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,CAAC,MAAM,OAAO,GAAG,oBAAoB,CAAC;AAC5C,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAAC;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,EAAE,CAAC;AAE3C,MAAM,UAAU,KAAK,CAAC,IAAkB,EAAE,MAAM,GAAG,GAAG;IACpD,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,YAAoB,EAAE,MAAM,GAAG,GAAG;IACzD,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AACtE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Users.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Users.spec.d.ts","sourceRoot":"","sources":["../../../src/__tests__/Users.spec.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- export declare const createUserWithMultiFixture: {
2
- id: string;
3
- username: string;
4
- data: {
5
- profile: {
6
- icon: string;
7
- phoneNumber: string;
8
- firstName: string;
9
- lastName: string;
10
- };
11
- };
12
- };
13
- //# sourceMappingURL=create_user_with_multi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create_user_with_multi.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/mocks/create_user_with_multi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B;;;;;;;;;;;CAWtC,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './server';
2
- export * from './profile';
3
- export * from './create_user_with_multi';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/mocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,0BAA0B,CAAC"}
@@ -1,25 +0,0 @@
1
- export declare const profileFixture: {
2
- id: string;
3
- username: string;
4
- data: {
5
- profile: {
6
- icon: string;
7
- phoneNumber: string;
8
- firstName: string;
9
- lastName: string;
10
- };
11
- };
12
- };
13
- export declare const profileNoPhoneFixture: {
14
- id: string;
15
- username: string;
16
- data: {
17
- profile: {
18
- icon: string;
19
- phoneNumber: string;
20
- firstName: string;
21
- lastName: string;
22
- };
23
- };
24
- };
25
- //# sourceMappingURL=profile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/mocks/profile.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;;;;;;CAW1B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;CAWjC,CAAC"}
@@ -1,7 +0,0 @@
1
- import { HttpResponse, JsonBodyType } from 'msw';
2
- export declare const SDK_URL = "https://sdkapi.url";
3
- export declare const USERS_URL = "https://users.url";
4
- export declare const mockApiServer: import("msw/lib/node").SetupServerApi;
5
- export declare function okRes(data: JsonBodyType, status?: number): () => HttpResponse<JsonBodyType>;
6
- export declare function errorRes(errorMessage: string, status?: number): () => HttpResponse<JsonBodyType>;
7
- //# sourceMappingURL=server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/mocks/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AAGjD,eAAO,MAAM,OAAO,uBAAuB,CAAC;AAC5C,eAAO,MAAM,SAAS,sBAAsB,CAAC;AAE7C,eAAO,MAAM,aAAa,uCAAgB,CAAC;AAE3C,wBAAgB,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,SAAM,oCAErD;AAED,wBAAgB,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,SAAM,oCAE1D"}