@distilled.cloud/core 1.0.0-rc.2 → 1.0.0-rc.20

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 (291) hide show
  1. package/LICENSE +201 -0
  2. package/lib/_bundle/aws.js +2 -0
  3. package/lib/_bundle/aws.js.map +1 -0
  4. package/lib/_bundle/base.js +5 -0
  5. package/lib/_bundle/base.js.map +1 -0
  6. package/lib/_bundle/graphql.js +3 -0
  7. package/lib/_bundle/graphql.js.map +1 -0
  8. package/lib/_bundle/grpc.js +2 -0
  9. package/lib/_bundle/grpc.js.map +1 -0
  10. package/lib/_bundle/rest.js +2 -0
  11. package/lib/_bundle/rest.js.map +1 -0
  12. package/lib/_bundle/xml.js +4 -0
  13. package/lib/_bundle/xml.js.map +1 -0
  14. package/lib/annotations.d.ts +17 -0
  15. package/lib/annotations.d.ts.map +1 -0
  16. package/lib/annotations.js +2 -0
  17. package/lib/annotations.js.map +1 -0
  18. package/lib/api.d.ts +174 -18
  19. package/lib/api.d.ts.map +1 -1
  20. package/lib/api.js +1 -178
  21. package/lib/category.d.ts +4 -4
  22. package/lib/category.d.ts.map +1 -1
  23. package/lib/category.js +1 -280
  24. package/lib/chunks.d.ts +3 -0
  25. package/lib/chunks.d.ts.map +1 -0
  26. package/lib/chunks.js +1 -0
  27. package/lib/config.d.ts +68 -0
  28. package/lib/config.d.ts.map +1 -0
  29. package/lib/config.js +1 -0
  30. package/lib/crypto.d.ts +76 -0
  31. package/lib/crypto.d.ts.map +1 -0
  32. package/lib/crypto.js +1 -0
  33. package/lib/error-category.d.ts +1 -1
  34. package/lib/error-category.d.ts.map +1 -1
  35. package/lib/error-category.js +1 -46
  36. package/lib/errors.d.ts +64 -72
  37. package/lib/errors.d.ts.map +1 -1
  38. package/lib/errors.js +1 -186
  39. package/lib/graphql.d.ts +403 -0
  40. package/lib/graphql.d.ts.map +1 -0
  41. package/lib/graphql.js +1 -0
  42. package/lib/graphql.types.d.ts +12 -0
  43. package/lib/graphql.types.d.ts.map +1 -0
  44. package/lib/graphql.types.js +1 -0
  45. package/lib/grpc-transport-cloudflare-http2.d.ts +7 -0
  46. package/lib/grpc-transport-cloudflare-http2.d.ts.map +1 -0
  47. package/lib/grpc-transport-cloudflare-http2.js +6 -0
  48. package/lib/grpc-transport-cloudflare-http2.js.map +1 -0
  49. package/lib/grpc-transport-cloudflare-sockets.d.ts +7 -0
  50. package/lib/grpc-transport-cloudflare-sockets.d.ts.map +1 -0
  51. package/lib/grpc-transport-cloudflare-sockets.js +5 -0
  52. package/lib/grpc-transport-cloudflare-sockets.js.map +1 -0
  53. package/lib/grpc-transport-node-http2.d.ts +19 -0
  54. package/lib/grpc-transport-node-http2.d.ts.map +1 -0
  55. package/lib/grpc-transport-node-http2.js +2 -0
  56. package/lib/grpc-transport-node-http2.js.map +1 -0
  57. package/lib/grpc-transport.d.ts +76 -0
  58. package/lib/grpc-transport.d.ts.map +1 -0
  59. package/lib/grpc-transport.js +1 -0
  60. package/lib/hpack.d.ts +34 -0
  61. package/lib/hpack.d.ts.map +1 -0
  62. package/lib/hpack.js +2 -0
  63. package/lib/hpack.js.map +1 -0
  64. package/lib/index.d.ts +32 -0
  65. package/lib/index.d.ts.map +1 -0
  66. package/lib/index.js +17 -0
  67. package/lib/pagination.d.ts +101 -24
  68. package/lib/pagination.d.ts.map +1 -1
  69. package/lib/pagination.js +1 -182
  70. package/lib/plain-values.d.ts +10 -0
  71. package/lib/plain-values.d.ts.map +1 -0
  72. package/lib/plain-values.js +2 -0
  73. package/lib/plain-values.js.map +1 -0
  74. package/lib/protobuf.d.ts +92 -0
  75. package/lib/protobuf.d.ts.map +1 -0
  76. package/lib/protobuf.js +1 -0
  77. package/lib/protocol-grpc.d.ts +86 -0
  78. package/lib/protocol-grpc.d.ts.map +1 -0
  79. package/lib/protocol-grpc.js +1 -0
  80. package/lib/protocol-http.d.ts +102 -23
  81. package/lib/protocol-http.d.ts.map +1 -1
  82. package/lib/protocol-http.js +1 -554
  83. package/lib/protocol-rest.d.ts +120 -50
  84. package/lib/protocol-rest.d.ts.map +1 -1
  85. package/lib/protocol-rest.js +1 -242
  86. package/lib/query.d.ts +29 -0
  87. package/lib/query.d.ts.map +1 -0
  88. package/lib/query.js +1 -0
  89. package/lib/response-validation-strict.d.ts +48 -0
  90. package/lib/response-validation-strict.d.ts.map +1 -0
  91. package/lib/response-validation-strict.js +1 -0
  92. package/lib/response-validation.d.ts +86 -0
  93. package/lib/response-validation.d.ts.map +1 -0
  94. package/lib/response-validation.js +1 -0
  95. package/lib/retry-after.d.ts +3 -3
  96. package/lib/retry-after.d.ts.map +1 -1
  97. package/lib/retry-after.js +1 -112
  98. package/lib/retry.d.ts +48 -29
  99. package/lib/retry.d.ts.map +1 -1
  100. package/lib/retry.js +1 -210
  101. package/lib/schema-lite-impl.d.ts +158 -0
  102. package/lib/schema-lite-impl.d.ts.map +1 -0
  103. package/lib/schema-lite-impl.js +1 -0
  104. package/lib/schema-lite-typed.d.ts +41 -0
  105. package/lib/schema-lite-typed.d.ts.map +1 -0
  106. package/lib/schema-lite-typed.js +1 -0
  107. package/lib/schema-lite.d.ts +40 -0
  108. package/lib/schema-lite.d.ts.map +1 -0
  109. package/lib/schema-lite.js +1 -0
  110. package/lib/schema.d.ts +21 -7
  111. package/lib/schema.d.ts.map +1 -1
  112. package/lib/schema.js +1 -48
  113. package/lib/sdk-error.d.ts +27 -0
  114. package/lib/sdk-error.d.ts.map +1 -0
  115. package/lib/sdk-error.js +1 -0
  116. package/lib/sensitive.d.ts +28 -0
  117. package/lib/sensitive.d.ts.map +1 -0
  118. package/lib/sensitive.js +2 -0
  119. package/lib/sensitive.js.map +1 -0
  120. package/lib/telemetry-debug.d.ts +6 -0
  121. package/lib/telemetry-debug.d.ts.map +1 -0
  122. package/lib/telemetry-debug.js +2 -0
  123. package/lib/telemetry-debug.js.map +1 -0
  124. package/lib/telemetry-hooks.d.ts +32 -0
  125. package/lib/telemetry-hooks.d.ts.map +1 -0
  126. package/lib/telemetry-hooks.js +2 -0
  127. package/lib/telemetry-hooks.js.map +1 -0
  128. package/lib/telemetry-host-rules.d.ts +23 -0
  129. package/lib/telemetry-host-rules.d.ts.map +1 -0
  130. package/lib/telemetry-host-rules.js +2 -0
  131. package/lib/telemetry-host-rules.js.map +1 -0
  132. package/lib/telemetry-lambda-context.d.ts +17 -0
  133. package/lib/telemetry-lambda-context.d.ts.map +1 -0
  134. package/lib/telemetry-lambda-context.js +2 -0
  135. package/lib/telemetry-lambda-context.js.map +1 -0
  136. package/lib/telemetry-message-context.d.ts +52 -0
  137. package/lib/telemetry-message-context.d.ts.map +1 -0
  138. package/lib/telemetry-message-context.js +2 -0
  139. package/lib/telemetry-message-context.js.map +1 -0
  140. package/lib/telemetry-metrics.d.ts +6 -0
  141. package/lib/telemetry-metrics.d.ts.map +1 -0
  142. package/lib/telemetry-metrics.js +2 -0
  143. package/lib/telemetry-metrics.js.map +1 -0
  144. package/lib/telemetry-name-template.d.ts +13 -0
  145. package/lib/telemetry-name-template.d.ts.map +1 -0
  146. package/lib/telemetry-name-template.js +2 -0
  147. package/lib/telemetry-name-template.js.map +1 -0
  148. package/lib/telemetry-stream.d.ts +11 -0
  149. package/lib/telemetry-stream.d.ts.map +1 -0
  150. package/lib/telemetry-stream.js +2 -0
  151. package/lib/telemetry-stream.js.map +1 -0
  152. package/lib/telemetry-xray.d.ts +28 -0
  153. package/lib/telemetry-xray.d.ts.map +1 -0
  154. package/lib/telemetry-xray.js +2 -0
  155. package/lib/telemetry-xray.js.map +1 -0
  156. package/lib/telemetry.d.ts +288 -0
  157. package/lib/telemetry.d.ts.map +1 -0
  158. package/lib/telemetry.js +3 -0
  159. package/lib/telemetry.js.map +1 -0
  160. package/lib/trait.d.ts +71 -20
  161. package/lib/trait.d.ts.map +1 -1
  162. package/lib/trait.js +1 -107
  163. package/lib/unknown-error.d.ts +18 -0
  164. package/lib/unknown-error.d.ts.map +1 -0
  165. package/lib/unknown-error.js +1 -0
  166. package/lib/xml.d.ts +44 -0
  167. package/lib/xml.d.ts.map +1 -0
  168. package/lib/xml.js +1 -0
  169. package/package.json +13 -13
  170. package/src/annotations.ts +53 -0
  171. package/src/api.ts +1370 -200
  172. package/src/category.ts +76 -106
  173. package/src/chunks.ts +30 -0
  174. package/src/config.ts +245 -0
  175. package/src/crypto.ts +202 -0
  176. package/src/error-category.ts +16 -29
  177. package/src/errors.ts +75 -75
  178. package/src/graphql.ts +1778 -0
  179. package/src/graphql.types.ts +105 -0
  180. package/src/grpc-transport-cloudflare-http2.ts +494 -0
  181. package/src/grpc-transport-cloudflare-sockets.ts +299 -0
  182. package/src/grpc-transport-node-http2.ts +234 -0
  183. package/src/grpc-transport.ts +118 -0
  184. package/src/hpack.ts +331 -0
  185. package/src/index.ts +31 -0
  186. package/src/pagination.ts +368 -94
  187. package/src/plain-values.ts +41 -0
  188. package/src/protobuf.ts +1332 -0
  189. package/src/protocol-grpc.ts +641 -0
  190. package/src/protocol-http.ts +622 -322
  191. package/src/protocol-rest.ts +440 -227
  192. package/src/query.ts +39 -0
  193. package/src/response-validation-strict.ts +327 -0
  194. package/src/response-validation.ts +161 -0
  195. package/src/retry-after.ts +7 -13
  196. package/src/retry.ts +96 -110
  197. package/src/schema-lite-impl.ts +550 -0
  198. package/src/schema-lite-typed.ts +44 -0
  199. package/src/schema-lite.ts +44 -0
  200. package/src/schema.ts +259 -15
  201. package/src/sdk-error.ts +33 -0
  202. package/src/sensitive.ts +154 -0
  203. package/src/telemetry-debug.ts +179 -0
  204. package/src/telemetry-hooks.ts +33 -0
  205. package/src/telemetry-host-rules.ts +39 -0
  206. package/src/telemetry-lambda-context.ts +46 -0
  207. package/src/telemetry-message-context.ts +170 -0
  208. package/src/telemetry-metrics.ts +69 -0
  209. package/src/telemetry-name-template.ts +26 -0
  210. package/src/telemetry-stream.ts +100 -0
  211. package/src/telemetry-xray.ts +66 -0
  212. package/src/telemetry.ts +832 -0
  213. package/src/trait.ts +106 -67
  214. package/src/unknown-error.ts +38 -0
  215. package/src/xml.ts +346 -0
  216. package/lib/api.js.map +0 -1
  217. package/lib/category.js.map +0 -1
  218. package/lib/codegen/cli.d.ts +0 -29
  219. package/lib/codegen/cli.d.ts.map +0 -1
  220. package/lib/codegen/cli.js +0 -165
  221. package/lib/codegen/cli.js.map +0 -1
  222. package/lib/codegen/emit.d.ts +0 -129
  223. package/lib/codegen/emit.d.ts.map +0 -1
  224. package/lib/codegen/emit.js +0 -105
  225. package/lib/codegen/emit.js.map +0 -1
  226. package/lib/codegen/format.d.ts +0 -23
  227. package/lib/codegen/format.d.ts.map +0 -1
  228. package/lib/codegen/format.js +0 -28
  229. package/lib/codegen/format.js.map +0 -1
  230. package/lib/codegen/generator.d.ts +0 -334
  231. package/lib/codegen/generator.d.ts.map +0 -1
  232. package/lib/codegen/generator.js +0 -691
  233. package/lib/codegen/generator.js.map +0 -1
  234. package/lib/codegen/graph.d.ts +0 -36
  235. package/lib/codegen/graph.d.ts.map +0 -1
  236. package/lib/codegen/graph.js +0 -136
  237. package/lib/codegen/graph.js.map +0 -1
  238. package/lib/codegen/members.d.ts +0 -25
  239. package/lib/codegen/members.d.ts.map +0 -1
  240. package/lib/codegen/members.js +0 -55
  241. package/lib/codegen/members.js.map +0 -1
  242. package/lib/codegen/naming.d.ts +0 -29
  243. package/lib/codegen/naming.d.ts.map +0 -1
  244. package/lib/codegen/naming.js +0 -74
  245. package/lib/codegen/naming.js.map +0 -1
  246. package/lib/codegen/openapi-cli.d.ts +0 -38
  247. package/lib/codegen/openapi-cli.d.ts.map +0 -1
  248. package/lib/codegen/openapi-cli.js +0 -107
  249. package/lib/codegen/openapi-cli.js.map +0 -1
  250. package/lib/codegen/openapi.d.ts +0 -115
  251. package/lib/codegen/openapi.d.ts.map +0 -1
  252. package/lib/codegen/openapi.js +0 -1220
  253. package/lib/codegen/openapi.js.map +0 -1
  254. package/lib/codegen/operations.d.ts +0 -24
  255. package/lib/codegen/operations.d.ts.map +0 -1
  256. package/lib/codegen/operations.js +0 -56
  257. package/lib/codegen/operations.js.map +0 -1
  258. package/lib/codegen/pagination.d.ts +0 -39
  259. package/lib/codegen/pagination.d.ts.map +0 -1
  260. package/lib/codegen/pagination.js +0 -33
  261. package/lib/codegen/pagination.js.map +0 -1
  262. package/lib/codegen/prelude.d.ts +0 -15
  263. package/lib/codegen/prelude.d.ts.map +0 -1
  264. package/lib/codegen/prelude.js +0 -60
  265. package/lib/codegen/prelude.js.map +0 -1
  266. package/lib/error-category.js.map +0 -1
  267. package/lib/errors.js.map +0 -1
  268. package/lib/json-patch.d.ts +0 -44
  269. package/lib/json-patch.d.ts.map +0 -1
  270. package/lib/json-patch.js +0 -174
  271. package/lib/json-patch.js.map +0 -1
  272. package/lib/pagination.js.map +0 -1
  273. package/lib/protocol-http.js.map +0 -1
  274. package/lib/protocol-rest.js.map +0 -1
  275. package/lib/retry-after.js.map +0 -1
  276. package/lib/retry.js.map +0 -1
  277. package/lib/schema.js.map +0 -1
  278. package/lib/trait.js.map +0 -1
  279. package/src/codegen/cli.ts +0 -268
  280. package/src/codegen/emit.ts +0 -207
  281. package/src/codegen/format.ts +0 -47
  282. package/src/codegen/generator.ts +0 -1153
  283. package/src/codegen/graph.ts +0 -151
  284. package/src/codegen/members.ts +0 -71
  285. package/src/codegen/naming.ts +0 -86
  286. package/src/codegen/openapi-cli.ts +0 -166
  287. package/src/codegen/openapi.ts +0 -1450
  288. package/src/codegen/operations.ts +0 -76
  289. package/src/codegen/pagination.ts +0 -71
  290. package/src/codegen/prelude.ts +0 -70
  291. package/src/json-patch.ts +0 -222
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Minimal schemas for generated SDK code: plain objects shaped like Effect
3
+ * Schema ASTs (`_tag`, `annotations`, `propertySignatures`, `types`,
4
+ * `thunk`, `encoding`), without Effect Schema's parser, issue and
5
+ * transformation machinery.
6
+ *
7
+ * Request encoding and lenient response decoding only walk the AST: they
8
+ * read wire names, HTTP bindings and the shape of the value. Importing
9
+ * `effect/Schema` to build those ASTs put about 37 KB gzip of decode
10
+ * machinery into every bundle that never decodes. These nodes carry the
11
+ * same fields protocol code reads, so it runs unchanged.
12
+ *
13
+ * When a caller asks for real validation (`ResponseValidation.strict` or
14
+ * `additionalProperties`), {@link toEffect} rebuilds the equivalent Effect
15
+ * schema from a lite node, loading `effect/Schema` only then.
16
+ *
17
+ * Every value here has the members generated code uses on schemas: `.ast`,
18
+ * `.pipe(...)`, `.annotate(...)`, `.fields` (structs) and `.key`/`.value`
19
+ * (records).
20
+ */
21
+ import type * as Cause from "effect/Cause";
22
+ import { type Pipeable } from "effect/Pipeable";
23
+ import type * as EffectSchema from "effect/Schema";
24
+ export type Annotations = Record<string | symbol, unknown>;
25
+ /** A lite AST node. Field names match Effect's SchemaAST where protocols read them. */
26
+ export interface Node {
27
+ readonly _tag: string;
28
+ readonly annotations?: Annotations;
29
+ /**
30
+ * The wire-side node, for nodes whose value changes on the wire (AWS
31
+ * timestamps, blobs, sensitive values). Same shape as Effect's encoding
32
+ * chain, so code that follows `encoding[0].to` reads the wire type.
33
+ */
34
+ readonly encoding?: ReadonlyArray<{
35
+ readonly to: Node;
36
+ }>;
37
+ /** Declaration: the type guard strict validation applies (Unknown without one). */
38
+ readonly check?: (u: unknown) => boolean;
39
+ readonly context?: {
40
+ readonly isOptional: boolean;
41
+ };
42
+ /** Objects */
43
+ readonly propertySignatures?: ReadonlyArray<PropertySignature>;
44
+ readonly indexSignatures?: ReadonlyArray<{
45
+ readonly parameter: Node;
46
+ readonly type: Node;
47
+ }>;
48
+ /** Union */
49
+ readonly types?: ReadonlyArray<Node>;
50
+ /** Arrays */
51
+ readonly elements?: ReadonlyArray<Node>;
52
+ readonly rest?: ReadonlyArray<Node>;
53
+ /** Suspend */
54
+ readonly thunk?: () => Node;
55
+ /** Literal */
56
+ readonly literal?: unknown;
57
+ /** Declaration */
58
+ readonly typeParameters?: ReadonlyArray<Node>;
59
+ }
60
+ export interface PropertySignature {
61
+ readonly name: PropertyKey;
62
+ readonly type: Node;
63
+ }
64
+ /** A lite schema value: what generated code holds and passes around. */
65
+ export interface Lite {
66
+ readonly ast: Node;
67
+ readonly "~lite": true;
68
+ pipe(...fns: ReadonlyArray<(s: any) => any>): any;
69
+ annotate(annotations: Annotations): Lite;
70
+ }
71
+ /** Marks lite nodes so strict validation knows to convert them. */
72
+ export declare const liteKey = "~lite";
73
+ /** A lite schema for a hand-built node (SDK-specific declarations). */
74
+ export declare const fromNode: (n: Node) => Lite;
75
+ export declare const isLite: (u: unknown) => u is Lite;
76
+ export declare const String: Lite;
77
+ export declare const Number: Lite;
78
+ export declare const Boolean: Lite;
79
+ export declare const Unknown: Lite;
80
+ export declare const Any: Lite;
81
+ export declare const Null: Lite;
82
+ export declare const Void: Lite;
83
+ export declare const Undefined: Lite;
84
+ export declare const Literal: (value: unknown) => Lite;
85
+ export declare const Literals: (values: ReadonlyArray<unknown>) => Lite;
86
+ export declare const optional: (s: Lite) => Lite;
87
+ export declare const NullOr: (s: Lite) => Lite;
88
+ export declare const Union: (members: ReadonlyArray<Lite>) => Lite;
89
+ export declare const Array: (item: Lite) => Lite;
90
+ export declare const Tuple: (elements: ReadonlyArray<Lite>) => Lite;
91
+ export declare const Record: (key: Lite, value: Lite) => Lite;
92
+ export declare const Struct: (fields: Readonly<Record<string, Lite>>) => Lite;
93
+ /**
94
+ * A struct that also allows keys it does not declare (OpenAPI
95
+ * `additionalProperties` next to `properties`): the struct's property
96
+ * signatures plus each record's index signature, as Effect's
97
+ * `StructWithRest` builds them.
98
+ */
99
+ export declare const StructWithRest: (struct: Lite, records: ReadonlyArray<Lite>) => Lite;
100
+ /** A lazily resolved schema; `.ast` is a Suspend node whose thunk resolves the target. */
101
+ export declare const suspend: (f: () => Lite) => Lite;
102
+ /** Rename struct keys on the wire: `{ typeKey: "wire_key" }`. */
103
+ export declare const encodeKeys: (mapping: Readonly<Record<string, string>>) => (s: Lite) => Lite;
104
+ export declare const encodeKeysKey = "@distilled.cloud/core/schema-lite/encodeKeys";
105
+ export declare const Date: Lite;
106
+ export declare const Duration: Lite;
107
+ export declare const Redacted: (value: Lite) => Lite;
108
+ export declare const instanceOf: (cls: Function, annotations?: Annotations) => Lite;
109
+ export declare const declare: (_is: (u: unknown) => boolean, annotations?: Annotations) => Lite;
110
+ /**
111
+ * The type of a lite tagged error class: what the class really has. It is
112
+ * not an Effect Schema, so `Schema.is(E)`, `Schema.decode(E)` and friends do
113
+ * not compile against it -- at runtime they would fail on the lite `.ast`.
114
+ * Match errors with `_tag` (`Effect.catchTag`) or `instanceof`.
115
+ */
116
+ export interface TaggedErrorClass<Tag extends string, Fields extends EffectSchema.Struct.Fields> extends Pipeable {
117
+ new (...args: {} extends EffectSchema.Struct.MakeIn<Fields> ? [props?: EffectSchema.Struct.MakeIn<Fields>] : [props: EffectSchema.Struct.MakeIn<Fields>]): Cause.YieldableError & {
118
+ readonly _tag: Tag;
119
+ } & EffectSchema.Struct.Type<Fields>;
120
+ /** `new this(props)`. */
121
+ make<C extends abstract new (...args: any) => any>(this: C, ...args: ConstructorParameters<C>): InstanceType<C>;
122
+ /**
123
+ * Whether `u` is an error of this class, by `_tag`, so it holds across
124
+ * duplicate copies of a package (`instanceof` does not). Errors of another
125
+ * service with the same tag also match.
126
+ */
127
+ is<C extends abstract new (...args: any) => any>(this: C, u: unknown): u is InstanceType<C>;
128
+ readonly fields: Fields;
129
+ readonly identifier: Tag;
130
+ /** The lite struct node (not an Effect Schema AST). */
131
+ readonly ast: Node;
132
+ }
133
+ /**
134
+ * `TaggedError<Self>()(tag, fields)`, typed by the field schemas. `Self` is
135
+ * accepted for source compatibility with `Schema.TaggedError` and unused.
136
+ */
137
+ export type TaggedErrorFactory = <_Self = never>(identifier?: string) => <Tag extends string, const Fields extends EffectSchema.Struct.Fields = {}>(tag: Tag, fields?: Fields, annotations?: object) => TaggedErrorClass<Tag, Fields>;
138
+ /**
139
+ * A tagged error class without Effect Schema. It does not validate on
140
+ * construction. Carries `.fields` and `.identifier`, and a static `.pipe`
141
+ * for category decorators.
142
+ */
143
+ export declare const TaggedError: (_identifier?: string) => (tag: string, fields?: Readonly<Record<string, Lite>>, annotations?: object) => any;
144
+ /**
145
+ * Schema `j` of builder `build`, made on first use (the lite `chunks.at`).
146
+ * Its `.ast` is the built schema's own node, not a Suspend around it, so
147
+ * protocol code sees the same node shapes as with eager schemas.
148
+ */
149
+ export declare const at: (build: (j: number) => unknown, j: number) => any;
150
+ /**
151
+ * The Effect schema equivalent to a lite node, for strict decoding. Loaded
152
+ * on demand so `effect/Schema` is only bundled/imported by callers that
153
+ * validate.
154
+ */
155
+ /** The Effect Schema functions the bridge uses (passed in, so callers import only these). */
156
+ export type EffectSchemaApi = Pick<typeof import("effect/Schema"), "Any" | "Array" | "Boolean" | "Literal" | "Null" | "Number" | "Record" | "String" | "Struct" | "StructWithRest" | "Tuple" | "Undefined" | "Union" | "Unknown" | "Void" | "declare" | "make" | "optional" | "suspend">;
157
+ export declare const toEffect: (S: EffectSchemaApi, ast: Node) => unknown;
158
+ //# sourceMappingURL=schema-lite-impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-lite-impl.d.ts","sourceRoot":"","sources":["../src/schema-lite-impl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAiB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,KAAK,YAAY,MAAM,eAAe,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3D,uFAAuF;AACvF,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,C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cAAc,eAAe,CAAC,EAC5B,KAAK,GACL,OAAO,GACP,SAAS,GACT,SAAS,GACT,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,gBAAgB,GAChB,OAAO,GACP,WAAW,GACX,OAAO,GACP,SAAS,GACT,MAAM,GACN,SAAS,GACT,MAAM,GACN,UAAU,GACV,SAAS,CACZ,CAAC;AAEF,eAAO,MAAM,QAAQ,MAAO,eAAe,OAAO,IAAI,KAAG,OAiGxD,CAAC"}
@@ -0,0 +1 @@
1
+ export { schema_lite_impl$Any as Any, schema_lite_impl$Array as Array, schema_lite_impl$Boolean as Boolean, schema_lite_impl$Date as Date, schema_lite_impl$Duration as Duration, schema_lite_impl$Literal as Literal, schema_lite_impl$Literals as Literals, schema_lite_impl$Null as Null, schema_lite_impl$NullOr as NullOr, schema_lite_impl$Number as Number, schema_lite_impl$Record as Record, schema_lite_impl$Redacted as Redacted, schema_lite_impl$String as String, schema_lite_impl$Struct as Struct, schema_lite_impl$StructWithRest as StructWithRest, schema_lite_impl$TaggedError as TaggedError, schema_lite_impl$Tuple as Tuple, schema_lite_impl$Undefined as Undefined, schema_lite_impl$Union as Union, schema_lite_impl$Unknown as Unknown, schema_lite_impl$Void as Void, schema_lite_impl$at as at, schema_lite_impl$declare as declare, schema_lite_impl$encodeKeys as encodeKeys, schema_lite_impl$encodeKeysKey as encodeKeysKey, schema_lite_impl$fromNode as fromNode, schema_lite_impl$instanceOf as instanceOf, schema_lite_impl$isLite as isLite, schema_lite_impl$liteKey as liteKey, schema_lite_impl$optional as optional, schema_lite_impl$suspend as suspend, schema_lite_impl$toEffect as toEffect } from "./_bundle/base.js";
@@ -0,0 +1,41 @@
1
+ /**
2
+ * `schema-lite` with Effect Schema's types, for hand-written modules.
3
+ *
4
+ * Generated services import `schema-lite`, whose builders are typed `any`
5
+ * because every generated schema is cast to its declared interface. Hand-
6
+ * written error classes have no such cast: built from untyped builders,
7
+ * their fields declare as `any` (`ValidationError.message: any`), which
8
+ * erases the field types for every consumer. This module exposes the same
9
+ * lite runtime values with the Effect Schema types, so `S.TaggedError` field
10
+ * types infer as they did with Effect Schema.
11
+ */
12
+ import type * as S from "effect/Schema";
13
+ import * as L from "./schema-lite-impl.ts";
14
+ export type * from "effect/Schema";
15
+ export declare const optional: typeof S.optional;
16
+ export declare const Struct: typeof S.Struct;
17
+ export declare const StructWithRest: typeof S.StructWithRest;
18
+ export declare const suspend: typeof S.suspend;
19
+ export declare const Array: typeof S.Array;
20
+ export declare const Record: typeof S.Record;
21
+ export declare const Union: typeof S.Union;
22
+ export declare const Literal: typeof S.Literal;
23
+ export declare const Literals: typeof S.Literals;
24
+ export declare const NullOr: typeof S.NullOr;
25
+ export declare const Tuple: typeof S.Tuple;
26
+ export declare const declare: typeof S.declare;
27
+ export declare const instanceOf: typeof S.instanceOf;
28
+ export declare const Redacted: typeof S.Redacted;
29
+ export declare const String: typeof S.String;
30
+ export declare const Number: typeof S.Number;
31
+ export declare const Int: typeof S.Int;
32
+ export declare const Boolean: typeof S.Boolean;
33
+ export declare const Date: typeof S.Date;
34
+ export declare const Duration: typeof S.Duration;
35
+ export declare const Unknown: typeof S.Unknown;
36
+ export declare const Null: typeof S.Null;
37
+ export declare const Void: typeof S.Void;
38
+ export declare const Any: typeof S.Any;
39
+ export declare const TaggedError: L.TaggedErrorFactory;
40
+ export type { TaggedErrorClass, TaggedErrorFactory } from "./schema-lite-impl.ts";
41
+ //# sourceMappingURL=schema-lite-typed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-lite-typed.d.ts","sourceRoot":"","sources":["../src/schema-lite-typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,KAAK,CAAC,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,CAAC,MAAM,uBAAuB,CAAC;AAE3C,mBAAmB,eAAe,CAAC;AAEnC,eAAO,MAAM,QAAQ,EAA4B,OAAO,CAAC,CAAC,QAAQ,C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CAAC,OAAO,CAAC;AAChE,eAAO,MAAM,IAAI,EAAwB,OAAO,CAAC,CAAC,IAAI,CAAC;AACvD,eAAO,MAAM,IAAI,EAAwB,OAAO,CAAC,CAAC,IAAI,CAAC;AACvD,eAAO,MAAM,GAAG,EAAuB,OAAO,CAAC,CAAC,GAAG,CAAC;AAEpD,eAAO,MAAM,WAAW,EAA+B,CAAC,CAAC,kBAAkB,CAAC;AAC5E,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1 @@
1
+ export { schema_lite_typed$Any as Any, schema_lite_typed$Array as Array, schema_lite_typed$Boolean as Boolean, schema_lite_typed$Date as Date, schema_lite_typed$Duration as Duration, schema_lite_typed$Int as Int, schema_lite_typed$Literal as Literal, schema_lite_typed$Literals as Literals, schema_lite_typed$Null as Null, schema_lite_typed$NullOr as NullOr, schema_lite_typed$Number as Number, schema_lite_typed$Record as Record, schema_lite_typed$Redacted as Redacted, schema_lite_typed$String as String, schema_lite_typed$Struct as Struct, schema_lite_typed$StructWithRest as StructWithRest, schema_lite_typed$TaggedError as TaggedError, schema_lite_typed$Tuple as Tuple, schema_lite_typed$Union as Union, schema_lite_typed$Unknown as Unknown, schema_lite_typed$Void as Void, schema_lite_typed$declare as declare, schema_lite_typed$instanceOf as instanceOf, schema_lite_typed$optional as optional, schema_lite_typed$suspend as suspend } from "./_bundle/base.js";
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Effect Schema's API surface for generated code, backed by lite schemas
3
+ * (see `schema-lite-impl.ts`): the same names and types as
4
+ * `@distilled.cloud/core/schema`, without importing Effect Schema at runtime.
5
+ */
6
+ import type * as S from "effect/Schema";
7
+ import * as L from "./schema-lite-impl.ts";
8
+ export type * from "effect/Schema";
9
+ export type AnyFn = (...args: any[]) => any;
10
+ export declare const optional: AnyFn;
11
+ export declare const Struct: AnyFn;
12
+ export declare const StructWithRest: AnyFn;
13
+ export declare const suspend: AnyFn;
14
+ export declare const Array: AnyFn;
15
+ export declare const Record: AnyFn;
16
+ export declare const Union: AnyFn;
17
+ export declare const Literal: AnyFn;
18
+ export declare const Literals: AnyFn;
19
+ export declare const NullOr: AnyFn;
20
+ export declare const Tuple: AnyFn;
21
+ export declare const encodeKeys: AnyFn;
22
+ export declare const declare: typeof S.declare;
23
+ export declare const instanceOf: AnyFn;
24
+ export declare const Redacted: AnyFn;
25
+ export declare const String: any;
26
+ export declare const Number: any;
27
+ export declare const Int: any;
28
+ export declare const Boolean: any;
29
+ export declare const Date: any;
30
+ export declare const Duration: any;
31
+ export declare const Unknown: any;
32
+ export declare const Null: any;
33
+ export declare const Void: any;
34
+ export declare const Any: any;
35
+ export declare const TaggedError: L.TaggedErrorFactory;
36
+ export type { TaggedErrorClass, TaggedErrorFactory } from "./schema-lite-impl.ts";
37
+ /** Lite `chunks.at`: generated services name this module `__L`. */
38
+ export declare const at: typeof L.at;
39
+ export { liteKey, toEffect } from "./schema-lite-impl.ts";
40
+ //# sourceMappingURL=schema-lite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-lite.d.ts","sourceRoot":"","sources":["../src/schema-lite.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,KAAK,CAAC,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,CAAC,MAAM,uBAAuB,CAAC;AAE3C,mBAAmB,eAAe,CAAC;AACnC,MAAM,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE5C,eAAO,MAAM,QAAQ,EAAE,KAAkB,CAAC;AAC1C,eAAO,MAAM,MAAM,EAAE,KAAgB,CAAC;AACtC,eAAO,MAAM,cAAc,EAAE,KAAwB,CAAC;AACtD,eAAO,MAAM,OAAO,EAAE,KAAiB,CAAC;AACxC,eAAO,MAAM,KAAK,EAAE,KAAe,CAAC;AACpC,eAAO,MAAM,MAAM,EAAE,KAAgB,CAAC;AACtC,eAAO,MAAM,KAAK,EAAE,KAAe,CAAC;AACpC,eAAO,MAAM,OAAO,EAAE,KAAiB,CAAC;AACxC,eAAO,MAAM,QAAQ,EAAE,KAAkB,CAAC;AAC1C,eAAO,MAAM,MAAM,EAAE,KAAgB,CAAC;AACtC,eAAO,MAAM,KAAK,EAAE,KAAe,CAAC;AACpC,eAAO,MAAM,UAAU,EAAE,KAAoB,CAAC;AAC9C,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,CAAC,OAAkD,CAAC;AAClF,eAAO,MAAM,UAAU,EAAE,KAAoB,CAAC;AAC9C,eAAO,MAAM,QAAQ,EAAE,KAAkB,CAAC;AAE1C,eAAO,MAAM,MAAM,EAAE,GAAc,CAAC;AACpC,eAAO,MAAM,MAAM,EAAE,GAAc,CAAC;AACpC,eAAO,MAAM,GAAG,EAAE,GAAc,CAAC;AACjC,eAAO,MAAM,OAAO,EAAE,GAAe,CAAC;AACtC,eAAO,MAAM,IAAI,EAAE,GAAY,CAAC;AAChC,eAAO,MAAM,QAAQ,EAAE,GAAgB,CAAC;AACxC,eAAO,MAAM,OAAO,EAAE,GAAe,CAAC;AACtC,eAAO,MAAM,IAAI,EAAE,GAAY,CAAC;AAChC,eAAO,MAAM,IAAI,EAAE,GAAY,CAAC;AAChC,eAAO,MAAM,GAAG,EAAE,GAAW,CAAC;AAE9B,eAAO,MAAM,WAAW,EAA+B,CAAC,CAAC,kBAAkB,CAAC;AAC5E,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAElF,mEAAmE;AACnE,eAAO,MAAM,EAAE,aAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1 @@
1
+ export { schema_lite$Any as Any, schema_lite$Array as Array, schema_lite$Boolean as Boolean, schema_lite$Date as Date, schema_lite$Duration as Duration, schema_lite$Int as Int, schema_lite$Literal as Literal, schema_lite$Literals as Literals, schema_lite$Null as Null, schema_lite$NullOr as NullOr, schema_lite$Number as Number, schema_lite$Record as Record, schema_lite$Redacted as Redacted, schema_lite$String as String, schema_lite$Struct as Struct, schema_lite$StructWithRest as StructWithRest, schema_lite$TaggedError as TaggedError, schema_lite$Tuple as Tuple, schema_lite$Union as Union, schema_lite$Unknown as Unknown, schema_lite$Void as Void, schema_lite$at as at, schema_lite$declare as declare, schema_lite$encodeKeys as encodeKeys, schema_lite$instanceOf as instanceOf, schema_lite$liteKey as liteKey, schema_lite$optional as optional, schema_lite$suspend as suspend, schema_lite$toEffect as toEffect } from "./_bundle/rest.js";
package/lib/schema.d.ts CHANGED
@@ -5,24 +5,28 @@
5
5
  * provider package via `@distilled.cloud/core/schema`. Do not copy it into
