@owlmeans/api 0.1.18-rc.44 → 0.1.18-rc.45
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
CHANGED
|
@@ -12,7 +12,7 @@ HTTP API client service for OwlMeans client contexts — carries entrypoint call
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
bun add @owlmeans/api@^0.1.18-rc.
|
|
15
|
+
bun add @owlmeans/api@^0.1.18-rc.45
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
@@ -73,7 +73,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
73
73
|
your project's skill store (`.agents/skills/`):
|
|
74
74
|
|
|
75
75
|
```sh
|
|
76
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
76
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.47
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/api",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"version": "0.1.18-rc.45",
|
|
5
|
+
"generatedAt": "2026-10-03T20:05:07.613Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/utils/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAM1C,OAAO,EAAE,cAAc,EAAuD,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/utils/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAM1C,OAAO,EAAE,cAAc,EAAuD,MAAM,cAAc,CAAA;AAOlG,eAAO,MAAM,eAAe,aAAc,aAAa,SAAS,gBAAgB,CAAC,GAAG,CAAC,SAqBpF,CAAA;AAkCD;;;;GAIG;AACH,eAAO,MAAM,WAAW,WAAY,MAAM,eAAe,MAAM,KAAG,cAUjE,CAAA"}
|
package/build/utils/handler.js
CHANGED
|
@@ -3,6 +3,8 @@ import { ACCEPTED, CREATED, FINISHED, FORBIDDEN_ERROR, INCIDENT_ID_HEADER, DENIA
|
|
|
3
3
|
import { ResilientError } from '@owlmeans/error';
|
|
4
4
|
import { ApiClientError, ApiStatusError, ServerAuthError, ServerCrashedError } from '../errors.js';
|
|
5
5
|
import { isIncidentBody } from '../status/index.js';
|
|
6
|
+
import { logger } from '@owlmeans/log';
|
|
7
|
+
const log = logger('api');
|
|
6
8
|
export const processResponse = (response, reply) => {
|
|
7
9
|
switch (response.status) {
|
|
8
10
|
case OK:
|
|
@@ -16,9 +18,11 @@ export const processResponse = (response, reply) => {
|
|
|
16
18
|
case FINISHED:
|
|
17
19
|
return processEmptyResponse(response, reply, EntrypointOutcome.Finished);
|
|
18
20
|
default:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
// A refusal is ordinary traffic (401, 403, 409, 428): debug, and never the headers.
|
|
22
|
+
log.debug('Request answered with a failure', {
|
|
23
|
+
status: response.status, statusText: response.statusText, url: response.config?.url,
|
|
24
|
+
incidentId: headerOf(response.headers, INCIDENT_ID_HEADER),
|
|
25
|
+
});
|
|
22
26
|
reply.reject(failureOf(response));
|
|
23
27
|
}
|
|
24
28
|
};
|
|
@@ -46,7 +50,7 @@ const failureOf = (response) => {
|
|
|
46
50
|
return error;
|
|
47
51
|
}
|
|
48
52
|
catch {
|
|
49
|
-
|
|
53
|
+
log.warn('Server returned an unrecognizable text error', { status: response.status, body: response.data });
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
return Object.assign(statusError(response.status, incidentId), { denialKind });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/utils/handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,EACL,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EACpF,kBAAkB,EAAE,EAAE,EAAE,YAAY,EAAE,kBAAkB,GACzD,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/utils/handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,EACL,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EACpF,kBAAkB,EAAE,EAAE,EAAE,YAAY,EAAE,kBAAkB,GACzD,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,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,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACpF,CAAC,CAAA;AAED,MAAM,oBAAoB,GAAG,CAAC,QAAuB,EAAE,KAA4B,EAAE,OAA0B,EAAE,EAAE;IACjH,IAAI,QAAQ,CAAC,IAAI,IAAI,IAAI,IAAI,QAAQ,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;QACjD,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QACrC,OAAM;IACR,CAAC;IACD,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,IAAI,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;QACrF,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,CAAA;QACjD,OAAM;IACR,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AAC1C,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/api",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.45",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -29,20 +29,21 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@owlmeans/auth-common": "^0.1.18-rc.
|
|
33
|
-
"@owlmeans/client-config": "^0.1.18-rc.
|
|
34
|
-
"@owlmeans/client-route": "^0.1.18-rc.
|
|
35
|
-
"@owlmeans/config": "^0.1.18-rc.
|
|
32
|
+
"@owlmeans/auth-common": "^0.1.18-rc.45",
|
|
33
|
+
"@owlmeans/client-config": "^0.1.18-rc.42",
|
|
34
|
+
"@owlmeans/client-route": "^0.1.18-rc.46",
|
|
35
|
+
"@owlmeans/config": "^0.1.18-rc.42",
|
|
36
36
|
"@owlmeans/context": "^0.1.18-rc.32",
|
|
37
|
-
"@owlmeans/error": "^0.1.18-rc.36",
|
|
38
37
|
"@owlmeans/entrypoint": "^0.1.18-rc.39",
|
|
38
|
+
"@owlmeans/error": "^0.1.18-rc.36",
|
|
39
|
+
"@owlmeans/log": "^0.1.18-rc.0",
|
|
39
40
|
"@owlmeans/route": "^0.1.18-rc.33",
|
|
40
41
|
"axios": "^1.7.7",
|
|
41
42
|
"qs": "^6.13.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@owlmeans/dep-config": "workspace:*",
|
|
45
|
-
"@owlmeans/resource": "^0.1.18-rc.
|
|
46
|
+
"@owlmeans/resource": "^0.1.18-rc.38",
|
|
46
47
|
"@types/qs": "^6.9.16",
|
|
47
48
|
"nodemon": "^3.1.14",
|
|
48
49
|
"typescript": "^7.0.2"
|
package/src/utils/handler.ts
CHANGED
|
@@ -9,6 +9,9 @@ import { ResilientError } from '@owlmeans/error'
|
|
|
9
9
|
import { ApiClientError, ApiStatusError, ServerAuthError, ServerCrashedError } from '../errors.js'
|
|
10
10
|
import { isIncidentBody } from '../status/index.js'
|
|
11
11
|
import type { ResponseStatusCarrier } from '../status/index.js'
|
|
12
|
+
import { logger } from '@owlmeans/log'
|
|
13
|
+
|
|
14
|
+
const log = logger('api')
|
|
12
15
|
|
|
13
16
|
export const processResponse = (response: AxiosResponse, reply: AbstractResponse<any>) => {
|
|
14
17
|
switch (response.status) {
|
|
@@ -23,10 +26,11 @@ export const processResponse = (response: AxiosResponse, reply: AbstractResponse
|
|
|
23
26
|
case FINISHED:
|
|
24
27
|
return processEmptyResponse(response, reply, EntrypointOutcome.Finished)
|
|
25
28
|
default:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
// A refusal is ordinary traffic (401, 403, 409, 428): debug, and never the headers.
|
|
30
|
+
log.debug('Request answered with a failure', {
|
|
31
|
+
status: response.status, statusText: response.statusText, url: response.config?.url,
|
|
32
|
+
incidentId: headerOf(response.headers, INCIDENT_ID_HEADER),
|
|
33
|
+
})
|
|
30
34
|
|
|
31
35
|
reply.reject(failureOf(response))
|
|
32
36
|
}
|
|
@@ -57,7 +61,7 @@ const failureOf = (response: AxiosResponse): Error => {
|
|
|
57
61
|
|
|
58
62
|
return error
|
|
59
63
|
} catch {
|
|
60
|
-
|
|
64
|
+
log.warn('Server returned an unrecognizable text error', { status: response.status, body: response.data })
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
67
|
|