@or-sdk/users 3.8.6-beta.4281.0 → 3.9.1-beta.4282.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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.9.0](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/users@3.8.5...@or-sdk/users@3.9.0) (2026-08-05)
7
+
8
+
9
+ ### Features
10
+
11
+ * **packages:** add package descriptions and published files metadata ([801f823](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/commit/801f823034717ef8b961405a73d51ebc2ec07649))
12
+
13
+
14
+
6
15
  ## [3.8.5](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/users@3.8.0...@or-sdk/users@3.8.5) (2026-08-04)
7
16
 
8
17
  **Note:** Version bump only for package @or-sdk/users
package/README.md CHANGED
@@ -1,9 +1,23 @@
1
- ## Installation:
1
+ # `@or-sdk/users`
2
+
3
+ OneReach SDK client for Users.
4
+
5
+ ## When to use
6
+
7
+ - Use this package when integrating with the Users capability on the OneReach platform.
8
+ - Use its typed client and exported models instead of hand-writing requests to that service.
9
+
10
+ ## When not to use
11
+
12
+ - Do not use it for a different platform capability; choose the dedicated `@or-sdk/*` package instead.
13
+ - Do not use it for generic third-party HTTP calls.
14
+
15
+ ## Installation
2
16
  ```
3
17
  $ npm i @or-sdk/users
4
18
  ```
5
19
 
6
- ## Usage:
20
+ ## Usage
7
21
  ```typescript
8
22
  import { Users } from '@or-sdk/users'
9
23
 
@@ -20,3 +34,69 @@ const users = new Users({
20
34
  discoveryUrl: 'http://example.discovery/endpoint'
21
35
  });
22
36
  ```