6
6
  * individual packages.
7
7
  *
8
- * Every real TYPE (`Schema`, `Codec`, `Top`, …) is re-exported untouched, so
8
+ * Every real TYPE (`Schema`, `Codec`, `Top`, ...) is re-exported untouched, so
9
9
  * the `Schema.Schema<Foo>` annotations on generated consts (and the public
10
10
  * `.d.ts`) stay precise. The schema *construction surface* (`Struct`,
11
- * `optional`, `suspend`, …) and the leaf scalar schemas are retyped to `any`,
11
+ * `optional`, `suspend`, ...) and the leaf scalar schemas are retyped to `any`,
12
12
  * so the compiler instantiates none of the heavy Schema generics while
13
- * building a service file — the explicit annotations carry the real types.
13
+ * building a service file -- the explicit annotations carry the real types.
14
14
  *
15
15
  * Overriding a *value* export never affects the same-named *type* export (they
16
16
  * live in separate namespaces and continue to flow through `export *`), so
17
17
  * `Schema.Literal<"x">`-style type usages remain precise.
18
18
  *
19
- * Runtime behaviour is identical — every override aliases the exact same
20
- * runtime value from `effect/Schema`.
19
+ * Runtime behaviour is identical. Every override aliases the exact same
20
+ * runtime value from `effect/Schema`, except `suspend`, `Array` and
21
+ * `Record`, which build the same schema lazily (see "Lazy schemas").
21
22
  */
