effect-app 1.0.8 → 1.0.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @effect-app/prelude
2
2
 
3
+ ## 1.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 83f19e1: schema next minor
8
+ - Updated dependencies [83f19e1]
9
+ - @effect-app/schema@1.0.8
10
+
3
11
  ## 1.0.8
4
12
 
5
13
  ### Patch Changes
package/_cjs/ids.cjs CHANGED
@@ -14,9 +14,7 @@ const RequestId = exports.RequestId = (0, _utils.extendM)(Object
14
14
  const make = _schema.StringId.make;
15
15
  return {
16
16
  make,
17
- withDefault: _index.S.propertySignature(s, {
18
- default: make
19
- })
17
+ withDefault: s.pipe(_index.S.withDefaultConstructor(make))
20
18
  };
21
19
  }).pipe(_schema.withDefaults);
22
20
  const UserProfileId = exports.UserProfileId = (0, _schema.brandedStringId)();
package/_cjs/ids.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ids.cjs","names":["_schema","require","_index","_utils","RequestId","exports","extendM","Object","assign","create","NonEmptyString255","s","make","StringId","withDefault","S","propertySignature","default","pipe","withDefaults","UserProfileId","brandedStringId"],"sources":["../src/ids.ts"],"sourcesContent":[null],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAUA;AACO,MAAMG,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,cAAO,EAC9BC;AACE;AAAA,CACCC,MAAM,CAACD,MAAM,CAACE,MAAM,CAACC,yBAAiB,CAAO,EAAEA,yBAAsD,CAAC,EACxGC,CAAC,IAAI;EACJ,MAAMC,IAAI,GAAGC,gBAAQ,CAACD,IAA+B;EACrD,OAAQ;IACNA,IAAI;IACJE,WAAW,EAAEC,QAAC,CAACC,iBAAiB,CAACL,CAAC,EAAE;MAAEM,OAAO,EAAEL;IAAI,CAAE;GACtD;AACH,CAAC,CACF,CACEM,IAAI,CAACC,oBAAY,CAAC;AAOd,MAAMC,aAAa,GAAAf,OAAA,CAAAe,aAAA,GAAG,IAAAC,uBAAe,GAAsB","ignoreList":[]}
1
+ {"version":3,"file":"ids.cjs","names":["_schema","require","_index","_utils","RequestId","exports","extendM","Object","assign","create","NonEmptyString255","s","make","StringId","withDefault","pipe","S","withDefaultConstructor","withDefaults","UserProfileId","brandedStringId"],"sources":["../src/ids.ts"],"sourcesContent":[null],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAUA;AACO,MAAMG,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,cAAO,EAC9BC;AACE;AAAA,CACCC,MAAM,CAACD,MAAM,CAACE,MAAM,CAACC,yBAAiB,CAAO,EAAEA,yBAAsD,CAAC,EACxGC,CAAC,IAAI;EACJ,MAAMC,IAAI,GAAGC,gBAAQ,CAACD,IAA+B;EACrD,OAAQ;IACNA,IAAI;IACJE,WAAW,EAAEH,CAAC,CAACI,IAAI,CAACC,QAAC,CAACC,sBAAsB,CAACL,IAAI,CAAC;GACnD;AACH,CAAC,CACF,CACEG,IAAI,CAACG,oBAAY,CAAC;AAOd,MAAMC,aAAa,GAAAd,OAAA,CAAAc,aAAA,GAAG,IAAAC,uBAAe,GAAsB","ignoreList":[]}
@@ -2,10 +2,10 @@ import * as S from "./schema.js";
2
2
  export type OperationId = S.StringId;
3
3
  export declare const OperationId: S.WithDefaults<S.Schema<string & S.StringIdBrand, string, never> & {
4
4
  make: () => S.StringId;
5
- withDefault: S.PropertySignature<":", S.StringId, never, ":", string, true, never>;
5
+ withDefault: S.PropertySignature<":", string & S.StringIdBrand, never, ":", string, true, never>;
6
6
  }> & S.Schema<string & S.StringIdBrand, string, never> & {
7
7
  make: () => S.StringId;
8
- withDefault: S.PropertySignature<":", S.StringId, never, ":", string, true, never>;
8
+ withDefault: S.PropertySignature<":", string & S.StringIdBrand, never, ":", string, true, never>;
9
9
  };
10
10
  declare const OperationProgress_base: S.EnhancedClass<OperationProgress, {
11
11
  completed: S.WithDefaults<S.Schema<number & S.NonNegativeIntBrand, number, never>> & S.Schema<number & S.NonNegativeIntBrand, number, never> & {
@@ -55,10 +55,10 @@ export type OperationResult = S.Schema.Type<typeof OperationResult>;
55
55
  declare const Operation_base: S.EnhancedClass<Operation, {
56
56
  id: S.WithDefaults<S.Schema<string & S.StringIdBrand, string, never> & {
57
57
  make: () => S.StringId;
58
- withDefault: S.PropertySignature<":", S.StringId, never, ":", string, true, never>;
58
+ withDefault: S.PropertySignature<":", string & S.StringIdBrand, never, ":", string, true, never>;
59
59
  }> & S.Schema<string & S.StringIdBrand, string, never> & {
60
60
  make: () => S.StringId;
61
- withDefault: S.PropertySignature<":", S.StringId, never, ":", string, true, never>;
61
+ withDefault: S.PropertySignature<":", string & S.StringIdBrand, never, ":", string, true, never>;
62
62
  };
63
63
  title: S.WithDefaults<S.Schema<string & S.NonEmptyString2kBrand, string, never>> & S.Schema<string & S.NonEmptyString2kBrand, string, never>;
64
64
  progress: S.PropertySignature<"?:", OperationProgress | undefined, never, "?:", OperationProgress.From | undefined, false, never>;
@@ -2,19 +2,19 @@ import { Cause, S } from "../lib.js";
2
2
  declare const NotFoundError_base: import("@effect/schema/Schema").Class<NotFoundError<ItemType>, {
3
3
  readonly _tag: S.Literal<["NotFoundError"]>;
4
4
  } & {
5
- type: S.$String;
6
- id: S.Unknown;
5
+ type: typeof S.String;
6
+ id: typeof S.Unknown;
7
7
  }, {
8
8
  readonly _tag: "NotFoundError";
9
- readonly type: string;
10
9
  readonly id: unknown;
10
+ readonly type: string;
11
11
  }, {
12
12
  readonly _tag: "NotFoundError";
13
- readonly type: string;
14
13
  readonly id: unknown;
15
- }, never, {
16
14
  readonly type: string;
15
+ }, never, {
17
16
  readonly id: unknown;
17
+ readonly type: string;
18
18
  }, {}, Cause.YieldableError>;
19
19
  export declare class NotFoundError<ItemType = string> extends NotFoundError_base {
20
20
  get message(): string;
@@ -22,7 +22,7 @@ export declare class NotFoundError<ItemType = string> extends NotFoundError_base
22
22
  declare const InvalidStateError_base: import("@effect/schema/Schema").Class<InvalidStateError, {
23
23
  readonly _tag: S.Literal<["InvalidStateError"]>;
24
24
  } & {
25
- message: S.$String;
25
+ message: typeof S.String;
26
26
  }, {
27
27
  readonly _tag: "InvalidStateError";
28
28
  readonly message: string;
@@ -40,7 +40,7 @@ export declare class InvalidStateError extends InvalidStateError_base {
40
40
  declare const ServiceUnavailableError_base: import("@effect/schema/Schema").Class<ServiceUnavailableError, {
41
41
  readonly _tag: S.Literal<["ServiceUnavailableError"]>;
42
42
  } & {
43
- message: S.$String;
43
+ message: typeof S.String;
44
44
  }, {
45
45
  readonly _tag: "ServiceUnavailableError";
46
46
  readonly message: string;
@@ -58,7 +58,7 @@ export declare class ServiceUnavailableError extends ServiceUnavailableError_bas
58
58
  declare const ValidationError_base: import("@effect/schema/Schema").Class<ValidationError, {
59
59
  readonly _tag: S.Literal<["ValidationError"]>;
60
60
  } & {
61
- errors: S.$Array<S.Unknown> & {
61
+ errors: S.$Array<typeof S.Unknown> & {
62
62
  withDefault: S.PropertySignature<":", readonly unknown[], never, ":", readonly unknown[], true, never>;
63
63
  };
64
64
  }, {
@@ -139,7 +139,7 @@ type OptimisticConcurrencyDetails = {
139
139
  declare const OptimisticConcurrencyException_base: import("@effect/schema/Schema").Class<OptimisticConcurrencyException, {
140
140
  readonly _tag: S.Literal<["OptimisticConcurrencyException"]>;
141
141
  } & {
142
- message: S.$String;
142
+ message: typeof S.String;
143
143
  }, {
144
144
  readonly _tag: "OptimisticConcurrencyException";
145
145
  readonly message: string;
@@ -21,7 +21,7 @@ export declare function fetchApi2S<RequestR, RequestFrom, RequestTo, ResponseR,
21
21
  body: ResponseTo;
22
22
  headers: Headers;
23
23
  status: number;
24
- }, NotFoundError<ItemType> | InvalidStateError | ServiceUnavailableError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | ResError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError | S.ParseResult.ParseError, HttpClient.Client.Default | ApiConfig | RequestR | ResponseR>;
24
+ }, S.ParseResult.ParseError | NotFoundError<ItemType> | InvalidStateError | ServiceUnavailableError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | ResError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError, HttpClient.Client.Default | ApiConfig | RequestR | ResponseR>;
25
25
  export declare function fetchApi3S<RequestA, RequestE, ResponseE = unknown, ResponseA = void>({ Request, Response }: {
26
26
  Request: REST.RequestSchemed<RequestA, RequestE>;
27
27
  Response: REST.ReqRes<ResponseA, ResponseE, any>;
@@ -29,11 +29,11 @@ export declare function fetchApi3S<RequestA, RequestE, ResponseE = unknown, Resp
29
29
  body: ResponseA;
30
30
  headers: Headers;
31
31
  status: number;
32
- }, NotFoundError<ItemType> | InvalidStateError | ServiceUnavailableError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | ResError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError | S.ParseResult.ParseError, any>;
32
+ }, S.ParseResult.ParseError | NotFoundError<ItemType> | InvalidStateError | ServiceUnavailableError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | ResError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError, any>;
33
33
  export declare function fetchApi3SE<RequestA, RequestE, ResponseE = unknown, ResponseA = void>({ Request, Response }: {
34
34
  Request: REST.RequestSchemed<RequestA, RequestE>;
35
35
  Response: REST.ReqRes<ResponseA, ResponseE, any>;
36
- }): (req: RequestA) => Effect.Effect<FetchResponse<ResponseE>, NotFoundError<ItemType> | InvalidStateError | ServiceUnavailableError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | ResError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError | S.ParseResult.ParseError, any>;
36
+ }): (req: RequestA) => Effect.Effect<FetchResponse<ResponseE>, S.ParseResult.ParseError | NotFoundError<ItemType> | InvalidStateError | ServiceUnavailableError | ValidationError | NotLoggedInError | import("./errors.js").LoginError | UnauthorizedError | OptimisticConcurrencyException | HttpRequestError | ResError | HttpResponseError<unknown> | import("@effect/platform/Http/Body").BodyError, any>;
37
37
  export declare function makePathWithQuery(path: Path, pars: Record<string, string | number | boolean | readonly string[] | readonly number[] | readonly boolean[] | null>): string;
38
38
  export declare function makePathWithBody(path: Path, pars: Record<string, string | number | boolean | readonly string[] | readonly number[] | readonly boolean[] | null>): string;
39
39
  export declare function mapResponse<T, A>(map: (t: T) => A): (r: FetchResponse<T>) => FetchResponse<A>;
package/dist/ids.d.ts CHANGED
@@ -12,10 +12,10 @@ export interface RequestIdBrand extends StringIdBrand {
12
12
  export type RequestId = NonEmptyString255;
13
13
  export declare const RequestId: S.WithDefaults<Schema<NonEmptyString255, string, never> & {
14
14
  make: () => NonEmptyString255;
15
- withDefault: S.PropertySignature<":", NonEmptyString255, never, ":", string, true, never>;
15
+ withDefault: S.PropertySignature<":", string & S.NonEmptyString255Brand, never, ":", string, true, never>;
16
16
  }> & Schema<NonEmptyString255, string, never> & {
17
17
  make: () => NonEmptyString255;
18
- withDefault: S.PropertySignature<":", NonEmptyString255, never, ":", string, true, never>;
18
+ withDefault: S.PropertySignature<":", string & S.NonEmptyString255Brand, never, ":", string, true, never>;
19
19
  };
20
20
  export interface UserProfileIdBrand extends Simplify<B.Brand<"UserProfileId"> & StringIdBrand> {
21
21
  }
package/dist/ids.js CHANGED
@@ -8,9 +8,9 @@ export const RequestId = extendM(Object
8
8
  const make = StringId.make;
9
9
  return ({
10
10
  make,
11
- withDefault: S.propertySignature(s, { default: make })
11
+ withDefault: s.pipe(S.withDefaultConstructor(make))
12
12
  });
13
13
  })
14
14
  .pipe(withDefaults);
15
15
  export const UserProfileId = brandedStringId();
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2lkcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsZUFBZSxFQUFFLGlCQUFpQixFQUFFLFFBQVEsRUFBRSxZQUFZLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQTtBQUc5RixPQUFPLEVBQUUsQ0FBQyxFQUFFLE1BQU0sWUFBWSxDQUFBO0FBQzlCLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxZQUFZLENBQUE7QUFVcEMsdUZBQXVGO0FBQ3ZGLE1BQU0sQ0FBQyxNQUFNLFNBQVMsR0FBRyxPQUFPLENBQzlCLE1BQU07SUFDSix3REFBd0Q7S0FDdkQsTUFBTSxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsaUJBQWlCLENBQU8sRUFBRSxpQkFBc0QsQ0FBQyxFQUN6RyxDQUFDLENBQUMsRUFBRSxFQUFFO0lBQ0osTUFBTSxJQUFJLEdBQUcsUUFBUSxDQUFDLElBQStCLENBQUE7SUFDckQsT0FBTyxDQUFDO1FBQ04sSUFBSTtRQUNKLFdBQVcsRUFBRSxDQUFDLENBQUMsaUJBQWlCLENBQUMsQ0FBQyxFQUFFLEVBQUUsT0FBTyxFQUFFLElBQUksRUFBRSxDQUFDO0tBQ3ZELENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FDRjtLQUNFLElBQUksQ0FBQyxZQUFZLENBQUMsQ0FBQTtBQU9yQixNQUFNLENBQUMsTUFBTSxhQUFhLEdBQUcsZUFBZSxFQUFzQixDQUFBIn0=
16
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2lkcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsZUFBZSxFQUFFLGlCQUFpQixFQUFFLFFBQVEsRUFBRSxZQUFZLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQTtBQUc5RixPQUFPLEVBQUUsQ0FBQyxFQUFFLE1BQU0sWUFBWSxDQUFBO0FBQzlCLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxZQUFZLENBQUE7QUFVcEMsdUZBQXVGO0FBQ3ZGLE1BQU0sQ0FBQyxNQUFNLFNBQVMsR0FBRyxPQUFPLENBQzlCLE1BQU07SUFDSix3REFBd0Q7S0FDdkQsTUFBTSxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsaUJBQWlCLENBQU8sRUFBRSxpQkFBc0QsQ0FBQyxFQUN6RyxDQUFDLENBQUMsRUFBRSxFQUFFO0lBQ0osTUFBTSxJQUFJLEdBQUcsUUFBUSxDQUFDLElBQStCLENBQUE7SUFDckQsT0FBTyxDQUFDO1FBQ04sSUFBSTtRQUNKLFdBQVcsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxzQkFBc0IsQ0FBQyxJQUFJLENBQUMsQ0FBQztLQUNwRCxDQUFDLENBQUE7QUFDSixDQUFDLENBQ0Y7S0FDRSxJQUFJLENBQUMsWUFBWSxDQUFDLENBQUE7QUFPckIsTUFBTSxDQUFDLE1BQU0sYUFBYSxHQUFHLGVBQWUsRUFBc0IsQ0FBQSJ9
package/dist/schema.d.ts CHANGED
@@ -2,9 +2,9 @@ import { Array } from "@effect-app/core";
2
2
  import { type Email as EmailT, type PhoneNumber as PhoneNumberT } from "@effect-app/schema";
3
3
  import * as S from "@effect-app/schema";
4
4
  export * from "@effect-app/schema";
5
- export declare const Email: S.WithDefaults<S.Schema<string & S.EmailBrand, string, never>> & S.Schema<string & S.EmailBrand, string, never>;
5
+ export declare const Email: S.WithDefaults<S.filter<string & S.EmailBrand, string, never>> & S.filter<string & S.EmailBrand, string, never>;
6
6
  export type Email = EmailT;
7
- export declare const PhoneNumber: S.WithDefaults<S.Schema<string & S.PhoneNumberBrand, string, never>> & S.Schema<string & S.PhoneNumberBrand, string, never>;
7
+ export declare const PhoneNumber: S.WithDefaults<S.filter<string & S.PhoneNumberBrand, string, never>> & S.filter<string & S.PhoneNumberBrand, string, never>;
8
8
  export declare const makeIs: <A extends {
9
9
  _tag: string;
10
10
  }, I, R>(schema: S.Schema<A, I, R>) => Is<A>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effect-app",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -13,7 +13,7 @@
13
13
  "uuid": "^9.0.1",
14
14
  "validator": "^13.11.0",
15
15
  "@effect-app/core": "1.0.5",
16
- "@effect-app/schema": "1.0.7"
16
+ "@effect-app/schema": "1.0.8"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@babel/cli": "^7.24.1",
@@ -24,7 +24,7 @@
24
24
  "fast-check": "~3.17.2",
25
25
  "ts-node": "^10.9.2",
26
26
  "typescript": "^5.4.5",
27
- "vitest": "^1.5.1"
27
+ "vitest": "^1.5.2"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@effect/platform": "^0.50.5",
package/src/ids.ts CHANGED
@@ -22,7 +22,7 @@ export const RequestId = extendM(
22
22
  const make = StringId.make as () => NonEmptyString255
23
23
  return ({
24
24
  make,
25
- withDefault: S.propertySignature(s, { default: make })
25
+ withDefault: s.pipe(S.withDefaultConstructor(make))
26
26
  })
27
27
  }
28
28
  )