@fonderie/client 0.1.0 → 0.1.1

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 (2) hide show
  1. package/brain/signatures.md +167 -0
  2. package/package.json +5 -4
@@ -0,0 +1,167 @@
1
+ <!-- GENERATED — do not edit. Regenerate with: npm run docs:signatures -->
2
+
3
+ # @fonderie/client — signatures
4
+
5
+ ## @fonderie/client
6
+
7
+ ```ts
8
+ new FonderieClient(opts: IFonderieClientOptions): FonderieClient
9
+ .auth: AuthClient
10
+
11
+ interface IFonderieClientOptions {
12
+ baseUrl: string;
13
+ accessToken?: string;
14
+ }
15
+
16
+ new FonderieApiError(reason: string, explanation: string, status: number, details?: unknown): FonderieApiError
17
+ .reason: string
18
+ .explanation: string
19
+ .status: number
20
+ .details: unknown
21
+ .name: string
22
+ .message: string
23
+ .stack: string
24
+ .cause: unknown
25
+
26
+ new AuthClient(http: HttpClient, accessToken?: string | undefined): AuthClient
27
+ .phone: PhoneClient
28
+ .mfa: MfaClient
29
+ .setAccessToken(token: string | undefined): void
30
+ .register(input: IRegisterInput): Promise<IApiResponse<IRegisterResult>>
31
+ .login(input: ILoginInput): Promise<IApiResponse<ILoginResult>>
32
+ .refreshTokens(refreshToken?: string | undefined): Promise<IApiResponse<IRefreshResult>>
33
+ .forgotPassword(email: string): Promise<IApiResponse<undefined>>
34
+ .resetPassword(input: IResetPasswordInput): Promise<IApiResponse<undefined>>
35
+ .verifyEmail(pin: string): Promise<IApiResponse<IVerifyEmailResult>>
36
+ .logout(refreshToken?: string | undefined): Promise<IApiResponse<undefined>>
37
+ .sendVerificationEmail(): Promise<IApiResponse<IResendVerificationResult>>
38
+ .getUser(): Promise<IApiResponse<IMeResult>>
39
+ .updateUser(input: IUpdateUserInput): Promise<IApiResponse<IMeResult>>
40
+ .deleteUser(): Promise<IApiResponse<undefined>>
41
+
42
+ interface IRegisterInput {
43
+ email: string;
44
+ password: string;
45
+ firstName?: string;
46
+ lastName?: string;
47
+ }
48
+
49
+ interface ILoginInput {
50
+ email: string;
51
+ password: string;
52
+ }
53
+
54
+ interface IResetPasswordInput {
55
+ resetToken: string;
56
+ password: string;
57
+ }
58
+
59
+ interface IUpdateUserInput {
60
+ firstName?: string;
61
+ lastName?: string;
62
+ phoneNumber?: string;
63
+ avatarUrl?: string;
64
+ locale?: string;
65
+ timezone?: string;
66
+ preferences?: Record<string, unknown>;
67
+ }
68
+
69
+ interface IApiResponse<T = undefined> {
70
+ reason: string;
71
+ explanation: string;
72
+ result: T;
73
+ }
74
+
75
+ interface IApiError {
76
+ reason: string;
77
+ explanation: string;
78
+ details?: unknown;
79
+ }
80
+
81
+ interface IUserDTO {
82
+ id: string;
83
+ email: string;
84
+ firstName: string;
85
+ lastName: string;
86
+ phone: string;
87
+ profileImageUrl: string;
88
+ isActive: boolean;
89
+ lastLogin: string;
90
+ skills: IUserSkill[];
91
+ preferences: IUserPreferences;
92
+ isEmailVerified: boolean;
93
+ mfaEnabled: boolean;
94
+ suspended: boolean;
95
+ whitelist: boolean;
96
+ ipWhitelist: string[];
97
+ createdAt: string;
98
+ updatedAt: string;
99
+ }
100
+
101
+ interface IUserPreferences {
102
+ locale: string;
103
+ timezone: string;
104
+ notifications: {
105
+ email: boolean;
106
+ inApp: boolean;
107
+ sms: boolean;
108
+ push: boolean;
109
+ };
110
+ emailDigest: string;
111
+ dateFormat: string;
112
+ timeFormat: string;
113
+ }
114
+
115
+ interface IUserSkill {
116
+ name: string;
117
+ level: string;
118
+ }
119
+
120
+ interface ITokens {
121
+ access: string;
122
+ refresh: string;
123
+ }
124
+
125
+ interface IRegisterResult {
126
+ tokens: ITokens;
127
+ user: IUserDTO;
128
+ }
129
+
130
+ interface ILoginResult {
131
+ tokens: ITokens;
132
+ user: IUserDTO;
133
+ }
134
+
135
+ interface IRefreshResult {
136
+ tokens: ITokens;
137
+ }
138
+
139
+ interface IVerifyEmailResult {
140
+ verified: boolean;
141
+ email: string;
142
+ }
143
+
144
+ interface IResendVerificationResult {
145
+ stat: string;
146
+ message: string;
147
+ data: {
148
+ token: string;
149
+ expiresAt: string;
150
+ email: string;
151
+ };
152
+ }
153
+
154
+ interface IMeResult {
155
+ user: IUserDTO;
156
+ }
157
+
158
+ interface IMfaSetupResult {
159
+ secret: string;
160
+ uri: string;
161
+ }
162
+
163
+ interface IMfaEnabledResult {
164
+ tokens: ITokens;
165
+ user: IUserDTO;
166
+ }
167
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonderie/client",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Isomorphic TypeScript client for Fonderie-powered APIs — fully typed request and response shapes, zero runtime dependencies.",
5
5
  "keywords": [
6
6
  "fonderie-js",
@@ -40,16 +40,17 @@
40
40
  },
41
41
  "files": [
42
42
  "dist",
43
+ "brain",
43
44
  "LICENSE",
44
45
  "README.md"
45
46
  ],
46
47
  "repository": {
47
48
  "type": "git",
48
- "url": "git+https://github.com/fonderie-js/sdk.git",
49
+ "url": "git+https://github.com/fonderiejs/sdk.git",
49
50
  "directory": "packages/client"
50
51
  },
51
- "homepage": "https://github.com/fonderie-js/sdk/tree/main/packages/client#readme",
52
+ "homepage": "https://github.com/fonderiejs/sdk/tree/main/packages/client#readme",
52
53
  "bugs": {
53
- "url": "https://github.com/fonderie-js/sdk/issues"
54
+ "url": "https://github.com/fonderiejs/sdk/issues"
54
55
  }
55
56
  }