@homeflare/distilled-grafana 0.2.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/LICENSE +201 -0
- package/README.md +85 -0
- package/dist/credentials.d.ts +42 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +48 -0
- package/dist/credentials.js.map +1 -0
- package/dist/errors.d.ts +36 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +26 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/pagination.d.ts +11 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +11 -0
- package/dist/pagination.js.map +1 -0
- package/dist/protocol.d.ts +18 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +58 -0
- package/dist/protocol.js.map +1 -0
- package/dist/retry.d.ts +32 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +32 -0
- package/dist/retry.js.map +1 -0
- package/dist/services/grafana.d.ts +5677 -0
- package/dist/services/grafana.d.ts.map +1 -0
- package/dist/services/grafana.js +7069 -0
- package/dist/services/grafana.js.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +3 -0
- package/dist/services/index.js.map +1 -0
- package/dist/traits.d.ts +11 -0
- package/dist/traits.d.ts.map +1 -0
- package/dist/traits.js +11 -0
- package/dist/traits.js.map +1 -0
- package/package.json +81 -0
- package/src/credentials.ts +72 -0
- package/src/errors.ts +50 -0
- package/src/index.ts +33 -0
- package/src/pagination.ts +10 -0
- package/src/protocol.ts +82 -0
- package/src/retry.ts +54 -0
- package/src/services/grafana.ts +16453 -0
- package/src/services/index.ts +2 -0
- package/src/traits.ts +44 -0
package/dist/retry.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grafana retry configuration.
|
|
3
|
+
*
|
|
4
|
+
* Defines the per-SDK `Retry` Context.Service tag that generated operations
|
|
5
|
+
* wire into `API.make`. Callers can install a blanket retry policy at the
|
|
6
|
+
* layer level and have every Grafana API call below it pick it up:
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import * as Grafana from "@distilled.cloud/grafana";
|
|
11
|
+
*
|
|
12
|
+
* myEffect.pipe(Grafana.Retry.transient);
|
|
13
|
+
* Effect.provide(myEffect, Layer.succeed(Grafana.Retry.Retry, customPolicy));
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import * as Context from "effect/Context";
|
|
17
|
+
import * as Effect from "effect/Effect";
|
|
18
|
+
import { type Policy } from "@distilled.cloud/core/retry";
|
|
19
|
+
export { type Options, type Factory, type Policy, makeDefault, jittered, capped, throttlingOptions, transientOptions, throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
|
|
20
|
+
declare const Retry_base: Context.ServiceClass<Retry, "GrafanaRetry", Policy>;
|
|
21
|
+
/** Context tag for configuring retry behavior of Grafana API calls. */
|
|
22
|
+
export declare class Retry extends Retry_base {
|
|
23
|
+
}
|
|
24
|
+
/** Provides a custom retry policy to every Grafana API call below it. */
|
|
25
|
+
export declare const policy: (optionsOrFactory: Policy) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
|
|
26
|
+
/** Disables all automatic retries. */
|
|
27
|
+
export declare const none: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
|
|
28
|
+
/** Apply the throttling retry policy (retries throttling errors indefinitely). */
|
|
29
|
+
export declare const throttling: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
|
|
30
|
+
/** Apply the transient retry policy (retries all transient errors indefinitely). */
|
|
31
|
+
export declare const transient: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
|
|
32
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EACL,KAAK,MAAM,EAGZ,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;;AAErC,uEAAuE;AACvE,qBAAa,KAAM,SAAQ,UAAgD;CAAG;AAE9E,yEAAyE;AACzE,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,IAAI,mFAEhB,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,UAAU,mFAA4B,CAAC;AAEpD,oFAAoF;AACpF,eAAO,MAAM,SAAS,mFAA2B,CAAC"}
|
package/dist/retry.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grafana retry configuration.
|
|
3
|
+
*
|
|
4
|
+
* Defines the per-SDK `Retry` Context.Service tag that generated operations
|
|
5
|
+
* wire into `API.make`. Callers can install a blanket retry policy at the
|
|
6
|
+
* layer level and have every Grafana API call below it pick it up:
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import * as Grafana from "@distilled.cloud/grafana";
|
|
11
|
+
*
|
|
12
|
+
* myEffect.pipe(Grafana.Retry.transient);
|
|
13
|
+
* Effect.provide(myEffect, Layer.succeed(Grafana.Retry.Retry, customPolicy));
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import * as Context from "effect/Context";
|
|
17
|
+
import * as Effect from "effect/Effect";
|
|
18
|
+
import * as Layer from "effect/Layer";
|
|
19
|
+
import { throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
|
|
20
|
+
export { makeDefault, jittered, capped, throttlingOptions, transientOptions, throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
|
|
21
|
+
/** Context tag for configuring retry behavior of Grafana API calls. */
|
|
22
|
+
export class Retry extends Context.Service()("GrafanaRetry") {
|
|
23
|
+
}
|
|
24
|
+
/** Provides a custom retry policy to every Grafana API call below it. */
|
|
25
|
+
export const policy = (optionsOrFactory) => Effect.provide(Layer.succeed(Retry, optionsOrFactory));
|
|
26
|
+
/** Disables all automatic retries. */
|
|
27
|
+
export const none = Effect.provide(Layer.succeed(Retry, { while: () => false }));
|
|
28
|
+
/** Apply the throttling retry policy (retries throttling errors indefinitely). */
|
|
29
|
+
export const throttling = policy(throttlingFactory);
|
|
30
|
+
/** Apply the transient retry policy (retries all transient errors indefinitely). */
|
|
31
|
+
export const transient = policy(transientFactory);
|
|
32
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAEL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAIL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAErC,uEAAuE;AACvE,MAAM,OAAO,KAAM,SAAQ,OAAO,CAAC,OAAO,EAAiB,CAAC,cAAc,CAAC;CAAG;AAE9E,yEAAyE;AACzE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,gBAAwB,EAAE,EAAE,CACjD,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEzD,sCAAsC;AACtC,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAChC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAC7C,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEpD,oFAAoF;AACpF,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC"}
|