@distilled.cloud/core 1.0.0-rc.15 → 1.0.0-rc.17

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 (318) hide show
  1. package/lib/_bundle/aws.js +2 -0
  2. package/lib/_bundle/aws.js.map +1 -0
  3. package/lib/_bundle/base.js +5 -0
  4. package/lib/_bundle/base.js.map +1 -0
  5. package/lib/_bundle/graphql.js +3 -0
  6. package/lib/_bundle/graphql.js.map +1 -0
  7. package/lib/_bundle/rest.js +2 -0
  8. package/lib/_bundle/rest.js.map +1 -0
  9. package/lib/_bundle/xml.js +4 -0
  10. package/lib/_bundle/xml.js.map +1 -0
  11. package/lib/api.d.ts +118 -13
  12. package/lib/api.d.ts.map +1 -1
  13. package/lib/api.js +1 -188
  14. package/lib/category.d.ts.map +1 -1
  15. package/lib/category.js +1 -278
  16. package/lib/chunks.d.ts +3 -0
  17. package/lib/chunks.d.ts.map +1 -0
  18. package/lib/chunks.js +1 -0
  19. package/lib/codegen/boolean-string-enums.js +36 -36
  20. package/lib/codegen/chunk.d.ts +7 -0
  21. package/lib/codegen/chunk.d.ts.map +1 -0
  22. package/lib/codegen/chunk.js +139 -0
  23. package/lib/codegen/chunk.js.map +1 -0
  24. package/lib/codegen/cli.d.ts.map +1 -1
  25. package/lib/codegen/cli.js +28 -14
  26. package/lib/codegen/cli.js.map +1 -1
  27. package/lib/codegen/datafy.d.ts +14 -0
  28. package/lib/codegen/datafy.d.ts.map +1 -0
  29. package/lib/codegen/datafy.js +853 -0
  30. package/lib/codegen/datafy.js.map +1 -0
  31. package/lib/codegen/dedupe.d.ts +5 -0
  32. package/lib/codegen/dedupe.d.ts.map +1 -0
  33. package/lib/codegen/dedupe.js +153 -0
  34. package/lib/codegen/dedupe.js.map +1 -0
  35. package/lib/codegen/emit.js +56 -56
  36. package/lib/codegen/format.js +18 -18
  37. package/lib/codegen/generated-at.js +29 -29
  38. package/lib/codegen/generator.d.ts.map +1 -1
  39. package/lib/codegen/generator.js +92 -84
  40. package/lib/codegen/generator.js.map +1 -1
  41. package/lib/codegen/graph.js +36 -36
  42. package/lib/codegen/graphql-client.d.ts +2 -0
  43. package/lib/codegen/graphql-client.d.ts.map +1 -1
  44. package/lib/codegen/graphql-client.js +55 -26
  45. package/lib/codegen/graphql-client.js.map +1 -1
  46. package/lib/codegen/graphql.js +113 -113
  47. package/lib/codegen/latin1.d.ts +3 -0
  48. package/lib/codegen/latin1.d.ts.map +1 -0
  49. package/lib/codegen/latin1.js +126 -0
  50. package/lib/codegen/latin1.js.map +1 -0
  51. package/lib/codegen/members.d.ts +7 -0
  52. package/lib/codegen/members.d.ts.map +1 -1
  53. package/lib/codegen/members.js +26 -19
  54. package/lib/codegen/members.js.map +1 -1
  55. package/lib/codegen/model-diff.js +6 -6
  56. package/lib/codegen/naming.js +19 -19
  57. package/lib/codegen/openapi-cli.js +15 -15
  58. package/lib/codegen/openapi.d.ts +17 -0
  59. package/lib/codegen/openapi.d.ts.map +1 -1
  60. package/lib/codegen/openapi.js +323 -169
  61. package/lib/codegen/openapi.js.map +1 -1
  62. package/lib/codegen/operations.js +14 -14
  63. package/lib/codegen/pagination.js +11 -11
  64. package/lib/codegen/patch-audit.js +57 -57
  65. package/lib/codegen/patches.js +79 -79
  66. package/lib/codegen/prelude.js +19 -19
  67. package/lib/codegen/privatize.d.ts +21 -0
  68. package/lib/codegen/privatize.d.ts.map +1 -0
  69. package/lib/codegen/privatize.js +176 -0
  70. package/lib/codegen/privatize.js.map +1 -0
  71. package/lib/codegen/proto.js +25 -25
  72. package/lib/codegen/pure.d.ts +6 -0
  73. package/lib/codegen/pure.d.ts.map +1 -0
  74. package/lib/codegen/pure.js +91 -0
  75. package/lib/codegen/pure.js.map +1 -0
  76. package/lib/codegen/rewrite-operation-ids.js +108 -108
  77. package/lib/codegen/spec-path.js +57 -57
  78. package/lib/codegen/table.d.ts +5 -0
  79. package/lib/codegen/table.d.ts.map +1 -0
  80. package/lib/codegen/table.js +249 -0
  81. package/lib/codegen/table.js.map +1 -0
  82. package/lib/config.d.ts +27 -0
  83. package/lib/config.d.ts.map +1 -0
  84. package/lib/config.js +1 -0
  85. package/lib/crypto.d.ts +76 -0
  86. package/lib/crypto.d.ts.map +1 -0
  87. package/lib/crypto.js +1 -0
  88. package/lib/debug.d.ts +2 -0
  89. package/lib/debug.d.ts.map +1 -0
  90. package/lib/debug.js +1 -0
  91. package/lib/error-category.d.ts +1 -1
  92. package/lib/error-category.d.ts.map +1 -1
  93. package/lib/error-category.js +1 -46
  94. package/lib/errors.d.ts +62 -62
  95. package/lib/errors.d.ts.map +1 -1
  96. package/lib/errors.js +1 -195
  97. package/lib/graphql.d.ts +31 -20
  98. package/lib/graphql.d.ts.map +1 -1
  99. package/lib/graphql.js +1 -1027
  100. package/lib/graphql.types.js +1 -5
  101. package/lib/index.d.ts +3 -2
  102. package/lib/index.d.ts.map +1 -1
  103. package/lib/index.js +1 -15
  104. package/lib/json-patch.d.ts +2 -2
  105. package/lib/json-patch.js +1 -226
  106. package/lib/json-patch.js.map +1 -1
  107. package/lib/pagination.d.ts +9 -25
  108. package/lib/pagination.d.ts.map +1 -1
  109. package/lib/pagination.js +1 -266
  110. package/lib/plain-values.d.ts +10 -0
  111. package/lib/plain-values.d.ts.map +1 -0
  112. package/lib/plain-values.js +2 -0
  113. package/lib/plain-values.js.map +1 -0
  114. package/lib/protocol-http.d.ts +50 -14
  115. package/lib/protocol-http.d.ts.map +1 -1
  116. package/lib/protocol-http.js +1 -639
  117. package/lib/protocol-rest.d.ts +38 -25
  118. package/lib/protocol-rest.d.ts.map +1 -1
  119. package/lib/protocol-rest.js +1 -267
  120. package/lib/query.js +1 -27
  121. package/lib/response-validation-strict.d.ts +48 -0
  122. package/lib/response-validation-strict.d.ts.map +1 -0
  123. package/lib/response-validation-strict.js +1 -0
  124. package/lib/response-validation.d.ts +43 -25
  125. package/lib/response-validation.d.ts.map +1 -1
  126. package/lib/response-validation.js +1 -76
  127. package/lib/retry-after.d.ts +3 -3
  128. package/lib/retry-after.js +1 -112
  129. package/lib/retry.d.ts +48 -29
  130. package/lib/retry.d.ts.map +1 -1
  131. package/lib/retry.js +1 -209
  132. package/lib/schema-lite-impl.d.ts +158 -0
  133. package/lib/schema-lite-impl.d.ts.map +1 -0
  134. package/lib/schema-lite-impl.js +1 -0
  135. package/lib/schema-lite-typed.d.ts +41 -0
  136. package/lib/schema-lite-typed.d.ts.map +1 -0
  137. package/lib/schema-lite-typed.js +2 -0
  138. package/lib/schema-lite-typed.js.map +1 -0
  139. package/lib/schema-lite.d.ts +40 -0
  140. package/lib/schema-lite.d.ts.map +1 -0
  141. package/lib/schema-lite.js +1 -0
  142. package/lib/schema.d.ts +20 -6
  143. package/lib/schema.d.ts.map +1 -1
  144. package/lib/schema.js +1 -48
  145. package/lib/testing.d.ts +3 -2
  146. package/lib/testing.d.ts.map +1 -1
  147. package/lib/testing.js +1 -40
  148. package/lib/testing.js.map +1 -1
  149. package/lib/trait.d.ts +13 -13
  150. package/lib/trait.d.ts.map +1 -1
  151. package/lib/trait.js +1 -131
  152. package/lib/xml.d.ts +1 -1
  153. package/lib/xml.d.ts.map +1 -1
  154. package/lib/xml.js +1 -311
  155. package/package.json +9 -7
  156. package/src/api.ts +1080 -180
  157. package/src/category.ts +33 -33
  158. package/src/chunks.ts +30 -0
  159. package/src/codegen/chunk.ts +147 -0
  160. package/src/codegen/cli.ts +27 -1
  161. package/src/codegen/datafy.ts +874 -0
  162. package/src/codegen/dedupe.ts +173 -0
  163. package/src/codegen/generator.ts +10 -3
  164. package/src/codegen/graphql-client.ts +49 -15
  165. package/src/codegen/latin1.ts +131 -0
  166. package/src/codegen/members.ts +8 -0
  167. package/src/codegen/openapi.ts +194 -3
  168. package/src/codegen/privatize.ts +200 -0
  169. package/src/codegen/pure.ts +94 -0
  170. package/src/codegen/table.ts +254 -0
  171. package/src/config.ts +216 -0
  172. package/src/crypto.ts +202 -0
  173. package/src/debug.ts +8 -0
  174. package/src/error-category.ts +2 -1
  175. package/src/errors.ts +65 -56
  176. package/src/graphql.ts +109 -62
  177. package/src/graphql.types.ts +9 -7
  178. package/src/index.ts +3 -2
  179. package/src/json-patch.ts +2 -2
  180. package/src/pagination.ts +37 -18
  181. package/src/plain-values.ts +41 -0
  182. package/src/protocol-http.ts +378 -145
  183. package/src/protocol-rest.ts +337 -169
  184. package/src/response-validation-strict.ts +327 -0
  185. package/src/response-validation.ts +101 -50
  186. package/src/retry-after.ts +3 -3
  187. package/src/retry.ts +94 -93
  188. package/src/schema-lite-impl.ts +550 -0
  189. package/src/schema-lite-typed.ts +44 -0
  190. package/src/schema-lite.ts +44 -0
  191. package/src/schema.ts +258 -14
  192. package/src/testing.ts +4 -2
  193. package/src/trait.ts +36 -28
  194. package/src/xml.ts +31 -17
  195. package/lib/api.js.map +0 -1
  196. package/lib/category.js.map +0 -1
  197. package/lib/codegen/boolean-string-enums.test.d.ts +0 -2
  198. package/lib/codegen/boolean-string-enums.test.d.ts.map +0 -1
  199. package/lib/codegen/boolean-string-enums.test.js +0 -275
  200. package/lib/codegen/boolean-string-enums.test.js.map +0 -1
  201. package/lib/codegen/defer-naming.test.d.ts +0 -2
  202. package/lib/codegen/defer-naming.test.d.ts.map +0 -1
  203. package/lib/codegen/defer-naming.test.js +0 -105
  204. package/lib/codegen/defer-naming.test.js.map +0 -1
  205. package/lib/codegen/generated-at.test.d.ts +0 -2
  206. package/lib/codegen/generated-at.test.d.ts.map +0 -1
  207. package/lib/codegen/generated-at.test.js +0 -81
  208. package/lib/codegen/generated-at.test.js.map +0 -1
  209. package/lib/codegen/generator.test.d.ts +0 -2
  210. package/lib/codegen/generator.test.d.ts.map +0 -1
  211. package/lib/codegen/generator.test.js +0 -121
  212. package/lib/codegen/generator.test.js.map +0 -1
  213. package/lib/codegen/graphql-client.test.d.ts +0 -2
  214. package/lib/codegen/graphql-client.test.d.ts.map +0 -1
  215. package/lib/codegen/graphql-client.test.js +0 -171
  216. package/lib/codegen/graphql-client.test.js.map +0 -1
  217. package/lib/codegen/openapi-binary.test.d.ts +0 -2
  218. package/lib/codegen/openapi-binary.test.d.ts.map +0 -1
  219. package/lib/codegen/openapi-binary.test.js +0 -67
  220. package/lib/codegen/openapi-binary.test.js.map +0 -1
  221. package/lib/codegen/patch-audit.test.d.ts +0 -2
  222. package/lib/codegen/patch-audit.test.d.ts.map +0 -1
  223. package/lib/codegen/patch-audit.test.js +0 -141
  224. package/lib/codegen/patch-audit.test.js.map +0 -1
  225. package/lib/codegen/patches.test.d.ts +0 -2
  226. package/lib/codegen/patches.test.d.ts.map +0 -1
  227. package/lib/codegen/patches.test.js +0 -155
  228. package/lib/codegen/patches.test.js.map +0 -1
  229. package/lib/codegen/protocol-imports.test.d.ts +0 -2
  230. package/lib/codegen/protocol-imports.test.d.ts.map +0 -1
  231. package/lib/codegen/protocol-imports.test.js +0 -36
  232. package/lib/codegen/protocol-imports.test.js.map +0 -1
  233. package/lib/codegen/rewrite-operation-ids.test.d.ts +0 -2
  234. package/lib/codegen/rewrite-operation-ids.test.d.ts.map +0 -1
  235. package/lib/codegen/rewrite-operation-ids.test.js +0 -451
  236. package/lib/codegen/rewrite-operation-ids.test.js.map +0 -1
  237. package/lib/codegen/untagged-unions.test.d.ts +0 -2
  238. package/lib/codegen/untagged-unions.test.d.ts.map +0 -1
  239. package/lib/codegen/untagged-unions.test.js +0 -80
  240. package/lib/codegen/untagged-unions.test.js.map +0 -1
  241. package/lib/error-category.js.map +0 -1
  242. package/lib/errors.js.map +0 -1
  243. package/lib/fixtures/xml/upstream-validator.json +0 -397
  244. package/lib/graphql.js.map +0 -1
  245. package/lib/graphql.test.d.ts +0 -2
  246. package/lib/graphql.test.d.ts.map +0 -1
  247. package/lib/graphql.test.js +0 -151
  248. package/lib/graphql.test.js.map +0 -1
  249. package/lib/graphql.types.js.map +0 -1
  250. package/lib/index.js.map +0 -1
  251. package/lib/json-patch.test.d.ts +0 -2
  252. package/lib/json-patch.test.d.ts.map +0 -1
  253. package/lib/json-patch.test.js +0 -65
  254. package/lib/json-patch.test.js.map +0 -1
  255. package/lib/pagination.js.map +0 -1
  256. package/lib/pagination.test.d.ts +0 -2
  257. package/lib/pagination.test.d.ts.map +0 -1
  258. package/lib/pagination.test.js +0 -131
  259. package/lib/pagination.test.js.map +0 -1
  260. package/lib/protocol-http.js.map +0 -1
  261. package/lib/protocol-http.test.d.ts +0 -2
  262. package/lib/protocol-http.test.d.ts.map +0 -1
  263. package/lib/protocol-http.test.js +0 -228
  264. package/lib/protocol-http.test.js.map +0 -1
  265. package/lib/protocol-rest.js.map +0 -1
  266. package/lib/protocol-rest.test.d.ts +0 -2
  267. package/lib/protocol-rest.test.d.ts.map +0 -1
  268. package/lib/protocol-rest.test.js +0 -498
  269. package/lib/protocol-rest.test.js.map +0 -1
  270. package/lib/query.js.map +0 -1
  271. package/lib/response-validation.js.map +0 -1
  272. package/lib/response-validation.test.d.ts +0 -2
  273. package/lib/response-validation.test.d.ts.map +0 -1
  274. package/lib/response-validation.test.js +0 -72
  275. package/lib/response-validation.test.js.map +0 -1
  276. package/lib/retry-after.js.map +0 -1
  277. package/lib/retry-after.test.d.ts +0 -2
  278. package/lib/retry-after.test.d.ts.map +0 -1
  279. package/lib/retry-after.test.js +0 -204
  280. package/lib/retry-after.test.js.map +0 -1
  281. package/lib/retry.js.map +0 -1
  282. package/lib/retry.test.d.ts +0 -2
  283. package/lib/retry.test.d.ts.map +0 -1
  284. package/lib/retry.test.js +0 -407
  285. package/lib/retry.test.js.map +0 -1
  286. package/lib/schema.js.map +0 -1
  287. package/lib/sdks.test.d.ts +0 -2
  288. package/lib/sdks.test.d.ts.map +0 -1
  289. package/lib/sdks.test.js +0 -76
  290. package/lib/sdks.test.js.map +0 -1
  291. package/lib/trait.js.map +0 -1
  292. package/lib/xml.js.map +0 -1
  293. package/lib/xml.test.d.ts +0 -2
  294. package/lib/xml.test.d.ts.map +0 -1
  295. package/lib/xml.test.js +0 -210
  296. package/lib/xml.test.js.map +0 -1
  297. package/src/codegen/boolean-string-enums.test.ts +0 -299
  298. package/src/codegen/defer-naming.test.ts +0 -113
  299. package/src/codegen/generated-at.test.ts +0 -89
  300. package/src/codegen/generator.test.ts +0 -137
  301. package/src/codegen/graphql-client.test.ts +0 -189
  302. package/src/codegen/openapi-binary.test.ts +0 -91
  303. package/src/codegen/patch-audit.test.ts +0 -160
  304. package/src/codegen/patches.test.ts +0 -188
  305. package/src/codegen/protocol-imports.test.ts +0 -39
  306. package/src/codegen/rewrite-operation-ids.test.ts +0 -472
  307. package/src/codegen/untagged-unions.test.ts +0 -85
  308. package/src/fixtures/xml/upstream-validator.json +0 -397
  309. package/src/graphql.test.ts +0 -198
  310. package/src/json-patch.test.ts +0 -77
  311. package/src/pagination.test.ts +0 -169
  312. package/src/protocol-http.test.ts +0 -276
  313. package/src/protocol-rest.test.ts +0 -703
  314. package/src/response-validation.test.ts +0 -89
  315. package/src/retry-after.test.ts +0 -267
  316. package/src/retry.test.ts +0 -566
  317. package/src/sdks.test.ts +0 -87
  318. package/src/xml.test.ts +0 -251
