apps 0.0.1-beta.7 → 0.0.1-beta.70

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 (178) hide show
  1. package/README.md +25 -22
  2. package/framework-reference.json +1 -1
  3. package/js/{chunk-UESPOTUI.js → chunk-2YSTJMBD.js} +899 -190
  4. package/js/{chunk-RJDDBDSN.js → chunk-3CVQ3VPP.js} +762 -171
  5. package/js/chunk-3R3KFCDU.js +426 -0
  6. package/js/{chunk-FL2QR3XW.js → chunk-4NCIPADO.js} +326 -69
  7. package/js/chunk-5FHWNLCI.js +88 -0
  8. package/js/{chunk-M3B3DE4K.js → chunk-74YVXBKY.js} +463 -218
  9. package/js/chunk-7LMU3ER3.js +274 -0
  10. package/js/chunk-CDXQDN7W.js +92 -0
  11. package/js/{chunk-RFVIONFX.js → chunk-ECCWT5GJ.js} +79 -41
  12. package/js/{chunk-UK573G7W.js → chunk-EOPQ727L.js} +87 -51
  13. package/js/{chunk-27F7W2LG.js → chunk-H2CJWXA3.js} +2 -2
  14. package/js/{chunk-JU7VHODU.js → chunk-H72MEDMN.js} +65 -10
  15. package/js/{chunk-CDL5PM2Q.js → chunk-IFJU5SYQ.js} +19082 -18402
  16. package/js/{chunk-VFZKSM3T.js → chunk-JPEUKEV4.js} +3 -3
  17. package/js/{chunk-WLE7WX2U.js → chunk-JW5LYSER.js} +2262 -474
  18. package/js/{chunk-5T57N25Q.js → chunk-KGCTYL2S.js} +511 -63
  19. package/js/{chunk-KUMBKVJD.js → chunk-KLYSEHUD.js} +2 -2
  20. package/js/chunk-M5OLYYNU.js +347 -0
  21. package/js/chunk-MHB7IFG7.js +49 -0
  22. package/js/chunk-OD3KFKZD.js +1617 -0
  23. package/js/{chunk-57RKNWL2.js → chunk-PD6I2SDG.js} +4 -4
  24. package/js/{chunk-NKLWZJLE.js → chunk-RUP4JMKO.js} +25 -14
  25. package/js/{chunk-IJX4CYZO.js → chunk-TUMGL2OC.js} +228 -264
  26. package/js/{chunk-72JNVHPK.js → chunk-WDIVWSDG.js} +4 -3
  27. package/js/{chunk-CMYUWAX7.js → chunk-WGQP62EG.js} +126 -31
  28. package/js/{chunk-IPI4MFSN.js → chunk-XBG7HHXC.js} +2 -2
  29. package/js/{chunk-Z5M2LQOZ.js → chunk-ZEJ3IKEC.js} +67 -55
  30. package/js/chunk-ZR7QAG67.js +171 -0
  31. package/js/client.js +142 -94
  32. package/js/contracts.js +125 -26
  33. package/js/effect.js +19 -19
  34. package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
  35. package/js/graphql.js +50 -40
  36. package/js/host.js +83 -58
  37. package/js/index.js +131 -46
  38. package/js/mcp/effect.js +23 -21
  39. package/js/mcp/stdio.js +44 -34
  40. package/js/mcp.js +76 -53
  41. package/js/openapi.js +4063 -1359
  42. package/js/react.js +2 -3
  43. package/js/skills/effect.js +6 -3
  44. package/js/skills.js +208 -81
  45. package/js/storage/facet.js +1 -540
  46. package/js/ui/auth/contracts.js +2 -2
  47. package/js/ui/auth.js +5 -5
  48. package/js/ui/contracts.js +5 -4
  49. package/js/ui/serving.js +8517 -214
  50. package/package.json +3 -4
  51. package/runtime.json +1 -1
  52. package/types/app-cache/src/contracts/cache.d.ts +2 -0
  53. package/types/app-cache/src/index.d.ts +10 -1
  54. package/types/apps/src/contracts/api-response-error.d.ts +4 -0
  55. package/types/apps/src/contracts/app.d.ts +7 -3
  56. package/types/apps/src/contracts/cache.d.ts +20 -0
  57. package/types/apps/src/contracts/context.d.ts +19 -11
  58. package/types/apps/src/contracts/elicitation.d.ts +6 -6
  59. package/types/apps/src/contracts/events.d.ts +93 -0
  60. package/types/apps/src/contracts/failure.d.ts +30 -1
  61. package/types/apps/src/contracts/graphql.d.ts +2 -1
  62. package/types/apps/src/contracts/host.d.ts +641 -16
  63. package/types/apps/src/contracts/live.d.ts +2 -0
  64. package/types/apps/src/contracts/mcp.d.ts +80 -10
  65. package/types/apps/src/contracts/network.d.ts +120 -0
  66. package/types/apps/src/contracts/openapi-compile.d.ts +82 -3
  67. package/types/apps/src/contracts/openapi.d.ts +41 -9
  68. package/types/apps/src/contracts/operations.d.ts +8 -4
  69. package/types/apps/src/contracts/placement.d.ts +102 -0
  70. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  71. package/types/apps/src/contracts/protocols/1.d.ts +733 -81
  72. package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
  73. package/types/apps/src/contracts/protocols/2.d.ts +69 -26
  74. package/types/apps/src/contracts/protocols/3.d.ts +133 -33
  75. package/types/apps/src/contracts/protocols/4.d.ts +122 -45
  76. package/types/apps/src/contracts/protocols/5.d.ts +157 -47
  77. package/types/apps/src/contracts/protocols/6.d.ts +1629 -0
  78. package/types/apps/src/contracts/protocols/7.d.ts +1785 -0
  79. package/types/apps/src/contracts/protocols/8.d.ts +1182 -0
  80. package/types/apps/src/contracts/protocols/9.d.ts +1104 -0
  81. package/types/apps/src/contracts/protocols/current.d.ts +3842 -0
  82. package/types/apps/src/contracts/protocols/oauth-6.d.ts +74 -0
  83. package/types/apps/src/contracts/protocols/oauth.d.ts +134 -0
  84. package/types/apps/src/contracts/provider-error.d.ts +9 -0
  85. package/types/apps/src/contracts/provider.d.ts +90 -6
  86. package/types/apps/src/contracts/skills.d.ts +50 -13
  87. package/types/apps/src/contracts/sql.d.ts +63 -0
  88. package/types/apps/src/contracts/ui.d.ts +19 -1
  89. package/types/apps/src/contracts/workflows.d.ts +6 -0
  90. package/types/apps/src/facet.d.ts +4 -5
  91. package/types/apps/src/host.d.ts +5 -0
  92. package/types/apps/src/implementation/account-router.d.ts +4 -3
  93. package/types/apps/src/implementation/authoring.d.ts +25 -5
  94. package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
  95. package/types/apps/src/implementation/cache.d.ts +4 -0
  96. package/types/apps/src/implementation/catalog-cache.d.ts +35 -4
  97. package/types/apps/src/implementation/elicitation.d.ts +18 -15
  98. package/types/apps/src/implementation/events.d.ts +59 -0
  99. package/types/apps/src/implementation/failure-detail.d.ts +25 -3
  100. package/types/apps/src/implementation/graphql-catalog.d.ts +3 -3
  101. package/types/apps/src/implementation/graphql.d.ts +4 -3
  102. package/types/apps/src/implementation/input-problems.d.ts +6 -2
  103. package/types/apps/src/implementation/invocation-timing.d.ts +16 -0
  104. package/types/apps/src/implementation/live.d.ts +2 -2
  105. package/types/apps/src/implementation/mcp-call.d.ts +6 -5
  106. package/types/apps/src/implementation/mcp-catalog.d.ts +6 -4
  107. package/types/apps/src/implementation/mcp-client.d.ts +17 -9
  108. package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
  109. package/types/apps/src/implementation/mcp-tools.d.ts +2 -1
  110. package/types/apps/src/implementation/mcp.d.ts +20 -9
  111. package/types/apps/src/implementation/network.d.ts +16 -0
  112. package/types/apps/src/implementation/openapi-compile.d.ts +26 -6
  113. package/types/apps/src/implementation/openapi-document.d.ts +46 -19
  114. package/types/apps/src/implementation/openapi-names.d.ts +9 -4
  115. package/types/apps/src/implementation/openapi-request.d.ts +10 -2
  116. package/types/apps/src/implementation/openapi-source.d.ts +18 -0
  117. package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
  118. package/types/apps/src/implementation/operations.d.ts +17 -2
  119. package/types/apps/src/implementation/optimistic.d.ts +1 -1
  120. package/types/apps/src/implementation/placement.d.ts +60 -0
  121. package/types/apps/src/implementation/protocol-operations.d.ts +3 -0
  122. package/types/apps/src/implementation/provider-error.d.ts +28 -1
  123. package/types/apps/src/implementation/provider.d.ts +18 -3
  124. package/types/apps/src/implementation/query-commit.d.ts +1 -1
  125. package/types/apps/src/implementation/router-catalog.d.ts +11 -13
  126. package/types/apps/src/implementation/router.d.ts +16 -5
  127. package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
  128. package/types/apps/src/implementation/schema.d.ts +90 -10
  129. package/types/apps/src/implementation/skills.d.ts +18 -24
  130. package/types/apps/src/implementation/sql.d.ts +71 -0
  131. package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
  132. package/types/apps/src/implementation/ui-auth.d.ts +1 -1
  133. package/types/apps/src/implementation/ui-client.d.ts +2 -2
  134. package/types/apps/src/implementation/ui-document.d.ts +5 -0
  135. package/types/apps/src/implementation/ui-errors.d.ts +1 -1
  136. package/types/apps/src/implementation/ui-serving.d.ts +11 -5
  137. package/types/apps/src/implementation/ui-watch.d.ts +1 -1
  138. package/types/apps/src/implementation/upstream-error.d.ts +7 -0
  139. package/types/apps/src/implementation/webhooks.d.ts +1 -1
  140. package/types/apps/src/implementation/workflows.d.ts +1 -1
  141. package/types/apps/src/index.d.ts +55 -13
  142. package/types/apps/src/mcp.d.ts +20 -1
  143. package/types/apps/src/openapi.d.ts +1 -1
  144. package/types/apps/src/react.d.ts +1 -1
  145. package/types/apps/src/skills.d.ts +10 -8
  146. package/types/telemetry/src/app-records.d.ts +42 -0
  147. package/types/telemetry/src/browser-operations.d.ts +7 -4
  148. package/types/telemetry/src/browser.d.ts +8 -3
  149. package/types/telemetry/src/config.d.ts +2 -2
  150. package/types/telemetry/src/index.d.ts +2 -1
  151. package/types/telemetry/src/layer.d.ts +2 -2
  152. package/types/telemetry/src/measurements.d.ts +1 -1
  153. package/types/telemetry/src/ownership.d.ts +56 -0
  154. package/types/telemetry/src/recorded-failure.d.ts +29 -0
  155. package/types/telemetry/src/relay.d.ts +16 -6
  156. package/types/telemetry/src/span-attributes.d.ts +17 -1
  157. package/types/telemetry/src/transport.d.ts +8 -1
  158. package/types/utils/src/api-error.d.ts +55 -0
  159. package/types/utils/src/connection-failure.d.ts +33 -0
  160. package/types/utils/src/recorded-message.d.ts +18 -0
  161. package/types/utils/src/user-facing-error.d.ts +83 -0
  162. package/js/chunk-MKWZPDR6.js +0 -63
  163. package/js/chunk-N7YDVXYJ.js +0 -186
  164. package/js/chunk-OCYUEU47.js +0 -224
  165. package/js/chunk-PJJ24GU7.js +0 -877
  166. package/js/chunk-PZB6T6KU.js +0 -19
  167. package/js/chunk-R3EV5FTO.js +0 -97
  168. package/js/chunk-YXQHV65J.js +0 -242
  169. package/js/chunk-ZQINWV4W.js +0 -630
  170. package/types/app-data/src/implementation/cursor.d.ts +0 -10
  171. package/types/app-data/src/implementation/index-key.d.ts +0 -7
  172. package/types/app-data/src/implementation/promise.d.ts +0 -68
  173. package/types/app-data/src/implementation/range.d.ts +0 -8
  174. package/types/app-data/src/implementation/schema.d.ts +0 -18
  175. package/types/app-data/src/implementation/sqlite.d.ts +0 -11
  176. package/types/app-data/src/index.d.ts +0 -4
  177. package/types/apps/src/contracts/storage.d.ts +0 -68
  178. package/types/apps/src/implementation/storage.d.ts +0 -15
