@clidey/whodb-sdk 0.127.3 → 0.129.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/dist/client.d.ts +1 -1
- package/dist/client.js +21 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare class WhoDB {
|
|
|
19
19
|
/** SHA-256 of the platform manifest this SDK release was generated from. */
|
|
20
20
|
static readonly manifestHash = "3cc0e6ed8d6e928e57d0acaec664df395c36307c8425124270d4a4efa7bfb7a7";
|
|
21
21
|
/** This SDK package's version. */
|
|
22
|
-
static readonly version = "0.
|
|
22
|
+
static readonly version = "0.129.0";
|
|
23
23
|
private readonly transport;
|
|
24
24
|
private readonly httpTransport;
|
|
25
25
|
private readonly filesHandle;
|
package/dist/client.js
CHANGED
|
@@ -8,7 +8,26 @@ import { FilesHandle } from './files.js';
|
|
|
8
8
|
import * as ops from './generated/operations.js';
|
|
9
9
|
import { manifestHash } from './generated/manifest.js';
|
|
10
10
|
import { ValidationError } from './errors.js';
|
|
11
|
+
import { interpretServerError } from './manifest-check.js';
|
|
11
12
|
import { SDK_VERSION } from './version.js';
|
|
13
|
+
/**
|
|
14
|
+
* Wraps a transport so server "unknown operation" rejections surface as the
|
|
15
|
+
* actionable WhoDBVersionError instead of a raw validation error.
|
|
16
|
+
*/
|
|
17
|
+
class InterpretingTransport {
|
|
18
|
+
inner;
|
|
19
|
+
constructor(inner) {
|
|
20
|
+
this.inner = inner;
|
|
21
|
+
}
|
|
22
|
+
async execute(operationName, document, variables) {
|
|
23
|
+
try {
|
|
24
|
+
return await this.inner.execute(operationName, document, variables);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw interpretServerError(error, SDK_VERSION);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
12
31
|
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
13
32
|
/**
|
|
14
33
|
* WhoDB is the platform client. Configure with an API key (headless), a raw
|
|
@@ -46,7 +65,7 @@ export class WhoDB {
|
|
|
46
65
|
if (transportOverride) {
|
|
47
66
|
// Custom transports (IPC in the functions runtime, mocks in tests) skip
|
|
48
67
|
// slug resolution: org/project inputs are taken as IDs verbatim.
|
|
49
|
-
this.transport = transportOverride;
|
|
68
|
+
this.transport = new InterpretingTransport(transportOverride);
|
|
50
69
|
this.httpTransport = null;
|
|
51
70
|
this.filesHandle = null;
|
|
52
71
|
this.skipWorkspaceResolution = true;
|
|
@@ -54,7 +73,7 @@ export class WhoDB {
|
|
|
54
73
|
}
|
|
55
74
|
const host = resolved.host ?? DEFAULT_HOST;
|
|
56
75
|
const httpTransport = new HttpTransport({ host, credentials: resolved.credentials });
|
|
57
|
-
this.transport = httpTransport;
|
|
76
|
+
this.transport = new InterpretingTransport(httpTransport);
|
|
58
77
|
this.httpTransport = httpTransport;
|
|
59
78
|
this.filesHandle = new FilesHandle({
|
|
60
79
|
host,
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clidey/whodb-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.129.0",
|
|
4
4
|
"description": "Official WhoDB platform SDK — ontology, datasets, and sources as in-code function APIs",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"directory": "sdk/packages/typescript"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "
|
|
32
|
+
"@types/node": "26.5.0",
|
|
33
33
|
"typescript": "6.0.3"
|
|
34
34
|
}
|
|
35
35
|
}
|