package/lib/errors.d.ts CHANGED
@@ -6,21 +6,21 @@
6
6
  * that are used across all SDKs.
7
7
  */
8
8
  import * as Duration from "effect/Duration";
9
- import * as Schema from "effect/Schema";
10
9
  import * as Category from "./category.ts";
10
+ import * as Schema from "./schema-lite-typed.ts";
11
11
  /**
12
12
  * Opaque schema for an Effect `Duration.Duration` value.
13
13
  *
14
14
  * Used on retryable errors to carry a server-provided wait hint (e.g. parsed
15
15
  * from `Retry-After` or the IETF `Ratelimit` header). Core does not encode/decode
16
- * this field over the wire — it is constructed at runtime by `matchError` from
16
+ * this field over the wire -- it is constructed at runtime by `matchError` from
17
17
  * whatever the service actually returns (delay-seconds, HTTP-date, epoch, etc.)
18
18
  * and consumed at runtime by the retry policy.
19
19
  */
20
- export declare const DurationSchema: Schema.declare<Duration.Duration, Duration.Duration>;
21
- declare const Unauthorized_base: Schema.Class<Unauthorized, Schema.TaggedStruct<"Unauthorized", {
22
- readonly message: Schema.String;
23
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
20
+ export declare const DurationSchema: import("effect/Schema").declare<Duration.Duration, Duration.Duration>;
21
+ declare const Unauthorized_base: Schema.TaggedErrorClass<"Unauthorized", {
22
+ readonly message: import("effect/Schema").String;
23
+ }> & (new (...args: any[]) => {
24
24
  "@distilled.cloud/error/categories": {
25
25
  AuthError: true;
26
26
  };
@@ -28,11 +28,11 @@ declare const Unauthorized_base: Schema.Class<Unauthorized, Schema.TaggedStruct<
28
28
  /**
29
29
  * Unauthorized - Authentication failure (401).
30
30
  */
31
- export declare class Unauthorized extends Unauthorized_base {
31
+ export declare class Unauthorized extends /*@__PURE__*/ Unauthorized_base {
32
32
  }
33
- declare const Forbidden_base: Schema.Class<Forbidden, Schema.TaggedStruct<"Forbidden", {
34
- readonly message: Schema.String;
35
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
33
+ declare const Forbidden_base: Schema.TaggedErrorClass<"Forbidden", {
34
+ readonly message: import("effect/Schema").String;
35
+ }> & (new (...args: any[]) => {
36
36
  "@distilled.cloud/error/categories": {
37
37
  AuthError: true;
38
38
  };
@@ -40,11 +40,11 @@ declare const Forbidden_base: Schema.Class<Forbidden, Schema.TaggedStruct<"Forbi
40
40
  /**
41
41
  * Forbidden - Access denied (403).
42
42
  */
43
- export declare class Forbidden extends Forbidden_base {
43
+ export declare class Forbidden extends /*@__PURE__*/ Forbidden_base {
44
44
  }
45
- declare const NotFound_base: Schema.Class<NotFound, Schema.TaggedStruct<"NotFound", {
46
- readonly message: Schema.String;
47
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
45
+ declare const NotFound_base: Schema.TaggedErrorClass<"NotFound", {
46
+ readonly message: import("effect/Schema").String;
47
+ }> & (new (...args: any[]) => {
48
48
  "@distilled.cloud/error/categories": {
49
49
  NotFoundError: true;
50
50
  };
@@ -52,11 +52,11 @@ declare const NotFound_base: Schema.Class<NotFound, Schema.TaggedStruct<"NotFoun
52
52
  /**
53
53
  * NotFound - Resource not found (404).
54
54
  */
55
- export declare class NotFound extends NotFound_base {
55
+ export declare class NotFound extends /*@__PURE__*/ NotFound_base {
56
56
  }
57
- declare const BadRequest_base: Schema.Class<BadRequest, Schema.TaggedStruct<"BadRequest", {
58
- readonly message: Schema.String;
59
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
57
+ declare const BadRequest_base: Schema.TaggedErrorClass<"BadRequest", {
58
+ readonly message: import("effect/Schema").String;
59
+ }> & (new (...args: any[]) => {
60
60
  "@distilled.cloud/error/categories": {
61
61
  BadRequestError: true;
62
62
  };
@@ -64,11 +64,11 @@ declare const BadRequest_base: Schema.Class<BadRequest, Schema.TaggedStruct<"Bad
64
64
  /**
65
65
  * BadRequest - Invalid request (400).
66
66
  */
67
- export declare class BadRequest extends BadRequest_base {
67
+ export declare class BadRequest extends /*@__PURE__*/ BadRequest_base {
68
68
  }
69
- declare const Conflict_base: Schema.Class<Conflict, Schema.TaggedStruct<"Conflict", {
70
- readonly message: Schema.String;
71
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
69
+ declare const Conflict_base: Schema.TaggedErrorClass<"Conflict", {
70
+ readonly message: import("effect/Schema").String;
71
+ }> & (new (...args: any[]) => {
72
72
  "@distilled.cloud/error/categories": {
73
73
  ConflictError: true;
74
74
  };
@@ -76,11 +76,11 @@ declare const Conflict_base: Schema.Class<Conflict, Schema.TaggedStruct<"Conflic
76
76
  /**
77
77
  * Conflict - Resource conflict (409).
78
78
  */
79
- export declare class Conflict extends Conflict_base {
79
+ export declare class Conflict extends /*@__PURE__*/ Conflict_base {
80
80
  }
81
- declare const UnprocessableEntity_base: Schema.Class<UnprocessableEntity, Schema.TaggedStruct<"UnprocessableEntity", {
82
- readonly message: Schema.String;
83
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
81
+ declare const UnprocessableEntity_base: Schema.TaggedErrorClass<"UnprocessableEntity", {
82
+ readonly message: import("effect/Schema").String;
83
+ }> & (new (...args: any[]) => {
84
84
  "@distilled.cloud/error/categories": {
85
85
  BadRequestError: true;
86
86
  };
@@ -88,12 +88,12 @@ declare const UnprocessableEntity_base: Schema.Class<UnprocessableEntity, Schema
88
88
  /**
89
89
  * UnprocessableEntity - Validation error (422).
90
90
  */
91
- export declare class UnprocessableEntity extends UnprocessableEntity_base {
91
+ export declare class UnprocessableEntity extends /*@__PURE__*/ UnprocessableEntity_base {
92
92
  }
93
- declare const TooManyRequests_base: Schema.Class<TooManyRequests, Schema.TaggedStruct<"TooManyRequests", {
94
- readonly message: Schema.String;
95
- readonly retryAfter: Schema.optional<Schema.declare<Duration.Duration, Duration.Duration>>;
96
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
93
+ declare const TooManyRequests_base: Schema.TaggedErrorClass<"TooManyRequests", {
94
+ readonly message: import("effect/Schema").String;
95
+ readonly retryAfter: import("effect/Schema").optional<import("effect/Schema").declare<Duration.Duration, Duration.Duration>>;
96
+ }> & (new (...args: any[]) => {
97
97
  "@distilled.cloud/error/categories": {
98
98
  ThrottlingError: true;
99
99
  };
@@ -103,12 +103,12 @@ declare const TooManyRequests_base: Schema.Class<TooManyRequests, Schema.TaggedS
103
103
  /**
104
104
  * TooManyRequests - Rate limited (429).
105
105
  */
106
- export declare class TooManyRequests extends TooManyRequests_base {
106
+ export declare class TooManyRequests extends /*@__PURE__*/ TooManyRequests_base {
107
107
  }
108
- declare const Locked_base: Schema.Class<Locked, Schema.TaggedStruct<"Locked", {
109
- readonly message: Schema.String;
110
- readonly retryAfter: Schema.optional<Schema.declare<Duration.Duration, Duration.Duration>>;
111
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
108
+ declare const Locked_base: Schema.TaggedErrorClass<"Locked", {
109
+ readonly message: import("effect/Schema").String;
110
+ readonly retryAfter: import("effect/Schema").optional<import("effect/Schema").declare<Duration.Duration, Duration.Duration>>;
111
+ }> & (new (...args: any[]) => {
112
112
  "@distilled.cloud/error/categories": {
113
113
  LockedError: true;
114
114
  };
@@ -118,13 +118,13 @@ declare const Locked_base: Schema.Class<Locked, Schema.TaggedStruct<"Locked", {
118
118
  /**
119
119
  * Locked - Resource locked (423).
120
120
  */
121
- export declare class Locked extends Locked_base {
121
+ export declare class Locked extends /*@__PURE__*/ Locked_base {
122
122
  }
123
- declare const InternalServerError_base: Schema.Class<InternalServerError, Schema.TaggedStruct<"InternalServerError", {
124
- readonly message: Schema.String;
125
- readonly code: Schema.optional<Schema.Number>;
126
- readonly retryAfter: Schema.optional<Schema.declare<Duration.Duration, Duration.Duration>>;
127
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
123
+ declare const InternalServerError_base: Schema.TaggedErrorClass<"InternalServerError", {
124
+ readonly message: import("effect/Schema").String;
125
+ readonly code: import("effect/Schema").optional<import("effect/Schema").Number>;
126
+ readonly retryAfter: import("effect/Schema").optional<import("effect/Schema").declare<Duration.Duration, Duration.Duration>>;
127
+ }> & (new (...args: any[]) => {
128
128
  "@distilled.cloud/error/categories": {
129
129
  ServerError: true;
130
130
  };
@@ -139,12 +139,12 @@ declare const InternalServerError_base: Schema.Class<InternalServerError, Schema
139
139
  * 200 envelope carrying `{ code: 10002, message: "An unknown error has
140
140
  * occurred" }` for transient backend failures on some endpoints).
141
141
  */
142
- export declare class InternalServerError extends InternalServerError_base {
142
+ export declare class InternalServerError extends /*@__PURE__*/ InternalServerError_base {
143
143
  }
144
- declare const BadGateway_base: Schema.Class<BadGateway, Schema.TaggedStruct<"BadGateway", {
145
- readonly message: Schema.String;
146
- readonly retryAfter: Schema.optional<Schema.declare<Duration.Duration, Duration.Duration>>;
147
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
144
+ declare const BadGateway_base: Schema.TaggedErrorClass<"BadGateway", {
145
+ readonly message: import("effect/Schema").String;
146
+ readonly retryAfter: import("effect/Schema").optional<import("effect/Schema").declare<Duration.Duration, Duration.Duration>>;
147
+ }> & (new (...args: any[]) => {
148
148
  "@distilled.cloud/error/categories": {
149
149
  ServerError: true;
150
150
  };
@@ -154,12 +154,12 @@ declare const BadGateway_base: Schema.Class<BadGateway, Schema.TaggedStruct<"Bad
154
154
  /**
155
155
  * BadGateway - Bad gateway (502).
156
156
  */
157
- export declare class BadGateway extends BadGateway_base {
157
+ export declare class BadGateway extends /*@__PURE__*/ BadGateway_base {
158
158
  }
159
- declare const ServiceUnavailable_base: Schema.Class<ServiceUnavailable, Schema.TaggedStruct<"ServiceUnavailable", {
160
- readonly message: Schema.String;
161
- readonly retryAfter: Schema.optional<Schema.declare<Duration.Duration, Duration.Duration>>;
162
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
159
+ declare const ServiceUnavailable_base: Schema.TaggedErrorClass<"ServiceUnavailable", {
160
+ readonly message: import("effect/Schema").String;
161
+ readonly retryAfter: import("effect/Schema").optional<import("effect/Schema").declare<Duration.Duration, Duration.Duration>>;
162
+ }> & (new (...args: any[]) => {
163
163
  "@distilled.cloud/error/categories": {
164
164
  ServerError: true;
165
165
  };
@@ -169,12 +169,12 @@ declare const ServiceUnavailable_base: Schema.Class<ServiceUnavailable, Schema.T
169
169
  /**
170
170
  * ServiceUnavailable - Service unavailable (503).
171
171
  */
172
- export declare class ServiceUnavailable extends ServiceUnavailable_base {
172
+ export declare class ServiceUnavailable extends /*@__PURE__*/ ServiceUnavailable_base {
173
173
  }
174
- declare const GatewayTimeout_base: Schema.Class<GatewayTimeout, Schema.TaggedStruct<"GatewayTimeout", {
175
- readonly message: Schema.String;
176
- readonly retryAfter: Schema.optional<Schema.declare<Duration.Duration, Duration.Duration>>;
177
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
174
+ declare const GatewayTimeout_base: Schema.TaggedErrorClass<"GatewayTimeout", {
175
+ readonly message: import("effect/Schema").String;
176
+ readonly retryAfter: import("effect/Schema").optional<import("effect/Schema").declare<Duration.Duration, Duration.Duration>>;
177
+ }> & (new (...args: any[]) => {
178
178
  "@distilled.cloud/error/categories": {
179
179
  ServerError: true;
180
180
  };
@@ -184,11 +184,11 @@ declare const GatewayTimeout_base: Schema.Class<GatewayTimeout, Schema.TaggedStr
184
184
  /**
185
185
  * GatewayTimeout - HTTP request or gateway timeout (408, 504).
186
186
  */
187
- export declare class GatewayTimeout extends GatewayTimeout_base {
187
+ export declare class GatewayTimeout extends /*@__PURE__*/ GatewayTimeout_base {
188
188
  }
189
- declare const ConfigError_base: Schema.Class<ConfigError, Schema.TaggedStruct<"ConfigError", {
190
- readonly message: Schema.String;
191
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
189
+ declare const ConfigError_base: Schema.TaggedErrorClass<"ConfigError", {
190
+ readonly message: import("effect/Schema").String;
191
+ }> & (new (...args: any[]) => {
192
192
  "@distilled.cloud/error/categories": {
193
193
  ConfigurationError: true;
194
194
  };
@@ -196,7 +196,7 @@ declare const ConfigError_base: Schema.Class<ConfigError, Schema.TaggedStruct<"C
196
196
  /**
197
197
  * Configuration error - missing or invalid configuration.
198
198
  */
199
- export declare class ConfigError extends ConfigError_base {
199
+ export declare class ConfigError extends /*@__PURE__*/ ConfigError_base {
200
200
  }
201
201
  /**
202
202
  * Mapping from HTTP status codes to common error classes.
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAM1C;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,sDAAyD,CAAC;;;;;;;;AAMrF;;GAEG;AACH,qBAAa,YAAa,SAAQ,iBAEH;CAAG;;;;;;;;AAElC;;GAEG;AACH,qBAAa,SAAU,SAAQ,cAEA;CAAG;;;;;;;;AAElC;;GAEG;AACH,qBAAa,QAAS,SAAQ,aAEK;CAAG;;;;;;;;AAEtC;;GAEG;AACH,qBAAa,UAAW,SAAQ,eAEK;CAAG;;;;;;;;AAExC;;GAEG;AACH,qBAAa,QAAS,SAAQ,aAEK;CAAG;;;;;;;;AAEtC;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,wBAGL;CAAG;;;;;;;;;;;AAEvC;;GAEG;AACH,qBAAa,eAAgB,SAAQ,oBAG8C;CAAG;;;;;;;;;;;AAEtF;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAG+B;CAAG;;;;;;;;;;;;AAE9D;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,wBAOiB;CAAG;;;;;;;;;;;AAE7D;;GAEG;AACH,qBAAa,UAAW,SAAQ,eAG2B;CAAG;;;;;;;;;;;AAE9D;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,uBAMkB;CAAG;;;;;;;;;;;AAE7D;;GAEG;AACH,qBAAa,cAAe,SAAQ,mBAGuB;CAAG;;;;;;;;AAE9D;;GAEG;AACH,qBAAa,WAAY,SAAQ,gBAEO;CAAG;AAM3C;;GAEG;AACH,eAAO,MAAM,eAAe;aAC1B,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;CACK,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,sBAAsB,aAA0C,CAAC;AAE9E;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,aAA+C,CAAC;AAEpF;;GAEG;AACH,eAAO,MAAM,UAAU,2QAab,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,cAAc,yJAOjB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE1E,eAAO,MAAM,SAAS,EAAG,6BAAsC,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAMjD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,uEAAuE,CAAC;;;;;;;;AAMnG;;GAEG;AACH,qBAAa,YACX,SAAQ,aAAa,CAAC,iBAES;CAAG;;;;;;;;AAEpC;;GAEG;AACH,qBAAa,SACX,SAAQ,aAAa,CAAC,cAES;CAAG;;;;;;;;AAEpC;;GAEG;AACH,qBAAa,QACX,SAAQ,aAAa,CAAC,aAEa;CAAG;;;;;;;;AAExC;;GAEG;AACH,qBAAa,UACX,SAAQ,aAAa,CAAC,eAEe;CAAG;;;;;;;;AAE1C;;GAEG;AACH,qBAAa,QACX,SAAQ,aAAa,CAAC,aAEa;CAAG;;;;;;;;AAExC;;GAEG;AACH,qBAAa,mBACX,SAAQ,aAAa,CAAC,wBAEe;CAAG;;;;;;;;;;;AAE1C;;GAEG;AACH,qBAAa,eACX,SAAQ,aAAa,CAAC,oBAMrB;CAAG;;;;;;;;;;;AAEN;;GAEG;AACH,qBAAa,MACX,SAAQ,aAAa,CAAC,WAGmD;CAAG;;;;;;;;;;;;AAE9E;;;;;;;GAOG;AACH,qBAAa,mBACX,SAAQ,aAAa,CAAC,wBAImD;CAAG;;;;;;;;;;;AAE9E;;GAEG;AACH,qBAAa,UACX,SAAQ,aAAa,CAAC,eAGmD;CAAG;;;;;;;;;;;AAE9E;;GAEG;AACH,qBAAa,kBACX,SAAQ,aAAa,CAAC,uBAGmD;CAAG;;;;;;;;;;;AAE9E;;GAEG;AACH,qBAAa,cACX,SAAQ,aAAa,CAAC,mBAGmD;CAAG;;;;;;;;AAE9E;;GAEG;AACH,qBAAa,WACX,SAAQ,aAAa,CAAC,gBAEkB;CAAG;AAM7C;;GAEG;AACH,eAAO,MAAM,eAAe;aAC1B,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;aACH,GAAG;CACK,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,sBAAsB,aAAwD,CAAC;AAE5F;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,aAA6D,CAAC;AAElG;;GAEG;AACH,eAAO,MAAM,UAAU,2QAab,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,cAAc,yJAOjB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE1E,eAAO,MAAM,SAAS,EAAG,6BAAsC,CAAC"}
package/lib/errors.js CHANGED
@@ -1,195 +1 @@
1
- /**
2
- * Common error types shared across SDKs.
3
- *
4
- * Each SDK defines its own provider-specific errors (e.g., Unauthorized, NotFound)
5
- * using the category system. This module provides base error types and utilities
6
- * that are used across all SDKs.
7
- */
8
- import * as Duration from "effect/Duration";
9
- import * as Schema from "effect/Schema";
10
- import * as Category from "./category.js";
11
- // ============================================================================
12
- // Shared Schema Helpers
13
- // ============================================================================
14
- /**
15
- * Opaque schema for an Effect `Duration.Duration` value.
16
- *
17
- * Used on retryable errors to carry a server-provided wait hint (e.g. parsed
18
- * from `Retry-After` or the IETF `Ratelimit` header). Core does not encode/decode
19
- * this field over the wire — it is constructed at runtime by `matchError` from
20
- * whatever the service actually returns (delay-seconds, HTTP-date, epoch, etc.)
21
- * and consumed at runtime by the retry policy.
22
- */
23
- export const DurationSchema = Schema.declare(Duration.isDuration);
24
- // ============================================================================
25
- // Common HTTP Status Error Classes
26
- // ============================================================================
27
- /**
28
- * Unauthorized - Authentication failure (401).
29
- */
30
- export class Unauthorized extends Schema.TaggedError()("Unauthorized", {
31
- message: Schema.String,
32
- }).pipe(Category.withAuthError) {
33
- }
34
- /**
35
- * Forbidden - Access denied (403).
36
- */
37
- export class Forbidden extends Schema.TaggedError()("Forbidden", {
38
- message: Schema.String,
39
- }).pipe(Category.withAuthError) {
40
- }
41
- /**
42
- * NotFound - Resource not found (404).
43
- */
44
- export class NotFound extends Schema.TaggedError()("NotFound", {
45
- message: Schema.String,
46
- }).pipe(Category.withNotFoundError) {
47
- }
48
- /**
49
- * BadRequest - Invalid request (400).
50
- */
51
- export class BadRequest extends Schema.TaggedError()("BadRequest", {
52
- message: Schema.String,
53
- }).pipe(Category.withBadRequestError) {
54
- }
55
- /**
56
- * Conflict - Resource conflict (409).
57
- */
58
- export class Conflict extends Schema.TaggedError()("Conflict", {
59
- message: Schema.String,
60
- }).pipe(Category.withConflictError) {
61
- }
62
- /**
63
- * UnprocessableEntity - Validation error (422).
64
- */
65
- export class UnprocessableEntity extends Schema.TaggedError()("UnprocessableEntity", { message: Schema.String }).pipe(Category.withBadRequestError) {
66
- }
67
- /**
68
- * TooManyRequests - Rate limited (429).
69
- */
70
- export class TooManyRequests extends Schema.TaggedError()("TooManyRequests", {
71
- message: Schema.String,
72
- retryAfter: Schema.optional(DurationSchema),
73
- }).pipe(Category.withThrottlingError, Category.withRetryable({ throttling: true })) {
74
- }
75
- /**
76
- * Locked - Resource locked (423).
77
- */
78
- export class Locked extends Schema.TaggedError()("Locked", {
79
- message: Schema.String,
80
- retryAfter: Schema.optional(DurationSchema),
81
- }).pipe(Category.withLockedError, Category.withRetryable()) {
82
- }
83
- /**
84
- * InternalServerError - Server error.
85
- *
86
- * Mapped from HTTP 500 by default. Per-service patches may also pin it to a
87
- * specific in-band error code/message combination (e.g. Cloudflare returns a
88
- * 200 envelope carrying `{ code: 10002, message: "An unknown error has
89
- * occurred" }` for transient backend failures on some endpoints).
90
- */
91
- export class InternalServerError extends Schema.TaggedError()("InternalServerError", {
92
- message: Schema.String,
93
- code: Schema.optional(Schema.Number),
94
- retryAfter: Schema.optional(DurationSchema),
95
- }).pipe(Category.withServerError, Category.withRetryable()) {
96
- }
97
- /**
98
- * BadGateway - Bad gateway (502).
99
- */
100
- export class BadGateway extends Schema.TaggedError()("BadGateway", {
101
- message: Schema.String,
102
- retryAfter: Schema.optional(DurationSchema),
103
- }).pipe(Category.withServerError, Category.withRetryable()) {
104
- }
105
- /**
106
- * ServiceUnavailable - Service unavailable (503).
107
- */
108
- export class ServiceUnavailable extends Schema.TaggedError()("ServiceUnavailable", {
109
- message: Schema.String,
110
- retryAfter: Schema.optional(DurationSchema),
111
- }).pipe(Category.withServerError, Category.withRetryable()) {
112
- }
113
- /**
114
- * GatewayTimeout - HTTP request or gateway timeout (408, 504).
115
- */
116
- export class GatewayTimeout extends Schema.TaggedError()("GatewayTimeout", {
117
- message: Schema.String,
118
- retryAfter: Schema.optional(DurationSchema),
119
- }).pipe(Category.withServerError, Category.withRetryable()) {
120
- }
121
- /**
122
- * Configuration error - missing or invalid configuration.
123
- */
124
- export class ConfigError extends Schema.TaggedError()("ConfigError", {
125
- message: Schema.String,
126
- }).pipe(Category.withConfigurationError) {
127
- }
128
- // ============================================================================
129
- // Error Maps
130
- // ============================================================================
131
- /**
132
- * Mapping from HTTP status codes to common error classes.
133
- */
134
- export const HTTP_STATUS_MAP = {
135
- 400: BadRequest,
136
- 401: Unauthorized,
137
- 403: Forbidden,
138
- 404: NotFound,
139
- 408: GatewayTimeout,
140
- 409: Conflict,
141
- 422: UnprocessableEntity,
142
- 423: Locked,
143
- 429: TooManyRequests,
144
- 500: InternalServerError,
145
- 502: BadGateway,
146
- 503: ServiceUnavailable,
147
- 504: GatewayTimeout,
148
- };
149
- /**
150
- * HTTP status codes that are considered "default" errors (always present).
151
- * These are excluded from per-operation error types since they're handled globally.
152
- */
153
- export const DEFAULT_ERROR_STATUSES = new Set([401, 429, 500, 502, 503, 504]);
154
- /**
155
- * HTTP status codes whose corresponding error class in {@link HTTP_STATUS_MAP}
156
- * declares a `retryAfter` field. The retry policy honors `error.retryAfter`
157
- * with precedence over the default backoff for these.
158
- *
159
- * `matchError` implementations should only pass `retryAfter` into the
160
- * constructor when the status is in this set; passing it on non-retryable
161
- * classes (BadRequest/Unauthorized/etc.) would silently retain it as a
162
- * stale field on the instance and pollute serialized output.
163
- */
164
- export const RETRYABLE_HTTP_STATUSES = new Set([408, 423, 429, 500, 502, 503, 504]);
165
- /**
166
- * All common API error classes.
167
- */
168
- export const API_ERRORS = [
169
- Unauthorized,
170
- Forbidden,
171
- NotFound,
172
- BadRequest,
173
- Conflict,
174
- UnprocessableEntity,
175
- TooManyRequests,
176
- Locked,
177
- InternalServerError,
178
- BadGateway,
179
- ServiceUnavailable,
180
- GatewayTimeout,
181
- ];
182
- /**
183
- * Default errors that apply to ALL operations.
184
- * These are infrastructure-level errors that can occur regardless of the operation.
185
- */
186
- export const DEFAULT_ERRORS = [
187
- Unauthorized,
188
- TooManyRequests,
189
- InternalServerError,
190
- BadGateway,
191
- ServiceUnavailable,
192
- GatewayTimeout,
193
- ];
194
- export const RETRYABLE = "@distilled/errors/retryable";
195
- //# sourceMappingURL=errors.js.map
1
+ export { errors$API_ERRORS as API_ERRORS, errors$BadGateway as BadGateway, errors$BadRequest as BadRequest, errors$ConfigError as ConfigError, errors$Conflict as Conflict, errors$DEFAULT_ERRORS as DEFAULT_ERRORS, errors$DEFAULT_ERROR_STATUSES as DEFAULT_ERROR_STATUSES, errors$DurationSchema as DurationSchema, errors$Forbidden as Forbidden, errors$GatewayTimeout as GatewayTimeout, errors$HTTP_STATUS_MAP as HTTP_STATUS_MAP, errors$InternalServerError as InternalServerError, errors$Locked as Locked, errors$NotFound as NotFound, errors$RETRYABLE as RETRYABLE, errors$RETRYABLE_HTTP_STATUSES as RETRYABLE_HTTP_STATUSES, errors$ServiceUnavailable as ServiceUnavailable, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnprocessableEntity as UnprocessableEntity } from "./_bundle/rest.js";
package/lib/graphql.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  /**
2
- * GraphQL Query algebra — the runtime generated GraphQL SDKs target.
2
+ * GraphQL Query algebra -- the runtime generated GraphQL SDKs target.
3
3
  *
4
- * ── Why this exists ────────────────────────────────────────────────────────
4
+ * U+2500U+2500 Why this exists U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500
5
5
  * A GraphQL document is a *selection*, not an RPC. Distilled used to bake a
6
6
  * max-depth selection into every operation (`Railway.me({})` downloaded the
7
7
  * world). This module instead treats every field as a lazy `Query<Value>`:
8
8
  * reading `user.email` records that field, and nothing is posted until
9
9
  * `Query.fn` evaluates the plan you returned.
10
10
  *
11
- * ── The two phases ─────────────────────────────────────────────────────────
11
+ * U+2500U+2500 The two phases U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500
12
12
  * 1. Build (your function). `Railway.me()` / `user.email` / `Query.map` do
13
13
  * not talk to the network. They construct an expression tree:
14
14
  * Of | Map | Filter | FlatMap | Prop | Root
@@ -21,26 +21,26 @@
21
21
  * against the JSON. Effects reached via FlatMap (e.g.
22
22
  * `usernameIsAvailable(name)`) run *after* the POST, with real values.
23
23
  *
24
- * ── Combinators ────────────────────────────────────────────────────────────
25
- * - `Query.of(x)` — a literal; never selected.
26
- * - `Query.map` on a list — callback receives `Query<Item>` so `p.name` is
24
+ * U+2500U+2500 Combinators U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500
25
+ * - `Query.of(x)` -- a literal; never selected.
26
+ * - `Query.map` on a list -- callback receives `Query<Item>` so `p.name` is
27
27
  * still a Query (selected). On a scalar, callback receives the value
28
28
  * after extract (`stars => stars > 5`). Relay connections (`edges { node }`)
29
29
  * are lists of the node type, so `projects({ first: 20 }).pipe(Query.map)`
30
30
  * maps projects, not edges.
31
- * - `Query.filter` — predicate is `Query<Item> => Query<boolean>`; the
31
+ * - `Query.filter` -- predicate is `Query<Item> => Query<boolean>`; the
32
32
  * boolean Query is walked for fields, then run per row after the POST.
33
- * - `Query.flatMap` — after extract, run `(value) => Effect | Query`.
34
- * - `Query.pages` / `Query.items` — a Stream over every page / node of a
33
+ * - `Query.flatMap` -- after extract, run `(value) => Effect | Query`.
34
+ * - `Query.pages` / `Query.items` -- a Stream over every page / node of a
35
35
  * Relay connection, one POST per page (see "Pagination").
36
36
  *
37
- * ── Types ──────────────────────────────────────────────────────────────────
37
+ * U+2500U+2500 Types U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500
38
38
  * `Query<Value>` is `QueryNode<Value>` plus the GraphQL fields of `Value`,
39
39
  * so `user.name` type-checks. That copy is a circular type alias
40
40
  * (`Query<User>` contains `Query<Project[]>` which contains `Query<User>`
41
41
  * again). TypeScript leaves the cycle lazy; there is no depth cap.
42
42
  *
43
- * ── Transport ──────────────────────────────────────────────────────────────
43
+ * U+2500U+2500 Transport U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500U+2500
44
44
  * {@link GqlTransport.execute} posts `{ query, variables, operationName }`.
45
45
  * The Effect it returns may require Credentials / HttpClient; those leak
46
46
  * into `Query.fn`'s requirements. It returns the parsed `data` and raw
@@ -109,14 +109,15 @@ declare const UnknownGraphQLError_base: S.Class<UnknownGraphQLError, S.TaggedStr
109
109
  readonly coordinate: S.optional<S.String>;
110
110
  }>, import("effect/Cause").YieldableError>;
111
111
  /** A GraphQL error no declared matcher recognizes. */
112
- export declare class UnknownGraphQLError extends UnknownGraphQLError_base {
112
+ export declare class UnknownGraphQLError extends /*@__PURE__*/ UnknownGraphQLError_base {
113
113
  }
114
114
  declare const GraphQLFailure_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
115
115
  readonly _tag: "GraphQLFailure";
116
116
  } & Readonly<A>;
117
117
  /** One response carried errors with different tags; none is hidden. */
118
- export declare class GraphQLFailure<E extends GraphQLIssue = GraphQLIssue> extends GraphQLFailure_base<{
118
+ export declare class GraphQLFailure<E extends GraphQLIssue = GraphQLIssue> extends /*@__PURE__*/ GraphQLFailure_base<{
119
119
  readonly errors: readonly [E, ...E[]];
120
+ /** The partial response data, with sensitive fields wrapped in `Redacted`. */
120
121
  readonly data: unknown;
121
122
  readonly status?: number;
122
123
  }> {
@@ -126,7 +127,7 @@ declare const GraphQLTransportError_base: new <A extends Record<string, any> = {
126
127
  readonly _tag: "GraphQLTransportError";
127
128
  } & Readonly<A>;
128
129
  /** The request never produced a GraphQL response (network, HTTP, non-JSON). */
129
- export declare class GraphQLTransportError extends GraphQLTransportError_base<{
130
+ export declare class GraphQLTransportError extends /*@__PURE__*/ GraphQLTransportError_base<{
130
131
  readonly message: string;
131
132
  readonly status?: number;
132
133
  /** Server retry hint in seconds. */
@@ -138,7 +139,7 @@ declare const GraphQLPaginationError_base: new <A extends Record<string, any> =
138
139
  readonly _tag: "GraphQLPaginationError";
139
140
  } & Readonly<A>;
140
141
  /** A paginated connection reported more pages without a new cursor. */
141
- export declare class GraphQLPaginationError extends GraphQLPaginationError_base<{
142
+ export declare class GraphQLPaginationError extends /*@__PURE__*/ GraphQLPaginationError_base<{
142
143
  readonly message: string;
143
144
  readonly cursor: string | null;
144
145
  }> {
@@ -187,12 +188,16 @@ export type FieldMeta = {
187
188
  readonly kind: "scalar" | "object" | "list" | "connection";
188
189
  readonly of?: TypeMeta;
189
190
  readonly argTypes?: ArgMeta;
191
+ /** The value is a secret: extracted strings are wrapped in `Redacted`. */
192
+ readonly sensitive?: boolean;
190
193
  };
191
194
  export type TypeMeta = {
192
195
  readonly name: string;
193
196
  readonly fields: Record<string, FieldMeta>;
194
197
  };
195
- export declare const scalarField: (name: string) => FieldMeta;
198
+ export declare const scalarField: (name: string, options?: {
199
+ readonly sensitive?: boolean;
200
+ }) => FieldMeta;
196
201
  export declare const objectField: (name: string, objectType: TypeMeta) => FieldMeta;
197
202
  export declare const listField: (name: string, itemType: TypeMeta, argTypes?: ArgMeta) => FieldMeta;
198
203
  /** Relay connection: GraphQL `edges { node }` presented as `Query<Item[]>`. */
@@ -213,6 +218,8 @@ export interface SelNode {
213
218
  children: Map<string, SelNode>;
214
219
  isScalar: boolean;
215
220
  isList: boolean;
221
+ /** The value is a secret: its strings are wrapped in `Redacted`. */
222
+ sensitive?: boolean;
216
223
  }
217
224
  export interface CompiledOperation {
218
225
  readonly document: string;
@@ -224,12 +231,12 @@ export interface CompiledOperation {
224
231
  declare const GqlTransport_base: Context.ServiceClass<GqlTransport, "@distilled.cloud/graphql/Transport", {
225
232
  readonly execute: (req: CompiledOperation) => Effect.Effect<GraphQLResponse, GraphQLTransportError, any>;
226
233
  }>;
227
- export declare class GqlTransport extends GqlTransport_base {
234
+ export declare class GqlTransport extends /*@__PURE__*/ GqlTransport_base {
228
235
  }
229
236
  /**
230
237
  * GraphQL fields copied onto a Query so `user.name` type-checks.
231
238
  * `Query<User>` contains `projects: Query<Project[]>`, which contains
232
- * `owner: Query<User>` again — TypeScript leaves the cycle lazy. Fields
239
+ * `owner: Query<User>` again -- TypeScript leaves the cycle lazy. Fields
233
240
  * inherit the errors of the root they were read from.
234
241
  */
235
242
  type QueryFields<Value, Error> = [NonNullable<Value>] extends [ReadonlyArray<infer Item>] ? {
@@ -268,6 +275,8 @@ type RootExpr = {
268
275
  readonly connection?: boolean;
269
276
  /** Errors this root field can return, including global errors. */
270
277
  readonly errors: ReadonlyArray<ErrorSpec>;
278
+ /** Leaf root whose value is a secret: extracted strings are wrapped in `Redacted`. */
279
+ readonly sensitive?: boolean;
271
280
  };
272
281
  type PropExpr = {
273
282
  readonly _tag: "Prop";
@@ -336,7 +345,9 @@ export declare const rootList: <Item, Error = never>(op: "query" | "mutation", f
336
345
  /** Root Relay connection: typed as `Query<Item[]>`, document uses `edges { node }`. */
337
346
  export declare const rootConnection: <Item, Error = never>(op: "query" | "mutation", field: string, meta: TypeMeta, args?: Record<string, unknown>, argTypes?: ArgMeta, errors?: ReadonlyArray<ErrorSpec>) => Query<ReadonlyArray<Item>, Error>;
338
347
  /** Root field whose GraphQL type is a scalar, enum, or list of those. */
339
- export declare const rootLeaf: <Value, Error = never>(op: "query" | "mutation", field: string, list: boolean, args?: Record<string, unknown>, argTypes?: ArgMeta, errors?: ReadonlyArray<ErrorSpec>) => Query<Value, Error>;
348
+ export declare const rootLeaf: <Value, Error = never>(op: "query" | "mutation", field: string, list: boolean, args?: Record<string, unknown>, argTypes?: ArgMeta, errors?: ReadonlyArray<ErrorSpec>, options?: {
349
+ readonly sensitive?: boolean;
350
+ }) => Query<Value, Error>;
340
351
  /** `Query.of` / pure. */
341
352
  export declare const ofQuery: <Value>(value: Value) => Query<Value>;
342
353
  export declare function filterQuery<Item, Error = never>(predicate: (item: Query<Item>) => QueryNode<boolean, any>): (source: QueryNode<readonly Item[] | null, Error>) => Query<readonly Item[], Error>;
@@ -353,7 +364,7 @@ export declare function mapQuery<Value, Mapped, Error = never>(source: QueryNode
353
364
  export declare function flatMapQuery<Value, Result, Error, Requirements, SourceError = never>(flatMapFn: (value: Value) => Effect.Effect<Result, Error, Requirements> | QueryNode<Result, Error>): (source: QueryNode<Value, SourceError>) => Query<Result, SourceError | Error>;
354
365
  export declare function flatMapQuery<Value, Result, Error, Requirements, SourceError = never>(source: QueryNode<Value, SourceError>, flatMapFn: (value: Value) => Effect.Effect<Result, Error, Requirements> | QueryNode<Result, Error>): Query<Result, SourceError | Error>;
355
366
  /**
356
- * Builder → Effect. The inner function is *not* a generator; it returns a
367
+ * Builder -> Effect. The inner function is *not* a generator; it returns a
357
368
  * plan of Query/Effect values. Query.fn visits the plan, POSTs one document,
358
369
  * then interprets Map/Filter/FlatMap/Of.
359
370
  */