effect 4.0.0-beta.91 → 4.0.0-beta.93
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.
- package/dist/Cause.d.ts +3 -1
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js.map +1 -1
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +13 -7
- package/dist/Schema.js.map +1 -1
- package/dist/internal/core.js +1 -1
- package/dist/internal/effect.js +8 -6
- package/dist/internal/effect.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +1 -1
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +1 -1
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.js +2 -2
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +5 -4
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +5 -4
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +29 -4
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +44 -2
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +2 -28
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +4 -46
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +30 -15
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +4 -3
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/package.json +1 -1
- package/src/Cause.ts +3 -1
- package/src/Schema.ts +17 -3
- package/src/internal/core.ts +1 -1
- package/src/internal/effect.ts +14 -6
- package/src/unstable/http/HttpBody.ts +2 -2
- package/src/unstable/http/HttpClient.ts +2 -2
- package/src/unstable/http/HttpClientRequest.ts +8 -7
- package/src/unstable/http/Url.ts +62 -7
- package/src/unstable/http/UrlParams.ts +5 -58
- package/src/unstable/httpapi/HttpApiBuilder.ts +33 -21
- package/src/unstable/observability/OtlpTracer.ts +4 -3
package/dist/Schema.js
CHANGED
|
@@ -6549,7 +6549,10 @@ export const UnknownFromJsonString = /*#__PURE__*/fromJsonString(Unknown);
|
|
|
6549
6549
|
* @since 4.0.0
|
|
6550
6550
|
*/
|
|
6551
6551
|
export function fromJsonString(schema) {
|
|
6552
|
+
const identifier = SchemaAST.resolveIdentifier(schema.ast);
|
|
6552
6553
|
return String.annotate({
|
|
6554
|
+
// Give the transport wrapper its own name so the decoded payload keeps its identifier.
|
|
6555
|
+
identifier: identifier === undefined ? undefined : `${identifier}JsonString`,
|
|
6553
6556
|
expected: "a string that will be decoded as JSON",
|
|
6554
6557
|
contentMediaType: "application/json",
|
|
6555
6558
|
contentSchema: SchemaAST.toEncoded(schema.ast)
|
|
@@ -7469,19 +7472,22 @@ export const DateTimeZoned = /*#__PURE__*/declare(u => DateTime.isDateTime(u) &&
|
|
|
7469
7472
|
*/
|
|
7470
7473
|
export const DateTimeZonedFromString = /*#__PURE__*/DateTimeZonedString.pipe(/*#__PURE__*/decodeTo(DateTimeZoned, SchemaTransformation.dateTimeZonedFromString));
|
|
7471
7474
|
const immerable = /*#__PURE__*/globalThis.Symbol.for("immer-draftable");
|
|
7475
|
+
const payloadToken = {};
|
|
7472
7476
|
function makeClass(Inherited, identifier, struct, annotations, proto) {
|
|
7473
7477
|
const getClassSchema = getClassSchemaFactory(struct, identifier, annotations);
|
|
7474
7478
|
const ClassTypeId = getClassTypeId(identifier); // HMR support
|
|
7475
7479
|
const out = class extends Inherited {
|
|
7476
7480
|
constructor(...[input, options]) {
|
|
7477
|
-
|
|
7478
|
-
const
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
...validated
|
|
7482
|
-
}, {
|
|
7481
|
+
const internalOptions = options;
|
|
7482
|
+
const payload = internalOptions?.["~payload"];
|
|
7483
|
+
const value = payload?.token === payloadToken ? payload.value : struct.make(input ?? {}, options);
|
|
7484
|
+
super(value, {
|
|
7483
7485
|
...options,
|
|
7484
|
-
disableChecks: true
|
|
7486
|
+
disableChecks: true,
|
|
7487
|
+
"~payload": {
|
|
7488
|
+
token: payloadToken,
|
|
7489
|
+
value
|
|
7490
|
+
}
|
|
7485
7491
|
});
|
|
7486
7492
|
}
|
|
7487
7493
|
static [TypeId] = TypeId;
|