@oxyhq/services 5.10.4 → 5.10.6
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 +62 -14
- package/lib/commonjs/core/OxyServices.js +797 -5
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/core/index.js +8 -83
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +31 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +12 -12
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +2 -2
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/followStore.js +4 -4
- package/lib/commonjs/ui/stores/followStore.js.map +1 -1
- package/lib/commonjs/utils/s3FileManager.js +243 -0
- package/lib/commonjs/utils/s3FileManager.js.map +1 -0
- package/lib/commonjs/utils/s3FileManagerExample.js +407 -0
- package/lib/commonjs/utils/s3FileManagerExample.js.map +1 -0
- package/lib/commonjs/utils/s3FileManagerRN.js +274 -0
- package/lib/commonjs/utils/s3FileManagerRN.js.map +1 -0
- package/lib/module/core/OxyServices.js +796 -4
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/core/index.js +9 -24
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +12 -12
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +2 -2
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +1 -1
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/stores/followStore.js +4 -4
- package/lib/module/ui/stores/followStore.js.map +1 -1
- package/lib/module/utils/s3FileManager.js +237 -0
- package/lib/module/utils/s3FileManager.js.map +1 -0
- package/lib/module/utils/s3FileManagerExample.js +400 -0
- package/lib/module/utils/s3FileManagerExample.js.map +1 -0
- package/lib/module/utils/s3FileManagerRN.js +268 -0
- package/lib/module/utils/s3FileManagerRN.js.map +1 -0
- package/lib/typescript/core/OxyServices.d.ts +292 -3
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/core/index.d.ts +7 -16
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +4 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils/s3FileManager.d.ts +81 -0
- package/lib/typescript/utils/s3FileManager.d.ts.map +1 -0
- package/lib/typescript/utils/s3FileManagerExample.d.ts +87 -0
- package/lib/typescript/utils/s3FileManagerExample.d.ts.map +1 -0
- package/lib/typescript/utils/s3FileManagerRN.d.ts +104 -0
- package/lib/typescript/utils/s3FileManagerRN.d.ts.map +1 -0
- package/package.json +3 -1
- package/src/core/OxyServices.ts +881 -46
- package/src/core/index.ts +9 -24
- package/src/index.ts +17 -1
- package/src/ui/screens/FileManagementScreen.tsx +12 -12
- package/src/ui/screens/ProfileScreen.tsx +3 -3
- package/src/ui/screens/SignInScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +2 -2
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
- package/src/ui/stores/followStore.ts +4 -4
- package/src/utils/s3FileManager.ts +281 -0
- package/src/utils/s3FileManagerExample.ts +432 -0
- package/src/utils/s3FileManagerRN.ts +322 -0
- package/lib/commonjs/core/OxyServicesMain.js +0 -51
- package/lib/commonjs/core/OxyServicesMain.js.map +0 -1
- package/lib/commonjs/core/analytics/AnalyticsService.js +0 -67
- package/lib/commonjs/core/analytics/AnalyticsService.js.map +0 -1
- package/lib/commonjs/core/auth/AuthService.js +0 -538
- package/lib/commonjs/core/auth/AuthService.js.map +0 -1
- package/lib/commonjs/core/devices/DeviceService.js +0 -61
- package/lib/commonjs/core/devices/DeviceService.js.map +0 -1
- package/lib/commonjs/core/files/FileService.js +0 -180
- package/lib/commonjs/core/files/FileService.js.map +0 -1
- package/lib/commonjs/core/karma/KarmaService.js +0 -100
- package/lib/commonjs/core/karma/KarmaService.js.map +0 -1
- package/lib/commonjs/core/locations/LocationService.js +0 -131
- package/lib/commonjs/core/locations/LocationService.js.map +0 -1
- package/lib/commonjs/core/payments/PaymentService.js +0 -124
- package/lib/commonjs/core/payments/PaymentService.js.map +0 -1
- package/lib/commonjs/core/users/UserService.js +0 -234
- package/lib/commonjs/core/users/UserService.js.map +0 -1
- package/lib/module/core/OxyServicesMain.js +0 -47
- package/lib/module/core/OxyServicesMain.js.map +0 -1
- package/lib/module/core/analytics/AnalyticsService.js +0 -62
- package/lib/module/core/analytics/AnalyticsService.js.map +0 -1
- package/lib/module/core/auth/AuthService.js +0 -533
- package/lib/module/core/auth/AuthService.js.map +0 -1
- package/lib/module/core/devices/DeviceService.js +0 -57
- package/lib/module/core/devices/DeviceService.js.map +0 -1
- package/lib/module/core/files/FileService.js +0 -175
- package/lib/module/core/files/FileService.js.map +0 -1
- package/lib/module/core/karma/KarmaService.js +0 -95
- package/lib/module/core/karma/KarmaService.js.map +0 -1
- package/lib/module/core/locations/LocationService.js +0 -127
- package/lib/module/core/locations/LocationService.js.map +0 -1
- package/lib/module/core/payments/PaymentService.js +0 -119
- package/lib/module/core/payments/PaymentService.js.map +0 -1
- package/lib/module/core/users/UserService.js +0 -230
- package/lib/module/core/users/UserService.js.map +0 -1
- package/lib/typescript/core/OxyServicesMain.d.ts +0 -33
- package/lib/typescript/core/OxyServicesMain.d.ts.map +0 -1
- package/lib/typescript/core/analytics/AnalyticsService.d.ts +0 -26
- package/lib/typescript/core/analytics/AnalyticsService.d.ts.map +0 -1
- package/lib/typescript/core/auth/AuthService.d.ts +0 -165
- package/lib/typescript/core/auth/AuthService.d.ts.map +0 -1
- package/lib/typescript/core/devices/DeviceService.d.ts +0 -20
- package/lib/typescript/core/devices/DeviceService.d.ts.map +0 -1
- package/lib/typescript/core/files/FileService.d.ts +0 -59
- package/lib/typescript/core/files/FileService.d.ts.map +0 -1
- package/lib/typescript/core/karma/KarmaService.d.ts +0 -50
- package/lib/typescript/core/karma/KarmaService.d.ts.map +0 -1
- package/lib/typescript/core/locations/LocationService.d.ts +0 -39
- package/lib/typescript/core/locations/LocationService.d.ts.map +0 -1
- package/lib/typescript/core/payments/PaymentService.d.ts +0 -50
- package/lib/typescript/core/payments/PaymentService.d.ts.map +0 -1
- package/lib/typescript/core/users/UserService.d.ts +0 -111
- package/lib/typescript/core/users/UserService.d.ts.map +0 -1
- package/src/core/OxyServicesMain.ts +0 -57
- package/src/core/analytics/AnalyticsService.ts +0 -64
- package/src/core/auth/AuthService.ts +0 -560
- package/src/core/devices/DeviceService.ts +0 -55
- package/src/core/files/FileService.ts +0 -198
- package/src/core/karma/KarmaService.ts +0 -104
- package/src/core/locations/LocationService.ts +0 -141
- package/src/core/payments/PaymentService.ts +0 -133
- package/src/core/users/UserService.ts +0 -241
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export interface S3Config {
|
|
2
|
+
region: string;
|
|
3
|
+
accessKeyId: string;
|
|
4
|
+
secretAccessKey: string;
|
|
5
|
+
bucketName: string;
|
|
6
|
+
}
|
|
7
|
+
export interface UploadOptions {
|
|
8
|
+
contentType?: string;
|
|
9
|
+
metadata?: Record<string, string>;
|
|
10
|
+
publicRead?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface FileInfo {
|
|
13
|
+
key: string;
|
|
14
|
+
size: number;
|
|
15
|
+
lastModified: Date;
|
|
16
|
+
contentType?: string;
|
|
17
|
+
metadata?: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
export interface RNFile {
|
|
20
|
+
uri: string;
|
|
21
|
+
name: string;
|
|
22
|
+
type?: string;
|
|
23
|
+
size?: number;
|
|
24
|
+
}
|
|
25
|
+
export declare class S3FileManagerRN {
|
|
26
|
+
private s3Client;
|
|
27
|
+
private bucketName;
|
|
28
|
+
constructor(config: S3Config);
|
|
29
|
+
/**
|
|
30
|
+
* Upload a file to S3 from React Native
|
|
31
|
+
*/
|
|
32
|
+
uploadFile(key: string, file: RNFile | Buffer | string, options?: UploadOptions): Promise<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Download a file from S3 to React Native
|
|
35
|
+
*/
|
|
36
|
+
downloadFile(key: string): Promise<Buffer>;
|
|
37
|
+
/**
|
|
38
|
+
* Delete a file from S3
|
|
39
|
+
*/
|
|
40
|
+
deleteFile(key: string): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Generate a presigned URL for file upload
|
|
43
|
+
*/
|
|
44
|
+
getPresignedUploadUrl(key: string, contentType: string, expiresIn?: number): Promise<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Generate a presigned URL for file download
|
|
47
|
+
*/
|
|
48
|
+
getPresignedDownloadUrl(key: string, expiresIn?: number): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* List files in a directory
|
|
51
|
+
*/
|
|
52
|
+
listFiles(prefix?: string, maxKeys?: number): Promise<FileInfo[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Check if a file exists
|
|
55
|
+
*/
|
|
56
|
+
fileExists(key: string): Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Get file metadata
|
|
59
|
+
*/
|
|
60
|
+
getFileMetadata(key: string): Promise<FileInfo | null>;
|
|
61
|
+
/**
|
|
62
|
+
* Convert React Native file to Buffer
|
|
63
|
+
*/
|
|
64
|
+
private rnFileToBuffer;
|
|
65
|
+
/**
|
|
66
|
+
* Type guard to check if object is RNFile
|
|
67
|
+
*/
|
|
68
|
+
private isRNFile;
|
|
69
|
+
/**
|
|
70
|
+
* Upload multiple files
|
|
71
|
+
*/
|
|
72
|
+
uploadMultipleFiles(files: Array<{
|
|
73
|
+
key: string;
|
|
74
|
+
file: RNFile | Buffer | string;
|
|
75
|
+
options?: UploadOptions;
|
|
76
|
+
}>): Promise<string[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Delete multiple files
|
|
79
|
+
*/
|
|
80
|
+
deleteMultipleFiles(keys: string[]): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Copy file from one key to another
|
|
83
|
+
*/
|
|
84
|
+
copyFile(sourceKey: string, destinationKey: string): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Move file (copy + delete)
|
|
87
|
+
*/
|
|
88
|
+
moveFile(sourceKey: string, destinationKey: string): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Upload image with automatic resizing (placeholder for future implementation)
|
|
91
|
+
*/
|
|
92
|
+
uploadImage(key: string, file: RNFile, options?: UploadOptions & {
|
|
93
|
+
resize?: {
|
|
94
|
+
width?: number;
|
|
95
|
+
height?: number;
|
|
96
|
+
};
|
|
97
|
+
}): Promise<string>;
|
|
98
|
+
/**
|
|
99
|
+
* Get file size from React Native file
|
|
100
|
+
*/
|
|
101
|
+
getFileSize(file: RNFile): Promise<number>;
|
|
102
|
+
}
|
|
103
|
+
export declare function createS3FileManagerRN(config: S3Config): S3FileManagerRN;
|
|
104
|
+
//# sourceMappingURL=s3FileManagerRN.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3FileManagerRN.d.ts","sourceRoot":"","sources":["../../../src/utils/s3FileManagerRN.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,UAAU,CAAS;gBAEf,MAAM,EAAE,QAAQ;IAW5B;;OAEG;IACG,UAAU,CACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAC9B,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,M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AAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxE;;OAEG;IACG,WAAW,CACf,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,aAAa,GAAG;QAAE,MAAM,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAO,GAC7E,OAAO,CAAC,MAAM,CAAC;IAMlB;;OAEG;IACG,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAcjD;AAGD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,eAAe,CAEvE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "5.10.
|
|
3
|
+
"version": "5.10.6",
|
|
4
4
|
"description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -62,6 +62,8 @@
|
|
|
62
62
|
"release": "rm -rf lib && npm run build && release-it"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
+
"@aws-sdk/client-s3": "^3.857.0",
|
|
66
|
+
"@aws-sdk/s3-request-presigner": "^3.857.0",
|
|
65
67
|
"@react-native-async-storage/async-storage": "^2.1.2",
|
|
66
68
|
"@react-navigation/native": "^7.1.14",
|
|
67
69
|
"@th3rdwave/react-navigation-bottom-sheet": "^0.3.2",
|