@distilled.cloud/stackit 1.0.0-rc.15 → 1.0.0-rc.16

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 (285) hide show
  1. package/lib/credentials.d.ts +2 -2
  2. package/lib/credentials.d.ts.map +1 -1
  3. package/lib/credentials.js +32 -28
  4. package/lib/credentials.js.map +1 -1
  5. package/lib/errors.d.ts +13 -13
  6. package/lib/errors.d.ts.map +1 -1
  7. package/lib/errors.js +16 -16
  8. package/lib/errors.js.map +1 -1
  9. package/lib/index.d.ts +2 -2
  10. package/lib/index.js +22 -22
  11. package/lib/pagination.d.ts +1 -1
  12. package/lib/pagination.js +15 -15
  13. package/lib/protocol.d.ts +3 -3
  14. package/lib/protocol.d.ts.map +1 -1
  15. package/lib/protocol.js +31 -29
  16. package/lib/protocol.js.map +1 -1
  17. package/lib/retry.d.ts +1 -1
  18. package/lib/retry.d.ts.map +1 -1
  19. package/lib/retry.js +24 -23
  20. package/lib/retry.js.map +1 -1
  21. package/lib/services/alb.d.ts +10 -87
  22. package/lib/services/alb.d.ts.map +1 -1
  23. package/lib/services/alb.js +73 -502
  24. package/lib/services/alb_waf.d.ts +9 -82
  25. package/lib/services/alb_waf.d.ts.map +1 -1
  26. package/lib/services/alb_waf.js +84 -510
  27. package/lib/services/authorization.d.ts +5 -47
  28. package/lib/services/authorization.d.ts.map +1 -1
  29. package/lib/services/authorization.js +67 -314
  30. package/lib/services/automation.d.ts +7 -47
  31. package/lib/services/automation.d.ts.map +1 -1
  32. package/lib/services/automation.js +58 -353
  33. package/lib/services/cdn.d.ts +8 -220
  34. package/lib/services/cdn.d.ts.map +1 -1
  35. package/lib/services/cdn.js +81 -896
  36. package/lib/services/certificates.d.ts +8 -27
  37. package/lib/services/certificates.d.ts.map +1 -1
  38. package/lib/services/certificates.js +45 -171
  39. package/lib/services/cost.d.ts +10 -37
  40. package/lib/services/cost.d.ts.map +1 -1
  41. package/lib/services/cost.js +39 -169
  42. package/lib/services/dns.d.ts +9 -104
  43. package/lib/services/dns.d.ts.map +1 -1
  44. package/lib/services/dns.js +98 -714
  45. package/lib/services/dremio.d.ts +8 -50
  46. package/lib/services/dremio.d.ts.map +1 -1
  47. package/lib/services/dremio.js +56 -307
  48. package/lib/services/edge.d.ts +7 -40
  49. package/lib/services/edge.d.ts.map +1 -1
  50. package/lib/services/edge.js +66 -347
  51. package/lib/services/functions.d.ts +1 -48
  52. package/lib/services/functions.d.ts.map +1 -1
  53. package/lib/services/functions.js +64 -393
  54. package/lib/services/git.d.ts +8 -61
  55. package/lib/services/git.d.ts.map +1 -1
  56. package/lib/services/git.js +87 -510
  57. package/lib/services/iaas.d.ts +9 -337
  58. package/lib/services/iaas.d.ts.map +1 -1
  59. package/lib/services/iaas.js +409 -3532
  60. package/lib/services/intake.d.ts +8 -75
  61. package/lib/services/intake.d.ts.map +1 -1
  62. package/lib/services/intake.js +74 -465
  63. package/lib/services/kms.d.ts +9 -92
  64. package/lib/services/kms.d.ts.map +1 -1
  65. package/lib/services/kms.js +95 -650
  66. package/lib/services/lb_ip_lists.d.ts +9 -25
  67. package/lib/services/lb_ip_lists.d.ts.map +1 -1
  68. package/lib/services/lb_ip_lists.js +45 -146
  69. package/lib/services/load_balancer.d.ts +10 -81
  70. package/lib/services/load_balancer.d.ts.map +1 -1
  71. package/lib/services/load_balancer.js +76 -486
  72. package/lib/services/logme.d.ts +8 -69
  73. package/lib/services/logme.d.ts.map +1 -1
  74. package/lib/services/logme.js +82 -564
  75. package/lib/services/logs.d.ts +8 -64
  76. package/lib/services/logs.d.ts.map +1 -1
  77. package/lib/services/logs.js +84 -465
  78. package/lib/services/mariadb.d.ts +8 -65
  79. package/lib/services/mariadb.d.ts.map +1 -1
  80. package/lib/services/mariadb.js +84 -541
  81. package/lib/services/model_experiments.d.ts +9 -48
  82. package/lib/services/model_experiments.d.ts.map +1 -1
  83. package/lib/services/model_experiments.js +66 -325
  84. package/lib/services/model_serving.d.ts +7 -47
  85. package/lib/services/model_serving.d.ts.map +1 -1
  86. package/lib/services/model_serving.js +55 -277
  87. package/lib/services/mongodb_flex.d.ts +8 -137
  88. package/lib/services/mongodb_flex.d.ts.map +1 -1
  89. package/lib/services/mongodb_flex.js +102 -793
  90. package/lib/services/object_storage.d.ts +12 -59
  91. package/lib/services/object_storage.d.ts.map +1 -1
  92. package/lib/services/object_storage.js +93 -528
  93. package/lib/services/observability.d.ts +8 -407
  94. package/lib/services/observability.d.ts.map +1 -1
  95. package/lib/services/observability.js +375 -3148
  96. package/lib/services/opensearch.d.ts +8 -71
  97. package/lib/services/opensearch.d.ts.map +1 -1
  98. package/lib/services/opensearch.js +85 -553
  99. package/lib/services/pim.d.ts +12 -108
  100. package/lib/services/pim.d.ts.map +1 -1
  101. package/lib/services/pim.js +81 -726
  102. package/lib/services/postgres_flex.d.ts +14 -136
  103. package/lib/services/postgres_flex.d.ts.map +1 -1
  104. package/lib/services/postgres_flex.js +114 -841
  105. package/lib/services/pubsub.d.ts +11 -73
  106. package/lib/services/pubsub.d.ts.map +1 -1
  107. package/lib/services/pubsub.js +92 -507
  108. package/lib/services/rabbitmq.d.ts +8 -76
  109. package/lib/services/rabbitmq.d.ts.map +1 -1
  110. package/lib/services/rabbitmq.js +88 -564
  111. package/lib/services/registry.d.ts +10 -28
  112. package/lib/services/registry.d.ts.map +1 -1
  113. package/lib/services/registry.js +49 -189
  114. package/lib/services/resource_manager.d.ts +9 -61
  115. package/lib/services/resource_manager.d.ts.map +1 -1
  116. package/lib/services/resource_manager.js +92 -462
  117. package/lib/services/run_command.d.ts +5 -28
  118. package/lib/services/run_command.d.ts.map +1 -1
  119. package/lib/services/run_command.js +38 -176
  120. package/lib/services/sca.d.ts +8 -79
  121. package/lib/services/sca.d.ts.map +1 -1
  122. package/lib/services/sca.js +63 -435
  123. package/lib/services/scf.d.ts +8 -64
  124. package/lib/services/scf.d.ts.map +1 -1
  125. package/lib/services/scf.js +99 -660
  126. package/lib/services/secrets_manager.d.ts +8 -61
  127. package/lib/services/secrets_manager.d.ts.map +1 -1
  128. package/lib/services/secrets_manager.js +99 -601
  129. package/lib/services/server_backup.d.ts +7 -50
  130. package/lib/services/server_backup.d.ts.map +1 -1
  131. package/lib/services/server_backup.js +70 -444
  132. package/lib/services/server_update.d.ts +7 -35
  133. package/lib/services/server_update.d.ts.map +1 -1
  134. package/lib/services/server_update.js +58 -342
  135. package/lib/services/service_account.d.ts +10 -68
  136. package/lib/services/service_account.d.ts.map +1 -1
  137. package/lib/services/service_account.js +75 -495
  138. package/lib/services/service_enablement.d.ts +7 -29
  139. package/lib/services/service_enablement.d.ts.map +1 -1
  140. package/lib/services/service_enablement.js +40 -147
  141. package/lib/services/sfs.d.ts +4 -96
  142. package/lib/services/sfs.d.ts.map +1 -1
  143. package/lib/services/sfs.js +117 -782
  144. package/lib/services/ske.d.ts +9 -108
  145. package/lib/services/ske.d.ts.map +1 -1
  146. package/lib/services/ske.js +67 -549
  147. package/lib/services/sqlserverflex.d.ts +11 -152
  148. package/lib/services/sqlserverflex.d.ts.map +1 -1
  149. package/lib/services/sqlserverflex.js +112 -925
  150. package/lib/services/stackit_marketplace.d.ts +9 -38
  151. package/lib/services/stackit_marketplace.d.ts.map +1 -1
  152. package/lib/services/stackit_marketplace.js +64 -369
  153. package/lib/services/telemetry_link.d.ts +8 -61
  154. package/lib/services/telemetry_link.d.ts.map +1 -1
  155. package/lib/services/telemetry_link.js +81 -522
  156. package/lib/services/telemetry_router.d.ts +8 -72
  157. package/lib/services/telemetry_router.d.ts.map +1 -1
  158. package/lib/services/telemetry_router.js +73 -474
  159. package/lib/services/ufw.d.ts +7 -42
  160. package/lib/services/ufw.d.ts.map +1 -1
  161. package/lib/services/ufw.js +55 -269
  162. package/lib/services/valkey.d.ts +8 -68
  163. package/lib/services/valkey.d.ts.map +1 -1
  164. package/lib/services/valkey.js +85 -557
  165. package/lib/services/vpn.d.ts +21 -186
  166. package/lib/services/vpn.d.ts.map +1 -1
  167. package/lib/services/vpn.js +105 -920
  168. package/lib/services/workflows.d.ts +15 -84
  169. package/lib/services/workflows.d.ts.map +1 -1
  170. package/lib/services/workflows.js +67 -497
  171. package/lib/traits.d.ts +1 -1
  172. package/lib/traits.js +10 -10
  173. package/package.json +13 -9
  174. package/src/credentials.ts +21 -18
  175. package/src/errors.ts +10 -14
  176. package/src/index.ts +2 -2
  177. package/src/pagination.ts +2 -2
  178. package/src/protocol.ts +12 -9
  179. package/src/retry.ts +6 -4
  180. package/src/services/alb.ts +599 -655
  181. package/src/services/alb_waf.ts +597 -637
  182. package/src/services/authorization.ts +400 -383
  183. package/src/services/automation.ts +422 -405
  184. package/src/services/cdn.ts +817 -1375
  185. package/src/services/certificates.ts +209 -190
  186. package/src/services/cost.ts +100 -207
  187. package/src/services/dns.ts +793 -833
  188. package/src/services/dremio.ts +356 -349
  189. package/src/services/edge.ts +406 -366
  190. package/src/services/functions.ts +465 -463
  191. package/src/services/git.ts +602 -547
  192. package/src/services/iaas.ts +3931 -3821
  193. package/src/services/intake.ts +521 -549
  194. package/src/services/kms.ts +715 -692
  195. package/src/services/lb_ip_lists.ts +173 -152
  196. package/src/services/load_balancer.ts +576 -619
  197. package/src/services/logme.ts +696 -641
  198. package/src/services/logs.ts +510 -493
  199. package/src/services/mariadb.ts +671 -604
  200. package/src/services/model_experiments.ts +343 -356
  201. package/src/services/model_serving.ts +337 -328
  202. package/src/services/mongodb_flex.ts +955 -1007
  203. package/src/services/object_storage.ts +614 -557
  204. package/src/services/observability.ts +3469 -3866
  205. package/src/services/opensearch.ts +679 -628
  206. package/src/services/pim.ts +672 -909
  207. package/src/services/postgres_flex.ts +966 -986
  208. package/src/services/pubsub.ts +524 -546
  209. package/src/services/rabbitmq.ts +693 -654
  210. package/src/services/registry.ts +227 -194
  211. package/src/services/resource_manager.ts +520 -517
  212. package/src/services/run_command.ts +219 -211
  213. package/src/services/sca.ts +543 -570
  214. package/src/services/scf.ts +790 -716
  215. package/src/services/secrets_manager.ts +707 -622
  216. package/src/services/server_backup.ts +490 -475
  217. package/src/services/server_update.ts +353 -356
  218. package/src/services/service_account.ts +515 -553
  219. package/src/services/service_enablement.ts +162 -166
  220. package/src/services/sfs.ts +879 -958
  221. package/src/services/ske.ts +694 -769
  222. package/src/services/sqlserverflex.ts +1042 -1117
  223. package/src/services/stackit_marketplace.ts +377 -372
  224. package/src/services/telemetry_link.ts +530 -531
  225. package/src/services/telemetry_router.ts +509 -534
  226. package/src/services/ufw.ts +305 -307
  227. package/src/services/valkey.ts +684 -629
  228. package/src/services/vpn.ts +935 -1195
  229. package/src/services/workflows.ts +426 -586
  230. package/src/traits.ts +1 -1
  231. package/lib/protocol.test.d.ts +0 -2
  232. package/lib/protocol.test.d.ts.map +0 -1
  233. package/lib/protocol.test.js +0 -181
  234. package/lib/protocol.test.js.map +0 -1
  235. package/lib/services/alb.js.map +0 -1
  236. package/lib/services/alb_waf.js.map +0 -1
  237. package/lib/services/authorization.js.map +0 -1
  238. package/lib/services/automation.js.map +0 -1
  239. package/lib/services/cdn.js.map +0 -1
  240. package/lib/services/certificates.js.map +0 -1
  241. package/lib/services/cost.js.map +0 -1
  242. package/lib/services/dns.js.map +0 -1
  243. package/lib/services/dremio.js.map +0 -1
  244. package/lib/services/edge.js.map +0 -1
  245. package/lib/services/functions.js.map +0 -1
  246. package/lib/services/git.js.map +0 -1
  247. package/lib/services/iaas.js.map +0 -1
  248. package/lib/services/intake.js.map +0 -1
  249. package/lib/services/kms.js.map +0 -1
  250. package/lib/services/lb_ip_lists.js.map +0 -1
  251. package/lib/services/load_balancer.js.map +0 -1
  252. package/lib/services/logme.js.map +0 -1
  253. package/lib/services/logs.js.map +0 -1
  254. package/lib/services/mariadb.js.map +0 -1
  255. package/lib/services/model_experiments.js.map +0 -1
  256. package/lib/services/model_serving.js.map +0 -1
  257. package/lib/services/mongodb_flex.js.map +0 -1
  258. package/lib/services/object_storage.js.map +0 -1
  259. package/lib/services/observability.js.map +0 -1
  260. package/lib/services/opensearch.js.map +0 -1
  261. package/lib/services/pim.js.map +0 -1
  262. package/lib/services/postgres_flex.js.map +0 -1
  263. package/lib/services/pubsub.js.map +0 -1
  264. package/lib/services/rabbitmq.js.map +0 -1
  265. package/lib/services/registry.js.map +0 -1
  266. package/lib/services/resource_manager.js.map +0 -1
  267. package/lib/services/run_command.js.map +0 -1
  268. package/lib/services/sca.js.map +0 -1
  269. package/lib/services/scf.js.map +0 -1
  270. package/lib/services/secrets_manager.js.map +0 -1
  271. package/lib/services/server_backup.js.map +0 -1
  272. package/lib/services/server_update.js.map +0 -1
  273. package/lib/services/service_account.js.map +0 -1
  274. package/lib/services/service_enablement.js.map +0 -1
  275. package/lib/services/sfs.js.map +0 -1
  276. package/lib/services/ske.js.map +0 -1
  277. package/lib/services/sqlserverflex.js.map +0 -1
  278. package/lib/services/stackit_marketplace.js.map +0 -1
  279. package/lib/services/telemetry_link.js.map +0 -1
  280. package/lib/services/telemetry_router.js.map +0 -1
  281. package/lib/services/ufw.js.map +0 -1
  282. package/lib/services/valkey.js.map +0 -1
  283. package/lib/services/vpn.js.map +0 -1
  284. package/lib/services/workflows.js.map +0 -1
  285. package/src/protocol.test.ts +0 -304
