@or-sdk/settings 0.25.10-beta.4281.0 → 0.26.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 +9 -0
- package/README.md +46 -2
- package/dist/types/Settings.d.ts +110 -0
- package/dist/types/Settings.d.ts.map +1 -1
- package/dist/types/types.d.ts +9 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +21 -14
- package/tsconfig.dev.json +0 -8
- package/tsconfig.esm.json +0 -12
- package/tsconfig.json +0 -7
- package/tsconfig.types.json +0 -11
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
|
+
## [0.26.0](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/settings@0.25.9...@or-sdk/settings@0.26.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
|
## [0.25.9](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/settings@0.25.5...@or-sdk/settings@0.25.9) (2026-08-04)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @or-sdk/settings
|
package/README.md
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
# `@or-sdk/settings`
|
|
2
|
+
|
|
3
|
+
OneReach SDK client for Settings.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Use this package when integrating with the Settings 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/settings
|
|
4
18
|
```
|
|
5
19
|
|
|
6
|
-
## Usage
|
|
20
|
+
## Usage
|
|
7
21
|
```typescript
|
|
8
22
|
import { Settings } from '@or-sdk/settings'
|
|
9
23
|
|
|
@@ -19,3 +33,33 @@ const settings = new Settings({
|
|
|
19
33
|
discoveryUrl: 'http://example.discovery/endpoint'
|
|
20
34
|
});
|
|
21
35
|
```
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
- Prefer `sdkUrl` when the service URL is known; it avoids a discovery request.
|
|
40
|
+
- Use `discoveryUrl` only when the service URL is not available.
|
|
41
|
+
- Provide `token` as a bearer-token string or getter where supported.
|
|
42
|
+
|
|
43
|
+
## Common pitfalls
|
|
44
|
+
|
|
45
|
+
- Keep the client token current when it can expire; a token getter is preferable where the constructor accepts one.
|
|
46
|
+
- Treat the generated TypeScript types as the authoritative contract for optional parameters and response shapes.
|
|
47
|
+
|
|
48
|
+
## Method map
|
|
49
|
+
|
|
50
|
+
| Method | Purpose |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `init(...)` | See the exported TypeScript signature for parameters and result. |
|
|
53
|
+
| `getRoleSettings(...)` | See the exported TypeScript signature for parameters and result. |
|
|
54
|
+
| `setRoleSettings(...)` | See the exported TypeScript signature for parameters and result. |
|
|
55
|
+
| `getAccountSettings(...)` | See the exported TypeScript signature for parameters and result. |
|
|
56
|
+
| `getUserSettings(...)` | See the exported TypeScript signature for parameters and result. |
|
|
57
|
+
| `getMergedSettings(...)` | See the exported TypeScript signature for parameters and result. |
|
|
58
|
+
| `setAccountSettings(...)` | See the exported TypeScript signature for parameters and result. |
|
|
59
|
+
| `setUserSettings(...)` | See the exported TypeScript signature for parameters and result. |
|
|
60
|
+
| `deleteAccountSettings(...)` | See the exported TypeScript signature for parameters and result. |
|
|
61
|
+
| `deleteUserSettings(...)` | See the exported TypeScript signature for parameters and result. |
|
|
62
|
+
|
|
63
|
+
## More detail
|
|
64
|
+
|
|
65
|
+
Full signatures and exported types are available in `src/` and `dist/types/`.
|
package/dist/types/Settings.d.ts
CHANGED
|
@@ -6,14 +6,124 @@ export declare class Settings {
|
|
|
6
6
|
private accountSettingsRoute;
|
|
7
7
|
private userSettingsRoute;
|
|
8
8
|
private mergedSettingsRoute;
|
|
9
|
+
/**
|
|
10
|
+
* Get role settings
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const result = await instance.getRoleSettings({
|
|
13
|
+
* role: 'ROLE',
|
|
14
|
+
* payload: {
|
|
15
|
+
* accountId: 'account-id',
|
|
16
|
+
* userId: 'user-id',
|
|
17
|
+
* key: 'key',
|
|
18
|
+
* }
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
9
22
|
getRoleSettings(role: string, payload: RoleRouteGetPayload, ...rest: unknown[]): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Set role settings
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const result = await instance.setRoleSettings({
|
|
27
|
+
* role: 'ROLE',
|
|
28
|
+
* payload: {
|
|
29
|
+
* accountId: 'account-id',
|
|
30
|
+
* userId: 'user-id',
|
|
31
|
+
* key: 'key',
|
|
32
|
+
* value: value
|
|
33
|
+
* }
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
10
37
|
setRoleSettings(role: string, payload: RoleRouteParamsSetPayload, ...rest: unknown[]): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* Get account settings
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const result = await instance.getAccountSettings({
|
|
42
|
+
* payload: {
|
|
43
|
+
* accountId: 'account-id',
|
|
44
|
+
* key: 'key',
|
|
45
|
+
* }
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
11
49
|
getAccountSettings({ accountId, key }: AccountRouteGetPayload, ...rest: unknown[]): Promise<any>;
|
|
50
|
+
/**
|
|
51
|
+
* Get user settings
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const result = await instance.getUserSettings({
|
|
54
|
+
* payload: {
|
|
55
|
+
* accountId: 'account-id',
|
|
56
|
+
* userId: 'user-id',
|
|
57
|
+
* key: 'key',
|
|
58
|
+
* }
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
12
62
|
getUserSettings({ accountId, userId, key }: UserRouteGetPayload, ...rest: unknown[]): Promise<any>;
|
|
63
|
+
/**
|
|
64
|
+
* Get merged settings
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const result = await instance.getMergedSettings({
|
|
67
|
+
* payload: {
|
|
68
|
+
* accountId: 'account-id',
|
|
69
|
+
* userId: 'user-id',
|
|
70
|
+
* key: 'key',
|
|
71
|
+
* }
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
13
75
|
getMergedSettings({ accountId, userId, key }: MergedRouteGetPayload): Promise<any>;
|
|
76
|
+
/**
|
|
77
|
+
* Set account settings
|
|
78
|
+
* ```typescript
|
|
79
|
+
* const result = await instance.setAccountSettings({
|
|
80
|
+
* payload: {
|
|
81
|
+
* accountId: 'account-id',
|
|
82
|
+
* key: 'key',
|
|
83
|
+
* value: value
|
|
84
|
+
* }
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
14
88
|
setAccountSettings({ accountId, key, value }: AccountRouteSetPayload, ...rest: unknown[]): Promise<any>;
|
|
89
|
+
/**
|
|
90
|
+
* Set user settings
|
|
91
|
+
* ```typescript
|
|
92
|
+
* const result = await instance.setUserSettings({
|
|
93
|
+
* payload: {
|
|
94
|
+
* accountId: 'account-id',
|
|
95
|
+
* userId: 'user-id',
|
|
96
|
+
* key: 'key',
|
|
97
|
+
* value: value
|
|
98
|
+
* }
|
|
99
|
+
* });
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
15
102
|
setUserSettings({ accountId, userId, key, value, }: UserRouteSetPayload, ...rest: unknown[]): Promise<any>;
|
|
103
|
+
/**
|
|
104
|
+
* Delete account settings
|
|
105
|
+
* ```typescript
|
|
106
|
+
* const result = await instance.deleteAccountSettings({
|
|
107
|
+
* payload: {
|
|
108
|
+
* accountId: 'account-id',
|
|
109
|
+
* key: 'key',
|
|
110
|
+
* }
|
|
111
|
+
* });
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
16
114
|
deleteAccountSettings({ accountId, key }: AccountRouteDeletePayload): Promise<any>;
|
|
115
|
+
/**
|
|
116
|
+
* Delete user settings
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const result = await instance.deleteUserSettings({
|
|
119
|
+
* payload: {
|
|
120
|
+
* accountId: 'account-id',
|
|
121
|
+
* userId: 'user-id',
|
|
122
|
+
* key: 'key',
|
|
123
|
+
* }
|
|
124
|
+
* });
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
17
127
|
deleteUserSettings({ accountId, userId, key }: UserRouteDeletePayload): Promise<any>;
|
|
18
128
|
}
|
|
19
129
|
//# sourceMappingURL=Settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../src/Settings.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,MAAM,EAAE,cAAc;IAU5B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAG3B,O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E,MAAM,EAAE,GAAG,EAAE,EAAE,qBAAqB,GAAG,OAAO,CAAC,GAAG,CAAC;IAa/F;;;;;;;;;;;OAWG;IACU,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,sBAAsB,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAapH;;;;;;;;;;;;OAYG;IACU,eAAe,CAC1B,EACE,SAAS,EACT,MAAM,EACN,GAAG,EACH,KAAK,GACN,EAAE,mBAAmB,EACtB,GAAG,IAAI,EAAE,OAAO,EAAE,GACjB,OAAO,CAAC,GAAG,CAAC;IAcf;;;;;;;;;;OAUG;IACU,qBAAqB,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,yBAAyB,GAAG,OAAO,CAAC,GAAG,CAAC;IAU/F;;;;;;;;;;;OAWG;IACU,kBAAkB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC;CAUlG"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { Token } from '@or-sdk/base';
|
|
2
2
|
export type SettingsConfig = {
|
|
3
|
+
/**
|
|
4
|
+
* token
|
|
5
|
+
*/
|
|
3
6
|
token: Token;
|
|
7
|
+
/**
|
|
8
|
+
* Url of OneReach service discovery api
|
|
9
|
+
*/
|
|
4
10
|
discoveryUrl?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Url of OneReach SDK api
|
|
13
|
+
*/
|
|
5
14
|
sdkUrl?: string;
|
|
6
15
|
};
|
|
7
16
|
export type AccountRouteGetPayload = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,MAAM,MAAM,cAAc,GAAG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G,EAAE,MAAM,CAAC;CACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/settings",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1-beta.4282.0",
|
|
4
|
+
"description": "OneReach SDK client for Settings",
|
|
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
|
+
"@or-sdk/base": "^0.44.8-beta.4282.0",
|
|
17
|
+
"@or-sdk/sdk-api": "^0.30.1-beta.4282.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"concurrently": "^9.2.0",
|
|
21
|
+
"typescript": "^5.6.2"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
8
26
|
"scripts": {
|
|
9
|
-
"build": "
|
|
27
|
+
"build": "concurrently 'pnpm:build:*(!watch)'",
|
|
10
28
|
"build:cjs": "tsc --project tsconfig.json",
|
|
11
29
|
"build:esm": "tsc --project tsconfig.esm.json",
|
|
12
30
|
"build:types": "tsc --project tsconfig.types.json",
|
|
@@ -16,16 +34,5 @@
|
|
|
16
34
|
"build:watch:types": "tsc --project tsconfig.types.json -w",
|
|
17
35
|
"clean": "rm -rf ./dist",
|
|
18
36
|
"dev": "pnpm build:watch:esm"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@or-sdk/base": "^0.44.7",
|
|
22
|
-
"@or-sdk/sdk-api": "^0.29.6-beta.4281.0"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"concurrently": "9.0.1",
|
|
26
|
-
"typescript": "5.6.2"
|
|
27
|
-
},
|
|
28
|
-
"publishConfig": {
|
|
29
|
-
"access": "public"
|
|
30
37
|
}
|
|
31
|
-
}
|
|
38
|
+
}
|
package/tsconfig.dev.json
DELETED
package/tsconfig.esm.json
DELETED
package/tsconfig.json
DELETED
package/tsconfig.types.json
DELETED