@or-sdk/knowledge-models 0.25.9-beta.4273.0 → 0.25.9-beta.4274.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/README.md +47 -2
- package/package.json +20 -13
- package/src/KnowledgeModels.ts +1 -1
- package/tsconfig.dev.json +0 -8
- package/tsconfig.esm.json +0 -12
- package/tsconfig.json +0 -7
- package/tsconfig.types.json +0 -11
package/README.md
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
# `@or-sdk/knowledge-models`
|
|
2
|
+
|
|
3
|
+
OneReach SDK client for Knowledge Models.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Use this package when integrating with the Knowledge Models 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/knowledge-models
|
|
4
18
|
```
|
|
5
19
|
|
|
6
|
-
## Usage
|
|
20
|
+
## Usage
|
|
7
21
|
```typescript
|
|
8
22
|
import { KnowledgeModels } from '@or-sdk/knowledge-models'
|
|
9
23
|
|
|
@@ -19,3 +33,34 @@ const knowledgeModels = new KnowledgeModels({
|
|
|
19
33
|
discoveryUrl: 'http://example.discovery/endpoint'
|
|
20
34
|
});
|
|
21
35
|
```
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
- Prefer `nluUrl` 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
|
+
| `listKnowledgeModels(...)` | See the exported TypeScript signature for parameters and result. |
|
|
53
|
+
| `getKnowledgeModel(...)` | See the exported TypeScript signature for parameters and result. |
|
|
54
|
+
| `createKnowledgeModel(...)` | See the exported TypeScript signature for parameters and result. |
|
|
55
|
+
| `updateKnowledgeModel(...)` | See the exported TypeScript signature for parameters and result. |
|
|
56
|
+
| `getLimitsIndex(...)` | See the exported TypeScript signature for parameters and result. |
|
|
57
|
+
| `getLimits(...)` | See the exported TypeScript signature for parameters and result. |
|
|
58
|
+
| `postLimits(...)` | See the exported TypeScript signature for parameters and result. |
|
|
59
|
+
| `listPrebuiltEntities(...)` | See the exported TypeScript signature for parameters and result. |
|
|
60
|
+
| `listEntities(...)` | See the exported TypeScript signature for parameters and result. |
|
|
61
|
+
| `listFeatures(...)` | See the exported TypeScript signature for parameters and result. |
|
|
62
|
+
| `listApplications(...)` | See the exported TypeScript signature for parameters and result. |
|
|
63
|
+
|
|
64
|
+
## More detail
|
|
65
|
+
|
|
66
|
+
Full signatures and exported types are available in `src/` and `dist/types/`.
|
package/package.json
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/knowledge-models",
|
|
3
|
-
"version": "0.25.9-beta.
|
|
3
|
+
"version": "0.25.9-beta.4274.0",
|
|
4
|
+
"description": "OneReach SDK client for Knowledge Models",
|
|
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",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
"publishConfig": {
|
|
16
|
-
"access": "public"
|
|
17
|
-
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"src",
|
|
12
|
+
"README.md",
|
|
13
|
+
"CHANGELOG.md"
|
|
14
|
+
],
|
|
18
15
|
"scripts": {
|
|
19
|
-
"build": "concurrently 'pnpm:build:*(!watch)'",
|
|
16
|
+
"build": "pnpm clean && concurrently 'pnpm:build:*(!watch)'",
|
|
20
17
|
"build:cjs": "tsc --project tsconfig.json",
|
|
21
18
|
"build:esm": "tsc --project tsconfig.esm.json",
|
|
22
19
|
"build:types": "tsc --project tsconfig.types.json",
|
|
@@ -26,5 +23,15 @@
|
|
|
26
23
|
"build:watch:types": "tsc --project tsconfig.types.json -w",
|
|
27
24
|
"clean": "rm -rf ./dist",
|
|
28
25
|
"dev": "pnpm build:watch:esm"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@or-sdk/base": "^0.44.7"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"concurrently": "9.0.1",
|
|
32
|
+
"typescript": "5.6.2"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
29
36
|
}
|
|
30
|
-
}
|
|
37
|
+
}
|
package/src/KnowledgeModels.ts
CHANGED
|
@@ -48,7 +48,7 @@ export class KnowledgeModels extends Base {
|
|
|
48
48
|
private async getFullList<T>(
|
|
49
49
|
method: CalApiParams['method'],
|
|
50
50
|
route: string,
|
|
51
|
-
queryParams: { [key: string]: unknown; } = {}
|
|
51
|
+
queryParams: { [key: string]: unknown; } = {}
|
|
52
52
|
): Promise<List<T>> {
|
|
53
53
|
const params = {
|
|
54
54
|
...queryParams,
|
package/tsconfig.dev.json
DELETED
package/tsconfig.esm.json
DELETED
package/tsconfig.json
DELETED
package/tsconfig.types.json
DELETED