@shivaedev/platform 0.4.0 → 0.4.2

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,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.2 - 2026-09-26
4
+
5
+ ### Added
6
+
7
+ - `TooManyRequests` in `@shivaedev/platform/errors`, a rejection with a
8
+ `message` for a caller that exceeded a rate limit. Effect tRPC sends it as
9
+ `TOO_MANY_REQUESTS`, HTTP 429.
10
+
11
+ ### Changed
12
+
13
+ - Require Effect tRPC 0.4.1, which maps `TooManyRequests` to HTTP 429 and
14
+ marks input-validation rejections with `invalidInput: true`.
15
+
16
+ ## 0.4.1 - 2026-09-26
17
+
18
+ ### Changed
19
+
20
+ - Pin the optional `better-auth` peer dependency to exactly 1.6.25, the version
21
+ the package is tested against, instead of `^1.6.25`.
22
+
3
23
  ## 0.4.0 - 2026-09-26
4
24
 
5
25
  ### Added
package/README.md CHANGED
@@ -80,9 +80,10 @@ fallback remains available.
80
80
 
81
81
  `@shivaedev/platform/errors` exports browser-safe `Schema.TaggedError` classes:
82
82
  `NotFound`, `Unauthorized`, `Forbidden`, `BadRequest` and `Conflict` (both with an
83
- optional `field`), `PreconditionFailed` and `AuthUnavailable`. Use them as native
84
- RPC error schemas or effect-contract rejections. `rejectedField(error)` extracts
85
- `{ field, message }` from any field rejection so a form can show it.
83
+ optional `field`), `PreconditionFailed`, `TooManyRequests` and `AuthUnavailable`.
84
+ Use them as native RPC error schemas or effect-contract rejections.
85
+ `rejectedField(error)` extracts `{ field, message }` from any field rejection so a
86
+ form can show it.
86
87
 
87
88
  `@shivaedev/platform/rpc` declares the `RequestTracing`, `Authenticated` and
88
89
  `MaybeAuthenticated` middleware and the `RequestId`, `Identity` and
@@ -31,6 +31,11 @@ declare const PreconditionFailed_base: Schema.Class<PreconditionFailed, Schema.T
31
31
  }>, import("effect/Cause").YieldableError>;
32
32
  export declare class PreconditionFailed extends PreconditionFailed_base {
33
33
  }
34
+ declare const TooManyRequests_base: Schema.Class<TooManyRequests, Schema.TaggedStruct<"TooManyRequests", {
35
+ message: Schema.String;
36
+ }>, import("effect/Cause").YieldableError>;
37
+ export declare class TooManyRequests extends TooManyRequests_base {
38
+ }
34
39
  declare const AuthUnavailable_base: Schema.Class<AuthUnavailable, Schema.TaggedStruct<"AuthUnavailable", {
35
40
  message: Schema.String;
36
41
  }>, import("effect/Cause").YieldableError>;
