@distilled.cloud/datadog 0.0.0 → 1.0.0-rc.9

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.
Files changed (52) hide show
  1. package/LICENSE +201 -0
  2. package/lib/credentials.d.ts +42 -0
  3. package/lib/credentials.d.ts.map +1 -0
  4. package/lib/credentials.js +57 -0
  5. package/lib/credentials.js.map +1 -0
  6. package/lib/errors.d.ts +36 -0
  7. package/lib/errors.d.ts.map +1 -0
  8. package/lib/errors.js +26 -0
  9. package/lib/errors.js.map +1 -0
  10. package/lib/index.d.ts +22 -0
  11. package/lib/index.d.ts.map +1 -0
  12. package/lib/index.js +22 -0
  13. package/lib/index.js.map +1 -0
  14. package/lib/pagination.d.ts +11 -0
  15. package/lib/pagination.d.ts.map +1 -0
  16. package/lib/pagination.js +11 -0
  17. package/lib/pagination.js.map +1 -0
  18. package/lib/protocol.d.ts +18 -0
  19. package/lib/protocol.d.ts.map +1 -0
  20. package/lib/protocol.js +87 -0
  21. package/lib/protocol.js.map +1 -0
  22. package/lib/retry.d.ts +32 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +32 -0
  25. package/lib/retry.js.map +1 -0
  26. package/lib/services/index.d.ts +3 -0
  27. package/lib/services/index.d.ts.map +1 -0
  28. package/lib/services/index.js +4 -0
  29. package/lib/services/index.js.map +1 -0
  30. package/lib/services/v1.d.ts +12737 -0
  31. package/lib/services/v1.d.ts.map +1 -0
  32. package/lib/services/v1.js +9659 -0
  33. package/lib/services/v1.js.map +1 -0
  34. package/lib/services/v2.d.ts +75167 -0
  35. package/lib/services/v2.d.ts.map +1 -0
  36. package/lib/services/v2.js +69959 -0
  37. package/lib/services/v2.js.map +1 -0
  38. package/lib/traits.d.ts +11 -0
  39. package/lib/traits.d.ts.map +1 -0
  40. package/lib/traits.js +11 -0
  41. package/lib/traits.js.map +1 -0
  42. package/package.json +77 -6
  43. package/src/credentials.ts +88 -0
  44. package/src/errors.ts +50 -0
  45. package/src/index.ts +25 -0
  46. package/src/pagination.ts +10 -0
  47. package/src/protocol.ts +116 -0
  48. package/src/retry.ts +54 -0
  49. package/src/services/index.ts +3 -0
  50. package/src/services/v1.ts +27861 -0
  51. package/src/services/v2.ts +181842 -0
  52. package/src/traits.ts +44 -0
package/lib/retry.js ADDED
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Datadog 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 Datadog API call below it pick it up:
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * import * as Datadog from "@distilled.cloud/datadog";
11
+ *
12
+ * myEffect.pipe(Datadog.Retry.transient);
13
+ * Effect.provide(myEffect, Layer.succeed(Datadog.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 Datadog API calls. */
22
+ export class Retry extends Context.Service()("DatadogRetry") {
23
+ }
24
+ /** Provides a custom retry policy to every Datadog 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"}
@@ -0,0 +1,3 @@
1
+ export * as v1 from "./v1.ts";
2
+ export * as v2 from "./v2.ts";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ // AUTO-GENERATED by scripts/generate.ts. Do not edit.
2
+ export * as v1 from "./v1.js";
3
+ export * as v2 from "./v2.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC"}