@borealise/api 2.1.0-alpha.4 → 2.1.0-alpha.5
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/index.d.mts +56 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +6 -1
- package/dist/index.mjs +6 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -71,6 +71,8 @@ interface AuthUser {
|
|
|
71
71
|
subscriptionMonths?: number;
|
|
72
72
|
subscriptionExpiresAt?: string | null;
|
|
73
73
|
emailVerified?: boolean;
|
|
74
|
+
twoFactorEnabled?: boolean;
|
|
75
|
+
twoFactorMethod?: 'totp' | 'email' | null;
|
|
74
76
|
createdAt?: string;
|
|
75
77
|
}
|
|
76
78
|
interface LoginCredentials {
|
|
@@ -87,6 +89,42 @@ interface RegisterData {
|
|
|
87
89
|
interface AuthResponse {
|
|
88
90
|
success: boolean;
|
|
89
91
|
message?: string;
|
|
92
|
+
data: {
|
|
93
|
+
user?: AuthUser;
|
|
94
|
+
accessToken?: string;
|
|
95
|
+
refreshToken?: string;
|
|
96
|
+
expiresAt?: string;
|
|
97
|
+
requiresSecondFactor?: boolean;
|
|
98
|
+
secondFactorMethod?: 'totp' | 'email';
|
|
99
|
+
challengeToken?: string;
|
|
100
|
+
challengeExpiresAt?: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
interface TwoFactorStatusResponse {
|
|
104
|
+
success: boolean;
|
|
105
|
+
data: {
|
|
106
|
+
enabled: boolean;
|
|
107
|
+
method: 'totp' | 'email' | null;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
interface TwoFactorSetupResponse {
|
|
111
|
+
success: boolean;
|
|
112
|
+
data: {
|
|
113
|
+
method: 'totp' | 'email';
|
|
114
|
+
challengeToken: string;
|
|
115
|
+
challengeExpiresAt: string;
|
|
116
|
+
secret?: string;
|
|
117
|
+
otpauthUrl?: string;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
interface TwoFactorSetupVerifyResponse {
|
|
121
|
+
success: boolean;
|
|
122
|
+
data: {
|
|
123
|
+
backupCodes: string[];
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
interface TwoFactorVerifyResponse {
|
|
127
|
+
success: boolean;
|
|
90
128
|
data: {
|
|
91
129
|
user: AuthUser;
|
|
92
130
|
accessToken: string;
|
|
@@ -123,6 +161,13 @@ interface AuthResource {
|
|
|
123
161
|
resetPassword(token: string, password: string): Promise<ApiResponse<{
|
|
124
162
|
success: boolean;
|
|
125
163
|
}>>;
|
|
164
|
+
getTwoFactorStatus(): Promise<ApiResponse<TwoFactorStatusResponse>>;
|
|
165
|
+
startTwoFactorSetup(method: 'totp' | 'email'): Promise<ApiResponse<TwoFactorSetupResponse>>;
|
|
166
|
+
verifyTwoFactorSetup(challengeToken: string, code: string): Promise<ApiResponse<TwoFactorSetupVerifyResponse>>;
|
|
167
|
+
verifySecondFactor(challengeToken: string, code: string, trustDevice?: boolean): Promise<ApiResponse<TwoFactorVerifyResponse>>;
|
|
168
|
+
disableTwoFactor(): Promise<ApiResponse<{
|
|
169
|
+
success: boolean;
|
|
170
|
+
}>>;
|
|
126
171
|
}
|
|
127
172
|
declare const createAuthResource: (api: Api) => AuthResource;
|
|
128
173
|
|
|
@@ -692,9 +737,20 @@ interface ChatMessage {
|
|
|
692
737
|
deleted?: boolean;
|
|
693
738
|
deleted_at?: number | null;
|
|
694
739
|
deleted_by?: number | null;
|
|
740
|
+
reply_to?: ChatReplyTarget | null;
|
|
741
|
+
}
|
|
742
|
+
interface ChatReplyTarget {
|
|
743
|
+
id: string;
|
|
744
|
+
user_id?: number;
|
|
745
|
+
username?: string;
|
|
746
|
+
display_name?: string | null;
|
|
747
|
+
content: string;
|
|
748
|
+
type?: 'user' | 'system';
|
|
749
|
+
deleted?: boolean;
|
|
695
750
|
}
|
|
696
751
|
interface SendMessageData {
|
|
697
752
|
content: string;
|
|
753
|
+
replyToId?: string;
|
|
698
754
|
}
|
|
699
755
|
interface ChatMessagesResponse {
|
|
700
756
|
success: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -71,6 +71,8 @@ interface AuthUser {
|
|
|
71
71
|
subscriptionMonths?: number;
|
|
72
72
|
subscriptionExpiresAt?: string | null;
|
|
73
73
|
emailVerified?: boolean;
|
|
74
|
+
twoFactorEnabled?: boolean;
|
|
75
|
+
twoFactorMethod?: 'totp' | 'email' | null;
|
|
74
76
|
createdAt?: string;
|
|
75
77
|
}
|
|
76
78
|
interface LoginCredentials {
|
|
@@ -87,6 +89,42 @@ interface RegisterData {
|
|
|
87
89
|
interface AuthResponse {
|
|
88
90
|
success: boolean;
|
|
89
91
|
message?: string;
|
|
92
|
+
data: {
|
|
93
|
+
user?: AuthUser;
|
|
94
|
+
accessToken?: string;
|
|
95
|
+
refreshToken?: string;
|
|
96
|
+
expiresAt?: string;
|
|
97
|
+
requiresSecondFactor?: boolean;
|
|
98
|
+
secondFactorMethod?: 'totp' | 'email';
|
|
99
|
+
challengeToken?: string;
|
|
100
|
+
challengeExpiresAt?: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
interface TwoFactorStatusResponse {
|
|
104
|
+
success: boolean;
|
|
105
|
+
data: {
|
|
106
|
+
enabled: boolean;
|
|
107
|
+
method: 'totp' | 'email' | null;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
interface TwoFactorSetupResponse {
|
|
111
|
+
success: boolean;
|
|
112
|
+
data: {
|
|
113
|
+
method: 'totp' | 'email';
|
|
114
|
+
challengeToken: string;
|
|
115
|
+
challengeExpiresAt: string;
|
|
116
|
+
secret?: string;
|
|
117
|
+
otpauthUrl?: string;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
interface TwoFactorSetupVerifyResponse {
|
|
121
|
+
success: boolean;
|
|
122
|
+
data: {
|
|
123
|
+
backupCodes: string[];
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
interface TwoFactorVerifyResponse {
|
|
127
|
+
success: boolean;
|
|
90
128
|
data: {
|
|
91
129
|
user: AuthUser;
|
|
92
130
|
accessToken: string;
|
|
@@ -123,6 +161,13 @@ interface AuthResource {
|
|
|
123
161
|
resetPassword(token: string, password: string): Promise<ApiResponse<{
|
|
124
162
|
success: boolean;
|
|
125
163
|
}>>;
|
|
164
|
+
getTwoFactorStatus(): Promise<ApiResponse<TwoFactorStatusResponse>>;
|
|
165
|
+
startTwoFactorSetup(method: 'totp' | 'email'): Promise<ApiResponse<TwoFactorSetupResponse>>;
|
|
166
|
+
verifyTwoFactorSetup(challengeToken: string, code: string): Promise<ApiResponse<TwoFactorSetupVerifyResponse>>;
|
|
167
|
+
verifySecondFactor(challengeToken: string, code: string, trustDevice?: boolean): Promise<ApiResponse<TwoFactorVerifyResponse>>;
|
|
168
|
+
disableTwoFactor(): Promise<ApiResponse<{
|
|
169
|
+
success: boolean;
|
|
170
|
+
}>>;
|
|
126
171
|
}
|
|
127
172
|
declare const createAuthResource: (api: Api) => AuthResource;
|
|
128
173
|
|
|
@@ -692,9 +737,20 @@ interface ChatMessage {
|
|
|
692
737
|
deleted?: boolean;
|
|
693
738
|
deleted_at?: number | null;
|
|
694
739
|
deleted_by?: number | null;
|
|
740
|
+
reply_to?: ChatReplyTarget | null;
|
|
741
|
+
}
|
|
742
|
+
interface ChatReplyTarget {
|
|
743
|
+
id: string;
|
|
744
|
+
user_id?: number;
|
|
745
|
+
username?: string;
|
|
746
|
+
display_name?: string | null;
|
|
747
|
+
content: string;
|
|
748
|
+
type?: 'user' | 'system';
|
|
749
|
+
deleted?: boolean;
|
|
695
750
|
}
|
|
696
751
|
interface SendMessageData {
|
|
697
752
|
content: string;
|
|
753
|
+
replyToId?: string;
|
|
698
754
|
}
|
|
699
755
|
interface ChatMessagesResponse {
|
|
700
756
|
success: boolean;
|
package/dist/index.js
CHANGED
|
@@ -269,7 +269,12 @@ var createAuthResource = (api) => ({
|
|
|
269
269
|
logout: () => api.post(`${endpoint}/logout`),
|
|
270
270
|
me: () => api.get(`${endpoint}/me`),
|
|
271
271
|
forgotPassword: (email) => api.post(`${endpoint}/forgot-password`, { email }),
|
|
272
|
-
resetPassword: (token, password) => api.post(`${endpoint}/reset-password`, { token, password })
|
|
272
|
+
resetPassword: (token, password) => api.post(`${endpoint}/reset-password`, { token, password }),
|
|
273
|
+
getTwoFactorStatus: () => api.get(`${endpoint}/2fa/status`),
|
|
274
|
+
startTwoFactorSetup: (method) => api.post(`${endpoint}/2fa/setup`, { method }),
|
|
275
|
+
verifyTwoFactorSetup: (challengeToken, code) => api.post(`${endpoint}/2fa/setup/verify`, { challengeToken, code }),
|
|
276
|
+
verifySecondFactor: (challengeToken, code, trustDevice = false) => api.post(`${endpoint}/2fa/verify`, { challengeToken, code, trustDevice }),
|
|
277
|
+
disableTwoFactor: () => api.post(`${endpoint}/2fa/disable`)
|
|
273
278
|
});
|
|
274
279
|
|
|
275
280
|
// src/resources/user.ts
|
package/dist/index.mjs
CHANGED
|
@@ -220,7 +220,12 @@ var createAuthResource = (api) => ({
|
|
|
220
220
|
logout: () => api.post(`${endpoint}/logout`),
|
|
221
221
|
me: () => api.get(`${endpoint}/me`),
|
|
222
222
|
forgotPassword: (email) => api.post(`${endpoint}/forgot-password`, { email }),
|
|
223
|
-
resetPassword: (token, password) => api.post(`${endpoint}/reset-password`, { token, password })
|
|
223
|
+
resetPassword: (token, password) => api.post(`${endpoint}/reset-password`, { token, password }),
|
|
224
|
+
getTwoFactorStatus: () => api.get(`${endpoint}/2fa/status`),
|
|
225
|
+
startTwoFactorSetup: (method) => api.post(`${endpoint}/2fa/setup`, { method }),
|
|
226
|
+
verifyTwoFactorSetup: (challengeToken, code) => api.post(`${endpoint}/2fa/setup/verify`, { challengeToken, code }),
|
|
227
|
+
verifySecondFactor: (challengeToken, code, trustDevice = false) => api.post(`${endpoint}/2fa/verify`, { challengeToken, code, trustDevice }),
|
|
228
|
+
disableTwoFactor: () => api.post(`${endpoint}/2fa/disable`)
|
|
224
229
|
});
|
|
225
230
|
|
|
226
231
|
// src/resources/user.ts
|