@oxyhq/services 0.1.0 → 0.1.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.
Files changed (86) hide show
  1. package/README.md +144 -250
  2. package/dist/backend/auth.d.ts +37 -0
  3. package/dist/backend/index.d.ts +12 -0
  4. package/dist/backend/karma.d.ts +45 -0
  5. package/dist/backend/users.d.ts +39 -0
  6. package/dist/backend/wallet.d.ts +29 -0
  7. package/dist/bundle.js +2 -0
  8. package/dist/bundle.js.LICENSE.txt +9 -0
  9. package/dist/frontend/context/OxyContext.d.ts +20 -0
  10. package/dist/frontend/hooks/useAuth.d.ts +19 -0
  11. package/dist/frontend/hooks/useKarma.d.ts +27 -0
  12. package/dist/frontend/hooks/useUser.d.ts +13 -0
  13. package/dist/frontend/hooks/useWallet.d.ts +14 -0
  14. package/dist/frontend/index.d.ts +6 -0
  15. package/dist/index.d.ts +3 -28
  16. package/dist/shared/api-client.d.ts +15 -0
  17. package/dist/shared/types.d.ts +135 -0
  18. package/package.json +45 -71
  19. package/dist/components/AuthBottomSheet/types.d.ts +0 -24
  20. package/dist/components/AuthBottomSheet/types.js +0 -2
  21. package/dist/components/FileSelectorModal/types.d.ts +0 -35
  22. package/dist/components/FileSelectorModal/types.js +0 -2
  23. package/dist/components/SessionProvider.d.ts +0 -26
  24. package/dist/components/SessionProvider.js +0 -367
  25. package/dist/config.d.ts +0 -169
  26. package/dist/config.js +0 -115
  27. package/dist/constants.d.ts +0 -54
  28. package/dist/constants.js +0 -61
  29. package/dist/hooks/index.d.ts +0 -11
  30. package/dist/hooks/index.js +0 -23
  31. package/dist/hooks/useAuth.d.ts +0 -6
  32. package/dist/hooks/useAuth.js +0 -17
  33. package/dist/hooks/useFiles.d.ts +0 -10
  34. package/dist/hooks/useFiles.js +0 -329
  35. package/dist/hooks/useProfile.d.ts +0 -13
  36. package/dist/hooks/useProfile.js +0 -154
  37. package/dist/hooks/useSession.d.ts +0 -2
  38. package/dist/hooks/useSession.js +0 -12
  39. package/dist/hooks/useSubscription.d.ts +0 -15
  40. package/dist/hooks/useSubscription.js +0 -85
  41. package/dist/index.js +0 -82
  42. package/dist/package.json +0 -71
  43. package/dist/reducers/index.d.ts +0 -8
  44. package/dist/reducers/index.js +0 -29
  45. package/dist/reducers/profileReducer.d.ts +0 -55
  46. package/dist/reducers/profileReducer.js +0 -136
  47. package/dist/services/OxyClient.d.ts +0 -84
  48. package/dist/services/OxyClient.js +0 -309
  49. package/dist/services/api.service.d.ts +0 -61
  50. package/dist/services/api.service.js +0 -289
  51. package/dist/services/auth.service.d.ts +0 -87
  52. package/dist/services/auth.service.js +0 -266
  53. package/dist/services/index.d.ts +0 -30
  54. package/dist/services/index.js +0 -88
  55. package/dist/services/payment.service.d.ts +0 -20
  56. package/dist/services/payment.service.js +0 -56
  57. package/dist/services/privacy.service.d.ts +0 -16
  58. package/dist/services/privacy.service.js +0 -69
  59. package/dist/services/profile.service.d.ts +0 -20
  60. package/dist/services/profile.service.js +0 -158
  61. package/dist/services/subscription.service.d.ts +0 -7
  62. package/dist/services/subscription.service.js +0 -46
  63. package/dist/services/user.service.d.ts +0 -25
  64. package/dist/services/user.service.js +0 -109
  65. package/dist/styles/colors.d.ts +0 -24
  66. package/dist/styles/colors.js +0 -31
  67. package/dist/styles/shared.d.ts +0 -168
  68. package/dist/styles/shared.js +0 -177
  69. package/dist/types/index.d.ts +0 -136
  70. package/dist/types/index.js +0 -7
  71. package/dist/utils/api.d.ts +0 -20
  72. package/dist/utils/api.js +0 -546
  73. package/dist/utils/authEvents.d.ts +0 -44
  74. package/dist/utils/authEvents.js +0 -73
  75. package/dist/utils/errorHandler.d.ts +0 -68
  76. package/dist/utils/errorHandler.js +0 -166
  77. package/dist/utils/index.d.ts +0 -12
  78. package/dist/utils/index.js +0 -41
  79. package/dist/utils/logger.d.ts +0 -100
  80. package/dist/utils/logger.js +0 -298
  81. package/dist/utils/socket.d.ts +0 -6
  82. package/dist/utils/socket.js +0 -179
  83. package/dist/utils/socketConfig.d.ts +0 -32
  84. package/dist/utils/socketConfig.js +0 -67
  85. package/dist/utils/storage.d.ts +0 -54
  86. package/dist/utils/storage.js +0 -253
