@homeflare/distilled-grafana 0.2.0 → 0.2.1
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/protocol.d.ts +2 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +3 -1
- package/dist/protocol.js.map +1 -1
- package/package.json +3 -3
- package/src/protocol.ts +5 -3
package/dist/protocol.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as Layer from "effect/Layer";
|
|
2
|
-
import type * as HttpClient from "effect/
|
|
3
|
-
import type * as HttpClientError from "effect/
|
|
2
|
+
import type * as HttpClient from "effect/http/HttpClient";
|
|
3
|
+
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
4
4
|
import type * as API from "@distilled.cloud/core/api";
|
|
5
5
|
import type { API_ERRORS, ConfigError } from "@distilled.cloud/core/errors";
|
|
6
6
|
import { Credentials } from "./credentials.ts";
|
package/dist/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,KAAK,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAqB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAErE;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GACtB,YAAY,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GACzC,mBAAmB,GACnB,WAAW,GACX,eAAe,CAAC,eAAe,CAAC;AAEpC,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAQnE,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAkClD,CAAC"}
|
package/dist/protocol.js
CHANGED
|
@@ -19,7 +19,7 @@ import * as Effect from "effect/Effect";
|
|
|
19
19
|
import * as Redacted from "effect/Redacted";
|
|
20
20
|
import { makeRestProtocol } from "@distilled.cloud/core/protocol-rest";
|
|
21
21
|
import { Credentials } from "./credentials.js";
|
|
22
|
-
import { UnknownGrafanaError } from "./errors.js";
|
|
22
|
+
import { GrafanaParseError, UnknownGrafanaError } from "./errors.js";
|
|
23
23
|
/** Join the instance origin with `/api` unless the caller already included it. */
|
|
24
24
|
const apiBaseUrl = (origin) => {
|
|
25
25
|
const trimmed = origin.replace(/\/+$/, "");
|
|
@@ -45,6 +45,8 @@ export const GrafanaProtocol = makeRestProtocol({
|
|
|
45
45
|
},
|
|
46
46
|
// Grafana's error body is `{ message?: string, status?: string }` — the
|
|
47
47
|
// factory's default lenient envelope covers it.
|
|
48
|
+
// A 2xx body that fails strict output validation (core rc.13).
|
|
49
|
+
parseError: ({ body, cause }) => new GrafanaParseError({ body, cause }),
|
|
48
50
|
unknownError: ({ code, message, body }) => new UnknownGrafanaError({
|
|
49
51
|
code: typeof code === "string"
|
|
50
52
|
? code
|
package/dist/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KA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C,KAAK,EAAE,EAAE;QACjB,MAAM,OAAO,GAA2B;YACtC,aAAa,EAAE,UAAU,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACtD,MAAM,EAAE,kBAAkB;SAC3B,CAAC;QACF,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,CAAC,kBAAkB,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,wEAAwE;IACxE,gDAAgD;IAChD,+DAA+D;IAC/D,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,iBAAiB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACvE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CACxC,IAAI,mBAAmB,CAAC;QACtB,IAAI,EACF,OAAO,IAAI,KAAK,QAAQ;YACtB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,IAAI,KAAK,SAAS;gBAClB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;gBACd,CAAC,CAAC,SAAS;QACjB,OAAO;QACP,IAAI;KACL,CAAC;CACL,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homeflare/distilled-grafana",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Interim npm home for @distilled.cloud/grafana — see docs/distilled-interim.md. Not published upstream yet; the kit aliases @distilled.cloud/grafana onto this package until it is.",
|
|
5
5
|
"homepage": "https://github.com/taslabs-net/homeflare-kit/tree/main/packages/distilled-grafana#readme",
|
|
6
6
|
"bugs": "https://github.com/taslabs-net/homeflare-kit/issues",
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"access": "public"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@distilled.cloud/core": "1.0.0-rc.
|
|
76
|
+
"@distilled.cloud/core": "1.0.0-rc.13"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"effect": "4.0.
|
|
79
|
+
"effect": "4.0.1"
|
|
80
80
|
}
|
|
81
81
|
}
|
package/src/protocol.ts
CHANGED
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
import * as Effect from "effect/Effect";
|
|
19
19
|
import type * as Layer from "effect/Layer";
|
|
20
20
|
import * as Redacted from "effect/Redacted";
|
|
21
|
-
import type * as HttpClient from "effect/
|
|
22
|
-
import type * as HttpClientError from "effect/
|
|
21
|
+
import type * as HttpClient from "effect/http/HttpClient";
|
|
22
|
+
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
23
23
|
import type * as API from "@distilled.cloud/core/api";
|
|
24
24
|
import { makeRestProtocol } from "@distilled.cloud/core/protocol-rest";
|
|
25
25
|
import type { API_ERRORS, ConfigError } from "@distilled.cloud/core/errors";
|
|
26
26
|
import { Credentials, type Config } from "./credentials.ts";
|
|
27
|
-
import { UnknownGrafanaError } from "./errors.ts";
|
|
27
|
+
import { GrafanaParseError, UnknownGrafanaError } from "./errors.ts";
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Error channel shared by every generated Grafana operation. Generated
|
|
@@ -68,6 +68,8 @@ export const GrafanaProtocol: Layer.Layer<API.Protocol> =
|
|
|
68
68
|
},
|
|
69
69
|
// Grafana's error body is `{ message?: string, status?: string }` — the
|
|
70
70
|
// factory's default lenient envelope covers it.
|
|
71
|
+
// A 2xx body that fails strict output validation (core rc.13).
|
|
72
|
+
parseError: ({ body, cause }) => new GrafanaParseError({ body, cause }),
|
|
71
73
|
unknownError: ({ code, message, body }) =>
|
|
72
74
|
new UnknownGrafanaError({
|
|
73
75
|
code:
|