@@ -1 +1 @@
1
- {"version":3,"file":"taxonomy.d.ts","sourceRoot":"","sources":["../../src/errors/taxonomy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;AAKhC,qBAAa,QAAS,SAAQ,aAAqD;CAAG;;;;AAEtF,qBAAa,YAAa,SAAQ,iBAA6D;CAAG;;;;AAElG,qBAAa,SAAU,SAAQ,cAAuD;CAAG;;;;;AAEzF,qBAAa,UAAW,SAAQ,eAAwD;CAAG;;;;;AAE3F,qBAAa,QAAS,SAAQ,aAAoD;CAAG;;;;AAErF,qBAAa,kBAAmB,SAAQ,uBAAyE;CAAG;;;;AAEpH,qBAAa,eAAgB,SAAQ,oBAAmE;CAAG"}
1
+ {"version":3,"file":"taxonomy.d.ts","sourceRoot":"","sources":["../../src/errors/taxonomy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;AAKhC,qBAAa,QAAS,SAAQ,aAAqD;CAAG;;;;AAEtF,qBAAa,YAAa,SAAQ,iBAA6D;CAAG;;;;AAElG,qBAAa,SAAU,SAAQ,cAAuD;CAAG;;;;;AAEzF,qBAAa,UAAW,SAAQ,eAAwD;CAAG;;;;;AAE3F,qBAAa,QAAS,SAAQ,aAAoD;CAAG;;;;AAErF,qBAAa,kBAAmB,SAAQ,uBAAyE;CAAG;;;;AAEpH,qBAAa,eAAgB,SAAQ,oBAAmE;CAAG;;;;AAE3G,qBAAa,eAAgB,SAAQ,oBAAmE;CAAG"}
@@ -13,6 +13,8 @@ export class Conflict extends Schema.TaggedError()("Conflict", perField) {
13
13
  }
14
14
  export class PreconditionFailed extends Schema.TaggedError()("PreconditionFailed", described) {
15
15
  }
16
+ export class TooManyRequests extends Schema.TaggedError()("TooManyRequests", described) {
17
+ }
16
18
  export class AuthUnavailable extends Schema.TaggedError()("AuthUnavailable", described) {
17
19
  }
18
20
  //# sourceMappingURL=taxonomy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taxonomy.js","sourceRoot":"","sources":["../../src/errors/taxonomy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,SAAS,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;AAC7C,MAAM,QAAQ,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;AAEtF,MAAM,OAAO,QAAS,SAAQ,MAAM,CAAC,WAAW,EAAY,CAAC,UAAU,EAAE,SAAS,CAAC;CAAG;AAEtF,MAAM,OAAO,YAAa,SAAQ,MAAM,CAAC,WAAW,EAAgB,CAAC,cAAc,EAAE,SAAS,CAAC;CAAG;AAElG,MAAM,OAAO,SAAU,SAAQ,MAAM,CAAC,WAAW,EAAa,CAAC,WAAW,EAAE,SAAS,CAAC;CAAG;AAEzF,MAAM,OAAO,UAAW,SAAQ,MAAM,CAAC,WAAW,EAAc,CAAC,YAAY,EAAE,QAAQ,CAAC;CAAG;AAE3F,MAAM,OAAO,QAAS,SAAQ,MAAM,CAAC,WAAW,EAAY,CAAC,UAAU,EAAE,QAAQ,CAAC;CAAG;AAErF,MAAM,OAAO,kBAAmB,SAAQ,MAAM,CAAC,WAAW,EAAsB,CAAC,oBAAoB,EAAE,SAAS,CAAC;CAAG;AAEpH,MAAM,OAAO,eA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edField, rejectedField } from "./errors/rejected-field.ts";
2
- export { AuthUnavailable, BadRequest, Conflict, Forbidden, NotFound, PreconditionFailed, Unauthorized } from "./errors/taxonomy.ts";
2
+ export { AuthUnavailable, BadRequest, Conflict, Forbidden, NotFound, PreconditionFailed, TooManyRequests, Unauthorized } from "./errors/taxonomy.ts";
3
3
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/errors.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { rejectedField } from "./errors/rejected-field.js";
2
- export { AuthUnavailable, BadRequest, Conflict, Forbidden, NotFound, PreconditionFailed, Unauthorized } from "./errors/taxonomy.js";
2
+ export { AuthUnavailable, BadRequest, Conflict, Forbidden, NotFound, PreconditionFailed, TooManyRequests, Unauthorized } from "./errors/taxonomy.js";
3
3
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shivaedev/platform",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Opinionated Effect application infrastructure for ShivaeDev services",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -74,11 +74,11 @@
74
74
  },
75
75
  "peerDependencies": {
76
76
  "@effect/vitest": "4.0.0-rc.112",
77
- "@shivaedev/effect-prisma": "0.6.4",
78
- "@shivaedev/effect-trpc": "0.4.0",
79
77
  "@trpc/server": "11.18.0",
80
- "better-auth": "^1.6.25",
81
- "effect": "4.0.0-rc.112"
78
+ "better-auth": "1.6.25",
79
+ "effect": "4.0.0-rc.112",
80
+ "@shivaedev/effect-trpc": "0.4.1",
81
+ "@shivaedev/effect-prisma": "0.6.4"
82
82
  },
83
83
  "peerDependenciesMeta": {
84
84
  "@effect/vitest": {
@@ -104,8 +104,6 @@
104
104
  "@prisma-next/postgres": "0.15.0",
105
105
  "@prisma-next/sql-contract": "0.15.0",
106
106
  "@prisma-next/target-postgres": "0.15.0",
107
- "@shivaedev/effect-prisma": "0.6.4",
108
- "@shivaedev/effect-trpc": "0.4.0",
109
107
  "@trpc/client": "11.18.0",
110
108
  "@trpc/server": "11.18.0",
111
109
  "@types/node": "24.10.1",
@@ -114,7 +112,9 @@
114
112
  "effect": "4.0.0-rc.112",
115
113
  "superjson": "2.2.6",
116
114
  "typescript": "npm:@typescript/typescript6@6.0.2",
117
- "vitest": "4.1.9"
115
+ "vitest": "4.1.9",
116
+ "@shivaedev/effect-prisma": "0.6.4",
117
+ "@shivaedev/effect-trpc": "0.4.1"
118
118
  },
119
119
  "scripts": {
120
120
  "build": "node --eval \"import('node:fs').then(({ rmSync }) => rmSync('dist', { force: true, recursive: true }))\" && tsc6 --project tsconfig.build.json",
@@ -15,4 +15,6 @@ export class Conflict extends Schema.TaggedError<Conflict>()("Conflict", perFiel
15
15
 
16
16
  export class PreconditionFailed extends Schema.TaggedError<PreconditionFailed>()("PreconditionFailed", described) {}
17
17
 
18
+ export class TooManyRequests extends Schema.TaggedError<TooManyRequests>()("TooManyRequests", described) {}
19
+
18
20
  export class AuthUnavailable extends Schema.TaggedError<AuthUnavailable>()("AuthUnavailable", described) {}
package/src/errors.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { type RejectedField, rejectedField } from "./errors/rejected-field.ts";
2
- export { AuthUnavailable, BadRequest, Conflict, Forbidden, NotFound, PreconditionFailed, Unauthorized } from "./errors/taxonomy.ts";
2
+ export { AuthUnavailable, BadRequest, Conflict, Forbidden, NotFound, PreconditionFailed, TooManyRequests, Unauthorized } from "./errors/taxonomy.ts";