@@ -1,168 +0,0 @@
1
- /**
2
- * Shared Styles
3
- *
4
- * This file contains shared styles used across the OxyHQ services module.
5
- * These styles establish a consistent design language for the application.
6
- */
7
- /**
8
- * Theme variables for consistent sizing, spacing, and visual elements
9
- */
10
- export declare const theme: {
11
- spacing: {
12
- xs: number;
13
- sm: number;
14
- md: number;
15
- lg: number;
16
- xl: number;
17
- };
18
- radius: {
19
- sm: number;
20
- md: number;
21
- lg: number;
22
- };
23
- fontSize: {
24
- small: number;
25
- regular: number;
26
- large: number;
27
- xlarge: number;
28
- xxlarge: number;
29
- };
30
- animation: {
31
- fast: string;
32
- normal: string;
33
- slow: string;
34
- };
35
- };
36
- /**
37
- * Shared styles used throughout the application
38
- */
39
- export declare const sharedStyles: {
40
- input: {
41
- width: "100%";
42
- height: number;
43
- paddingHorizontal: number;
44
- borderWidth: number;
45
- borderColor: string;
46
- borderRadius: number;
47
- color: string;
48
- backgroundColor: string;
49
- fontSize: number;
50
- boxShadow: string;
51
- elevation: number;
52
- };
53
- inputWrapper: {
54
- width: "100%";
55
- maxWidth: number;
56
- marginBottom: number;
57
- };
58
- button: {
59
- height: number;
60
- borderRadius: number;
61
- overflow: "hidden";
62
- boxShadow: string;
63
- elevation: number;
64
- };
65
- buttonGradient: {
66
- flex: number;
67
- justifyContent: "center";
68
- alignItems: "center";
69
- };
70
- buttonText: {
71
- color: string;
72
- fontWeight: "600";
73
- fontSize: number;
74
- };
75
- buttonOutline: {
76
- height: number;
77
- paddingHorizontal: number;
78
- justifyContent: "center";
79
- alignItems: "center";
80
- borderRadius: number;
81
- borderWidth: number;
82
- borderColor: string;
83
- backgroundColor: string;
84
- };
85
- buttonOutlineText: {
86
- color: string;
87
- fontWeight: "600";
88
- fontSize: number;
89
- };
90
- title: {
91
- fontSize: number;
92
- fontWeight: "bold";
93
- marginBottom: number;
94
- textAlign: "center";
95
- color: string;
96
- };
97
- subtitle: {
98
- fontSize: number;
99
- textAlign: "center";
100
- marginBottom: number;
101
- color: string;
102
- lineHeight: number;
103
- };
104
- listItem: {
105
- flexDirection: "row";
106
- alignItems: "center";
107
- padding: number;
108
- borderBottomWidth: number;
109
- borderBottomColor: string;
110
- };
111
- listItemText: {
112
- fontSize: number;
113
- fontWeight: "600";
114
- color: string;
115
- };
116
- listItemSubtext: {
117
- fontSize: number;
118
- color: string;
119
- };
120
- container: {
121
- flex: number;
122
- width: "100%";
123
- paddingHorizontal: number;
124
- gap: number;
125
- };
126
- content: {
127
- width: "100%";
128
- alignItems: "center";
129
- paddingVertical: number;
130
- maxWidth: number;
131
- alignSelf: "center";
132
- };
133
- progressContainer: {
134
- flexDirection: "row";
135
- justifyContent: "center";
136
- alignItems: "center";
137
- marginBottom: number;
138
- paddingHorizontal: number;
139
- };
140
- progressDot: {
141
- width: number;
142
- height: number;
143
- borderRadius: number;
144
- backgroundColor: string;
145
- borderWidth: number;
146
- borderColor: string;
147
- };
148
- progressDotActive: {
149
- backgroundColor: string;
150
- borderColor: string;
151
- transform: {
152
- scale: number;
153
- }[];
154
- };
155
- progressDotCompleted: {
156
- backgroundColor: string;
157
- borderColor: string;
158
- };
159
- progressLine: {
160
- flex: number;
161
- height: number;
162
- backgroundColor: string;
163
- marginHorizontal: number;
164
- };
165
- progressLineCompleted: {
166
- backgroundColor: string;
167
- };
168
- };
@@ -1,177 +0,0 @@
1
- "use strict";
2
- /**
3
- * Shared Styles
4
- *
5
- * This file contains shared styles used across the OxyHQ services module.
6
- * These styles establish a consistent design language for the application.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.sharedStyles = exports.theme = void 0;
10
- const react_native_1 = require("react-native");
11
- const colors_1 = require("./colors");
12
- /**
13
- * Theme variables for consistent sizing, spacing, and visual elements
14
- */
15
- exports.theme = {
16
- spacing: {
17
- xs: 4,
18
- sm: 8,
19
- md: 16,
20
- lg: 24,
21
- xl: 32
22
- },
23
- radius: {
24
- sm: 8,
25
- md: 16,
26
- lg: 28
27
- },
28
- fontSize: {
29
- small: 14,
30
- regular: 16,
31
- large: 18,
32
- xlarge: 24,
33
- xxlarge: 32
34
- },
35
- animation: {
36
- fast: '200ms',
37
- normal: '300ms',
38
- slow: '500ms'
39
- }
40
- };
41
- /**
42
- * Shared styles used throughout the application
43
- */
44
- exports.sharedStyles = react_native_1.StyleSheet.create({
45
- // ======== Form Elements ========
46
- input: {
47
- width: '100%',
48
- height: 56,
49
- paddingHorizontal: 20,
50
- borderWidth: 1.5,
51
- borderColor: colors_1.colors.COLOR_BLACK_LIGHT_6,
52
- borderRadius: exports.theme.radius.lg,
53
- color: colors_1.colors.COLOR_BLACK,
54
- backgroundColor: colors_1.colors.primaryLight_1,
55
- fontSize: exports.theme.fontSize.regular,
56
- boxShadow: '0px 2px 4px rgba(0, 0, 0, 0.05)',
57
- elevation: 2,
58
- },
59
- inputWrapper: {
60
- width: '100%',
61
- maxWidth: 400,
62
- marginBottom: exports.theme.spacing.md,
63
- },
64
- // ======== Buttons ========
65
- button: {
66
- height: 56,
67
- borderRadius: exports.theme.radius.lg,
68
- overflow: 'hidden',
69
- boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.2)',
70
- elevation: 4,
71
- },
72
- buttonGradient: {
73
- flex: 1,
74
- justifyContent: 'center',
75
- alignItems: 'center',
76
- },
77
- buttonText: {
78
- color: colors_1.colors.primaryLight,
79
- fontWeight: '600',
80
- fontSize: exports.theme.fontSize.regular + 1,
81
- },
82
- buttonOutline: {
83
- height: 56,
84
- paddingHorizontal: exports.theme.spacing.lg,
85
- justifyContent: 'center',
86
- alignItems: 'center',
87
- borderRadius: exports.theme.radius.lg,
88
- borderWidth: 1.5,
89
- borderColor: colors_1.colors.COLOR_BLACK_LIGHT_6,
90
- backgroundColor: colors_1.colors.primaryLight_1,
91
- },
92
- buttonOutlineText: {
93
- color: colors_1.colors.COLOR_BLACK,
94
- fontWeight: '600',
95
- fontSize: exports.theme.fontSize.regular + 1,
96
- },
97
- // ======== Typography ========
98
- title: {
99
- fontSize: 28,
100
- fontWeight: 'bold',
101
- marginBottom: exports.theme.spacing.md,
102
- textAlign: 'center',
103
- color: colors_1.colors.COLOR_BLACK,
104
- },
105
- subtitle: {
106
- fontSize: exports.theme.fontSize.regular + 1,
107
- textAlign: 'center',
108
- marginBottom: exports.theme.spacing.xl * 1.5,
109
- color: colors_1.colors.COLOR_BLACK_LIGHT_4,
110
- lineHeight: 24,
111
- },
112
- // ======== Lists ========
113
- listItem: {
114
- flexDirection: 'row',
115
- alignItems: 'center',
116
- padding: exports.theme.spacing.md - 4,
117
- borderBottomWidth: 1,
118
- borderBottomColor: colors_1.colors.COLOR_BLACK_LIGHT_6,
119
- },
120
- listItemText: {
121
- fontSize: exports.theme.fontSize.regular,
122
- fontWeight: '600',
123
- color: colors_1.colors.COLOR_BLACK,
124
- },
125
- listItemSubtext: {
126
- fontSize: exports.theme.fontSize.small,
127
- color: colors_1.colors.COLOR_BLACK_LIGHT_4,
128
- },
129
- // ======== Layout ========
130
- container: {
131
- flex: 1,
132
- width: '100%',
133
- paddingHorizontal: exports.theme.spacing.md,
134
- gap: exports.theme.spacing.md,
135
- },
136
- content: {
137
- width: '100%',
138
- alignItems: 'center',
139
- paddingVertical: 20,
140
- maxWidth: 400,
141
- alignSelf: 'center',
142
- },
143
- // ======== Progress Indicators ========
144
- progressContainer: {
145
- flexDirection: 'row',
146
- justifyContent: 'center',
147
- alignItems: 'center',
148
- marginBottom: exports.theme.spacing.xl,
149
- paddingHorizontal: 20,
150
- },
151
- progressDot: {
152
- width: 12,
153
- height: 12,
154
- borderRadius: 6,
155
- backgroundColor: colors_1.colors.COLOR_BLACK_LIGHT_6,
156
- borderWidth: 2,
157
- borderColor: colors_1.colors.COLOR_BLACK_LIGHT_6,
158
- },
159
- progressDotActive: {
160
- backgroundColor: colors_1.colors.primaryColor,
161
- borderColor: colors_1.colors.primaryColor,
162
- transform: [{ scale: 1.2 }],
163
- },
164
- progressDotCompleted: {
165
- backgroundColor: colors_1.colors.primaryColor,
166
- borderColor: colors_1.colors.primaryColor,
167
- },
168
- progressLine: {
169
- flex: 1,
170
- height: 2,
171
- backgroundColor: colors_1.colors.COLOR_BLACK_LIGHT_6,
172
- marginHorizontal: exports.theme.spacing.xs,
173
- },
174
- progressLineCompleted: {
175
- backgroundColor: colors_1.colors.primaryColor,
176
- },
177
- });
@@ -1,136 +0,0 @@
1
- /**
2
- * OxyHQ Services Types
3
- *
4
- * Core type definitions used throughout the OxyHQ services module.
5
- */
6
- /**
7
- * Extended user session with authentication tokens and profile data
8
- */
9
- export interface ExtendedUserSession {
10
- id: string;
11
- accessToken: string;
12
- refreshToken?: string;
13
- lastRefresh: number;
14
- profile?: OxyProfile;
15
- }
16
- /**
17
- * Privacy settings for a user profile
18
- */
19
- export interface PrivacySettings {
20
- isPrivateAccount: boolean;
21
- hideOnlineStatus: boolean;
22
- hideLastSeen: boolean;
23
- profileVisibility: boolean;
24
- postVisibility: boolean;
25
- twoFactorEnabled: boolean;
26
- loginAlerts: boolean;
27
- blockScreenshots: boolean;
28
- secureLogin: boolean;
29
- biometricLogin: boolean;
30
- showActivity: boolean;
31
- allowTagging: boolean;
32
- allowMentions: boolean;
33
- hideReadReceipts: boolean;
34
- allowComments: boolean;
35
- allowDirectMessages: boolean;
36
- dataSharing: boolean;
37
- locationSharing: boolean;
38
- analyticsSharing: boolean;
39
- sensitiveContent: boolean;
40
- autoFilter: boolean;
41
- muteKeywords: boolean;
42
- }
43
- /**
44
- * Full user profile from the OxyHQ platform
45
- */
46
- export interface OxyProfile {
47
- _id?: string;
48
- userID: string;
49
- name?: {
50
- first?: string;
51
- last?: string;
52
- };
53
- username: string;
54
- email: string;
55
- privacySettings?: PrivacySettings;
56
- avatar?: string;
57
- labels?: string[];
58
- description?: string;
59
- coverPhoto?: string;
60
- location?: string;
61
- website?: string;
62
- pinnedPost?: {
63
- cid?: string;
64
- uri?: string;
65
- };
66
- _count?: {
67
- followers: number;
68
- following: number;
69
- posts: number;
70
- karma: number;
71
- };
72
- createdAt?: string;
73
- updatedAt?: string;
74
- premium?: {
75
- isPremium: boolean;
76
- subscriptionStatus?: string;
77
- subscriptionTier?: string;
78
- startDate?: string;
79
- endDate?: string;
80
- features?: {
81
- analyticsSharing?: boolean;
82
- customThemes?: boolean;
83
- prioritySupport?: boolean;
84
- maxProjects?: number;
85
- storageLimit?: number;
86
- [key: string]: any;
87
- };
88
- paymentHistory?: Array<{
89
- transactionId: string;
90
- amount: number;
91
- date: string;
92
- status: string;
93
- provider: string;
94
- plan: string;
95
- }>;
96
- };
97
- stats?: {
98
- followers: number;
99
- following: number;
100
- posts: number;
101
- karma: number;
102
- };
103
- associated?: {
104
- feedgens?: number;
105
- labeler?: boolean;
106
- lists?: number;
107
- starterPacks?: number;
108
- [key: string]: any;
109
- };
110
- bookmarks?: string[];
111
- followers?: any[];
112
- following?: any[];
113
- pinnedPosts?: any[];
114
- }
115
- /**
116
- * Subscription plan types
117
- */
118
- export type SubscriptionPlan = 'basic' | 'pro' | 'business';
119
- /**
120
- * Subscription features
121
- */
122
- export interface SubscriptionFeatures {
123
- analytics: boolean;
124
- premiumBadge: boolean;
125
- unlimitedFollowing: boolean;
126
- higherUploadLimits: boolean;
127
- promotedPosts: boolean;
128
- businessTools: boolean;
129
- }
130
- /**
131
- * Authentication response error with field-specific validation details
132
- */
133
- export interface AuthError {
134
- message: string;
135
- details?: Record<string, string>;
136
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /**
3
- * OxyHQ Services Types
4
- *
5
- * Core type definitions used throughout the OxyHQ services module.
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,20 +0,0 @@
1
- declare const api: import("axios").AxiosInstance;
2
- type AuthEventListener = () => void;
3
- export declare const addAuthEventListener: (listener: AuthEventListener) => void;
4
- export declare const removeAuthEventListener: (listener: AuthEventListener) => void;
5
- export declare const fetchData: (endpoint: string, options?: {
6
- params?: Record<string, any>;
7
- } & RequestInit) => Promise<any>;
8
- export declare const deleteData: (endpoint: string, data?: any) => Promise<any>;
9
- export declare const postData: (endpoint: string, data: any) => Promise<any>;
10
- export declare const putData: (endpoint: string, data: any) => Promise<any>;
11
- export declare const patchData: (endpoint: string, data: any) => Promise<any>;
12
- export declare const login: (username: string, password: string) => Promise<any>;
13
- export declare const refreshAccessToken: () => Promise<any>;
14
- export declare const logout: () => Promise<boolean>;
15
- export declare const validateSession: () => Promise<boolean>;
16
- export declare const clearApiCache: (pattern?: string) => void;
17
- export declare const invalidateCache: (pattern: string) => void;
18
- export declare const fetchUsersByUsername: (username: string) => Promise<any>;
19
- export declare const forceLogout: () => Promise<void>;
20
- export default api;