@oxyhq/services 0.1.18 → 5.1.8
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/README.md +17 -138
- package/UI_COMPONENTS.md +143 -0
- package/lib/commonjs/assets/OxyLogo.svg +1 -0
- package/lib/commonjs/assets/assets/OxyLogo.svg +1 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/commonjs/core/index.js +783 -0
- package/lib/commonjs/core/index.js.map +1 -0
- package/lib/commonjs/index.js +137 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/models/interfaces.js +2 -0
- package/lib/commonjs/models/interfaces.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/ui/components/Avatar.js +98 -0
- package/lib/commonjs/ui/components/Avatar.js.map +1 -0
- package/lib/commonjs/ui/components/FontLoader.js +181 -0
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -0
- package/lib/commonjs/ui/components/OxyLogo.js +56 -0
- package/lib/commonjs/ui/components/OxyLogo.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +464 -0
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -0
- package/lib/commonjs/ui/components/OxySignInButton.js +178 -0
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -0
- package/lib/commonjs/ui/components/bottomSheet/index.js +37 -0
- package/lib/commonjs/ui/components/bottomSheet/index.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +296 -0
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -0
- package/lib/commonjs/ui/index.js +144 -0
- package/lib/commonjs/ui/index.js.map +1 -0
- package/lib/commonjs/ui/navigation/OxyRouter.js +145 -0
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -0
- package/lib/commonjs/ui/navigation/types.js +6 -0
- package/lib/commonjs/ui/navigation/types.js.map +1 -0
- package/lib/commonjs/ui/screens/AboutKarmaScreen.js +45 -0
- package/lib/commonjs/ui/screens/AboutKarmaScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +280 -0
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +566 -0
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SignInScreen.js +230 -0
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SignUpScreen.js +673 -0
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -0
- package/lib/commonjs/ui/styles/FONTS.md +126 -0
- package/lib/commonjs/ui/styles/fonts.js +84 -0
- package/lib/commonjs/ui/styles/fonts.js.map +1 -0
- package/lib/commonjs/ui/styles/index.js +28 -0
- package/lib/commonjs/ui/styles/index.js.map +1 -0
- package/lib/commonjs/ui/styles/theme.js +122 -0
- package/lib/commonjs/ui/styles/theme.js.map +1 -0
- package/lib/module/assets/OxyLogo.svg +1 -0
- package/lib/module/assets/assets/OxyLogo.svg +1 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/module/core/index.js +777 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/index.js +40 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/models/interfaces.js +2 -0
- package/lib/module/models/interfaces.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/ui/components/Avatar.js +93 -0
- package/lib/module/ui/components/Avatar.js.map +1 -0
- package/lib/module/ui/components/FontLoader.js +176 -0
- package/lib/module/ui/components/FontLoader.js.map +1 -0
- package/lib/module/ui/components/OxyLogo.js +49 -0
- package/lib/module/ui/components/OxyLogo.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +458 -0
- package/lib/module/ui/components/OxyProvider.js.map +1 -0
- package/lib/module/ui/components/OxySignInButton.js +172 -0
- package/lib/module/ui/components/OxySignInButton.js.map +1 -0
- package/lib/module/ui/components/bottomSheet/index.js +8 -0
- package/lib/module/ui/components/bottomSheet/index.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +291 -0
- package/lib/module/ui/context/OxyContext.js.map +1 -0
- package/lib/module/ui/index.js +26 -0
- package/lib/module/ui/index.js.map +1 -0
- package/lib/module/ui/navigation/OxyRouter.js +138 -0
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -0
- package/lib/module/ui/navigation/types.js +4 -0
- package/lib/module/ui/navigation/types.js.map +1 -0
- package/lib/module/ui/screens/AboutKarmaScreen.js +40 -0
- package/lib/module/ui/screens/AboutKarmaScreen.js.map +1 -0
- package/lib/module/ui/screens/AccountCenterScreen.js +275 -0
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -0
- package/lib/module/ui/screens/AccountOverviewScreen.js +560 -0
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -0
- package/lib/module/ui/screens/SignInScreen.js +224 -0
- package/lib/module/ui/screens/SignInScreen.js.map +1 -0
- package/lib/module/ui/screens/SignUpScreen.js +668 -0
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -0
- package/lib/module/ui/styles/FONTS.md +126 -0
- package/lib/module/ui/styles/fonts.js +81 -0
- package/lib/module/ui/styles/fonts.js.map +1 -0
- package/lib/module/ui/styles/index.js +5 -0
- package/lib/module/ui/styles/index.js.map +1 -0
- package/lib/module/ui/styles/theme.js +115 -0
- package/lib/module/ui/styles/theme.js.map +1 -0
- package/lib/typescript/core/index.d.ts +304 -0
- package/lib/typescript/core/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +14 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/models/interfaces.d.ts +98 -0
- package/lib/typescript/models/interfaces.d.ts.map +1 -0
- package/lib/typescript/ui/components/Avatar.d.ts +62 -0
- package/lib/typescript/ui/components/Avatar.d.ts.map +1 -0
- package/lib/typescript/ui/components/FontLoader.d.ts +15 -0
- package/lib/typescript/ui/components/FontLoader.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyLogo.d.ts +29 -0
- package/lib/typescript/ui/components/OxyLogo.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts +12 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxySignInButton.d.ts +65 -0
- package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -0
- package/lib/typescript/ui/components/bottomSheet/index.d.ts +3 -0
- package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/ui/context/OxyContext.d.ts +26 -0
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -0
- package/lib/typescript/ui/index.d.ts +16 -0
- package/lib/typescript/ui/index.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/OxyRouter.d.ts +5 -0
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/types.d.ts +107 -0
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -0
- package/lib/typescript/ui/screens/AboutKarmaScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/AboutKarmaScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SignInScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SignUpScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -0
- package/lib/typescript/ui/styles/fonts.d.ts +21 -0
- package/lib/typescript/ui/styles/fonts.d.ts.map +1 -0
- package/lib/typescript/ui/styles/index.d.ts +3 -0
- package/lib/typescript/ui/styles/index.d.ts.map +1 -0
- package/lib/typescript/ui/styles/theme.d.ts +69 -0
- package/lib/typescript/ui/styles/theme.d.ts.map +1 -0
- package/package.json +95 -51
- package/src/assets/OxyLogo.svg +1 -0
- package/src/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/src/core/index.ts +768 -0
- package/src/index.ts +57 -0
- package/src/models/interfaces.ts +128 -0
- package/src/ui/components/Avatar.tsx +155 -0
- package/src/ui/components/FontLoader.tsx +180 -0
- package/src/ui/components/OxyLogo.tsx +73 -0
- package/src/ui/components/OxyProvider.tsx +490 -0
- package/src/ui/components/OxySignInButton.tsx +207 -0
- package/src/ui/components/bottomSheet/index.tsx +12 -0
- package/src/ui/context/OxyContext.tsx +344 -0
- package/src/ui/index.ts +28 -0
- package/src/ui/navigation/OxyRouter.tsx +142 -0
- package/src/ui/navigation/types.ts +124 -0
- package/src/ui/screens/AboutKarmaScreen.tsx +52 -0
- package/src/ui/screens/AccountCenterScreen.tsx +240 -0
- package/src/ui/screens/AccountOverviewScreen.tsx +512 -0
- package/src/ui/screens/SignInScreen.tsx +210 -0
- package/src/ui/screens/SignUpScreen.tsx +607 -0
- package/src/ui/styles/FONTS.md +126 -0
- package/src/ui/styles/fonts.ts +77 -0
- package/src/ui/styles/index.ts +2 -0
- package/src/ui/styles/theme.ts +142 -0
- package/dist/index.d.ts +0 -152
- package/dist/index.js +0 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { OxyConfig, User, LoginResponse, Notification, Wallet, Transaction, TransferFundsRequest, PurchaseRequest, WithdrawalRequest, TransactionResponse, KarmaRule, KarmaHistory, KarmaLeaderboardEntry, KarmaAwardRequest, PaymentMethod, PaymentRequest, PaymentResponse, AnalyticsData, FollowerDetails, ContentViewer } from '../models/interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* OxyServices - Client library for interacting with the Oxy API
|
|
4
|
+
*/
|
|
5
|
+
export declare class OxyServices {
|
|
6
|
+
private client;
|
|
7
|
+
private accessToken;
|
|
8
|
+
private refreshToken;
|
|
9
|
+
private refreshPromise;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new instance of the OxyServices client
|
|
12
|
+
* @param config - Configuration for the client
|
|
13
|
+
*/
|
|
14
|
+
constructor(config: OxyConfig);
|
|
15
|
+
/**
|
|
16
|
+
* Gets the currently authenticated user ID from the token
|
|
17
|
+
* @returns The user ID or null if not authenticated
|
|
18
|
+
*/
|
|
19
|
+
getCurrentUserId(): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Checks if the user is currently authenticated
|
|
22
|
+
* @returns Boolean indicating authentication status
|
|
23
|
+
*/
|
|
24
|
+
isAuthenticated(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Sets authentication tokens directly (useful for initializing from storage)
|
|
27
|
+
* @param accessToken - JWT access token
|
|
28
|
+
* @param refreshToken - Refresh token for getting new access tokens
|
|
29
|
+
*/
|
|
30
|
+
setTokens(accessToken: string, refreshToken: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Clears all authentication tokens
|
|
33
|
+
*/
|
|
34
|
+
clearTokens(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Sign up a new user
|
|
37
|
+
* @param username - Desired username
|
|
38
|
+
* @param email - User's email address
|
|
39
|
+
* @param password - User's password
|
|
40
|
+
* @returns Object containing the message, token and user data
|
|
41
|
+
*/
|
|
42
|
+
signUp(username: string, email: string, password: string): Promise<{
|
|
43
|
+
message: string;
|
|
44
|
+
token: string;
|
|
45
|
+
user: User;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Log in and store tokens
|
|
49
|
+
* @param username - User's username or email
|
|
50
|
+
* @param password - User's password
|
|
51
|
+
* @returns Login response containing tokens and user data
|
|
52
|
+
*/
|
|
53
|
+
login(username: string, password: string): Promise<LoginResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Log out user
|
|
56
|
+
*/
|
|
57
|
+
logout(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Refresh access and refresh tokens
|
|
60
|
+
* @returns New tokens
|
|
61
|
+
*/
|
|
62
|
+
refreshTokens(): Promise<{
|
|
63
|
+
accessToken: string;
|
|
64
|
+
refreshToken: string;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Validate current access token
|
|
68
|
+
* @returns Boolean indicating if the token is valid
|
|
69
|
+
*/
|
|
70
|
+
validate(): Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* Fetch profile by username
|
|
73
|
+
* @param username - The username to look up
|
|
74
|
+
* @returns User profile data
|
|
75
|
+
*/
|
|
76
|
+
getProfileByUsername(username: string): Promise<User>;
|
|
77
|
+
/**
|
|
78
|
+
* Search profiles
|
|
79
|
+
* @param query - Search query string
|
|
80
|
+
* @param limit - Maximum number of results to return
|
|
81
|
+
* @param offset - Number of results to skip for pagination
|
|
82
|
+
* @returns Array of matching user profiles
|
|
83
|
+
*/
|
|
84
|
+
searchProfiles(query: string, limit?: number, offset?: number): Promise<User[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Get general user by ID
|
|
87
|
+
* @param userId - The user ID to look up
|
|
88
|
+
* @returns User data
|
|
89
|
+
*/
|
|
90
|
+
getUserById(userId: string): Promise<User>;
|
|
91
|
+
/**
|
|
92
|
+
* Update user profile (requires auth)
|
|
93
|
+
* @param userId - User ID to update (must match authenticated user or have admin rights)
|
|
94
|
+
* @param updates - Object containing fields to update
|
|
95
|
+
* @returns Updated user data
|
|
96
|
+
*/
|
|
97
|
+
updateUser(userId: string, updates: Record<string, any>): Promise<User>;
|
|
98
|
+
/**
|
|
99
|
+
* Follow a user
|
|
100
|
+
* @param userId - User ID to follow
|
|
101
|
+
* @returns Status of the follow operation
|
|
102
|
+
*/
|
|
103
|
+
followUser(userId: string): Promise<{
|
|
104
|
+
success: boolean;
|
|
105
|
+
message: string;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* Unfollow a user
|
|
109
|
+
* @param userId - User ID to unfollow
|
|
110
|
+
* @returns Status of the unfollow operation
|
|
111
|
+
*/
|
|
112
|
+
unfollowUser(userId: string): Promise<{
|
|
113
|
+
success: boolean;
|
|
114
|
+
message: string;
|
|
115
|
+
}>;
|
|
116
|
+
/**
|
|
117
|
+
* Fetch all notifications for the authenticated user
|
|
118
|
+
* @returns Array of notifications
|
|
119
|
+
*/
|
|
120
|
+
getNotifications(): Promise<Notification[]>;
|
|
121
|
+
/**
|
|
122
|
+
* Get count of unread notifications
|
|
123
|
+
* @returns Number of unread notifications
|
|
124
|
+
*/
|
|
125
|
+
getUnreadCount(): Promise<number>;
|
|
126
|
+
/**
|
|
127
|
+
* Create a new notification (admin use)
|
|
128
|
+
* @param data - Notification data
|
|
129
|
+
* @returns Created notification
|
|
130
|
+
*/
|
|
131
|
+
createNotification(data: Partial<Notification>): Promise<Notification>;
|
|
132
|
+
/**
|
|
133
|
+
* Mark a single notification as read
|
|
134
|
+
* @param notificationId - ID of notification to mark as read
|
|
135
|
+
*/
|
|
136
|
+
markNotificationAsRead(notificationId: string): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Mark all notifications as read
|
|
139
|
+
*/
|
|
140
|
+
markAllNotificationsAsRead(): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* Delete a notification
|
|
143
|
+
* @param notificationId - ID of notification to delete
|
|
144
|
+
*/
|
|
145
|
+
deleteNotification(notificationId: string): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Process a payment
|
|
148
|
+
* @param data - Payment data including user ID, plan, and payment method
|
|
149
|
+
* @returns Payment result with transaction ID
|
|
150
|
+
*/
|
|
151
|
+
processPayment(data: PaymentRequest): Promise<PaymentResponse>;
|
|
152
|
+
/**
|
|
153
|
+
* Validate a payment method
|
|
154
|
+
* @param paymentMethod - Payment method to validate
|
|
155
|
+
* @returns Object indicating if the payment method is valid
|
|
156
|
+
*/
|
|
157
|
+
validatePaymentMethod(paymentMethod: any): Promise<{
|
|
158
|
+
valid: boolean;
|
|
159
|
+
}>;
|
|
160
|
+
/**
|
|
161
|
+
* Get saved payment methods for a user
|
|
162
|
+
* @param userId - User ID to get payment methods for
|
|
163
|
+
* @returns Array of payment methods
|
|
164
|
+
*/
|
|
165
|
+
getPaymentMethods(userId: string): Promise<PaymentMethod[]>;
|
|
166
|
+
/**
|
|
167
|
+
* Get analytics data
|
|
168
|
+
* @param userId - User ID to get analytics for
|
|
169
|
+
* @param period - Time period for analytics (e.g., "day", "week", "month")
|
|
170
|
+
* @returns Analytics data
|
|
171
|
+
*/
|
|
172
|
+
getAnalytics(userId: string, period?: string): Promise<AnalyticsData>;
|
|
173
|
+
/**
|
|
174
|
+
* Update analytics (internal use)
|
|
175
|
+
* @param userId - User ID to update analytics for
|
|
176
|
+
* @param type - Type of analytics to update
|
|
177
|
+
* @param data - Analytics data to update
|
|
178
|
+
* @returns Message indicating success
|
|
179
|
+
*/
|
|
180
|
+
updateAnalytics(userId: string, type: string, data: Record<string, any>): Promise<{
|
|
181
|
+
message: string;
|
|
182
|
+
}>;
|
|
183
|
+
/**
|
|
184
|
+
* Get content viewers analytics
|
|
185
|
+
* @param userId - User ID to get viewer data for
|
|
186
|
+
* @param period - Time period for analytics
|
|
187
|
+
* @returns Array of content viewer data
|
|
188
|
+
*/
|
|
189
|
+
getContentViewers(userId: string, period?: string): Promise<ContentViewer[]>;
|
|
190
|
+
/**
|
|
191
|
+
* Get follower analytics details
|
|
192
|
+
* @param userId - User ID to get follower data for
|
|
193
|
+
* @param period - Time period for follower data
|
|
194
|
+
* @returns Follower details
|
|
195
|
+
*/
|
|
196
|
+
getFollowerDetails(userId: string, period?: string): Promise<FollowerDetails>;
|
|
197
|
+
/**
|
|
198
|
+
* Get wallet info
|
|
199
|
+
* @param userId - User ID to get wallet for
|
|
200
|
+
* @returns Wallet data
|
|
201
|
+
*/
|
|
202
|
+
getWallet(userId: string): Promise<Wallet>;
|
|
203
|
+
/**
|
|
204
|
+
* Get transaction history
|
|
205
|
+
* @param userId - User ID to get transactions for
|
|
206
|
+
* @param limit - Maximum number of transactions to return
|
|
207
|
+
* @param offset - Number of transactions to skip for pagination
|
|
208
|
+
* @returns Array of transactions and pagination info
|
|
209
|
+
*/
|
|
210
|
+
getTransactionHistory(userId: string, limit?: number, offset?: number): Promise<{
|
|
211
|
+
transactions: Transaction[];
|
|
212
|
+
total: number;
|
|
213
|
+
hasMore: boolean;
|
|
214
|
+
}>;
|
|
215
|
+
/**
|
|
216
|
+
* Get a specific transaction
|
|
217
|
+
* @param transactionId - ID of transaction to retrieve
|
|
218
|
+
* @returns Transaction data
|
|
219
|
+
*/
|
|
220
|
+
getTransaction(transactionId: string): Promise<Transaction>;
|
|
221
|
+
/**
|
|
222
|
+
* Transfer funds between users
|
|
223
|
+
* @param data - Transfer details including source, destination, and amount
|
|
224
|
+
* @returns Transaction response
|
|
225
|
+
*/
|
|
226
|
+
transferFunds(data: TransferFundsRequest): Promise<TransactionResponse>;
|
|
227
|
+
/**
|
|
228
|
+
* Process a purchase
|
|
229
|
+
* @param data - Purchase details including user, item, and amount
|
|
230
|
+
* @returns Transaction response
|
|
231
|
+
*/
|
|
232
|
+
processPurchase(data: PurchaseRequest): Promise<TransactionResponse>;
|
|
233
|
+
/**
|
|
234
|
+
* Request a withdrawal
|
|
235
|
+
* @param data - Withdrawal details including user, amount, and address
|
|
236
|
+
* @returns Transaction response
|
|
237
|
+
*/
|
|
238
|
+
requestWithdrawal(data: WithdrawalRequest): Promise<TransactionResponse>;
|
|
239
|
+
/**
|
|
240
|
+
* Get karma leaderboard
|
|
241
|
+
* @returns Array of karma leaderboard entries
|
|
242
|
+
*/
|
|
243
|
+
getKarmaLeaderboard(): Promise<KarmaLeaderboardEntry[]>;
|
|
244
|
+
/**
|
|
245
|
+
* Get karma rules
|
|
246
|
+
* @returns Array of karma rules
|
|
247
|
+
*/
|
|
248
|
+
getKarmaRules(): Promise<KarmaRule[]>;
|
|
249
|
+
/**
|
|
250
|
+
* Get total karma for a user
|
|
251
|
+
* @param userId - User ID to get karma for
|
|
252
|
+
* @returns Object with total karma points
|
|
253
|
+
*/
|
|
254
|
+
getUserKarmaTotal(userId: string): Promise<{
|
|
255
|
+
total: number;
|
|
256
|
+
}>;
|
|
257
|
+
/**
|
|
258
|
+
* Get karma history for a user
|
|
259
|
+
* @param userId - User ID to get karma history for
|
|
260
|
+
* @param limit - Maximum number of history entries to return
|
|
261
|
+
* @param offset - Number of entries to skip for pagination
|
|
262
|
+
* @returns Karma history entries and pagination info
|
|
263
|
+
*/
|
|
264
|
+
getUserKarmaHistory(userId: string, limit?: number, offset?: number): Promise<{
|
|
265
|
+
history: KarmaHistory[];
|
|
266
|
+
total: number;
|
|
267
|
+
hasMore: boolean;
|
|
268
|
+
}>;
|
|
269
|
+
/**
|
|
270
|
+
* Award karma points to a user
|
|
271
|
+
* @param data - Karma award details
|
|
272
|
+
* @returns Karma award response
|
|
273
|
+
*/
|
|
274
|
+
awardKarma(data: KarmaAwardRequest): Promise<{
|
|
275
|
+
success: boolean;
|
|
276
|
+
message: string;
|
|
277
|
+
history: KarmaHistory;
|
|
278
|
+
}>;
|
|
279
|
+
/**
|
|
280
|
+
* Deduct karma points from a user
|
|
281
|
+
* @param data - Karma deduction details
|
|
282
|
+
* @returns Karma deduction response
|
|
283
|
+
*/
|
|
284
|
+
deductKarma(data: KarmaAwardRequest): Promise<{
|
|
285
|
+
success: boolean;
|
|
286
|
+
message: string;
|
|
287
|
+
history: KarmaHistory;
|
|
288
|
+
}>;
|
|
289
|
+
/**
|
|
290
|
+
* Create or update karma rule (admin)
|
|
291
|
+
* @param data - Karma rule data
|
|
292
|
+
* @returns Created or updated karma rule
|
|
293
|
+
*/
|
|
294
|
+
createOrUpdateKarmaRule(data: Partial<KarmaRule>): Promise<KarmaRule>;
|
|
295
|
+
/**
|
|
296
|
+
* Centralized error handling
|
|
297
|
+
* @private
|
|
298
|
+
* @param error - Error object from API call
|
|
299
|
+
* @returns Formatted API error
|
|
300
|
+
*/
|
|
301
|
+
private handleError;
|
|
302
|
+
}
|
|
303
|
+
export default OxyServices;
|
|
304
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,MAAM,EACN,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EAEjB,aAAa,EACb,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,EACd,MAAM,sBAAsB,CAAC;AAQ9B;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,cAAc,CAAuE;IAE7F;;;OAGG;gBACS,MAAM,EAAE,SAAS;IAyE7B;;;OAGG;IACI,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAWxC;;;OAGG;IACI,eAAe,IAAI,OAAO;IAIjC;;;;OAIG;IACI,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAKjE;;OAEG;IACI,WAAW,IAAI,IAAI;IAK1B;;;;;;OAMG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,M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AAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,CAAA;KAAE,CAAC;IAShH;;;;OAIG;IACG,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,CAAA;KAAE,CAAC;IASjH;;;;OAIG;IACG,uBAAuB,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;IAS3E;;;;;OAKG;IACH,OAAO,CAAC,WAAW;CAepB;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OxyHQServices Main Export File
|
|
3
|
+
*/
|
|
4
|
+
import OxyCore from './core';
|
|
5
|
+
import { OxyServices } from './core';
|
|
6
|
+
import { OxyProvider, OxyContextProvider, useOxy, SignInScreen, SignUpScreen, AccountCenterScreen, OxySignInButton, OxyLogo, Avatar, FontLoader } from './ui';
|
|
7
|
+
import { OxyContextState, OxyContextProviderProps } from './ui/context/OxyContext';
|
|
8
|
+
export default OxyCore;
|
|
9
|
+
export { OxyServices };
|
|
10
|
+
export * from './core';
|
|
11
|
+
export { OxyProvider, OxyContextProvider, useOxy, SignInScreen, SignUpScreen, AccountCenterScreen, OxySignInButton, OxyLogo, Avatar, FontLoader };
|
|
12
|
+
export { OxyContextState, OxyContextProviderProps };
|
|
13
|
+
export * from './ui/navigation/types';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,OAAO,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,EAEL,WAAW,EACX,kBAAkB,EAClB,MAAM,EAGN,YAAY,EACZ,YAAY,EACZ,mBAAmB,EAGnB,eAAe,EACf,OAAO,EACP,MAAM,EACN,UAAU,EACX,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAGnF,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,cAAc,QAAQ,CAAC;AAGvB,OAAO,EAEL,WAAW,EACX,kBAAkB,EAClB,MAAM,EAGN,YAAY,EACZ,YAAY,EACZ,mBAAmB,EAGnB,eAAe,EACf,OAAO,EACP,MAAM,EACN,UAAU,EACX,CAAC;AAGF,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,CAAC;AACpD,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export interface OxyConfig {
|
|
2
|
+
baseURL: string;
|
|
3
|
+
}
|
|
4
|
+
export interface User {
|
|
5
|
+
id: string;
|
|
6
|
+
username: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
avatarUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LoginResponse {
|
|
11
|
+
accessToken?: string;
|
|
12
|
+
refreshToken?: string;
|
|
13
|
+
token?: string;
|
|
14
|
+
user: User;
|
|
15
|
+
message?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface Notification {
|
|
18
|
+
id: string;
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
export interface Wallet {
|
|
22
|
+
id: string;
|
|
23
|
+
balance: number;
|
|
24
|
+
}
|
|
25
|
+
export interface Transaction {
|
|
26
|
+
id: string;
|
|
27
|
+
amount: number;
|
|
28
|
+
type: string;
|
|
29
|
+
timestamp: string;
|
|
30
|
+
}
|
|
31
|
+
export interface TransferFundsRequest {
|
|
32
|
+
fromUserId: string;
|
|
33
|
+
toUserId: string;
|
|
34
|
+
amount: number;
|
|
35
|
+
}
|
|
36
|
+
export interface PurchaseRequest {
|
|
37
|
+
userId: string;
|
|
38
|
+
itemId: string;
|
|
39
|
+
amount: number;
|
|
40
|
+
}
|
|
41
|
+
export interface WithdrawalRequest {
|
|
42
|
+
userId: string;
|
|
43
|
+
amount: number;
|
|
44
|
+
address: string;
|
|
45
|
+
}
|
|
46
|
+
export interface TransactionResponse {
|
|
47
|
+
success: boolean;
|
|
48
|
+
transaction: Transaction;
|
|
49
|
+
}
|
|
50
|
+
export interface KarmaRule {
|
|
51
|
+
id: string;
|
|
52
|
+
description: string;
|
|
53
|
+
}
|
|
54
|
+
export interface KarmaHistory {
|
|
55
|
+
id: string;
|
|
56
|
+
userId: string;
|
|
57
|
+
points: number;
|
|
58
|
+
}
|
|
59
|
+
export interface KarmaLeaderboardEntry {
|
|
60
|
+
userId: string;
|
|
61
|
+
total: number;
|
|
62
|
+
}
|
|
63
|
+
export interface KarmaAwardRequest {
|
|
64
|
+
userId: string;
|
|
65
|
+
points: number;
|
|
66
|
+
reason?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface ApiError {
|
|
69
|
+
message: string;
|
|
70
|
+
code: string;
|
|
71
|
+
status: number;
|
|
72
|
+
details?: any;
|
|
73
|
+
}
|
|
74
|
+
export interface PaymentMethod {
|
|
75
|
+
id: string;
|
|
76
|
+
type: string;
|
|
77
|
+
}
|
|
78
|
+
export interface PaymentRequest {
|
|
79
|
+
userId: string;
|
|
80
|
+
planId: string;
|
|
81
|
+
paymentMethodId: string;
|
|
82
|
+
}
|
|
83
|
+
export interface PaymentResponse {
|
|
84
|
+
transactionId: string;
|
|
85
|
+
status: string;
|
|
86
|
+
}
|
|
87
|
+
export interface AnalyticsData {
|
|
88
|
+
userId: string;
|
|
89
|
+
}
|
|
90
|
+
export interface FollowerDetails {
|
|
91
|
+
userId: string;
|
|
92
|
+
followers: number;
|
|
93
|
+
}
|
|
94
|
+
export interface ContentViewer {
|
|
95
|
+
userId: string;
|
|
96
|
+
viewedAt: string;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/models/interfaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;CAEjB;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CAEpB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CAEjB;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CAEjB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CAEnB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf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AElB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle, ImageStyle, TextStyle } from 'react-native';
|
|
3
|
+
export interface AvatarProps {
|
|
4
|
+
/**
|
|
5
|
+
* URL of the avatar image
|
|
6
|
+
*/
|
|
7
|
+
imageUrl?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Text to display when no image is available
|
|
10
|
+
* Defaults to first letter of name if name is provided
|
|
11
|
+
*/
|
|
12
|
+
text?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Full name to derive the initials from (takes first letter)
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Size of the avatar in pixels
|
|
19
|
+
* @default 40
|
|
20
|
+
*/
|
|
21
|
+
size?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Theme to use for colors
|
|
24
|
+
* @default 'light'
|
|
25
|
+
*/
|
|
26
|
+
theme?: 'light' | 'dark';
|
|
27
|
+
/**
|
|
28
|
+
* Background color for text avatar
|
|
29
|
+
* Defaults to theme primary color
|
|
30
|
+
*/
|
|
31
|
+
backgroundColor?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Text color for text avatar
|
|
34
|
+
* @default '#FFFFFF'
|
|
35
|
+
*/
|
|
36
|
+
textColor?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Additional styles for the container
|
|
39
|
+
*/
|
|
40
|
+
style?: StyleProp<ViewStyle>;
|
|
41
|
+
/**
|
|
42
|
+
* Additional styles for the image
|
|
43
|
+
* Only used when imageUrl is provided
|
|
44
|
+
*/
|
|
45
|
+
imageStyle?: StyleProp<ImageStyle>;
|
|
46
|
+
/**
|
|
47
|
+
* Additional styles for the text
|
|
48
|
+
*/
|
|
49
|
+
textStyle?: StyleProp<TextStyle>;
|
|
50
|
+
/**
|
|
51
|
+
* Is loading state
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
isLoading?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Avatar component that displays either an image or text avatar
|
|
58
|
+
* Falls back to displaying the first letter of the name if no image is provided
|
|
59
|
+
*/
|
|
60
|
+
declare const Avatar: React.FC<AvatarProps>;
|
|
61
|
+
export default Avatar;
|
|
62
|
+
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAA+B,MAAM,cAAc,CAAC;AAIvI,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAEnC;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAEjC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmEjC,CAAC;AAcF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* FontLoader component that loads custom fonts before rendering children
|
|
4
|
+
* This works in both the package development and when consumed as an npm package
|
|
5
|
+
*/
|
|
6
|
+
export declare const FontLoader: ({ children, fallbackContent, }: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
fallbackContent?: React.ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Setup fonts for applications consuming this package
|
|
12
|
+
* This should be called by applications using your package
|
|
13
|
+
*/
|
|
14
|
+
export declare const setupFonts: () => Promise<boolean>;
|
|
15
|
+
//# sourceMappingURL=FontLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontLoader.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/FontLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA2BnD;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,gCAGxB;IACC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACrC,4CA6CA,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,wBA8EtB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
interface OxyLogoProps {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
style?: ViewStyle;
|
|
7
|
+
/**
|
|
8
|
+
* Primary fill color for the logo
|
|
9
|
+
* If not provided, the theme's primary color will be used
|
|
10
|
+
*/
|
|
11
|
+
fillColor?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Secondary fill color for the inner glow effect
|
|
14
|
+
* If not provided, a lighter shade of the fillColor will be used
|
|
15
|
+
*/
|
|
16
|
+
secondaryFillColor?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Theme to use for the logo colors
|
|
19
|
+
* @default 'light'
|
|
20
|
+
*/
|
|
21
|
+
theme?: 'light' | 'dark';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* SVG logo component for Oxy
|
|
25
|
+
* This component renders the Oxy logo as an SVG and uses theme colors by default
|
|
26
|
+
*/
|
|
27
|
+
export declare const OxyLogo: React.FC<OxyLogoProps>;
|
|
28
|
+
export default OxyLogo;
|
|
29
|
+
//# sourceMappingURL=OxyLogo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OxyLogo.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/OxyLogo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,UAAU,YAAY;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAwC1C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OxyProviderProps } from '../navigation/types';
|
|
3
|
+
/**
|
|
4
|
+
* Enhanced OxyProvider component
|
|
5
|
+
*
|
|
6
|
+
* This component serves two purposes:
|
|
7
|
+
* 1. As a context provider for authentication and session management across the app
|
|
8
|
+
* 2. As a UI component for authentication and account management using a bottom sheet
|
|
9
|
+
*/
|
|
10
|
+
declare const OxyProvider: React.FC<OxyProviderProps>;
|
|
11
|
+
export default OxyProvider;
|
|
12
|
+
//# sourceMappingURL=OxyProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OxyProvider.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/OxyProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAKxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAgBvD;;;;;;GAMG;AACH,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA+C3C,CAAC;AA6ZF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewStyle, TextStyle, StyleProp } from 'react-native';
|
|
3
|
+
export interface OxySignInButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Controls the appearance of the button
|
|
6
|
+
* @default 'default'
|
|
7
|
+
*/
|
|
8
|
+
variant?: 'default' | 'outline' | 'contained';
|
|
9
|
+
/**
|
|
10
|
+
* Optional function to handle button press
|
|
11
|
+
* If not provided, the button will use the showBottomSheet method from OxyContext
|
|
12
|
+
*/
|
|
13
|
+
onPress?: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Additional styles for the button container
|
|
16
|
+
*/
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
/**
|
|
19
|
+
* Additional styles for the button text
|
|
20
|
+
*/
|
|
21
|
+
textStyle?: StyleProp<TextStyle>;
|
|
22
|
+
/**
|
|
23
|
+
* Custom button text
|
|
24
|
+
* @default 'Sign in with Oxy'
|
|
25
|
+
*/
|
|
26
|
+
text?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to disable the button
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to show the button even if user is already authenticated
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
showWhenAuthenticated?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A pre-styled button component for signing in with Oxy services
|
|
40
|
+
*
|
|
41
|
+
* This component automatically integrates with the OxyProvider context
|
|
42
|
+
* and will control the authentication bottom sheet when pressed.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // Basic usage
|
|
47
|
+
* <OxySignInButton />
|
|
48
|
+
*
|
|
49
|
+
* // Custom styling
|
|
50
|
+
* <OxySignInButton
|
|
51
|
+
* variant="contained"
|
|
52
|
+
* style={{ marginTop: 20 }}
|
|
53
|
+
* text="Login with Oxy"
|
|
54
|
+
* />
|
|
55
|
+
*
|
|
56
|
+
* // Custom handler
|
|
57
|
+
* <OxySignInButton onPress={() => {
|
|
58
|
+
* // Custom authentication flow
|
|
59
|
+
* console.log('Custom auth flow initiated');
|
|
60
|
+
* }} />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare const OxySignInButton: React.FC<OxySignInButtonProps>;
|
|
64
|
+
export default OxySignInButton;
|
|
65
|
+
//# sourceMappingURL=OxySignInButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OxySignInButton.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/OxySignInButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA4C,SAAS,EAAE,SAAS,EAAE,SAAS,EAAY,MAAM,cAAc,CAAC;AAKnH,MAAM,WAAW,oBAAoB;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;IAE9C;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAEjC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA8E1D,CAAC;AAuDF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BottomSheetModal, BottomSheetBackdrop, BottomSheetBackdropProps, BottomSheetModalProvider, BottomSheetView } from '@gorhom/bottom-sheet';
|
|
2
|
+
export { BottomSheetModal, BottomSheetBackdrop, BottomSheetBackdropProps, BottomSheetModalProvider, BottomSheetView };
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/bottomSheet/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIlJ,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EAClB,CAAC"}
|