22
- export * from "effect/Schema";
23
- type AnyFn = (...args: any[]) => any;
23
+ export type * from "effect/Schema";
24
+ export { declare, Duration, instanceOf, Redacted } from "effect/Schema";
25
+ import * as S from "effect/Schema";
26
+ export type AnyFn = (...args: any[]) => any;
24
27
  export declare const optional: AnyFn;
25
28
  export declare const Struct: AnyFn;
29
+ export declare const StructWithRest: AnyFn;
26
30
  export declare const suspend: AnyFn;
27
31
  export declare const Array: AnyFn;
28
32
  export declare const Record: AnyFn;
@@ -40,4 +44,14 @@ export declare const Unknown: any;
40
44
  export declare const Null: any;
41
45
  export declare const Void: any;
42
46
  export declare const Any: any;
47
+ /**
48
+ * How a lazy schema builds itself: a closure, or a shared builder plus data
49
+ * stored on the schema object (no closure per schema; see packed.ts).
50
+ */
51
+ export interface LazyBuilder {
52
+ readonly build: (data: unknown) => S.Top;
53
+ }
54
+ /** A schema built on first use by `builder.build(data)`. */
55
+ export declare const lazyFrom: (builder: LazyBuilder, data: unknown) => S.Top;
56
+ export declare const TaggedError: typeof S.TaggedError;
43
57
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,cAAc,eAAe,CAAC;AAI9B,KAAK,KAAK,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAGrC,eAAO,MAAM,QAAQ,EAAE,KAA2B,CAAC;AACnD,eAAO,MAAM,MAAM,EAAE,KAAyB,CAAC;AAC/C,eAAO,MAAM,OAAO,EAAE,KAA0B,CAAC;AACjD,eAAO,MAAM,KAAK,EAAE,KAAwB,CAAC;AAC7C,eAAO,MAAM,MAAM,EAAE,KAAyB,CAAC;AAC/C,eAAO,MAAM,KAAK,EAAE,KAAwB,CAAC;AAC7C,eAAO,MAAM,OAAO,EAAE,KAA0B,CAAC;AACjD,eAAO,MAAM,QAAQ,EAAE,KAA2B,CAAC;AACnD,eAAO,MAAM,MAAM,EAAE,KAAyB,CAAC;AAC/C,eAAO,MAAM,KAAK,EAAE,KAAwB,CAAC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MAAM,UAAU,EAAE,KAA6B,CAAC;AAGvD,eAAO,MAAM,MAAM,EAAE,GAAc,CAAC;AACpC,eAAO,MAAM,MAAM,EAAE,GAAc,CAAC;AACpC,eAAO,MAAM,OAAO,EAAE,GAAe,CAAC;AACtC,eAAO,MAAM,IAAI,EAAE,GAAY,CAAC;AAChC,eAAO,MAAM,OAAO,EAAE,GAAe,CAAC;AACtC,eAAO,MAAM,IAAI,EAAE,GAAY,CAAC;AAChC,eAAO,MAAM,IAAI,EAAE,GAAY,CAAC;AAChC,eAAO,MAAM,GAAG,EAAE,GAAW,CAAC;AAmC9B;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,CAAC,CAAC,GAAG,CAAC;CAC1C;AAqED,4DAA4D;AAC5D,eAAO,MAAM,QAAQ,YAAa,WAAW,QAAQ,OAAO,KAAG,CAAC,CAAC,GACjC,CAAC;AA+HjC,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,CAAC,WAAqD,CAAC"}
package/lib/schema.js CHANGED
@@ -1,48 +1 @@
1
- /**
2
- * `any`-collapsing re-export of `effect/Schema` for generated service files.
3
- *
4
- * This is the single, shared definition consumed by every code-generated
5
- * provider package via `@distilled.cloud/core/schema`. Do not copy it into
6
- * individual packages.
7
- *
8
- * Every real TYPE (`Schema`, `Codec`, `Top`, …) is re-exported untouched, so
9
- * the `Schema.Schema<Foo>` annotations on generated consts (and the public
10
- * `.d.ts`) stay precise. The schema *construction surface* (`Struct`,
11
- * `optional`, `suspend`, …) and the leaf scalar schemas are retyped to `any`,
12
- * so the compiler instantiates none of the heavy Schema generics while
13
- * building a service file — the explicit annotations carry the real types.
14
- *
15
- * Overriding a *value* export never affects the same-named *type* export (they
16
- * live in separate namespaces and continue to flow through `export *`), so
17
- * `Schema.Literal<"x">`-style type usages remain precise.
18
- *
19
- * Runtime behaviour is identical — every override aliases the exact same
20
- * runtime value from `effect/Schema`.
21
- */
22
- export * from "effect/Schema";
23
- import * as S from "effect/Schema";
24
- // Construction surface — collapse to `any` so generics are never instantiated.
25
- export const optional = S.optional;
26
- export const Struct = S.Struct;
27
- export const suspend = S.suspend;
28
- export const Array = S.Array;
29
- export const Record = S.Record;
30
- export const Union = S.Union;
31
- export const Literal = S.Literal;
32
- export const Literals = S.Literals;
33
- export const NullOr = S.NullOr;
34
- export const Tuple = S.Tuple;
35
- export const encodeKeys = S.encodeKeys;
36
- // Leaf schemas — collapse to `any` so `.pipe(...)` on them is free.
37
- export const String = S.String;
38
- export const Number = S.Number;
39
- export const Boolean = S.Boolean;
40
- export const Date = S.Date;
41
- export const Unknown = S.Unknown;
42
- export const Null = S.Null;
43
- export const Void = S.Void;
44
- export const Any = S.Any;
45
- // NOTE: `Schema` / `Codec` (types) and `TaggedErrorClass` are intentionally NOT
46
- // overridden — they flow through `export *` with real types so cast targets and
47
- // typed error classes stay precise.
48
- //# sourceMappingURL=schema.js.map
1
+ export { schema$Any as Any, schema$Array as Array, schema$Boolean as Boolean, schema$Date as Date, schema$Duration as Duration, schema$Literal as Literal, schema$Literals as Literals, schema$Null as Null, schema$NullOr as NullOr, schema$Number as Number, schema$Record as Record, schema$Redacted as Redacted, schema$String as String, schema$Struct as Struct, schema$StructWithRest as StructWithRest, schema$TaggedError as TaggedError, schema$Tuple as Tuple, schema$Union as Union, schema$Unknown as Unknown, schema$Void as Void, schema$declare as declare, schema$encodeKeys as encodeKeys, schema$instanceOf as instanceOf, schema$lazyFrom as lazyFrom, schema$optional as optional, schema$suspend as suspend } from "./_bundle/aws.js";
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The error an operation fails with when the SDK itself cannot make the
3
+ * call: its generated config or a core module is broken (a paginated
4
+ * operation without the fields its strategy reads, a gRPC operation
5
+ * without a descriptor, ...), or one of its own modules fails to load. No
6
+ * input or response causes it; the generator refuses the configs that
7
+ * would. It is typed, so it fails the call instead of crashing the fiber,
8
+ * and it is never retried.
9
+ *
10
+ * Defined on its own, in core's `base` bundle group, so pagination and
11
+ * the protocols fail with it without importing the REST modules.
12
+ */
13
+ import * as Effect from "effect/Effect";
14
+ import * as Schema from "./schema-lite-typed.ts";
15
+ declare const SdkError_base: Schema.TaggedErrorClass<"SdkError", {
16
+ readonly message: import("effect/Schema").String;
17
+ }>;
18
+ export declare class SdkError extends /*@__PURE__*/ SdkError_base {
19
+ }
20
+ /**
21
+ * Load one of the SDK's own modules on first use (`() => import("./x.ts")`).
22
+ * A rejected import -- a chunk missing from a bundle, a browser chunk that
23
+ * fails to download -- fails with {@link SdkError}.
24
+ */
25
+ export declare const loadModule: <A>(load: () => PromiseLike<A>) => Effect.Effect<A, SdkError>;
26
+ export {};
27
+ //# sourceMappingURL=sdk-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk-error.d.ts","sourceRoot":"","sources":["../src/sdk-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;;;;AAEjD,qBAAa,QACX,SAAQ,aAAa,CAAC,aAEpB;CAAG;AAEP;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,QAAQ,MAAM,WAAW,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAOhF,CAAC"}
@@ -0,0 +1 @@
1
+ export { sdk_error$SdkError as SdkError, sdk_error$loadModule as loadModule } from "./_bundle/base.js";
@@ -0,0 +1,28 @@
1
+ import type * as AST from "effect/SchemaAST";
2
+ export declare const sensitiveValueSymbol: unique symbol;
3
+ /** What the plain form of a value that can hold a secret is shown as. */
4
+ export declare const REDACTED = "[REDACTED]";
5
+ /** Whether `ast` is marked sensitive (through optional, Suspend and encoding wrappers). */
6
+ export declare const isSensitive: (ast: AST.AST) => boolean;
7
+ /**
8
+ * Whether a value of the type `ast` can hold a sensitive value, at any depth:
9
+ * the type itself, members, map values, list elements and union arms.
10
+ */
11
+ export declare const holdsSensitive: (ast: AST.AST) => boolean;
12
+ /** `plain`, the plain form of a value of the type `ast`: {@link REDACTED} when it can hold a secret. */
13
+ export declare const redactPlain: <A>(ast: AST.AST, plain: A) => A | typeof REDACTED;
14
+ /**
15
+ * `value`, a parsed value of the type `ast`, as a log shows it: every
16
+ * sensitive value `Redacted` whole, whatever its type, and the rest as is.
17
+ */
18
+ export declare const redactParsed: (ast: AST.AST, value: unknown) => unknown;
19
+ /**
20
+ * Walk a decoded (TS-named) value alongside its schema AST, wrapping values
21
+ * marked sensitive (members, map values, list elements) in `Redacted`: a
22
+ * string, or any non-null value of an untyped (`S.Unknown`) schema. A typed
23
+ * struct is walked so its own sensitive members are wrapped and its type
24
+ * stays accurate. Keys the schema doesn't model pass through. A union
25
+ * applies every arm in turn; a map arm skips keys a sibling arm names.
26
+ */
27
+ export declare const wrapSensitive: (ast: AST.AST, value: unknown, siblingNames?: ReadonlySet<string>) => unknown;
28
+ //# sourceMappingURL=sensitive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sensitive.d.ts","sourceRoot":"","sources":["../src/sensitive.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAI7C,eAAO,MAAM,oBAAoB,eAEhC,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,QAAQ,eAAe,CAAC;AAErC,2FAA2F;AAC3F,eAAO,MAAM,WAAW,QAAS,GAAG,CAAC,GAAG,KAAG,OACM,CAAC;AAIlD;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAS,GAAG,CAAC,GAAG,KAAG,OAyB7C,CAAC;AAEF,wGAAwG;AACxG,eAAO,MAAM,WAAW,GAAI,CAAC,OAAO,GAAG,CAAC,GAAG,SAAS,CAAC,KAAG,CAAC,GAAG,OAAO,QAC3B,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAS,GAAG,CAAC,GAAG,SAAS,OAAO,KAAG,OACN,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,QACnB,GAAG,CAAC,GAAG,SACL,OAAO,iBACC,WAAW,CAAC,MAAM,CAAC,KACjC,OAAgD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{getAnn as e,getProps as t,resolveNode as n}from"./annotations.js";import{isOpaqueValue as r}from"./plain-values.js";import*as i from"effect/Redacted";const a=/*@__PURE__*/ Symbol.for(`@distilled.cloud/core/sensitive-value`);const o=`[REDACTED]`;const isSensitive=t=>e(t,a)!==void 0;const s=/*@__PURE__*/ new WeakMap;const holdsSensitive=e=>{const t=s.get(e);if(t!==void 0)return t;const r=/* @__PURE__ */ new Set;const visit=e=>{if(isSensitive(e))return true;const t=n(e);if(r.has(t))return false;r.add(t);switch(t._tag){case`Union`:return t.types.some(visit);case`Arrays`:return[...t.elements??[],...t.rest??[]].some(visit);case`Objects`:return[...t.propertySignatures??[],...t.indexSignatures??[]].some(e=>visit(e.type));default:return false}};const i=visit(e);s.set(e,i);return i};const redactPlain=(e,t)=>holdsSensitive(e)?o:t;const redactParsed=(e,t)=>holdsSensitive(e)?wrap(e,t,true):t;const wrapSensitive=(e,t,n)=>wrap(e,t,false,n);const isSecretValue=(e,t,r)=>r?t!==null&&t!==void 0:typeof t===`string`||t!==null&&n(e)._tag===`Unknown`;const wrap=(e,a,o,s)=>{if(a===null||typeof a!==`object`||r(a)||i.isRedacted(a))return a;const c=n(e);if(c._tag===`Union`){const e=new Set(c.types.flatMap(e=>{const r=n(e);return r._tag===`Objects`?t(r).map(e=>String(e.name)):[]}));return c.types.reduce((t,n)=>wrap(n,t,o,e),a)}if(c._tag===`Arrays`){if(!Array.isArray(a))return a;const e=c.rest?.[0];if(!e)return a;const t=isSensitive(e);return a.map(n=>t&&isSecretValue(e,n,o)&&!i.isRedacted(n)?i.make(n):wrap(e,n,o))}if(c._tag===`Objects`&&!Array.isArray(a)){const e=t(c);const n=c.indexSignatures?.[0]?.type;if(e.length===0&&n===void 0)return a;const r=new Map(e.map(e=>[String(e.name),e]));return Object.fromEntries(Object.entries(a).flatMap(([e,t])=>{if(t===void 0)return[];const a=r.get(e)?.type??(s?.has(e)?void 0:n);if(a===void 0)return[[e,t]];if(isSensitive(a)&&isSecretValue(a,t,o))return[[e,i.isRedacted(t)?t:i.make(t)]];return[[e,wrap(a,t,o)]]}))}return a};export{o as REDACTED,holdsSensitive,isSensitive,redactParsed,redactPlain,a as sensitiveValueSymbol,wrapSensitive};
2
+ //# sourceMappingURL=sensitive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sensitive.js","names":["Redacted","sensitiveValueSymbol","REDACTED","getAnn","ast","holds","cached","seen","n","node","resolveNode","m","result","plain","value","siblingNames","whole","v","type","isOpaqueValue","named","armNode","arm","getProps","p","redacted","elem","sensitive","props","mapValue","byName","k"],"sources":["../src/sensitive.ts"],"mappings":"6JAqBA,MAAaC,EAAqC,qBAAO,IACvD,uCACF,EAGA,MAAaC,EAAW,aAGxB,MAAa,YAAe,GAC1BC,EAAOC,EAAKH,CAAoB,IAAM,IAAA,GAExC,MAAMI,gBAAsB,IAAI,QAMhC,MAAa,eAAkB,GAA0B,CACvD,MAAMC,EAASD,EAAM,IAAID,CAAG,EAC5B,GAAIE,IAAW,IAAA,GAAW,OAAOA,EACjC,MAAMC,kBAAO,IAAI,IACjB,MAAM,MAAS,GAAwB,CACrC,GAAI,YAAYC,CAAC,EAAG,MAAO,MAC3B,MAAMC,EAAOC,EAAYF,CAAC,EAC1B,GAAID,EAAK,IAAIE,CAAI,EAAG,MAAO,OAC3BF,EAAK,IAAIE,CAAI,EACb,OAAQA,EAAK,KAAb,CACE,IAAK,QACH,OAAOA,EAAK,MAAM,KAAK,KAAK,EAC9B,IAAK,SACH,MAAO,CAAC,GAAIA,EAAK,UAAY,CAAC,EAAI,GAAIA,EAAK,MAAQ,CAAC,CAAE,CAAC,CAAC,KAAK,KAAK,EACpE,IAAK,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ACzB,GAAI,CAACiB,EAAM,OAAOZ,EAClB,MAAMa,EAAY,YAAYD,CAAI,EAClC,OAAOZ,EAAM,IAAK,GAChBa,GAAa,cAAcD,EAAMT,EAAGD,CAAK,GAAK,CAAChB,EAAS,WAAWiB,CAAC,EAChEjB,EAAS,KAAKiB,CAAC,EACf,KAAKS,EAAMT,EAAGD,CAAK,CACzB,CACF,CACA,GAAIP,EAAK,OAAS,WAAa,CAAC,MAAM,QAAQK,CAAK,EAAG,CACpD,MAAMc,EAAQL,EAASd,CAAI,EAC3B,MAAMoB,EAAWpB,EAAK,kBAAkB,EAAE,EAAE,KAC5C,GAAImB,EAAM,SAAW,GAAKC,IAAa,IAAA,GAAW,OAAOf,EACzD,MAAMgB,EAAS,IAAI,IAAIF,EAAM,IAAK,GAAM,CAAC,OAAOJ,EAAE,IAAI,EAAGA,CAAC,CAAC,CAAC,EAE5D,OAAO,OAAO,YACZ,OAAO,QAAQV,CAAgC,CAAC,CAAC,SAA4B,CAACiB,EAAGd,KAAO,CACtF,GAAIA,IAAM,IAAA,GAAW,MAAO,CAAC,EAE7B,MAAMC,EADOY,EAAO,IAAIC,CACR,CAAC,EAAE,OAAShB,GAAc,IAAIgB,CAAC,EAAI,IAAA,GAAYF,GAC/D,GAAIX,IAAS,IAAA,GAAW,MAAO,CAAC,CAACa,EAAGd,CAAC,CAAC,EAEtC,GAAI,YAAYC,CAAI,GAAK,cAAcA,EAAMD,EAAGD,CAAK,EACnD,MAAO,CAAC,CAACe,EAAG/B,EAAS,WAAWiB,CAAC,EAAIA,EAAIjB,EAAS,KAAKiB,CAAC,CAAC,CAAC,EAE5D,MAAO,CAAC,CAACc,EAAG,KAAKb,EAAMD,EAAGD,CAAK,CAAC,CAAC,CACnC,CAAC,CACH,CACF,CACA,OAAOF,CACT"}
@@ -0,0 +1,6 @@
1
+ import * as Layer from "effect/Layer";
2
+ export declare const TelemetryDebug: {
3
+ /** Turns on debug spans and debug log lines for every distilled call it is provided to. */
4
+ readonly layer: Layer.Layer<never>;
5
+ };
6
+ //# sourceMappingURL=telemetry-debug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-debug.d.ts","sourceRoot":"","sources":["../src/telemetry-debug.ts"],"names":[],"mappings":"AAyCA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AA+HtC,eAAO,MAAM,cAAc;IACzB,2FAA2F;aAC3F,KAAK,EAOC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;CAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{Debug as e,OperationSpan as t,tagOf as n}from"./telemetry.js";import{redactParsed as r}from"./sensitive.js";import*as i from"effect/Effect";import*as a from"effect/Exit";import*as o from"effect/Layer";import*as s from"effect/Stream";import*as c from"effect/Cause";import*as l from"effect/Tracer";const call=(e,t,o,s)=>{const l=e.attributes[`url.template`];const u=o===void 0?i.logDebug(`call ${e.name}`):i.logDebug(`call ${e.name}`,r(o.input,t));const d=i.flatMap(u,()=>i.onExit(s,t=>a.isSuccess(t)?o===void 0?i.logDebug(`ok ${e.name}`):i.logDebug(`ok ${e.name}`,r(o.output,t.value)):c.hasInterruptsOnly(t.cause)?i.logDebug(`interrupted ${e.name}`):i.logDebug(`failed ${e.name}: ${n(c.squash(t.cause))}`)));return i.annotateLogs(i.withLogSpan(d,`distilled.operation`),{"distilled.operation":e.name,...typeof l===`string`?{"url.template":l}:{}})};const hostOf=e=>{try{return new URL(e).host}catch{return``}};const http=(e,t)=>i.flatMap(i.logDebug(`-> ${e.method} ${hostOf(e.url)}`),()=>i.tap(t,e=>i.logDebug(`<- ${e.status}`)));const phase=(e,t,n)=>i.withSpan(t,e,{level:`Debug`,attributes:n,captureStackTrace:false});const attempt=(e,r)=>i.withFiber(a=>{const o=a.getRef(t);if(o===void 0)return e;return i.useSpan(`Attempt`,{parent:o.span,attributes:{"distilled.attempt":r,"http.request.resend_count":r-1}},t=>{o.attempt=t;const r=i.tapError(e,e=>i.sync(()=>t.attribute(`error.type`,n(e))));return i.provideService(r,l.ParentSpan,t)})});const readStream=(e,t,r)=>s.unwrap(i.map(i.makeSpan(`distilled.read_stream`,{parent:t,level:`Debug`,attributes:{"distilled.stream.member":r}}),t=>{let r=0;let o=0;const l=s.map(e,e=>{r++;if(e instanceof Uint8Array)o+=e.byteLength;return e});return s.onExit(l,e=>i.clockWith(s=>i.sync(()=>{t.attribute(`distilled.stream.items`,r);if(o>0)t.attribute(`distilled.stream.bytes`,o);if(a.isFailure(e)&&!c.hasInterruptsOnly(e.cause))t.attribute(`error.type`,n(c.squash(e.cause)));t.end(s.currentTimeNanosUnsafe(),e)})))}));const u=/\(?((?:file:\/\/)?[^\s()]+):(\d+):(\d+)\)?$/;const callSite=e=>{const t=e?.();const n=t?u.exec(t):null;if(!n)return void 0;const r=/^at (\S+) \(/.exec(t)?.[1];return{"code.file.path":n[1],"code.line.number":Number(n[2]),"code.column.number":Number(n[3]),...r?{"code.function.name":r}:{}}};const d={layer:/*@__PURE__*/ o.succeed(e,{phase,attempt,readStream,callSite,call,http})};export{d as TelemetryDebug};
2
+ //# sourceMappingURL=telemetry-debug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-debug.js","names":["Effect","Exit","Layer","Stream","Cause","Tracer","template","info","start","schemas","redactParsed","input","logged","effect","exit","tagOf","url","request","sent","response","name","call","fiber","OperationSpan","base","n","span","run","error","member","items","bytes","counted","stream","item","clock","LOCATION","line","site","match","fn","TelemetryDebug","Debug"],"sources":["../src/telemetry-debug.ts"],"mappings":"+SAqDA,MAAM,MAA4B,EAAM,EAAO,EAAS,IAAW,CACjE,MAAMM,EAAWC,EAAK,WAAW,gBACjC,MAAMC,EACJC,IAAY,IAAA,GACRT,EAAO,SAAS,QAAQO,EAAK,MAAM,EACnCP,EAAO,SAAS,QAAQO,EAAK,OAAQG,EAAaD,EAAQ,MAAOE,CAAK,CAAC,EAC7E,MAAMC,EAASZ,EAAO,QAAQQ,MAC5BR,EAAO,OAAOa,EAAS,GACrBZ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AAI,CAAC,CAC3C,CACF,EAEA,MAAaC,EAAiB,CAE5B,MAAqB,gBAAM,QAAQC,EAAO,CACxC,MACA,QACA,WACA,SACA,KACA,IACF,CAAC,CACH"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * App callbacks on each recorded operation span, for attributes distilled
3
+ * does not record (an app's own ids, a custom request field):
4
+ *
5
+ * ```ts
6
+ * import { TelemetryHooks } from "@distilled.cloud/core/telemetry-hooks";
7
+ *
8
+ * program.pipe(
9
+ * Effect.provide(
10
+ * TelemetryHooks.layer({
11
+ * onStart: (span, { method, input }) => {
12
+ * if (method === "S3/PutObject") span.attribute("app.tenant", tenantOf(input));
13
+ * },
14
+ * onEnd: (span, exit) => {},
15
+ * }),
16
+ * ),
17
+ * );
18
+ * ```
19
+ *
20
+ * `onStart` runs when the span starts, before the request is built, with
21
+ * the operation's span name, its `rpc.method` and the caller's input.
22
+ * `onEnd` runs when the call ends, after every retry. Both run only when a
23
+ * span is recorded (an exporter is installed). A program that never
24
+ * imports this module never bundles it.
25
+ */
26
+ import * as Layer from "effect/Layer";
27
+ import { type SpanHooks } from "./telemetry.ts";
28
+ export type { SpanHooks };
29
+ export declare const TelemetryHooks: {
30
+ readonly layer: (hooks: SpanHooks) => Layer.Layer<never>;
31
+ };
32
+ //# sourceMappingURL=telemetry-hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-hooks.d.ts","sourceRoot":"","sources":["../src/telemetry-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEvD,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,eAAO,MAAM,cAAc;aACzB,KAAK,UAAU,SAAS,KAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;CACrC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{Hooks as e}from"./telemetry.js";import*as t from"effect/Layer";const n={layer:n=>t.succeed(e,n)};export{n as TelemetryHooks};
2
+ //# sourceMappingURL=telemetry-hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-hooks.js","names":["Layer","TelemetryHooks","Hooks","hooks"],"sources":["../src/telemetry-hooks.ts"],"mappings":"sEA8BA,MAAaC,EAAiB,CAC5B,MAAQ,GAAyCD,EAAM,QAAQE,EAAOC,CAAK,CAC7E"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The `com.distilled.telemetry#service` trait's `hosts`: facts for requests
3
+ * to S3-compatible hosts such as Cloudflare R2. Generated code imports this
4
+ * only where a trait has one (S3). See
5
+ * `packages/dev/src/codegen/telemetry-traits.md`.
6
+ */
7
+ import type { RequestHook } from "./telemetry.ts";
8
+ /** Facts for requests to a host ending in `suffix`. */
9
+ export interface HostRule {
10
+ /** Host suffix, with its leading dot (`.r2.cloudflarestorage.com`). */
11
+ readonly suffix: string;
12
+ readonly attributes?: Readonly<Record<string, string | number | boolean>>;
13
+ /** Attribute that gets the host label just before the suffix (the account id). */
14
+ readonly hostLabel?: string;
15
+ /** Attribute values copied under a second name: `{ "aws.s3.bucket": "cloudflare.r2.bucket" }`. */
16
+ readonly copy?: Readonly<Record<string, string>>;
17
+ }
18
+ /**
19
+ * Facts recorded when a request goes to a matching host: an S3-compatible
20
+ * service such as Cloudflare R2 reached through the S3 SDK.
21
+ */
22
+ export declare const hostRules: (rules: ReadonlyArray<HostRule>) => RequestHook;
23
+ //# sourceMappingURL=telemetry-host-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-host-rules.d.ts","sourceRoot":"","sources":["../src/telemetry-host-rules.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,uDAAuD;AACvD,MAAM,WAAW,QAAQ;IACvB,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAC1E,kFAAkF;IAClF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,kGAAkG;IAClG,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAClD;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,UACZ,aAAa,CAAC,QAAQ,CAAC,KAAG,WAcjC,CAAC"}
@@ -0,0 +1,2 @@
1
+ const hostRules=e=>(t,n,r)=>{for(const i of e){if(!t.endsWith(i.suffix))continue;for(const e in i.attributes)r(e,i.attributes[e]);if(i.hostLabel!==void 0){const e=t.slice(0,t.length-i.suffix.length);if(e.length>0)r(i.hostLabel,e.slice(e.lastIndexOf(`.`)+1))}for(const e in i.copy){const t=n.attributes.get(e);if(t!==void 0)r(i.copy[e],t)}}};export{hostRules};
2
+ //# sourceMappingURL=telemetry-host-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-host-rules.js","names":["rule","rules","host","key","set","prefix","from","value","span"],"sources":["../src/telemetry-host-rules.ts"],"mappings":"AAuBA,MAAa,UACV,IACA,EAAM,EAAM,IAAQ,CACnB,IAAK,MAAMA,KAAQC,EAAO,CACxB,GAAI,CAACC,EAAK,SAASF,EAAK,MAAM,EAAG,SACjC,IAAK,MAAMG,KAAOH,EAAK,WAAYI,EAAID,EAAKH,EAAK,WAAWG,EAAI,EAChE,GAAIH,EAAK,YAAc,IAAA,GAAW,CAChC,MAAMK,EAASH,EAAK,MAAM,EAAGA,EAAK,OAASF,EAAK,OAAO,MAAM,EAC7D,GAAIK,EAAO,OAAS,EAAGD,EAAIJ,EAAK,UAAWK,EAAO,MAAMA,EAAO,YAAY,GAAG,EAAI,CAAC,CAAC,CACtF,CACA,IAAK,MAAMC,KAAQN,EAAK,KAAM,CAC5B,MAAMO,EAAQC,EAAK,WAAW,IAAIF,CAAI,EACtC,GAAIC,IAAU,IAAA,GAAWH,EAAIJ,EAAK,KAAKM,GAAQC,CAAK,CACtD,CACF,CACF"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * W3C trace context in a Lambda `Invoke`'s `ClientContext` (base64 JSON),
3
+ * under `custom.traceparent`, as `@opentelemetry/instrumentation-aws-sdk`
4
+ * writes it; the invoked function reads it from `context.clientContext`.
5
+ * Generated code imports this only where an operation's `inject` has format
6
+ * `lambdaClientContext`. See `packages/dev/src/codegen/telemetry-traits.md`.
7
+ */
8
+ import type * as Tracer from "effect/Tracer";
9
+ /**
10
+ * Add `custom.traceparent` to the input's `member` (a base64 JSON client
11
+ * context). Kept as it was: a `traceparent` already there, a value that is
12
+ * not base64 JSON, and a result over Lambda's size cap.
13
+ */
14
+ export declare const injectLambdaClientContext: (place: {
15
+ readonly member: string;
16
+ }) => (span: Tracer.Span, input: unknown) => unknown;
17
+ //# sourceMappingURL=telemetry-lambda-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-lambda-context.d.ts","sourceRoot":"","sources":["../src/telemetry-lambda-context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAe7C;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,UAC5B;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,YAC5B,MAAM,CAAC,IAAI,SAAS,OAAO,KAAG,OAgBpC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{traceparent as e}from"./telemetry-message-context.js";const t=3583;const toBase64=e=>{let t=``;for(const n of new TextEncoder().encode(e))t+=String.fromCharCode(n);return btoa(t)};const fromBase64=e=>new TextDecoder().decode(Uint8Array.from(atob(e),e=>e.charCodeAt(0)));const injectLambdaClientContext=n=>(r,i)=>{if(i===null||typeof i!==`object`)return i;const a=i;const o=a[n.member];try{const s=typeof o===`string`&&o.length>0?JSON.parse(fromBase64(o)):{};if(s===null||typeof s!==`object`)return i;if(s.custom?.traceparent!==void 0)return i;const c=toBase64(JSON.stringify({...s,custom:{...s.custom,traceparent:e(r)}}));return c.length>t?i:{...a,[n.member]:c}}catch{return i}};export{injectLambdaClientContext};
2
+ //# sourceMappingURL=telemetry-lambda-context.js.map