|
1 | 1 | import { Schema } from "effect" |
2 | 2 | import type * as HttpClientError from "effect/unstable/http/HttpClientError" |
3 | 3 |
|
4 | | -import { withStatics } from "@/util/schema" |
5 | | - |
6 | | -export const AccountID = Schema.String.pipe( |
7 | | - Schema.brand("AccountID"), |
8 | | - withStatics((s) => ({ make: (id: string) => s.makeUnsafe(id) })), |
9 | | -) |
| 4 | +export const AccountID = Schema.String.pipe(Schema.brand("AccountID")) |
10 | 5 | export type AccountID = Schema.Schema.Type<typeof AccountID> |
11 | 6 |
|
12 | | -export const OrgID = Schema.String.pipe( |
13 | | - Schema.brand("OrgID"), |
14 | | - withStatics((s) => ({ make: (id: string) => s.makeUnsafe(id) })), |
15 | | -) |
| 7 | +export const OrgID = Schema.String.pipe(Schema.brand("OrgID")) |
16 | 8 | export type OrgID = Schema.Schema.Type<typeof OrgID> |
17 | 9 |
|
18 | | -export const AccessToken = Schema.String.pipe( |
19 | | - Schema.brand("AccessToken"), |
20 | | - withStatics((s) => ({ make: (token: string) => s.makeUnsafe(token) })), |
21 | | -) |
| 10 | +export const AccessToken = Schema.String.pipe(Schema.brand("AccessToken")) |
22 | 11 | export type AccessToken = Schema.Schema.Type<typeof AccessToken> |
23 | 12 |
|
24 | | -export const RefreshToken = Schema.String.pipe( |
25 | | - Schema.brand("RefreshToken"), |
26 | | - withStatics((s) => ({ make: (token: string) => s.makeUnsafe(token) })), |
27 | | -) |
| 13 | +export const RefreshToken = Schema.String.pipe(Schema.brand("RefreshToken")) |
28 | 14 | export type RefreshToken = Schema.Schema.Type<typeof RefreshToken> |
29 | 15 |
|
30 | | -export const DeviceCode = Schema.String.pipe( |
31 | | - Schema.brand("DeviceCode"), |
32 | | - withStatics((s) => ({ make: (code: string) => s.makeUnsafe(code) })), |
33 | | -) |
| 16 | +export const DeviceCode = Schema.String.pipe(Schema.brand("DeviceCode")) |
34 | 17 | export type DeviceCode = Schema.Schema.Type<typeof DeviceCode> |
35 | 18 |
|
36 | | -export const UserCode = Schema.String.pipe( |
37 | | - Schema.brand("UserCode"), |
38 | | - withStatics((s) => ({ make: (code: string) => s.makeUnsafe(code) })), |
39 | | -) |
| 19 | +export const UserCode = Schema.String.pipe(Schema.brand("UserCode")) |
40 | 20 | export type UserCode = Schema.Schema.Type<typeof UserCode> |
41 | 21 |
|
42 | 22 | export class Info extends Schema.Class<Info>("Account")({ |
|
0 commit comments