@@ -19,10 +19,7 @@ import {
19
19
  text,
20
20
  uint8Array,
21
21
  urlParams
22
- } from "./chunk-UK573G7W.js";
23
- import {
24
- JsonValue
25
- } from "./chunk-27F7W2LG.js";
22
+ } from "./chunk-EOPQ727L.js";
26
23
  import {
27
24
  Cause,
28
25
  Defect,
@@ -31,7 +28,6 @@ import {
31
28
  Literal,
32
29
  Never,
33
30
  RecordFromUrlParams,
34
- Schema_exports,
35
31
  Service,
36
32
  String as String2,
37
33
  Struct,
@@ -45,6 +41,7 @@ import {
45
41
  UnknownFromJsonString,
46
42
  Void,
47
43
  add,
44
+ all,
48
45
  as,
49
46
  assignProperty,
50
47
  brand,
@@ -54,12 +51,11 @@ import {
54
51
  context,
55
52
  declare,
56
53
  decode2 as decode,
57
- decodeEffect,
58
54
  decodeText,
59
55
  decodeTo,
60
56
  decodeUnknownEffect2 as decodeUnknownEffect,
61
- empty2 as empty,
62
- empty6 as empty2,
57
+ empty,
58
+ empty5 as empty2,
63
59
  encodeSync,
64
60
  encodeUnknownEffect2 as encodeUnknownEffect,
65
61
  ensure,
@@ -89,11 +85,12 @@ import {
89
85
  isSuspend,
90
86
  isUnion,
91
87
  isVoid,
92
- make6 as make,
88
+ make2 as make,
93
89
  map2 as map,
94
90
  map3 as map2,
95
91
  map4 as map3,
96
92
  map6 as map4,
93
+ mapError,
97
94
  memoize,
98
95
  merge,
99
96
  millis,
@@ -101,7 +98,7 @@ import {
101
98
  pipeArguments,
102
99
  pipeThroughChannel,
103
100
  pipeTo,
104
- provideContext2 as provideContext,
101
+ provideContext,
105
102
  resolveAt,
106
103
  succeed,
107
104
  succeed4 as succeed2,
@@ -111,47 +108,18 @@ import {
111
108
  toCodecJson,
112
109
  toCodecStringTree,
113
110
  toEncoded,
114
- toEncoded2,
115
111
  toString,
116
112
  toType,
117
113
  transform,
118
114
  transformEffect,
119
115
  transformPull,
120
116
  void_2 as void_
121
- } from "./chunk-CDL5PM2Q.js";
117
+ } from "./chunk-IFJU5SYQ.js";
122
118
  import {
123
119
  __export
124
120
  } from "./chunk-CZ7CSFO4.js";
125
121
 
126
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApi.js
127
- var HttpApi_exports = {};
128
- __export(HttpApi_exports, {
129
- AdditionalSchemas: () => AdditionalSchemas,
130
- ParseOptions: () => ParseOptions,
131
- isHttpApi: () => isHttpApi,
132
- make: () => make4,
133
- reflect: () => reflect
134
- });
135
-
136
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiEndpoint.js
137
- var HttpApiEndpoint_exports = {};
138
- __export(HttpApiEndpoint_exports, {
139
- delete: () => del,
140
- get: () => get2,
141
- getErrorSchemas: () => getErrorSchemas,
142
- getPayloadSchemas: () => getPayloadSchemas,
143
- getSuccessSchemas: () => getSuccessSchemas,
144
- head: () => head,
145
- isHttpApiEndpoint: () => isHttpApiEndpoint,
146
- make: () => make3,
147
- options: () => options,
148
- patch: () => patch,
149
- post: () => post,
150
- put: () => put,
151
- query: () => query
152
- });
153
-
154
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiSchema.js
122
+ // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/http-api/HttpApiSchema.js
155
123
  var HttpApiSchema_exports = {};
156
124
  __export(HttpApiSchema_exports, {
157
125
  Accepted: () => Accepted,
@@ -192,7 +160,7 @@ __export(HttpApiSchema_exports, {
192
160
  withHeaders: () => withHeaders
193
161
  });
194
162
 
195
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/encoding/Sse.js
163
+ // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/encoding/Sse.js
196
164
  var SseErrorTypeId = "~effect/encoding/Sse/SseError";
197
165
  var EventTooLarge = class extends (/* @__PURE__ */ TaggedError("EventTooLarge")) {
198
166
  get message() {
@@ -203,12 +171,14 @@ var SseError = class extends (/* @__PURE__ */ TaggedError("SseError")) {
203
171
  /**
204
172
  * Marks this value as an SSE decoding error.
205
173
  *
174
+ * @stability unstable
206
175
  * @since 4.0.0
207
176
  */
208
177
  [SseErrorTypeId] = SseErrorTypeId;
209
178
  /**
210
179
  * Delegates the public message to the underlying SSE error reason.
211
180
  *
181
+ * @stability unstable
212
182
  * @since 4.0.0
213
183
  */
214
184
  get message() {
@@ -404,12 +374,14 @@ var Retry = class _Retry extends (/* @__PURE__ */ TaggedClass("Retry")) {
404
374
  /**
405
375
  * Marks this value as an SSE retry directive for runtime guards.
406
376
  *
377
+ * @stability unstable
407
378
  * @since 4.0.0
408
379
  */
409
380
  [RetryTypeId] = RetryTypeId;
410
381
  /**
411
382
  * Returns `true` when the value is an SSE retry directive.
412
383
  *
384
+ * @stability unstable
413
385
  * @since 4.0.0
414
386
  */
415
387
  static is(u) {
@@ -418,6 +390,7 @@ var Retry = class _Retry extends (/* @__PURE__ */ TaggedClass("Retry")) {
418
390
  /**
419
391
  * Separates SSE retry directives from regular event values.
420
392
  *
393
+ * @stability unstable
421
394
  * @since 4.0.0
422
395
  */
423
396
  static filter(u) {
@@ -425,8 +398,8 @@ var Retry = class _Retry extends (/* @__PURE__ */ TaggedClass("Retry")) {
425
398
  }
426
399
  };
427
400
 
428
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiSchema.js
429
- var StreamSchemaTypeId = "~effect/httpapi/HttpApiSchema/Stream";
401
+ // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/http-api/HttpApiSchema.js
402
+ var StreamSchemaTypeId = "~effect/http-api/HttpApiSchema/Stream";
430
403
  function status(code) {
431
404
  const statusCode = typeof code === "string" ? fromLiteral(code) : code;
432
405
  return (self) => self.annotate({
@@ -481,8 +454,8 @@ function defaultStreamContentType(mode) {
481
454
  return "application/octet-stream";
482
455
  }
483
456
  }
484
- var WithHeadersTypeId = "~effect/httpapi/HttpApiSchema/WithHeaders";
485
- var WithHeadersValueTypeId = "~effect/httpapi/HttpApiSchema/WithHeadersValue";
457
+ var WithHeadersTypeId = "~effect/http-api/HttpApiSchema/WithHeaders";
458
+ var WithHeadersValueTypeId = "~effect/http-api/HttpApiSchema/WithHeadersValue";
486
459
  var isWithHeadersValue = (u) => hasProperty(u, WithHeadersValueTypeId);
487
460
  var withHeadersValueSchema = /* @__PURE__ */ declare(isWithHeadersValue);
488
461
  function WithHeaders(schema, headers) {
@@ -521,14 +494,16 @@ function encodeToWithHeaders(options2, transformation) {
521
494
  "~httpApiWithHeaders": {
522
495
  body,
523
496
  headers,
524
- headersCodec: toEncoded2(headers)
497
+ bodyCodec: body,
498
+ headersCodec: headers,
499
+ transformation
525
500
  },
526
501
  httpApiStatus: status2,
527
502
  "~httpApiEncoding": encoding
528
503
  });
529
504
  };
530
505
  }
531
- var MultipartTypeId = "~effect/httpapi/HttpApiSchema/Multipart";
506
+ var MultipartTypeId = "~effect/http-api/HttpApiSchema/Multipart";
532
507
  function asMultipart(options2) {
533
508
  return (self) => self.pipe(brand(MultipartTypeId)).annotate({
534
509
  "~httpApiEncoding": {
@@ -539,7 +514,7 @@ function asMultipart(options2) {
539
514
  }
540
515
  });
541
516
  }
542
- var MultipartStreamTypeId = "~effect/httpapi/HttpApiSchema/MultipartStream";
517
+ var MultipartStreamTypeId = "~effect/http-api/HttpApiSchema/MultipartStream";
543
518
  function asMultipartStream(options2) {
544
519
  return (self) => self.pipe(brand(MultipartStreamTypeId)).annotate({
545
520
  "~httpApiEncoding": {
@@ -655,15 +630,33 @@ function getStatusErrorSchema(schema) {
655
630
  return getStatusError(schema.ast);
656
631
  }
657
632
 
658
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/internal/mediaType.js
633
+ // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/http-api/HttpApiEndpoint.js
634
+ var HttpApiEndpoint_exports = {};
635
+ __export(HttpApiEndpoint_exports, {
636
+ delete: () => del,
637
+ get: () => get2,
638
+ getErrorSchemas: () => getErrorSchemas,
639
+ getPayloadSchemas: () => getPayloadSchemas,
640
+ getSuccessSchemas: () => getSuccessSchemas,
641
+ head: () => head,
642
+ isHttpApiEndpoint: () => isHttpApiEndpoint,
643
+ make: () => make3,
644
+ options: () => options,
645
+ patch: () => patch,
646
+ post: () => post,
647
+ put: () => put,
648
+ query: () => query
649
+ });
650
+
651
+ // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/http-api/internal/mediaType.js
659
652
  function normalize(contentType) {
660
653
  const normalized = contentType.toLowerCase().trim();
661
654
  const index = normalized.indexOf(";");
662
655
  return index === -1 ? normalized : normalized.slice(0, index).trim();
663
656
  }
664
657
 
665
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiEndpoint.js
666
- var TypeId = "~effect/httpapi/HttpApiEndpoint";
658
+ // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/http-api/HttpApiEndpoint.js
659
+ var TypeId = "~effect/http-api/HttpApiEndpoint";
667
660
  var isHttpApiEndpoint = (u) => hasProperty(u, TypeId);
668
661
  function getPayloadSchemas(endpoint2) {
669
662
  const result = [];
@@ -788,7 +781,7 @@ function getPayload(payload, method, disableCodecs) {
788
781
  }
789
782
  return result;
790
783
  }
791
- var reservedStreamFailureEvent = "effect/httpapi/stream/failure";
784
+ var reservedStreamFailureEvent = "effect/http-api/stream/failure";
792
785
  function getSuccessResponse(success, method, disableCodecs) {
793
786
  if (success === void 0) return /* @__PURE__ */ new Set();
794
787
  const schemas = ensure(success);
@@ -945,14 +938,11 @@ function transformResponse(schema) {
945
938
  if (withHeaders2 === void 0) {
946
939
  return applyResponseEncoding(schema, encoding);
947
940
  }
948
- const headers = toEncoded2(withHeaders2.headers);
949
- return Struct({
950
- body: applyResponseEncoding(toEncoded2(withHeaders2.body), encoding),
951
- headers
952
- }).pipe(decodeTo(schema)).annotate({
941
+ return schema.annotate({
953
942
  "~httpApiWithHeaders": {
954
943
  ...withHeaders2,
955
- headersCodec: toCodecStringTree(headers)
944
+ bodyCodec: applyResponseEncoding(withHeaders2.body, encoding),
945
+ headersCodec: toCodecStringTree(withHeaders2.headers)
956
946
  }
957
947
  });
958
948
  }
@@ -989,8 +979,23 @@ var del = /* @__PURE__ */ make3("DELETE");
989
979
  var head = /* @__PURE__ */ make3("HEAD");
990
980
  var options = /* @__PURE__ */ make3("OPTIONS");
991
981
 
992
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApi.js
993
- var TypeId2 = "~effect/httpapi/HttpApi";
982
+ // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/http-api/HttpApi.js
983
+ var HttpApi_exports = {};
984
+ __export(HttpApi_exports, {
985
+ AdditionalSchemas: () => AdditionalSchemas,
986
+ ErrorParseOptions: () => ErrorParseOptions,
987
+ HeadersParseOptions: () => HeadersParseOptions,
988
+ ParamsParseOptions: () => ParamsParseOptions,
989
+ ParseOptions: () => ParseOptions,
990
+ PayloadParseOptions: () => PayloadParseOptions,
991
+ QueryParseOptions: () => QueryParseOptions,
992
+ SuccessParseOptions: () => SuccessParseOptions,
993
+ getSlotParseOptions: () => getSlotParseOptions,
994
+ isHttpApi: () => isHttpApi,
995
+ make: () => make4,
996
+ reflect: () => reflect
997
+ });
998
+ var TypeId2 = "~effect/http-api/HttpApi";
994
999
  var isHttpApi = (u) => hasProperty(u, TypeId2);
995
1000
  var Proto2 = {
996
1001
  [TypeId2]: TypeId2,
@@ -1104,12 +1109,117 @@ var extractResponseContent = (schemas, getStatus) => {
1104
1109
  }
1105
1110
  }
1106
1111
  };
1107
- var AdditionalSchemas = class extends (/* @__PURE__ */ Service()("effect/httpapi/HttpApi/AdditionalSchemas")) {
1112
+ var AdditionalSchemas = class extends (/* @__PURE__ */ Service()("effect/http-api/HttpApi/AdditionalSchemas")) {
1113
+ };
1114
+ var ParseOptions = class extends (/* @__PURE__ */ Service()("effect/http-api/HttpApi/ParseOptions")) {
1115
+ };
1116
+ var ParamsParseOptions = class extends (/* @__PURE__ */ Service()("effect/http-api/HttpApi/ParamsParseOptions")) {
1117
+ };
1118
+ var QueryParseOptions = class extends (/* @__PURE__ */ Service()("effect/http-api/HttpApi/QueryParseOptions")) {
1119
+ };
1120
+ var HeadersParseOptions = class extends (/* @__PURE__ */ Service()("effect/http-api/HttpApi/HeadersParseOptions")) {
1121
+ };
1122
+ var PayloadParseOptions = class extends (/* @__PURE__ */ Service()("effect/http-api/HttpApi/PayloadParseOptions")) {
1123
+ };
1124
+ var SuccessParseOptions = class extends (/* @__PURE__ */ Service()("effect/http-api/HttpApi/SuccessParseOptions")) {
1108
1125
  };
1109
- var ParseOptions = class extends (/* @__PURE__ */ Service()("effect/httpapi/HttpApi/ParseOptions")) {
1126
+ var ErrorParseOptions = class extends (/* @__PURE__ */ Service()("effect/http-api/HttpApi/ErrorParseOptions")) {
1127
+ };
1128
+ var getSlotParseOptions = (annotations) => {
1129
+ const fallback = getOrUndefined(annotations, ParseOptions);
1130
+ return {
1131
+ params: getOrUndefined(annotations, ParamsParseOptions) ?? fallback,
1132
+ query: getOrUndefined(annotations, QueryParseOptions) ?? fallback,
1133
+ headers: getOrUndefined(annotations, HeadersParseOptions) ?? fallback,
1134
+ payload: getOrUndefined(annotations, PayloadParseOptions) ?? fallback,
1135
+ success: getOrUndefined(annotations, SuccessParseOptions) ?? fallback,
1136
+ error: getOrUndefined(annotations, ErrorParseOptions) ?? fallback
1137
+ };
1110
1138
  };
1111
1139
 
1112
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/internal/path.js
1140
+ // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/http-api/HttpApiGroup.js
1141
+ var HttpApiGroup_exports = {};
1142
+ __export(HttpApiGroup_exports, {
1143
+ isHttpApiGroup: () => isHttpApiGroup,
1144
+ make: () => make5
1145
+ });
1146
+ var TypeId3 = "~effect/http-api/HttpApiGroup";
1147
+ var isHttpApiGroup = (u) => hasProperty(u, TypeId3);
1148
+ var Proto3 = {
1149
+ [TypeId3]: TypeId3,
1150
+ add(...toAdd) {
1151
+ const endpoints = {
1152
+ ...this.endpoints
1153
+ };
1154
+ for (const endpoint2 of toAdd) {
1155
+ assignProperty(endpoints, endpoint2.identifier, endpoint2);
1156
+ }
1157
+ return makeProto3({
1158
+ ...optionsFromGroup(this),
1159
+ endpoints
1160
+ });
1161
+ },
1162
+ prefix(prefix) {
1163
+ return makeProto3({
1164
+ ...optionsFromGroup(this),
1165
+ endpoints: map(this.endpoints, (endpoint2) => endpoint2.prefix(prefix))
1166
+ });
1167
+ },
1168
+ middleware(middleware) {
1169
+ return makeProto3({
1170
+ ...optionsFromGroup(this),
1171
+ endpoints: map(this.endpoints, (endpoint2) => endpoint2.middleware(middleware))
1172
+ });
1173
+ },
1174
+ annotateMerge(annotations) {
1175
+ return makeProto3({
1176
+ ...optionsFromGroup(this),
1177
+ annotations: merge(this.annotations, annotations)
1178
+ });
1179
+ },
1180
+ annotate(annotation, value) {
1181
+ return makeProto3({
1182
+ ...optionsFromGroup(this),
1183
+ annotations: add(this.annotations, annotation, value)
1184
+ });
1185
+ },
1186
+ annotateEndpointsMerge(annotations) {
1187
+ return makeProto3({
1188
+ ...optionsFromGroup(this),
1189
+ endpoints: map(this.endpoints, (endpoint2) => endpoint2.annotateMerge(annotations))
1190
+ });
1191
+ },
1192
+ annotateEndpoints(annotation, value) {
1193
+ return makeProto3({
1194
+ ...optionsFromGroup(this),
1195
+ endpoints: map(this.endpoints, (endpoint2) => endpoint2.annotate(annotation, value))
1196
+ });
1197
+ },
1198
+ pipe() {
1199
+ return pipeArguments(this, arguments);
1200
+ }
1201
+ };
1202
+ var optionsFromGroup = (group2) => ({
1203
+ identifier: group2.identifier,
1204
+ topLevel: group2.topLevel,
1205
+ endpoints: group2.endpoints,
1206
+ annotations: group2.annotations
1207
+ });
1208
+ var makeProto3 = (options2) => {
1209
+ function HttpApiGroup() {
1210
+ }
1211
+ Object.setPrototypeOf(HttpApiGroup, Proto3);
1212
+ HttpApiGroup.key = `effect/http-api/HttpApiGroup/${options2.identifier}`;
1213
+ return Object.assign(HttpApiGroup, options2);
1214
+ };
1215
+ var make5 = (identifier, options2) => makeProto3({
1216
+ identifier,
1217
+ topLevel: options2?.topLevel ?? false,
1218
+ endpoints: {},
1219
+ annotations: empty()
1220
+ });
1221
+
1222
+ // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/http-api/internal/path.js
1113
1223
  var emptyParamNames = /* @__PURE__ */ new Set();
1114
1224
  function getParamNames(schema) {
1115
1225
  if (schema === void 0) return emptyParamNames;
@@ -1117,12 +1227,12 @@ function getParamNames(schema) {
1117
1227
  return isObjects(ast) && ast.indexSignatures.length === 0 ? new Set(ast.propertySignatures.map((ps) => String(ps.name))) : void 0;
1118
1228
  }
1119
1229
 
1120
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiClient.js
1230
+ // ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/http-api/HttpApiClient.js
1121
1231
  var HttpApiClient_exports = {};
1122
1232
  __export(HttpApiClient_exports, {
1123
1233
  endpoint: () => endpoint,
1124
1234
  group: () => group,
1125
- make: () => make5,
1235
+ make: () => make6,
1126
1236
  makeClient: () => makeClient,
1127
1237
  makeWith: () => makeWith,
1128
1238
  urlBuilder: () => urlBuilder
@@ -1156,20 +1266,20 @@ var makeClient = (api, options2) => gen(function* () {
1156
1266
  const {
1157
1267
  group: group2,
1158
1268
  endpoint: endpoint2,
1159
- errors: errors2,
1269
+ errors,
1160
1270
  successes,
1161
1271
  mergedAnnotations
1162
1272
  } = onEndpointOptions;
1163
- const parseOptions = getOrUndefined(mergedAnnotations, ParseOptions);
1273
+ const parseOptions = getSlotParseOptions(mergedAnnotations);
1164
1274
  const makeUrl = compilePath(endpoint2.path, endpoint2.params);
1165
1275
  const decodeMap = {
1166
1276
  orElse: statusOrElse
1167
1277
  };
1168
1278
  const errorAlternatives = /* @__PURE__ */ new Map();
1169
- for (const [status2, schemas] of errors2.entries()) {
1279
+ for (const [status2, schemas] of errors.entries()) {
1170
1280
  const grouped = groupSchemasByContentType(schemas);
1171
1281
  for (const [contentType, schemas2] of grouped.entries()) {
1172
- addResponseAlternative(errorAlternatives, status2, contentType, schemasToResponse(schemas2, parseOptions));
1282
+ addResponseAlternative(errorAlternatives, status2, contentType, schemasToResponse(schemas2, parseOptions.error, parseOptions.headers));
1173
1283
  }
1174
1284
  }
1175
1285
  for (const [status2, alternatives] of errorAlternatives.entries()) {
@@ -1185,22 +1295,21 @@ var makeClient = (api, options2) => gen(function* () {
1185
1295
  for (const [status2, schemas] of successes.entries()) {
1186
1296
  const grouped = groupSchemasByContentType(schemas);
1187
1297
  for (const [contentType, schemas2] of grouped.entries()) {
1188
- addResponseAlternative(successAlternatives, status2, contentType, schemasToResponse(schemas2, parseOptions));
1298
+ addResponseAlternative(successAlternatives, status2, contentType, schemasToResponse(schemas2, parseOptions.success, parseOptions.headers));
1189
1299
  }
1190
1300
  }
1191
1301
  for (const streamSuccess of getStreamSuccessSchemas(endpoint2)) {
1192
1302
  const streamSchema2 = isWithHeadersStreamSuccess(streamSuccess) ? streamSuccess.schema : streamSuccess;
1193
- addResponseAlternative(successAlternatives, getStatusSuccessSchema(streamSuccess), streamSchema2.contentType, streamToResponse(streamSuccess, parseOptions));
1303
+ addResponseAlternative(successAlternatives, getStatusSuccessSchema(streamSuccess), streamSchema2.contentType, streamToResponse(streamSuccess, parseOptions.success, parseOptions.headers));
1194
1304
  }
1195
1305
  for (const [status2, alternatives] of successAlternatives.entries()) {
1196
1306
  decodeMap[status2] = makeResponseDecoder(alternatives);
1197
1307
  }
1198
- const encodeUnknownEffect2 = (schema) => encodeUnknownEffect(schema, parseOptions);
1199
- const encodeParams = map4(endpoint2.params, encodeUnknownEffect2);
1308
+ const encodeParams = map4(endpoint2.params, (schema) => encodeUnknownEffect(schema, parseOptions.params));
1200
1309
  const payloadSchemas = getPayloadSchemas(endpoint2);
1201
- const encodePayload = isArrayNonEmpty(payloadSchemas) ? hasBody(endpoint2.method) ? encodeUnknownEffect2(getEncodePayloadSchema(payloadSchemas, endpoint2.method)) : encodeUnknownEffect2(Union(payloadSchemas)) : void 0;
1202
- const encodeHeaders = map4(endpoint2.headers, encodeUnknownEffect2);
1203
- const encodeQuery = map4(endpoint2.query, encodeUnknownEffect2);
1310
+ const encodePayload = isArrayNonEmpty(payloadSchemas) ? encodeUnknownEffect(hasBody(endpoint2.method) ? getEncodePayloadSchema(payloadSchemas, endpoint2.method) : Union(payloadSchemas), parseOptions.payload) : void 0;
1311
+ const encodeHeaders = map4(endpoint2.headers, (schema) => encodeUnknownEffect(schema, parseOptions.headers));
1312
+ const encodeQuery = map4(endpoint2.query, (schema) => encodeUnknownEffect(schema, parseOptions.query));
1204
1313
  const middlewareKeys = Array.from(onEndpointOptions.middleware, (tag2) => `${tag2.key}/Client`);
1205
1314
  const endpointFn = fnUntraced(function* (request) {
1206
1315
  let httpRequest = make2(endpoint2.method)(endpoint2.path);
@@ -1246,7 +1355,7 @@ var makeClient = (api, options2) => gen(function* () {
1246
1355
  }
1247
1356
  });
1248
1357
  });
1249
- var make5 = (api, options2) => flatMap(HttpClient, (httpClient) => makeWith(api, {
1358
+ var make6 = (api, options2) => flatMap(HttpClient, (httpClient) => makeWith(api, {
1250
1359
  ...options2,
1251
1360
  httpClient: options2?.transformClient ? options2.transformClient(httpClient) : httpClient
1252
1361
  }));
@@ -1314,10 +1423,10 @@ var urlBuilder = (api, options2) => {
1314
1423
  endpoint: endpoint2,
1315
1424
  mergedAnnotations
1316
1425
  }) {
1317
- const parseOptions = getOrUndefined(mergedAnnotations, ParseOptions);
1426
+ const parseOptions = getSlotParseOptions(mergedAnnotations);
1318
1427
  const makeUrl = compilePath(endpoint2.path, endpoint2.params);
1319
- const encodeParams = endpoint2.params === void 0 ? void 0 : encodeSync(endpoint2.params, parseOptions);
1320
- const encodeQuery = endpoint2.query === void 0 ? void 0 : encodeSync(endpoint2.query, parseOptions);
1428
+ const encodeParams = endpoint2.params === void 0 ? void 0 : encodeSync(endpoint2.params, parseOptions.params);
1429
+ const encodeQuery = endpoint2.query === void 0 ? void 0 : encodeSync(endpoint2.query, parseOptions.query);
1321
1430
  const endpointBuilder = (request) => {
1322
1431
  const params = request?.params;
1323
1432
  const path = params === void 0 ? endpoint2.path : makeUrl(encodeParams === void 0 ? params : encodeParams(params));
@@ -1362,34 +1471,44 @@ var compilePath = (path, schema) => {
1362
1471
  });
1363
1472
  };
1364
1473
  };
1365
- function schemasToResponse(schemas, options2) {
1474
+ function schemasToResponse(schemas, options2, headersOptions) {
1366
1475
  const hasWithHeaders = schemas.some((schema) => isWithHeaders(schema) || getWithHeadersAnnotation(schema.ast) !== void 0);
1367
- const codec = hasWithHeaders ? Union(schemas.map(toCodecArrayBufferWithHeaders)) : toCodecArrayBuffer(schemas);
1368
- const decode3 = decodeEffect(codec, options2);
1476
+ const codec = hasWithHeaders ? Union(schemas.map((schema) => toCodecArrayBufferWithHeaders(schema, options2, headersOptions))) : toCodecArrayBuffer(schemas);
1477
+ const decode3 = decodeUnknownEffect(codec, options2);
1369
1478
  return (response) => flatMap(response.arrayBuffer, hasWithHeaders ? (body) => decode3({
1370
1479
  body,
1371
1480
  headers: response.headers
1372
1481
  }) : decode3);
1373
1482
  }
1374
- function toCodecArrayBufferWithHeaders(schema) {
1375
- const isWithHeaders2 = isWithHeaders(schema);
1483
+ var ResponsePair = /* @__PURE__ */ Struct({
1484
+ body: Unknown,
1485
+ headers: Unknown
1486
+ });
1487
+ function toCodecArrayBufferWithHeaders(schema, options2, headersOptions) {
1376
1488
  const annotation = getWithHeadersAnnotation(schema.ast);
1377
- if (annotation !== void 0) {
1378
- return Struct({
1379
- body: fromArrayBuffer(annotation.body),
1380
- headers: annotation.headersCodec
1381
- }).pipe(decodeTo(schema));
1382
- }
1383
- const body = isWithHeaders2 ? schema.schema : schema;
1384
- return Struct({
1385
- body: fromArrayBuffer(body).pipe(decodeTo(body)),
1386
- headers: isWithHeaders2 ? schema.headers : Unknown
1387
- }).pipe(decodeTo(isWithHeaders2 ? schema : toType(schema), transform({
1388
- decode: (value) => isWithHeaders2 ? withHeaders(value) : value.body,
1389
- encode: (value) => isWithHeaders2 ? value : {
1390
- body: value,
1391
- headers: void 0
1392
- }
1489
+ const parts = annotation !== void 0 ? {
1490
+ body: annotation.bodyCodec,
1491
+ headers: annotation.headersCodec,
1492
+ toValue: annotation.transformation.decode
1493
+ } : isWithHeaders(schema) ? {
1494
+ body: schema.schema,
1495
+ headers: schema.headers,
1496
+ toValue: withHeaders
1497
+ } : {
1498
+ body: schema,
1499
+ headers: Unknown,
1500
+ toValue: (pair) => pair.body
1501
+ };
1502
+ const decodeBody = decodeUnknownEffect(fromArrayBuffer(parts.body).pipe(decodeTo(parts.body)), options2);
1503
+ const decodeHeaders = decodeUnknownEffect(parts.headers, headersOptions);
1504
+ return ResponsePair.pipe(decodeTo(isWithHeaders(schema) ? schema : toType(schema), transformEffect({
1505
+ decode: (pair) => all({
1506
+ body: decodeBody(pair.body),
1507
+ headers: decodeHeaders(pair.headers)
1508
+ }).pipe(map2(parts.toValue), mapError((error) => error.issue)),
1509
+ encode: (input, options3) => fail3(new Forbidden({
1510
+ message: "Decode only schema"
1511
+ }, input, options3))
1393
1512
  })));
1394
1513
  }
1395
1514
  function addResponseAlternative(map7, status2, contentType, decode3) {
@@ -1442,7 +1561,7 @@ function failUnsupportedContentType(response, contentType, alternatives) {
1442
1561
  })
1443
1562
  }));
1444
1563
  }
1445
- var reservedStreamFailureEvent2 = "effect/httpapi/stream/failure";
1564
+ var reservedStreamFailureEvent2 = "effect/http-api/stream/failure";
1446
1565
  var isWithHeadersStreamSuccess = (schema) => isWithHeaders(schema);
1447
1566
  function getStreamSuccessSchemas(endpoint2) {
1448
1567
  const schemas = [];
@@ -1454,7 +1573,7 @@ function getStreamSuccessSchemas(endpoint2) {
1454
1573
  }
1455
1574
  return schemas;
1456
1575
  }
1457
- function streamToResponse(successSchema, options2) {
1576
+ function streamToResponse(successSchema, options2, headersOptions) {
1458
1577
  const isWithHeaders2 = isWithHeadersStreamSuccess(successSchema);
1459
1578
  const streamSchema2 = isWithHeaders2 ? successSchema.schema : successSchema;
1460
1579
  const sse = isStreamUint8Array(streamSchema2) ? void 0 : {
@@ -1463,7 +1582,7 @@ function streamToResponse(successSchema, options2) {
1463
1582
  };
1464
1583
  const toStream = (response, sseOptions) => map2(context(), (context2) => provideContext(sse === void 0 ? response.stream : decodeSseStream(response.stream, sse.declaration, sse.decoder(sseOptions)), context2));
1465
1584
  if (!isWithHeaders2) return toStream;
1466
- const decodeHeaders = decodeUnknownEffect(successSchema.headers, options2);
1585
+ const decodeHeaders = decodeUnknownEffect(successSchema.headers, headersOptions);
1467
1586
  return (response, sseOptions) => flatMap(decodeHeaders(response.headers), (headers) => map2(toStream(response, sseOptions), (body) => withHeaders({
1468
1587
  body,
1469
1588
  headers
@@ -1632,165 +1751,10 @@ function getEncodePayloadSchemaFromBody(schema, method) {
1632
1751
  return out;
1633
1752
  }
1634
1753
 
1635
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiGroup.js
1636
- var HttpApiGroup_exports = {};
1637
- __export(HttpApiGroup_exports, {
1638
- isHttpApiGroup: () => isHttpApiGroup,
1639
- make: () => make6
1640
- });
1641
- var TypeId3 = "~effect/httpapi/HttpApiGroup";
1642
- var isHttpApiGroup = (u) => hasProperty(u, TypeId3);
1643
- var Proto3 = {
1644
- [TypeId3]: TypeId3,
1645
- add(...toAdd) {
1646
- const endpoints = {
1647
- ...this.endpoints
1648
- };
1649
- for (const endpoint2 of toAdd) {
1650
- assignProperty(endpoints, endpoint2.identifier, endpoint2);
1651
- }
1652
- return makeProto3({
1653
- ...optionsFromGroup(this),
1654
- endpoints
1655
- });
1656
- },
1657
- prefix(prefix) {
1658
- return makeProto3({
1659
- ...optionsFromGroup(this),
1660
- endpoints: map(this.endpoints, (endpoint2) => endpoint2.prefix(prefix))
1661
- });
1662
- },
1663
- middleware(middleware) {
1664
- return makeProto3({
1665
- ...optionsFromGroup(this),
1666
- endpoints: map(this.endpoints, (endpoint2) => endpoint2.middleware(middleware))
1667
- });
1668
- },
1669
- annotateMerge(annotations) {
1670
- return makeProto3({
1671
- ...optionsFromGroup(this),
1672
- annotations: merge(this.annotations, annotations)
1673
- });
1674
- },
1675
- annotate(annotation, value) {
1676
- return makeProto3({
1677
- ...optionsFromGroup(this),
1678
- annotations: add(this.annotations, annotation, value)
1679
- });
1680
- },
1681
- annotateEndpointsMerge(annotations) {
1682
- return makeProto3({
1683
- ...optionsFromGroup(this),
1684
- endpoints: map(this.endpoints, (endpoint2) => endpoint2.annotateMerge(annotations))
1685
- });
1686
- },
1687
- annotateEndpoints(annotation, value) {
1688
- return makeProto3({
1689
- ...optionsFromGroup(this),
1690
- endpoints: map(this.endpoints, (endpoint2) => endpoint2.annotate(annotation, value))
1691
- });
1692
- },
1693
- pipe() {
1694
- return pipeArguments(this, arguments);
1695
- }
1696
- };
1697
- var optionsFromGroup = (group2) => ({
1698
- identifier: group2.identifier,
1699
- topLevel: group2.topLevel,
1700
- endpoints: group2.endpoints,
1701
- annotations: group2.annotations
1702
- });
1703
- var makeProto3 = (options2) => {
1704
- function HttpApiGroup() {
1705
- }
1706
- Object.setPrototypeOf(HttpApiGroup, Proto3);
1707
- HttpApiGroup.key = `effect/httpapi/HttpApiGroup/${options2.identifier}`;
1708
- return Object.assign(HttpApiGroup, options2);
1709
- };
1710
- var make6 = (identifier, options2) => makeProto3({
1711
- identifier,
1712
- topLevel: options2?.topLevel ?? false,
1713
- endpoints: {},
1714
- annotations: empty()
1715
- });
1716
-
1717
- // src/contracts/ui.ts
1718
- var UiContext = Schema_exports.Struct({
1719
- deployment: Schema_exports.NonEmptyString,
1720
- profile: Schema_exports.optional(Schema_exports.NonEmptyString),
1721
- expectedProfileRevision: Schema_exports.optional(Schema_exports.Int)
1722
- });
1723
- var UiOperation = Schema_exports.Struct({
1724
- ...UiContext.fields,
1725
- name: Schema_exports.NonEmptyString,
1726
- input: JsonValue
1727
- });
1728
- var UiUnauthorized = class extends Schema_exports.TaggedError()(
1729
- "UiUnauthorized",
1730
- {},
1731
- { httpApiStatus: 401 }
1732
- ) {
1733
- };
1734
- var UiForbidden = class extends Schema_exports.TaggedError()(
1735
- "UiForbidden",
1736
- {},
1737
- { httpApiStatus: 403 }
1738
- ) {
1739
- };
1740
- var UiDeploymentChanged = class extends Schema_exports.TaggedError()(
1741
- "UiDeploymentChanged",
1742
- {},
1743
- { httpApiStatus: 409 }
1744
- ) {
1745
- };
1746
- var UiFailed = class extends Schema_exports.TaggedError()(
1747
- "UiFailed",
1748
- {
1749
- reason: Schema_exports.Literals(["unavailable", "operation_failed", "account_required"])
1750
- },
1751
- { httpApiStatus: 422 }
1752
- ) {
1753
- };
1754
- var UiSnapshot = Schema_exports.Union([
1755
- Schema_exports.Struct({
1756
- type: Schema_exports.Literal("snapshot"),
1757
- value: JsonValue,
1758
- trace: Schema_exports.optional(Schema_exports.Unknown)
1759
- }),
1760
- Schema_exports.Struct({ type: Schema_exports.Literal("failure"), error: UiFailed }),
1761
- Schema_exports.Struct({ type: Schema_exports.Literal("heartbeat") })
1762
- ]);
1763
- var errors = [UiUnauthorized, UiForbidden, UiDeploymentChanged, UiFailed];
1764
- var AppUiApi = HttpApi_exports.make("app-ui").add(
1765
- HttpApiGroup_exports.make("ui").add(
1766
- HttpApiEndpoint_exports.post("query", "/_executor/api/query", {
1767
- payload: UiOperation,
1768
- success: JsonValue,
1769
- error: errors
1770
- })
1771
- ).add(
1772
- HttpApiEndpoint_exports.post("mutate", "/_executor/api/mutate", {
1773
- payload: UiOperation,
1774
- success: JsonValue,
1775
- error: errors
1776
- })
1777
- ).add(
1778
- HttpApiEndpoint_exports.post("subscribe", "/_executor/api/subscribe", {
1779
- payload: UiOperation,
1780
- success: HttpApiSchema_exports.StreamSse({ data: UiSnapshot, error: Schema_exports.Union(errors) }),
1781
- error: errors
1782
- })
1783
- )
1784
- );
1785
-
1786
1754
  export {
1755
+ HttpApiSchema_exports,
1756
+ HttpApiEndpoint_exports,
1757
+ HttpApi_exports,
1787
1758
  HttpApiClient_exports,
1788
- UiContext,
1789
- UiOperation,
1790
- UiUnauthorized,
1791
- UiForbidden,
1792
- UiDeploymentChanged,
1793
- UiFailed,
1794
- UiSnapshot,
1795
- AppUiApi
1759
+ HttpApiGroup_exports
1796
1760
  };