@@ -7,7 +7,7 @@ export declare const DEFAULT_REGION = "eu01";
7
7
  export interface Config {
8
8
  readonly token: Redacted.Redacted<string>;
9
9
  /**
10
- * Region inserted into product hosts (`eu01` →
10
+ * Region inserted into product hosts (`eu01` ->
11
11
  * `https://iaas.api.eu01.stackit.cloud`). `"global"` leaves the spec URL
12
12
  * unchanged.
13
13
  */
@@ -16,7 +16,7 @@ export interface Config {
16
16
  readonly apiBaseUrl?: string;
17
17
  }
18
18
  declare const Credentials_base: Context.ServiceClass<Credentials, "StackitCredentials", Effect.Effect<Config, never, never>>;
19
- export declare class Credentials extends Credentials_base {
19
+ export declare class Credentials extends /*@__PURE__*/ Credentials_base {
20
20
  }
21
21
  export declare const CredentialsFromEnv: Layer.Layer<Credentials, never, never>;
22
22
  /** Convenience layer from a redacted token + optional region / base URL. */
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,8DAA8D;AAC9D,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAUJ,eAAO,MAAM,kBAAkB,wCAgB9B,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,WAAW,WAAY;IAClC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAQxB,CAAC"}
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,8DAA8D;AAC9D,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;;AAED,qBAAa,WACX,SAAQ,aAAa,CAAC,gBAErB;CAAG;AAYN,eAAO,MAAM,kBAAkB,wCAgB9B,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,WAAW,WAAY;IAClC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAQxB,CAAC"}
@@ -1,46 +1,50 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+ import * as EffectConfig from "@distilled.cloud/core/config";
1
20
  import { ConfigError } from "@distilled.cloud/core/errors";
2
- /**
3
- * STACKIT credentials — hand-written.
4
- *
5
- * The `Credentials` service resolves `{ token, region }` per request; the
6
- * protocol layer formats the `Authorization: Bearer <token>` header from it
7
- * and rewrites each operation's spec `servers` URL for the region. The token
8
- * is a STACKIT service-account access token — the same value the official
9
- * Go SDK, CLI and Terraform provider read from
10
- * `STACKIT_SERVICE_ACCOUNT_TOKEN`. Key-file exchange
11
- * (`STACKIT_SERVICE_ACCOUNT_KEY_PATH`) is not modelled: mint the token
12
- * outside the SDK.
13
- *
14
- * Each STACKIT product has its own host (`iaas.api.eu01.stackit.cloud`,
15
- * `ske.api.eu01.stackit.cloud`, …). The per-operation host is baked into
16
- * the generated `T.Http` trait from the OpenAPI `servers` entry; `region`
17
- * (default `eu01`) is substituted at request time. An explicit `apiBaseUrl`
18
- * overrides that host for every call — a proxy, not a per-product map.
19
- */
20
- import * as EffectConfig from "effect/Config";
21
21
  import * as Context from "effect/Context";
22
22
  import * as Effect from "effect/Effect";
23
23
  import * as Layer from "effect/Layer";
24
24
  import * as Redacted from "effect/Redacted";
25
- /** STACKIT's primary public region (Schwarz IT / Germany). */
25
+
26
26
  export const DEFAULT_REGION = "eu01";
27
- export class Credentials extends Context.Service()("StackitCredentials") {
27
+ export class Credentials extends /*@__PURE__*/ /*@__PURE__*/ Context.Service()("StackitCredentials") {
28
28
  }
29
- const envConfig = EffectConfig.all({
29
+ const envConfig = /*@__PURE__*/ EffectConfig.all({
30
30
  // `STACKIT_SERVICE_ACCOUNT_TOKEN` / `STACKIT_REGION` are what the
31
31
  // official Go SDK, CLI and Terraform provider read.
32
- token: EffectConfig.String("STACKIT_SERVICE_ACCOUNT_TOKEN"),
33
- region: EffectConfig.String("STACKIT_REGION").pipe(EffectConfig.withDefault(DEFAULT_REGION)),
34
- apiBaseUrl: EffectConfig.String("STACKIT_API_BASE_URL").pipe(EffectConfig.option),
32
+ token: /*@__PURE__*/ EffectConfig.String("STACKIT_SERVICE_ACCOUNT_TOKEN"),
33
+ region: /*@__PURE__*/ EffectConfig.String("STACKIT_REGION").pipe(
34
+ /*@__PURE__*/ EffectConfig.withDefault(DEFAULT_REGION)),
35
+ apiBaseUrl: /*@__PURE__*/ EffectConfig.String("STACKIT_API_BASE_URL").pipe(EffectConfig.option),
35
36
  });
36
- export const CredentialsFromEnv = Layer.succeed(Credentials, envConfig.pipe(Effect.mapError(() => new ConfigError({
37
+ export const CredentialsFromEnv = /*@__PURE__*/ Layer.succeed(Credentials,
38
+ /*@__PURE__*/ envConfig.pipe(
39
+ /*@__PURE__*/ Effect.mapError(() => new ConfigError({
37
40
  message: "STACKIT_SERVICE_ACCOUNT_TOKEN environment variable is required",
38
- })), Effect.map(({ token, region, apiBaseUrl }) => ({
41
+ })),
42
+ /*@__PURE__*/ Effect.map(({ token, region, apiBaseUrl }) => ({
39
43
  token: Redacted.make(token),
40
44
  region,
41
45
  apiBaseUrl: apiBaseUrl._tag === "Some" ? apiBaseUrl.value : undefined,
42
46
  })), Effect.orDie));
43
- /** Convenience layer from a redacted token + optional region / base URL. */
47
+
44
48
  export const credentials = (config) => Layer.succeed(Credentials, Effect.succeed({
45
49
  token: config.token,
46
50
  region: config.region ?? DEFAULT_REGION,
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC;AAcrC,MAAM,OAAO,WAAY,SAAQ,OAAO,CAAC,OAAO,EAAsC,CACpF,oBAAoB,CACrB;CAAG;AAEJ,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC;IACjC,kEAAkE;IAClE,oDAAoD;IACpD,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,+BAA+B,CAAC;IAC3D,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAC5F,UAAU,EAAE,YAAY,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;CAClF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAC7C,WAAW,EACX,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AE,MAAM,CAAC,KAAK;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,cAAc;IACvC,UAAU,EAAE,MAAM,CAAC,UAAU;CAC9B,CAAC,CACH,CAAC"}
package/lib/errors.d.ts CHANGED
@@ -9,28 +9,28 @@
9
9
  */
10
10
  export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
11
11
  export type { DefaultErrors } from "@distilled.cloud/core/errors";
12
- import * as Schema from "effect/Schema";
13
- declare const UnknownStackitError_base: Schema.Class<UnknownStackitError, Schema.TaggedStruct<"UnknownStackitError", {
14
- readonly code: Schema.optional<Schema.String>;
15
- readonly message: Schema.optional<Schema.String>;
16
- readonly body: Schema.Unknown;
17
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
12
+ import * as Schema from "@distilled.cloud/core/schema-lite-typed";
13
+ declare const UnknownStackitError_base: Schema.TaggedErrorClass<"UnknownStackitError", {
14
+ readonly code: import("effect/Schema").optional<import("effect/Schema").String>;
15
+ readonly message: import("effect/Schema").optional<import("effect/Schema").String>;
16
+ readonly body: import("effect/Schema").Unknown;
17
+ }> & (new (...args: any[]) => {
18
18
  "@distilled.cloud/error/categories": {
19
19
  ServerError: true;
20
20
  };
21
21
  });
22
- /** Unknown STACKIT error — returned when nothing else matches the failure. */
23
- export declare class UnknownStackitError extends UnknownStackitError_base {
22
+ /** Unknown STACKIT error -- returned when nothing else matches the failure. */
23
+ export declare class UnknownStackitError extends /*@__PURE__*/ UnknownStackitError_base {
24
24
  }
25
- declare const StackitParseError_base: Schema.Class<StackitParseError, Schema.TaggedStruct<"StackitParseError", {
26
- readonly body: Schema.Unknown;
27
- readonly cause: Schema.Unknown;
28
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
25
+ declare const StackitParseError_base: Schema.TaggedErrorClass<"StackitParseError", {
26
+ readonly body: import("effect/Schema").Unknown;
27
+ readonly cause: import("effect/Schema").Unknown;
28
+ }> & (new (...args: any[]) => {
29
29
  "@distilled.cloud/error/categories": {
30
30
  ParseError: true;
31
31
  };
32
32
  });
33
33
  /** Schema parse error wrapper. */
34
- export declare class StackitParseError extends StackitParseError_base {
34
+ export declare class StackitParseError extends /*@__PURE__*/ StackitParseError_base {
35
35
  }
36
36
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;;;;;;;;;;AAExC,8EAA8E;AAC9E,qBAAa,mBAAoB,SAAQ,wBAOT;CAAG;;;;;;;;;AAEnC,kCAAkC;AAClC,qBAAa,iBAAkB,SAAQ,sBAMR;CAAG"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;;;;;;;;;;AAElE,+EAA+E;AAC/E,qBAAa,mBACX,SAAQ,aAAa,CAAC,wBAIW;CAAG;;;;;;;;;AAEtC,kCAAkC;AAClC,qBAAa,iBACX,SAAQ,aAAa,CAAC,sBAGU;CAAG"}
package/lib/errors.js CHANGED
@@ -1,24 +1,24 @@
1
- /**
2
- * STACKIT-specific error types.
3
- *
4
- * Re-exports the common HTTP errors from core and adds the unknown-error
5
- * and parse-error wrappers. STACKIT failures carry `{ message, error? }`
6
- * (the `ErrorMessage` schema in most of the product specs); the protocol
7
- * reads `message` for the human half and `error` as the machine-readable
8
- * code on {@link UnknownStackitError}.
9
- */
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
10
  export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
11
11
  import * as Category from "@distilled.cloud/core/category";
12
- import * as Schema from "effect/Schema";
13
- /** Unknown STACKIT error — returned when nothing else matches the failure. */
14
- export class UnknownStackitError extends Schema.TaggedError()("UnknownStackitError", {
15
- code: Schema.optional(Schema.String),
16
- message: Schema.optional(Schema.String),
12
+ import * as Schema from "@distilled.cloud/core/schema-lite-typed";
13
+
14
+ export class UnknownStackitError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("UnknownStackitError", {
15
+ code: /*@__PURE__*/ Schema.optional(Schema.String),
16
+ message: /*@__PURE__*/ Schema.optional(Schema.String),
17
17
  body: Schema.Unknown,
18
18
  }).pipe(Category.withServerError) {
19
19
  }
20
- /** Schema parse error wrapper. */
21
- export class StackitParseError extends Schema.TaggedError()("StackitParseError", {
20
+
21
+ export class StackitParseError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("StackitParseError", {
22
22
  body: Schema.Unknown,
23
23
  cause: Schema.Unknown,
24
24
  }).pipe(Category.withParseError) {
package/lib/errors.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,8EAA8E;AAC9E,MAAM,OAAO,mBAAoB,SAAQ,MAAM,CAAC,WAAW,EAAuB,CAChF,qBAAqB,EACrB;IACE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC,OAAO;CACrB,CACF,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;CAAG;AAEnC,kCAAkC;AAClC,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,WAAW,EAAqB,CAC5E,mBAAmB,EACnB;IACE,IAAI,EAAE,MAAM,CAAC,OAAO;IACpB,KAAK,EAAE,MAAM,CAAC,OAAO;CACtB,CACF,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;CAAG"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;AAElE,+EAA+E;AAC/E,MAAM,OAAO,mBACX,SAAQ,aAAa,CAAb,aAAa,CAAC,MAAM,CAAC,WAAW,EAAuB,CAAC,qBAAqB,EAAE;IACrF,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC,OAAO;CACrB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;CAAG;AAEtC,kCAAkC;AAClC,MAAM,OAAO,iBACX,SAAQ,aAAa,CAAb,aAAa,CAAC,MAAM,CAAC,WAAW,EAAqB,CAAC,mBAAmB,EAAE;IACjF,IAAI,EAAE,MAAM,CAAC,OAAO;IACpB,KAAK,EAAE,MAAM,CAAC,OAAO;CACtB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;CAAG"}
package/lib/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @distilled.cloud/stackit — STACKIT Cloud API SDK for Effect.
2
+ * @distilled.cloud/stackit -- STACKIT Cloud API SDK for Effect.
3
3
  *
4
4
  * `./services` is generated by `scripts/generate.ts` from the Smithy models
5
5
  * in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI
6
6
  * documents mirrored at `specs/spec-mirror-stackit/specs/`). Everything else
7
7
  * in this folder is hand-written.
8
8
  *
9
- * One module per STACKIT product (IaaS, SKE, DNS, Postgres Flex, …), using
9
+ * One module per STACKIT product (IaaS, SKE, DNS, Postgres Flex, ...), using
10
10
  * that product's latest published OpenAPI version. Auth is a service-account
11
11
  * bearer token (`STACKIT_SERVICE_ACCOUNT_TOKEN`); each product's host is
12
12
  * rewritten for `STACKIT_REGION` (default `eu01`).
package/lib/index.js CHANGED
@@ -1,25 +1,25 @@
1
- /**
2
- * @distilled.cloud/stackit — STACKIT Cloud API SDK for Effect.
3
- *
4
- * `./services` is generated by `scripts/generate.ts` from the Smithy models
5
- * in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI
6
- * documents mirrored at `specs/spec-mirror-stackit/specs/`). Everything else
7
- * in this folder is hand-written.
8
- *
9
- * One module per STACKIT product (IaaS, SKE, DNS, Postgres Flex, …), using
10
- * that product's latest published OpenAPI version. Auth is a service-account
11
- * bearer token (`STACKIT_SERVICE_ACCOUNT_TOKEN`); each product's host is
12
- * rewritten for `STACKIT_REGION` (default `eu01`).
13
- *
14
- * @example
15
- * ```ts
16
- * import * as Stackit from "@distilled.cloud/stackit";
17
- *
18
- * const { zones } = yield* Stackit.dns.listZones({
19
- * projectId: "...",
20
- * });
21
- * ```
22
- */
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
23
  export * from "./credentials.js";
24
24
  export * from "./errors.js";
25
25
  export * as T from "./traits.js";
@@ -2,7 +2,7 @@ import { type PaginationStrategy } from "@distilled.cloud/core/pagination";
2
2
  export type { PaginatedTrait, PaginationStrategy } from "@distilled.cloud/core/pagination";
3
3
  /**
4
4
  * Stream of pages using STACKIT's `page` / `totalPages` envelope: request
5
- * `page`, `page+1`, … while `page < totalPages` and the collection is
5
+ * `page`, `page+1`, ... while `page < totalPages` and the collection is
6
6
  * non-empty.
7
7
  */
8
8
  export declare const paginateByTotalPages: PaginationStrategy;
package/lib/pagination.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import { getPath } from "@distilled.cloud/core/pagination";
2
- /**
3
- * STACKIT pagination — hand-written.
4
- *
5
- * Several STACKIT list operations page by NUMBER: `?page=N&pageSize=M` in,
6
- * and a response carrying the collection beside `totalPages` (DNS zones /
7
- * record sets, and the same envelope on other products). Core's
8
- * `paginatePageNumber` treats `outputToken` as the NEXT page number, so
9
- * pointing it at `totalPages` would jump to the last page; this strategy
10
- * advances by one until `page >= totalPages`.
11
- */
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
12
  import * as Effect from "effect/Effect";
13
13
  import * as Stream from "effect/Stream";
14
- /**
15
- * Stream of pages using STACKIT's `page` / `totalPages` envelope: request
16
- * `page`, `page+1`, … while `page < totalPages` and the collection is
17
- * non-empty.
18
- */
14
+
15
+
16
+
17
+
18
+
19
19
  export const paginateByTotalPages = (operation, input, pagination) => {
20
20
  const inputToken = pagination.inputToken;
21
21
  const totalPagesPath = pagination.outputToken;
package/lib/protocol.d.ts CHANGED
@@ -18,13 +18,13 @@ export type StackitOpContext = Credentials | HttpClient.HttpClient;
18
18
  /**
19
19
  * Rewrite a spec `servers` URL for the configured region.
20
20
  *
21
- * • `{region}` still in the template (IaaS v1:
21
+ * * `{region}` still in the template (IaaS v1:
22
22
  * `https://iaas.api.{region}stackit.cloud`, default `eu01.`) is
23
23
  * substituted. A glued `{region}stackit` means the spec's default
24
24
  * includes the trailing dot.
25
- * • `https://<svc>.api.stackit.cloud` becomes
25
+ * * `https://<svc>.api.stackit.cloud` becomes
26
26
  * `https://<svc>.api.<region>.stackit.cloud`.
27
- * • `region === "global"` leaves the URL alone (after dropping any
27
+ * * `region === "global"` leaves the URL alone (after dropping any
28
28
  * leftover `{region}`).
29
29
  */
30
30
  export declare const applyRegion: (specUrl: string, region: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,8BAA8B,C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AM,MAAM,cAAc,GACtB,aAAa,GACb,mBAAmB,GACnB,iBAAiB,GACjB,WAAW,GACX,eAAe,CAAC,eAAe,CAAC;AAEpC,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,YAAa,MAAM,UAAU,MAAM,KAAG,MAY7D,CAAC;AAgCF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CA2GrD,CAAC"}
package/lib/protocol.js CHANGED
@@ -1,41 +1,42 @@
1
1
  import * as API from "@distilled.cloud/core/api";
2
+ import { debugHttp } from "@distilled.cloud/core/debug";
2
3
  import { HTTP_STATUS_MAP, InternalServerError, } from "@distilled.cloud/core/errors";
3
4
  import { buildRequest, getAnn, mapKeys, matchTypedError, } from "@distilled.cloud/core/protocol-http";
4
5
  import { unwrapRedactedDeep, wrapSensitive, } from "@distilled.cloud/core/protocol-rest";
5
6
  import { validateResponse } from "@distilled.cloud/core/response-validation";
6
7
  import { parseRetryAfterForStatus } from "@distilled.cloud/core/retry-after";
7
8
  import { httpSymbol } from "@distilled.cloud/core/trait";
8
- /**
9
- * StackitProtocol — the shared bearer-REST protocol instantiated for STACKIT.
10
- *
11
- * STACKIT speaks plain JSON with no success envelope. FAILURES are
12
- * `{ "message": "...", "error": "..." }` (the `ErrorMessage` schema most
13
- * product specs share). Each product has its own host, baked into the
14
- * generated operation's `T.Http({ baseUrl })` from the OpenAPI `servers`
15
- * entry; this protocol reads that URL and rewrites it for the configured
16
- * region (`eu01` by default).
17
- *
18
- * Auth is `Authorization: Bearer <token>`. The API version is a PATH
19
- * segment (`/v1`, `/v2`, …), so the generated operations carry versioned
20
- * routes against a version-less host.
21
- */
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
22
23
  import * as Effect from "effect/Effect";
23
24
  import * as Layer from "effect/Layer";
24
25
  import * as Redacted from "effect/Redacted";
25
26
  import { Credentials } from "./credentials.js";
26
27
  import { StackitParseError, UnknownStackitError } from "./errors.js";
27
- /**
28
- * Rewrite a spec `servers` URL for the configured region.
29
- *
30
- * • `{region}` still in the template (IaaS v1:
31
- * `https://iaas.api.{region}stackit.cloud`, default `eu01.`) is
32
- * substituted. A glued `{region}stackit` means the spec's default
33
- * includes the trailing dot.
34
- * • `https://<svc>.api.stackit.cloud` becomes
35
- * `https://<svc>.api.<region>.stackit.cloud`.
36
- * • `region === "global"` leaves the URL alone (after dropping any
37
- * leftover `{region}`).
38
- */
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
39
40
  export const applyRegion = (specUrl, region) => {
40
41
  if (specUrl.includes("{region}")) {
41
42
  if (region === "global")
@@ -70,11 +71,12 @@ const baseUrlFor = (creds, inputAst) => {
70
71
  const http = getAnn(inputAst, httpSymbol);
71
72
  const specUrl = http?.baseUrl;
72
73
  if (typeof specUrl !== "string" || specUrl === "") {
73
- throw new Error("STACKIT operation is missing T.Http({ baseUrl }) — regenerate from convert");
74
+ throw new Error("STACKIT operation is missing T.Http({ baseUrl }) \u2014 regenerate from convert");
74
75
  }
75
76
  return applyRegion(specUrl, creds.region);
76
77
  };
77
- export const StackitProtocol = Layer.succeed(API.Protocol, API.Protocol.of({
78
+ export const StackitProtocol = /*@__PURE__*/ Layer.succeed(API.Protocol,
79
+ /*@__PURE__*/ API.Protocol.of({
78
80
  encode: ({ input, inputAst }) => Effect.gen(function* () {
79
81
  const resolve = yield* Credentials;
80
82
  const creds = yield* resolve;
@@ -89,7 +91,7 @@ export const StackitProtocol = Layer.succeed(API.Protocol, API.Protocol.of({
89
91
  }),
90
92
  decode: ({ response, outputAst, errors: errorClasses, }) => Effect.gen(function* () {
91
93
  const text = (yield* response.text.pipe(Effect.orDie)) ?? "";
92
- if (process.env.DISTILLED_DEBUG_HTTP) {
94
+ if (debugHttp()) {
93
95
  console.error(`[distilled] <- ${response.status} ${text.slice(0, 400)}`);
94
96
  }
95
97
  let json;
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,OAAO,EACL,eAAe,EACf,mBAAmB,GAEpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,YAAY,EACZ,MAAM,EACN,OAAO,EACP,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,kBAAkB,EAClB,aAAa,GAEd,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAoBrE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAe,EAAE,MAAc,EAAU,EAAE;IACrE,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACjC,IAAI,MAAM,KAAK,QAAQ;YAAE,OAAO,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACnE,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QAClD,MAAM,KAAK,GAAG,KAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,G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AAI,KAAK,SAAS;wBACtB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;wBAClB,CAAC,CAAC,SAAS;gBACjB,OAAO;gBACP,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;aAC5B,CAAC,CACH,CAAC;QACJ,CAAC;QAED,gEAAgE;QAChE,MAAM,IAAI,GAAY,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,gBAAgB,CACpC,SAAS,EACT,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,EAClC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,iBAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CACzE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3B,OAAO,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC,CAAC;CACL,CAAC,CACH,CAAC"}
package/lib/retry.d.ts CHANGED
@@ -18,7 +18,7 @@ import * as Effect from "effect/Effect";
18
18
  export { type Options, type Factory, type Policy, makeDefault, jittered, capped, throttlingOptions, transientOptions, throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
19
19
  declare const Retry_base: Context.ServiceClass<Retry, "StackitRetry", Policy>;
20
20
  /** Context tag for configuring retry behavior of STACKIT API calls. */
21
- export declare class Retry extends Retry_base {
21
+ export declare class Retry extends /*@__PURE__*/ Retry_base {
22
22
  }
23
23
  /** Provides a custom retry policy to every STACKIT API call below it. */
24
24
  export declare const policy: (optionsOrFactory: Policy) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
@@ -1 +1 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,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,mFAA+D,CAAC;AAEjF,kFAAkF;AAClF,eAAO,MAAM,UAAU,mFAA4B,CAAC;AAEpD,oFAAoF;AACpF,eAAO,MAAM,SAAS,mFAA2B,CAAC"}
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,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,aAAa,CAAC,UAAgD;CAAG;AAE5F,yEAAyE;AACzE,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,IAAI,mFAEhB,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,UAAU,mFAA0C,CAAC;AAElE,oFAAoF;AACpF,eAAO,MAAM,SAAS,mFAAyC,CAAC"}
package/lib/retry.js CHANGED
@@ -1,31 +1,32 @@
1
1
  import { throttlingFactory, transientFactory } from "@distilled.cloud/core/retry";
2
- /**
3
- * STACKIT retry configuration.
4
- *
5
- * Defines the per-SDK `Retry` Context.Service tag that generated operations
6
- * wire into `API.make`. Callers can install a blanket retry policy at the
7
- * layer level and have every STACKIT API call below it pick it up:
8
- *
9
- * @example
10
- * ```ts
11
- * import * as Stackit from "@distilled.cloud/stackit";
12
- *
13
- * myEffect.pipe(Stackit.Retry.transient);
14
- * ```
15
- */
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
16
  import * as Context from "effect/Context";
17
17
  import * as Effect from "effect/Effect";
18
18
  import * as Layer from "effect/Layer";
19
19
  export { makeDefault, jittered, capped, throttlingOptions, transientOptions, throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
20
- /** Context tag for configuring retry behavior of STACKIT API calls. */
21
- export class Retry extends Context.Service()("StackitRetry") {
20
+
21
+ export class Retry extends /*@__PURE__*/ /*@__PURE__*/ Context.Service()("StackitRetry") {
22
22
  }
23
- /** Provides a custom retry policy to every STACKIT API call below it. */
23
+
24
24
  export const policy = (optionsOrFactory) => Effect.provide(Layer.succeed(Retry, optionsOrFactory));
25
- /** Disables all automatic retries. */
26
- export const none = Effect.provide(Layer.succeed(Retry, { while: () => false }));
27
- /** Apply the throttling retry policy (retries throttling errors indefinitely). */
28
- export const throttling = policy(throttlingFactory);
29
- /** Apply the transient retry policy (retries all transient errors indefinitely). */
30
- export const transient = policy(transientFactory);
25
+
26
+ export const none = /*@__PURE__*/ Effect.provide(
27
+ /*@__PURE__*/ Layer.succeed(Retry, { while: () => false }));
28
+
29
+ export const throttling = /*@__PURE__*/ policy(throttlingFactory);
30
+
31
+ export const transient = /*@__PURE__*/ policy(transientFactory);
31
32
  //# sourceMappingURL=retry.js.map
package/lib/retry.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,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,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AAEjF,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"}
1
+ {"version":3,"file":"retry.js","sourceR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