37
+
38
+ ## Configuration
39
+
40
+ - Prefer `sdkUrl` when the service URL is known; it avoids a discovery request.
41
+ - Use `discoveryUrl` only when the service URL is not available.
42
+ - Provide `token` as a bearer-token string or getter where supported.
43
+
44
+ ## Common pitfalls
45
+
46
+ - Keep the client token current when it can expire; a token getter is preferable where the constructor accepts one.
47
+ - Treat the generated TypeScript types as the authoritative contract for optional parameters and response shapes.
48
+
49
+ ## Common workflows
50
+
51
+ ```typescript
52
+ const page = await users.listUsers({ from: 0, size: 50, orderProperty: 'email' });
53
+ const user = await users.getUserById('user-id', ['email', 'name']);
54
+ await users.disableUser(user.id);
55
+ ```
56
+
57
+ Use `getCurrentUser` for the identity represented by the token. `listAccounts` is restricted
58
+ to super administrators; cross-account operations require the corresponding SDK configuration
59
+ and authorization.
60
+
61
+ ## Complete API reference
62
+
63
+ All public methods below are taken from the package source. Parameter and return types use the exported TypeScript names; import the corresponding types from this package when constructing requests.
64
+
65
+ | Method | Returns | Purpose |
66
+ |---|---|---|
67
+ | `makeRequest(params: CalApiParams)` | `Promise<T>` | See the exported TypeScript signature for behavior and constraints. |
68
+ | `listUsers(params = {} as ListUsersParams)` | `Promise<ListUsersResult>` | List users in account |
69
+ | `getUserById(userId: GetUserByIdParams['userId'], projection: GetUserByIdParams['projection'])` | `Promise<User>` | Get account user by Id |
70
+ | `getCurrentMultiUserProfile({ validate }: ValidateParams = { validate: true })` | `Promise<CurrentMultiUserProfile>` | Get multi-user profile using user token |
71
+ | `getAccountInfo()` | `Promise<AccountItem>` | Get account info based on given token |
72
+ | `listAccountProfiles()` | `Promise<ListAccountProfilesResult>` | List account multi-user profiles |
73
+ | `listProfiles(params: ListProfilesParams)` | `Promise<ListProfilesResult>` | List profiles with ability for partial match by email, username or match by id. |
74
+ | `listUsersAdvanced(params: ListUsersAdvancedParams)` | `Promise<UserAdvanced[]>` | List users with profile information |
75
+ | `getProfileByEmail(email: string)` | `Promise<AccountProfile>` | Get profile by email |
76
+ | `getProfileById(profileId: string)` | `Promise<Profile>` | Get multi-user profile by Id |
77
+ | `getProfile()` | `Promise<Profile>` | Get profile |
78
+ | `attachProfile(params: AttachParams)` | `Promise<AttachResult>` | Attach profile. |
79
+ | `listProfileUsers()` | `Promise<List<ProfileUserItem>>` | List profiles users. |
80
+ | `getCurrentUser()` | `Promise<TokenData>` | Get current user |
81
+ | `getUserEmail(userId?: string)` | `Promise<{ email: string; }>` | Get profile email if exists or user email |
82
+ | `deleteUser(userId: string, accountId?: string)` | `Promise<void>` | Delete a user from account |
83
+ | `updateUser(userId: string, user: UpdateUserParam, accountId?: string)` | `Promise<void>` | Update user |
84
+ | `requestForceChangePassword(userId: string, multi?: boolean)` | `Promise<void>` | Request force change password for user |
85
+ | `disableUser(userId: string, accountId?: string)` | `Promise<void>` | Disable user |
86
+ | `enableUser(userId: string, accountId?: string)` | `Promise<void>` | Enable user |
87
+ | `createUserWithMulti(userData: CreateUserWithMultData, accountId = this.targetAccountId)` | `Promise<CreateUserWithMultResult>` | Initiate the creation of the multi-user |
88
+ | `userListProfileAccounts()` | `Promise<ProfileAccountItem[]>` | List accounts by profile |
89
+ | `listAccounts(params: ListAccountsParams = {})` | `Promise<ListAccountsResult>` | List accounts (super admin only) |
90
+ | `upsertMultiUser(params: UpsertMultiUserParams)` | `Promise<UpsertMultiUserResult>` | Upsert multi-user. |
91
+
92
+ ## More detail
93
+
94
+ Full signatures and exported types are available in `src/` and `dist/types/`.
95
+
96
+
97
+ ## Exported utility reference
98
+
99
+ | Function | Returns | Purpose |
100
+ |---|---|---|
101
+ | `okRes(data: JsonBodyType, status = 200)` | `unknown` | Exported utility; see its TypeScript signature for behavior. |
102
+ | `errorRes(errorMessage: string, status = 500)` | `unknown` | Exported utility; see its TypeScript signature for behavior. |
package/package.json CHANGED
@@ -1,12 +1,35 @@
1
1
  {
2
2
  "name": "@or-sdk/users",
3
- "version": "3.8.6-beta.4281.0",
3
+ "version": "3.9.1-beta.4282.0",
4
+ "description": "OneReach SDK client for Users",
4
5
  "license": "Apache-2.0",
5
6
  "main": "dist/cjs/index.js",
6
7
  "module": "dist/esm/index.js",
7
8
  "types": "dist/types/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "src",
12
+ "README.md",
13
+ "CHANGELOG.md"
14
+ ],
15
+ "dependencies": {
16
+ "validator": "^13.15.23",
17
+ "zod": "^3.24.4",
18
+ "@or-sdk/base": "^0.44.8-beta.4282.0",
19
+ "@or-sdk/sdk-api": "^0.30.1-beta.4282.0"
20
+ },
21
+ "devDependencies": {
22
+ "@types/validator": "^13.12.0",
23
+ "concurrently": "^9.2.0",
24
+ "msw": "^2.11.3",
25
+ "typescript": "^5.6.2",
26
+ "vitest": "^4.1.10"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
8
31
  "scripts": {
9
- "build": "pnpm clean && concurrently 'npm:build:*(!watch)'",
32
+ "build": "concurrently 'npm:build:*(!watch)'",
10
33
  "build:cjs": "tsc --project tsconfig.json",
11
34
  "build:esm": "tsc --project tsconfig.esm.json",
12
35
  "build:types": "tsc --project tsconfig.types.json",
@@ -18,20 +41,5 @@
18
41
  "dev": "pnpm build:watch:esm",
19
42
  "test": "vitest",
20
43
  "test:watch": "vitest --watch"
21
- },
22
- "dependencies": {
23
- "@or-sdk/base": "^0.44.7",
24
- "@or-sdk/sdk-api": "^0.29.6-beta.4281.0",
25
- "validator": "^13.15.23",
26
- "zod": "^3.24.4"
27
- },
28
- "devDependencies": {
29
- "@types/validator": "^13.11.8",
30
- "concurrently": "9.0.1",
31
- "msw": "^2.8.2",
32
- "typescript": "5.6.2"
33
- },
34
- "publishConfig": {
35
- "access": "public"
36
44
  }
37
- }
45
+ }
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "rootDir": "./src"
5
- },
6
- "exclude": [
7
- "./src/__tests__"
8
- ]
9
- }
package/tsconfig.dev.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.esm.json",
3
- "compilerOptions": {
4
- "declarationDir": "./dist/types",
5
- "declaration": true
6
- }
7
- }
package/tsconfig.esm.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "./tsconfig.build.json",
3
- "compilerOptions": {
4
- "outDir": "./dist/esm",
5
- "declarationDir": "./dist/types",
6
- "module": "ES6",
7
- "target": "es6",
8
- "declaration": true,
9
- "declarationMap": true
10
- }
11
- }
package/tsconfig.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "./tsconfig.build.json",
3
- "compilerOptions": {
4
- "outDir": "./dist/cjs"
5
- }
6
- }
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig.build.json",
3
- "compilerOptions": {
4
- "outDir": "./dist/types",
5
- "declaration": true,
6
- "declarationMap": true,
7
- "emitDeclarationOnly": true,
8
- "removeComments": false
9
- }
10
- }
package/vitest.config.mjs DELETED
@@ -1,25 +0,0 @@
1
- import { defineConfig } from 'vitest/config';
2
-
3
- export default defineConfig({
4
- test: {
5
- reporters: ['junit', 'default'],
6
- outputFile: 'test-results/junit.xml',
7
- include: ['src/**/*.{test,spec}.ts'],
8
- exclude: ['dist/**'],
9
- coverage: {
10
- reporter: ['text', 'json', 'html', 'cobertura', 'text-summary'],
11
- clean: true,
12
- include: [
13
- 'src/**',
14
- ],
15
- exclude: [
16
- 'src/types.ts',
17
- '**/*.spec.ts',
18
- ],
19
- },
20
- globals: true,
21
- environment: 'node',
22
- clearMocks: true,
23
- watch: false,
24
- },
25
- });